@李东岳 请问李老师,codedFixedValue
边界条件在U
文件和pointDisplacement
文件中获得网格坐标的方法是不是不通用,同样的代码,如:
type codedFixedValue;
value uniform (0 0 0);
name name_of_BC;
code
#{
const Patch& boundaryPatch = patch();
const vectorField& Cf = patch().Cf();
#};
在U
文件里可以使用,在pointDisplacement
文件里就会出错。
出错内容如下:
Create time
Create mesh for time = 0
Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: displacementLayeredMotion
Using dynamicCode for codedFixedValue name_of_BC at line 32 in "/mnt/hgfs/share/shotSleeveModeling3/0/pointDisplacement/boundaryField/movingWalls"
Creating new library in "dynamicCode/name_of_BC/platforms/linux64GccDPInt32Opt/lib/libname_of_BC_2749dd0d9becc7c4794a34f8159e9b4cbe66efce.so"
"/home/dyfluid/OpenFOAM/OpenFOAM-9/etc/codeTemplates/dynamicCode/codedFixedValuePointPatchFieldTemplate.C" "/mnt/hgfs/share/shotSleeveModeling3/dynamicCode/name_of_BC/codedFixedValuePointPatchFieldTemplate.C"
"/home/dyfluid/OpenFOAM/OpenFOAM-9/etc/codeTemplates/dynamicCode/codedFixedValuePointPatchFieldTemplate.H" "/mnt/hgfs/share/shotSleeveModeling3/dynamicCode/name_of_BC/codedFixedValuePointPatchFieldTemplate.H"
Invoking "wmake -s libso /mnt/hgfs/share/shotSleeveModeling3/dynamicCode/name_of_BC"
wmake libso /mnt/hgfs/share/shotSleeveModeling3/dynamicCode/name_of_BC
ln: ./lnInclude
ln: failed to create symbolic link './codedFixedValuePointPatchFieldTemplate.C': Operation not supported
ln: failed to create symbolic link './codedFixedValuePointPatchFieldTemplate.H': Operation not supported
wmkdep: codedFixedValuePointPatchFieldTemplate.C
Ctoo: codedFixedValuePointPatchFieldTemplate.C
/mnt/hgfs/share/shotSleeveModeling3/0/pointDisplacement/boundaryField/movingWalls: In member function ‘virtual void Foam::name_of_BCFixedValuePointPatchVectorField::updateCoeffs()’:
/mnt/hgfs/share/shotSleeveModeling3/0/pointDisplacement/boundaryField/movingWalls:39:45: error: ‘const class Foam::pointPatch’ has no member named ‘Cf’
/mnt/hgfs/share/shotSleeveModeling3/0/pointDisplacement/boundaryField/movingWalls:37:14: warning: unused variable ‘boundaryPatch’ [-Wunused-variable]
/mnt/hgfs/share/shotSleeveModeling3/0/pointDisplacement/boundaryField/movingWalls:39:32: warning: unused variable ‘Cf’ [-Wunused-variable]
make: *** [/home/dyfluid/OpenFOAM/OpenFOAM-9/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/codedFixedValuePointPatchFieldTemplate.o] Error 1
--> FOAM FATAL IO ERROR:
Failed wmake "dynamicCode/name_of_BC/platforms/linux64GccDPInt32Opt/lib/libname_of_BC_2749dd0d9becc7c4794a34f8159e9b4cbe66efce.so"
file: /mnt/hgfs/share/shotSleeveModeling3/0/pointDisplacement/boundaryField/movingWalls from line 32 to line 36.
From function void Foam::codedBase::createLibrary(Foam::dynamicCode&, const Foam::dynamicCodeContext&) const
in file db/dynamicLibrary/codedBase/codedBase.C at line 209.
FOAM exiting
其中最关键的感觉是这几处:
ln: failed to create symbolic link './codedFixedValuePointPatchFieldTemplate.C': Operation not supported
ln: failed to create symbolic link './codedFixedValuePointPatchFieldTemplate.H': Operation not supported
/mnt/hgfs/share/shotSleeveModeling3/0/pointDisplacement/boundaryField/movingWalls:39:45: error: ‘const class Foam::pointPatch’ has no member named ‘Cf’
在U
文件使用上述代码,只会出现第一处提示,不会出现第二处错误。