动态边界条件的小问题
-
实验过程中驱替压力一直是变化的,受到启发,我想做一个简单的入口压力随时间变化的单管驱替小例子,看看自己能不能做出来
按照模板例子,自己写了一个很简单的初始压力场条件/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { left { // type zeroGradient; type codedFixedValue; value $internalField; redirectType ramp; code #{ scalar t = this->db().time().value(); scalar p_rgh = 0; if(t >= 0 && t <= 0.1) { p_rgh = 450*t; } else { p_rgh = 550*t; } (*this) == p_rgh; #}; } right { type fixedValue; value uniform 0; } "(bottom|top)" { type fixedFluxPressure; } frontAndBack { type empty; } } // ************************************************************************* //
但是运行的时候总是出错,自己还不知道这个错误是什么问题(初学,太难受了)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PIMPLE: Operating solver in PISO mode Reading field p_rgh --> FOAM FATAL ERROR: Unknown variable name 'WM_OPTIONS' From function Foam::string& Foam::stringOps::inplaceExpand(Foam::string&, bool) in file primitives/strings/stringOps/stringOps.C at line 782. FOAM exiting
自己也看了李老师的OpenFOAM小代码的codedFixedValue相关内容,但是还是不知道哪里出错了,求各位高手们指导一下