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

View File

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