mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add coded Function1 (#2282)
- update coded templates with qualified names GIT: add in missing PatchFunction1 constant() method - was missed in a previous commit
This commit is contained in:
@ -40,6 +40,16 @@ boundaryField
|
||||
// For general testing purposes:
|
||||
type exprFixedValue;
|
||||
|
||||
functions<scalar>
|
||||
{
|
||||
trigger
|
||||
{
|
||||
type functionObjectTrigger;
|
||||
triggers (2 4);
|
||||
defaultValue true;
|
||||
}
|
||||
}
|
||||
|
||||
variables
|
||||
(
|
||||
"Tcrit = 500"
|
||||
|
||||
@ -23,8 +23,26 @@ boundaryField
|
||||
inlet
|
||||
{
|
||||
type flowRateInletVelocity;
|
||||
massFlowRate constant 5;
|
||||
rhoInlet 1000; // Guess for rho
|
||||
|
||||
// massFlowRate constant 5;
|
||||
|
||||
massFlowRate
|
||||
{
|
||||
type coded;
|
||||
name liquidIn;
|
||||
code
|
||||
#{
|
||||
// Receives 'x' as the argument
|
||||
static bool reported(false);
|
||||
if (!reported)
|
||||
{
|
||||
Info<< "Using coded value for massFlowRate" << nl;
|
||||
reported = true;
|
||||
}
|
||||
return 5;
|
||||
#};
|
||||
}
|
||||
}
|
||||
|
||||
outlet
|
||||
|
||||
@ -5,6 +5,12 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
./Allrun.pre
|
||||
|
||||
if ! canCompile
|
||||
then
|
||||
echo "-- No dynamicCode: replace coded Function1 with constant value"
|
||||
foamDictionary -entry boundaryField/inlet/massFlowRate -set 'constant 5' 0/U
|
||||
fi
|
||||
|
||||
runApplication decomposePar
|
||||
|
||||
#- Run without processorAgglomerator
|
||||
|
||||
@ -5,6 +5,12 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
./Allrun.pre
|
||||
|
||||
if ! canCompile
|
||||
then
|
||||
echo "-- No dynamicCode: replace coded Function1 with constant value"
|
||||
foamDictionary -entry boundaryField/inlet/massFlowRate -set 'constant 5' 0/U
|
||||
fi
|
||||
|
||||
runApplication $(getApplication)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -70,7 +70,7 @@ boundaryField
|
||||
{
|
||||
baseVel = Function1<scalar>::New
|
||||
(
|
||||
"timeFunction", dict, &db()
|
||||
"timeFunction", dict, this->whichDb()
|
||||
);
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ boundaryField
|
||||
// ie, NewIfPresent
|
||||
baseDir = Function1<vector>::New
|
||||
(
|
||||
"directionFunction", dict, &db()
|
||||
"directionFunction", dict, this->whichDb()
|
||||
);
|
||||
|
||||
InfoErr
|
||||
|
||||
Reference in New Issue
Block a user