setExprFieldsDict中表征变量幂次计算和指数计算的语法问题
-
各位老师同学,我遇到这样一个问题,想在初始流场中用setExprFieldsDict定义一个不均匀流场(表达大气分层现象),比如密度、压力的函数表达式为:
密度:ρ=1.225(1-6.5/288.15 H)^4.26
ρ=0.364 exp(-(H-11)/6.34)
压力:p=100465.03-11149.96x+374.99x^2
请问方程中的幂次、指数运算语法在setExprFieldsDict中是怎样的?
以下为我的setExprFieldsDict文件:/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2006 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object setExprFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // expressions ( rho { field rho; dimensions [1 -3 0 0 0 0 0]; constants { centre (0 0 0); } variables ( "height = pos().z()" ); condition #{ // Within the box (pos().z() < 11000) && (pos().z() > 0) && (pos().x() < 8000) && (pos().x() > -8000)) #}; expression #{ ??ρ=1.225(1-6.5/288.15 H)^4.26 #}; } p { field p; dimensions [1 -1 -2 0 0 0 0]; constants { centre (0 0 0); } variables ( "height = pos().z()" ); condition #{ // Within the radius (pos().z() < 11000) && (pos().z() > 0) && (pos().x() < 8000) && (pos().x() > -8000)) #}; expression #{ ??p=100465.03-11149.96x+374.99x^2 #}; } );