用DPMFoam求解周期边界的模型时,fvOptions不起作用?
-
在cyclic的模型中,想在DPMFoam求解的速度场(U.air)上添加一个源项momentumSource来维持恒定的总体速度,于是在fvOptions文件中加入了如下代码,
momentumSource { type meanVelocityForce; active true; meanVelocityForceCoeffs { selectionMode all; fields (U.air); Ubar (0 -10 0); } }
但是当运行计算的时候,出现如下提示说该源项并不起作用,而且流场的总体速度在不断的递减,请问有什么办法解决呀?
FOAM Warning : From function virtual void Foam::fv::option::checkApplied() const in file cfdTools/general/fvOptions/fvOption.C at line 118 Source momentumSource defined for field U.air but never used
在此先谢谢各位了!
-
@东岳 我查看了pimpleFoam的UEqn.H文件,确实有fvOptions,而DPMFoam的UcEqn.H文件中没有。我尝试在 ==的公式之后添加一个 + fvOptions(U),如下所示,不知道这样添加在逻辑上对不对?
fvVectorMatrix UcEqn ( fvm::ddt(alphac, Uc) + fvm::div(alphaPhic, Uc) - fvm::Sp(fvc::ddt(alphac) + fvc::div(alphaPhic), Uc) + continuousPhaseTurbulence->divDevRhoReff(Uc) == (1.0/rhoc)*cloudSU + fvOptions(Uc) ); UcEqn.relax(); volScalarField rAUc(1.0/UcEqn.A()); surfaceScalarField rAUcf("Dp", fvc::interpolate(rAUc)); surfaceScalarField phicForces ( fvc::flux(rAUc*cloudVolSUSu/rhoc) + rAUcf*(g & mesh.Sf()) ); if (pimple.momentumPredictor()) { solve ( UcEqn == fvc::reconstruct ( phicForces/rAUcf - fvc::snGrad(p)*mesh.magSf() ) ); }
而且编译DPMFoam的时候报错说没有声明,请问东岳老师还应该在哪里声明这个fvOptions?
UcEqn.H: In function 'int main(int, char**)': UcEqn.H:7:38: error: 'fvOptions' was not declared in this scope (1.0/rhoc)*cloudSU + fvOptions(Uc)