一. OF中常见的极小数和极大数常数的定义
OpenFOAM中为了避免除数为0等特殊情况,会在除数中加上极小的数VSMALL,类似的常数还有SMALL、GREAT、ROOTVGREAT等,以上常数具体数值如下:
单精度:
static const floatScalar floatScalarGREAT = 1.0e+6;
static const floatScalar floatScalarVGREAT = 1.0e+37;
static const floatScalar floatScalarROOTVGREAT = 1.0e+18;
static const floatScalar floatScalarSMALL = 1.0e-6;
static const floatScalar floatScalarVSMALL = 1.0e-37;
static const floatScalar floatScalarROOTVSMALL = 1.0e-18;双精度:
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版本:
OpenFOAM-.XX/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H
OpenFOAM-.XX/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H
foam-extend版本:
foam-extend-XX/src/foam/primitives/Scalar/floatScalar/floatScalar.H
foam-extend-XX/src/foam/primitives/Scalar/doubleScalar/doubleScalar.H