small常数
-
自己定义了一个类,里面有个除法,由于担心分母太小,因此在除法之前想判别分母是否小于一个很小的数,在OpenFOAM的源代码中有如下例子:
if ((d1 - d3) < rootVSmall)
或者
epsilonMin_ ( dimensioned<scalar>::lookupOrAddToDict ( "epsilonMin", RASDict_, kMin_.dimensions()/dimTime, small ) ),
我自己写成
if(d<small)或者if(d<rootVSmall)
就报错未定义small或者rootVSmall。请问如何引用这两个小量呢?
-
https://www.cfd-online.com/Forums/openfoam-solving/120990-small-great-rootvsmall-what.html
里面写了small常数还有这些以及大小static const doubleScalar doubleScalarGREAT = 1.0e+15; static const doubleScalar doubleScalarVGREAT = 1.0e+300; static const doubleScalar doubleScalarROOTVGREAT = 1.0e+150; static const doubleScalar doubleScalarSMALL = 1.0e-15; static const doubleScalar doubleScalarVSMALL = 1.0e-300; static const doubleScalar doubleScalarROOTVSMALL = 1.0e-150;
以及在OpenFOAM-7数值改变了(https://github.com/OpenFOAM/OpenFOAM-7/commit/c902c7a396c43ff733b33294f79acab03d7b92d8#diff-118c1e97b96036fb1f9d7f1ee5912713)
测试了一下OpenFOAM-7的VSMALL结果: