使用fieldAverage,求解器正常运行,但没有输出fieldAverage工
-
各位老师,我想问一下fieldAverage应该怎么用呀,我使用的是interfoam求解器,想计算一下全域的平均压强,但是设置好fieldAverage后,在postProcessing中并没有相应的结果
controlDict/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 10 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application pimpleFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 0.01; deltaT 0.001; writeControl timeStep; writeInterval 1; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; functions { surfaces { type surfaces; libs ("libsampling.so"); writeControl timeStep; writeInterval 1; // 你可以根据需要设置间隔 surfaceFormat raw; fields (U); interpolationScheme cellPoint; surfaces ( zNormal { type cuttingPlane; planeType pointAndNormal; point (0.01 0.01 -0.12); // 切片的起始点 normal (1 0 0); // 切片法向量 interpolate true; // 是否进行插值 } ); } fieldAverage1 { type fieldAverage; libs ( "libfieldFunctionObjects.so" ); writeControl writeTime; timeStart 0; timeEnd 0.002; resetOnOutput false; fields ( U { mean on; prime2Mean off; base time; } ); } inletFlux { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); writeControl timeStep; log true; // Output field values as well writeFields false; regionType patch; name inlet; operation sum; fields ( phi ); } } // ************************************************************************* //
-
用这个试一下
fieldAverage1 { type fieldAverage; functionObjectLibs ("libfieldFunctionObjects.so"); resetOnRestart true; resetOnOutput false; outputControl outputTime; fields ( U { mean on; prime2Mean on; base time;//iteration windowType exact;//计算精确窗口平均值 window 4000; allowRestart true; } p { mean on; prime2Mean on; base time;//iteration windowType exact;//计算精确窗口平均值 window 4000; allowRestart true; } ); }