TUT: replace exprFixedValue with uniformFixedValue

- wish to deprecate and remove exprFixedValue in the future since the
  same functionality is possible using patch expressions with a
  uniformFixedValue condition.
This commit is contained in:
Mark Olesen 2023-01-31 13:45:19 +01:00
parent a6b3a31b28
commit b93f038ea3
2 changed files with 40 additions and 30 deletions

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2212 |
| \\ / O peration | Version: v2306 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -40,8 +40,12 @@ boundaryField
outlet1
{
type exprFixedValue;
type uniformFixedValue;
value $internalField;
uniformValue
{
type expression;
// debug true;
// debug.scanner true;
// debug.parser true;
@ -52,7 +56,8 @@ boundaryField
"pOutlet2{outlet2} = p"
);
valueExpr "0.5*(pInlet + pOutlet2)";
expression "0.5*(pInlet + pOutlet2)";
}
}
outlet2

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2212 |
| \\ / O peration | Version: v2306 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -38,7 +38,11 @@ boundaryField
value uniform 350;
// For general testing purposes:
type exprFixedValue;
type uniformFixedValue;
uniformValue
{
type expression;
functions<scalar>
{
@ -56,13 +60,14 @@ boundaryField
"par1 = mag(internalField(U))/snGrad(T)"
);
valueExpr
expression
#{
Tcrit
+ par1*internalField(T) * max((Tcrit-T)/(Tcrit)*deltaT()/time(),0)
#};
}
}
}
// ************************************************************************* //