OF计算域中设置圆形相区域时出错
-
想请教各位,我在OF自带的溃坝算例上进行了修改,试图将原来矩形相区域改为圆形,我使用了cylinderToCell给圆柱区域添加相分数,但是在setFields这一步出错,错误提示是说在cylinderToCell中没有找到定义的半径radius,可是我分明定义了半径大小。请各位指正问题,感谢。
下面是错误提示:--> FOAM FATAL IO ERROR: (openfoam-2012) Entry 'radius' not found in dictionary "cylinderToCell" file: cylinderToCell at line 29 to 36. From bool Foam::dictionary::readCheck(const Foam::word&, T&, const Predicate&, Foam::keyType::option, bool) const [with T = double; Predicate = Foam::MinMax<double>] in file /home/pawan/OpenFOAM/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/dictionaryTemplates.C at line 372. FOAM exiting
下面是我的setFieldsDict文件内容:
defaultFieldValues ( volScalarFieldValue alpha.water 0 ); regions ( cylinderToCell { sourceInfo { p1 (0.5 0 0.85); p2 (0.5 0.1 0.85); radius 0.15; } fieldValues ( volScalarFieldValue alpha.water 1 ); } );
-
@李东岳 感谢东岳老师回复,这个问题解决了,把sourceInfo和大括号删掉就好了。现在setFields可以正常运行,不过程序运计算完成后有另一个问题就是结果中相区域无法显示。请问这是否是由于整体的计算域网格是矩形的,不能在网格上划出圆形区域,进而设置不同的相分数呢?
可以正常运行:Create time Create mesh for time = 0 Reading setFieldsDict Setting field default values Setting internal values of volScalarField alpha.water Setting field region values Adding cells with centre within cylinder, with p1 = (0.5 0.85 0), p2 = (0.5 0.85 0.1), radius = 0.15 Setting internal values of volScalarField alpha.water End
但是结果里显示不出设置的圆形相区域