ENH: Function1's - added objectRegistry access

This commit is contained in:
Andrew Heather 2021-11-22 11:56:49 +00:00 committed by Mark Olesen
parent 889bc171d9
commit 098aec4962
74 changed files with 173 additions and 136 deletions

View File

@ -123,7 +123,7 @@ Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
)
:
fv::cellSetOption(sourceName, modelType, dict, mesh),
alphaSolidT_(Function1<scalar>::New("alphaSolidT", coeffs_)),
alphaSolidT_(Function1<scalar>::New("alphaSolidT", coeffs_, &mesh)),
L_("L", dimEnergy/dimMass, coeffs_),
relax_(coeffs_.getOrDefault("relax", 0.9)),
Cu_(coeffs_.getOrDefault<scalar>("Cu", 100000)),

View File

@ -33,7 +33,7 @@ bool Foam::fv::VoFSolidificationMeltingSource::read(const dictionary& dict)
{
if (fv::cellSetOption::read(dict))
{
alphaSolidT_ = Function1<scalar>::New("alphaSolidT", coeffs_);
alphaSolidT_ = Function1<scalar>::New("alphaSolidT", coeffs_, &mesh_);
coeffs_.readEntry("L", L_);
coeffs_.readIfPresent("relax", relax_);
coeffs_.readIfPresent("Cu", Cu_);

View File

@ -343,12 +343,12 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
focalLaserPosition_
(
Function1<point>::New("focalLaserPosition", *this)
Function1<point>::New("focalLaserPosition", *this, &mesh_)
),
laserDirection_
(
Function1<vector>::New("laserDirection", *this)
Function1<vector>::New("laserDirection", *this, &mesh_)
),
focalLaserRadius_(get<scalar>("focalLaserRadius")),
@ -359,7 +359,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
sigma_(0),
I0_(0),
laserPower_(Function1<scalar>::New("laserPower", *this)),
laserPower_(Function1<scalar>::New("laserPower", *this, &mesh_)),
powerDistribution_(),
reflectionSwitch_(false),
@ -441,11 +441,11 @@ Foam::radiation::laserDTRM::laserDTRM
focalLaserPosition_
(
Function1<point>::New("focalLaserPosition", *this)
Function1<point>::New("focalLaserPosition", *this, &mesh_)
),
laserDirection_
(
Function1<vector>::New("laserDirection", *this)
Function1<vector>::New("laserDirection", *this, &mesh_)
),
focalLaserRadius_(get<scalar>("focalLaserRadius")),
@ -456,7 +456,7 @@ Foam::radiation::laserDTRM::laserDTRM
sigma_(0),
I0_(0),
laserPower_(Function1<scalar>::New("laserPower", *this)),
laserPower_(Function1<scalar>::New("laserPower", *this, &mesh_)),
powerDistribution_(),
reflectionSwitch_(false),

View File

@ -16,7 +16,7 @@ const vector L(dict.get<vector>("L"));
const Vector<label> N(dict.get<Vector<label>>("N"));
// Wave number vs energy profile
autoPtr<Function1<scalar>> Ek(Function1<scalar>::New("Ek", dict));
autoPtr<Function1<scalar>> Ek(Function1<scalar>::New("Ek", dict, &runTime));
// Number of modes
const label nModes = dict.get<label>("nModes");

View File

@ -78,7 +78,7 @@ CONSTRUCT
scalarData_(dict.get<scalar>("scalarData")),
data_(dict.get<TYPE>("data")),
fieldData_("fieldData", dict, p.size()),
timeVsData_(Function1<TYPE>::New("timeVsData", dict)),
timeVsData_(Function1<TYPE>::New("timeVsData", dict, &this->db())),
wordData_(dict.getOrDefault<word>("wordName", "wordDefault")),
labelData_(-1),
boolData_(false)

View File

@ -37,7 +37,7 @@ Description
It accepts primitive or dictionary entries for dispatching to different
function types, but wraps unspecified types as "constant".
In the dictionary form, the coefficents are the dictionary itself.
In the dictionary form, the coefficients are the dictionary itself.
This is arguably the more readable form.
For example,
\verbatim
@ -49,7 +49,7 @@ Description
}
\endverbatim
In the primitive form, the coefficents are provided separately.
In the primitive form, the coefficients are provided separately.
For example,
\verbatim
<entryName> linearRamp;

View File

@ -34,7 +34,7 @@ void Foam::Function1Types::LimitRange<Type>::read(const dictionary& coeffs)
{
min_ = coeffs.get<scalar>("min");
max_ = coeffs.get<scalar>("max");
value_ = Function1<Type>::New("value", coeffs);
value_ = Function1<Type>::New("value", coeffs, this->obrPtr_);
}

View File

@ -33,8 +33,8 @@ License
template<class Type>
void Foam::Function1Types::Scale<Type>::read(const dictionary& coeffs)
{
scale_ = Function1<scalar>::New("scale", coeffs);
value_ = Function1<Type>::New("value", coeffs);
scale_ = Function1<scalar>::New("scale", coeffs, this->obrPtr_);
value_ = Function1<Type>::New("value", coeffs, this->obrPtr_);
}

View File

@ -40,15 +40,21 @@ Foam::Function1Types::Sine<Type>::Sine
:
Function1<Type>(entryName, dict, obrPtr),
t0_(dict.getOrDefault<scalar>("t0", 0)),
amplitude_(Function1<scalar>::NewIfPresent("amplitude", dict)),
period_(Function1<scalar>::NewIfPresent("period", dict)),
amplitude_
(
Function1<scalar>::NewIfPresent("amplitude", dict, word::null, obrPtr)
),
period_
(
Function1<scalar>::NewIfPresent("period", dict, word::null, obrPtr)
),
frequency_(nullptr),
scale_(Function1<Type>::New("scale", dict)),
level_(Function1<Type>::New("level", dict))
scale_(Function1<Type>::New("scale", dict, obrPtr)),
level_(Function1<Type>::New("level", dict, obrPtr))
{
if (!period_)
{
frequency_ = Function1<scalar>::New("frequency", dict);
frequency_ = Function1<scalar>::New("frequency", dict, obrPtr);
}
}

View File

@ -110,7 +110,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
{
case fixedPower:
{
Q_ = Function1<scalar>::New("Q", dict);
Q_ = Function1<scalar>::New("Q", dict, &db());
break;
}
case fixedHeatFlux:
@ -121,7 +121,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
case fixedHeatTransferCoeff:
{
h_ = PatchFunction1<scalar>::New(patch().patch(), "h", dict);
Ta_ = Function1<scalar>::New("Ta", dict);
Ta_ = Function1<scalar>::New("Ta", dict, &db());
if (dict.readIfPresent("thicknessLayers", thicknessLayers_))
{

View File

@ -59,8 +59,8 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField
fixedJumpFvPatchField<scalar>(p, iF),
phiName_(dict.getOrDefault<word>("phi", "phi")),
rhoName_(dict.getOrDefault<word>("rho", "rho")),
D_(Function1<scalar>::New("D", dict)),
I_(Function1<scalar>::New("I", dict)),
D_(Function1<scalar>::New("D", dict, &db())),
I_(Function1<scalar>::New("I", dict, &db())),
length_(dict.get<scalar>("length")),
uniformJump_(dict.getOrDefault("uniformJump", false))
{

View File

@ -103,7 +103,7 @@ atmTurbulentHeatFluxTemperatureFvPatchScalarField
)
),
alphaEffName_(dict.get<word>("alphaEff")),
Cp0_(Function1<scalar>::New("Cp0", dict, &db().time())),
Cp0_(Function1<scalar>::New("Cp0", dict, &db())),
q_(PatchFunction1<scalar>::New(p.patch(), "q", dict))
{
if (dict.found("value") && dict.found("gradient"))

View File

@ -128,7 +128,7 @@ atmAlphatkWallFunctionFvPatchScalarField
scalarMinMax::ge(SMALL)
)
),
Pr_(Function1<scalar>::New("Pr", dict, &db().time())),
Pr_(Function1<scalar>::New("Pr", dict, &db())),
Prt_(PatchFunction1<scalar>::New(p.patch(), "Prt", dict)),
z0_(PatchFunction1<scalar>::New(p.patch(), "z0", dict))
{

View File

@ -76,7 +76,7 @@ Foam::porosityModels::powerLawLopesdaCostaZone::powerLawLopesdaCostaZone
// function of the normalized vertical position
autoPtr<Function1<scalar>> SigmaFunc
(
Function1<scalar>::New("Sigma", dict)
Function1<scalar>::New("Sigma", dict, &mesh)
);
// Searchable triSurface for the top of the porous region

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -57,7 +57,7 @@ Foam::solidBodyMotionFunctions::rotatingMotion::rotatingMotion
solidBodyMotionFunction(SBMFCoeffs, runTime),
origin_(SBMFCoeffs_.get<vector>("origin")),
axis_(SBMFCoeffs_.get<vector>("axis")),
omega_(Function1<scalar>::New("omega", SBMFCoeffs_))
omega_(Function1<scalar>::New("omega", SBMFCoeffs_, &runTime))
{}
@ -89,7 +89,7 @@ bool Foam::solidBodyMotionFunctions::rotatingMotion::read
omega_.reset
(
Function1<scalar>::New("omega", SBMFCoeffs_)
Function1<scalar>::New("omega", SBMFCoeffs_, &time_)
);
return true;

View File

@ -74,7 +74,7 @@ Foam::fa::externalHeatFluxSource::externalHeatFluxSource
Q_(0),
q_(0),
h_(0),
Ta_(),
Ta_(nullptr),
emissivity_(dict.getOrDefault<scalar>("emissivity", 0))
{
fieldNames_.resize(1, TName_);
@ -194,7 +194,7 @@ bool Foam::fa::externalHeatFluxSource::read(const dictionary& dict)
case fixedHeatTransferCoeff:
{
dict.readEntry("h", h_);
Ta_ = Function1<scalar>::New("Ta", dict);
Ta_ = Function1<scalar>::New("Ta", dict, &mesh_);
break;
}
}

View File

@ -41,7 +41,7 @@ void Foam::fa::jouleHeatingSource::initialiseSigma
if (dict.found("sigma"))
{
// Sigma to be defined using a Function1 type
sigmaVsTPtr = Function1<Type>::New("sigma", dict);
sigmaVsTPtr = Function1<Type>::New("sigma", dict, &mesh_);
auto tsigma = tmp<AreaFieldType>::New
(

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -256,7 +256,7 @@ Foam::MRFZone::MRFZone
),
origin_(coeffs_.get<vector>("origin")),
axis_(coeffs_.get<vector>("axis").normalise()),
omega_(Function1<scalar>::New("omega", coeffs_))
omega_(Function1<scalar>::New("omega", coeffs_, &mesh_))
{
if (cellZoneName_ == word::null)
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -58,7 +58,7 @@ Foam::porosityModels::solidification::solidification
TName_(coeffs_.getOrDefault<word>("T", "T")),
alphaName_(coeffs_.getOrDefault<word>("alpha", "none")),
rhoName_(coeffs_.getOrDefault<word>("rho", "rho")),
D_(Function1<scalar>::New("D", coeffs_))
D_(Function1<scalar>::New("D", coeffs_, &mesh))
{}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -79,9 +80,12 @@ cylindricalInletVelocityFvPatchVectorField
fixedValueFvPatchField<vector>(p, iF, dict),
origin_(dict.getCompat<vector>("origin", {{"centre", 1712}})),
axis_(dict.lookup("axis")),
axialVelocity_(Function1<scalar>::New("axialVelocity", dict)),
radialVelocity_(Function1<scalar>::New("radialVelocity", dict)),
rpm_(Function1<scalar>::New("rpm", dict))
axialVelocity_(Function1<scalar>::New("axialVelocity", dict, &db())),
radialVelocity_
(
Function1<scalar>::New("radialVelocity", dict, &db())
),
rpm_(Function1<scalar>::New("rpm", dict, &db()))
{}

View File

@ -84,7 +84,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
if (this->cyclicPatch().owner())
{
this->jumpTable_ = Function1<Type>::New("jumpTable", dict);
this->jumpTable_ = Function1<Type>::New("jumpTable", dict, &this->db());
}
if (dict.found("value"))

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd
Copyright (C) 2017-2021 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -103,10 +103,7 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
}
else
{
fanCurve_.reset
(
Function1<scalar>::New("fanCurve", dict)
);
fanCurve_.reset(Function1<scalar>::New("fanCurve", dict, &db()));
}
if (nonDimensional_)

View File

@ -52,7 +52,7 @@ Foam::fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
)
:
fixedValueFvPatchField<Type>(p, iF, dict),
meanValue_(Function1<Type>::New("meanValue", dict))
meanValue_(Function1<Type>::New("meanValue", dict, &this->db()))
{
this->patchType() = dict.getOrDefault<word>("patchType", word::null);
}

View File

@ -53,7 +53,7 @@ Foam::fixedMeanOutletInletFvPatchField<Type>::fixedMeanOutletInletFvPatchField
)
:
outletInletFvPatchField<Type>(p, iF),
meanValue_(Function1<Type>::New("meanValue", dict))
meanValue_(Function1<Type>::New("meanValue", dict, &this->db()))
{
this->phiName_ = dict.getOrDefault<word>("phi", "phi");

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -68,7 +68,7 @@ Foam::fixedProfileFvPatchField<Type>::fixedProfileFvPatchField
)
:
fixedValueFvPatchField<Type>(p, iF, dict, false),
profile_(Function1<Type>::New("profile", dict)),
profile_(Function1<Type>::New("profile", dict, &this->db())),
dir_(dict.lookup("direction")),
origin_(dict.get<scalar>("origin"))
{

View File

@ -70,12 +70,13 @@ flowRateInletVelocityFvPatchVectorField
if (dict.found("volumetricFlowRate"))
{
volumetric_ = true;
flowRate_ = Function1<scalar>::New("volumetricFlowRate", dict);
flowRate_ =
Function1<scalar>::New("volumetricFlowRate", dict, &db());
}
else if (dict.found("massFlowRate"))
{
volumetric_ = false;
flowRate_ = Function1<scalar>::New("massFlowRate", dict);
flowRate_ = Function1<scalar>::New("massFlowRate", dict, &db());
rhoName_ = dict.getOrDefault<word>("rho", "rho");
}
else

View File

@ -62,13 +62,14 @@ flowRateOutletVelocityFvPatchVectorField
if (dict.found("volumetricFlowRate"))
{
volumetric_ = true;
flowRate_ = Function1<scalar>::New("volumetricFlowRate", dict);
flowRate_ =
Function1<scalar>::New("volumetricFlowRate", dict, &db());
rhoName_ = "rho";
}
else if (dict.found("massFlowRate"))
{
volumetric_ = false;
flowRate_ = Function1<scalar>::New("massFlowRate", dict);
flowRate_ = Function1<scalar>::New("massFlowRate", dict, &db());
rhoName_ = dict.getOrDefault<word>("rho", "rho");
}
else

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -89,7 +89,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
)
:
pressureInletOutletVelocityFvPatchVectorField(p, iF, dict),
omega_(Function1<vector>::New("omega", dict))
omega_(Function1<vector>::New("omega", dict, &db()))
{
patchType() = dict.getOrDefault<word>("patchType", word::null);
calcTangentialVelocity();

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -68,7 +69,7 @@ rotatingTotalPressureFvPatchScalarField
)
:
totalPressureFvPatchScalarField(p, iF, dict),
omega_(Function1<vector>::New("omega", dict))
omega_(Function1<vector>::New("omega", dict, &db()))
{}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -57,7 +58,7 @@ rotatingWallVelocityFvPatchVectorField
fixedValueFvPatchField<vector>(p, iF, dict, false),
origin_(dict.lookup("origin")),
axis_(dict.lookup("axis")),
omega_(Function1<scalar>::New("omega", dict))
omega_(Function1<scalar>::New("omega", dict, &db()))
{
if (dict.found("value"))
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -56,7 +56,7 @@ surfaceNormalFixedValueFvPatchVectorField
:
fixedValueFvPatchVectorField(p, iF, dict, false),
refValue_("refValue", dict, p.size()),
ramp_(Function1<scalar>::NewIfPresent("ramp", dict))
ramp_(Function1<scalar>::NewIfPresent("ramp", dict, word::null, &db()))
{
tmp<vectorField> tvalues(refValue_*patch().nf());

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -155,7 +155,7 @@ Foam::swirlFanVelocityFvPatchField::swirlFanVelocityFvPatchField
rpm_
(
this->cyclicPatch().owner()
? Function1<scalar>::New("rpm", dict)
? Function1<scalar>::New("rpm", dict, &db())
: nullptr
),
rEff_(dict.getOrDefault<scalar>("rEff", 0)),

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -83,8 +83,8 @@ swirlFlowRateInletVelocityFvPatchVectorField
: Zero
)
),
flowRate_(Function1<scalar>::New("flowRate", dict)),
rpm_(Function1<scalar>::New("rpm", dict))
flowRate_(Function1<scalar>::New("flowRate", dict, &db())),
rpm_(Function1<scalar>::New("rpm", dict, &db()))
{}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -75,9 +76,15 @@ swirlInletVelocityFvPatchVectorField
fixedValueFvPatchField<vector>(p, iF, dict),
origin_(dict.lookup("origin")),
axis_(dict.lookup("axis")),
axialVelocity_(Function1<scalar>::New("axialVelocity", dict)),
radialVelocity_(Function1<scalar>::New("radialVelocity", dict)),
tangentialVelocity_(Function1<scalar>::New("tangentialVelocity", dict))
axialVelocity_(Function1<scalar>::New("axialVelocity", dict, &db())),
radialVelocity_
(
Function1<scalar>::New("radialVelocity", dict, &db())
),
tangentialVelocity_
(
Function1<scalar>::New("tangentialVelocity", dict, &db())
)
{}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -52,7 +53,7 @@ translatingWallVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(p, iF, dict, false),
U_(Function1<vector>::New("U", dict))
U_(Function1<vector>::New("U", dict, &db()))
{
// Evaluate the wall velocity
updateCoeffs();

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -56,7 +56,10 @@ Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
:
mixedFvPatchField<Type>(p, iF),
phiName_(dict.getOrDefault<word>("phi", "phi")),
uniformInletValue_(Function1<Type>::New("uniformInletValue", dict))
uniformInletValue_
(
Function1<Type>::New("uniformInletValue", dict, &this->db())
)
{
this->patchType() = dict.getOrDefault<word>("patchType", word::null);
this->refValue() =

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -71,7 +72,7 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
{
if (this->cyclicPatch().owner())
{
jumpTable_ = Function1<Type>::New("jumpTable", dict);
jumpTable_ = Function1<Type>::New("jumpTable", dict, &this->db());
}
if (dict.found("value"))

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -68,7 +69,7 @@ Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
{
if (this->cyclicAMIPatch().owner())
{
jumpTable_ = Function1<Type>::New("jumpTable", dict);
jumpTable_ = Function1<Type>::New("jumpTable", dict, &this->db());
}
if (dict.found("value"))

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -55,7 +55,7 @@ uniformNormalFixedValueFvPatchVectorField
:
fixedValueFvPatchVectorField(p, iF, dict, false),
uniformValue_(PatchFunction1<scalar>::New(p.patch(), "uniformValue", dict)),
ramp_(Function1<scalar>::NewIfPresent("ramp", dict))
ramp_(Function1<scalar>::NewIfPresent("ramp", dict, word::null, &db()))
{
if (dict.found("value"))
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -65,7 +65,7 @@ uniformTotalPressureFvPatchScalarField
rhoName_(dict.getOrDefault<word>("rho", "rho")),
psiName_(dict.getOrDefault<word>("psi", "none")),
gamma_(psiName_ != "none" ? dict.get<scalar>("gamma") : 1),
p0_(Function1<scalar>::New("p0", dict))
p0_(Function1<scalar>::New("p0", dict, &db()))
{
if (dict.found("value"))
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -53,7 +54,7 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(p, iF, dict),
flowRate_(Function1<scalar>::New("flowRate", dict)),
flowRate_(Function1<scalar>::New("flowRate", dict, &db())),
alphaName_(dict.lookup("alpha"))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -328,7 +328,7 @@ CrankNicolsonDdtScheme<Type>::CrankNicolsonDdtScheme
{
is.putBack(firstToken);
dictionary dict(is);
ocCoeff_ = Function1<scalar>::New("ocCoeff", dict);
ocCoeff_ = Function1<scalar>::New("ocCoeff", dict, &mesh);
}
// Ensure the old-old-time cell volumes are available

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -146,7 +146,7 @@ externalCoupledTemperatureMixedFvPatchScalarField
if (refTempType_ == refTemperatureType::USER)
{
Tref_ = Function1<scalar>::New("Tref", dict);
Tref_ = Function1<scalar>::New("Tref", dict, &db());
}
if (dict.found("refValue"))

View File

@ -47,7 +47,7 @@ bool Foam::functionObjects::reference::calcType()
autoPtr<Function1<Type>> valuePtr
(
Function1<Type>::New("refValue", localDict_, &mesh_)
Function1<Type>::New("refValue", localDict_, &this->mesh_)
);
refValue.value() = valuePtr->value(this->time().value());

View File

@ -155,18 +155,18 @@ bool Foam::functionObjects::setFlow::read(const dictionary& dict)
}
// Scaling is applied across all modes
scalePtr_ = Function1<scalar>::New("scale", dict);
scalePtr_ = Function1<scalar>::New("scale", dict, &mesh_);
switch (mode_)
{
case modeType::FUNCTION:
{
velocityPtr_ = Function1<vector>::New("velocity", dict);
velocityPtr_ = Function1<vector>::New("velocity", dict, &mesh_);
break;
}
case modeType::ROTATION:
{
omegaPtr_ = Function1<scalar>::New("omega", dict);
omegaPtr_ = Function1<scalar>::New("omega", dict, &mesh_);
dict.readEntry("origin", origin_);
const vector refDir(dict.get<vector>("refDir").normalise());

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -92,7 +92,7 @@ bool Foam::functionObjects::setTimeStepFunctionObject::read
{
timeFunctionObject::read(dict);
timeStepPtr_ = Function1<scalar>::New("deltaT", dict);
timeStepPtr_ = Function1<scalar>::New("deltaT", dict, &time_);
// Ensure that adjustTimeStep is active
if (!time_.controlDict().getOrDefault("adjustTimeStep", false))

View File

@ -85,7 +85,10 @@ timeVaryingMappedFixedValuePointPatchField
endSampleTime_(-1),
endSampledValues_(0),
endAverage_(Zero),
offset_(Function1<Type>::NewIfPresent("offset", dict))
offset_
(
Function1<Type>::NewIfPresent("offset", dict, word::null, &this->db())
)
{
if
(

View File

@ -80,7 +80,7 @@ Foam::fv::fixedTemperatureConstraint::fixedTemperatureConstraint
{
Tuniform_.reset
(
Function1<scalar>::New("temperature", coeffs_).ptr()
Function1<scalar>::New("temperature", coeffs_, &mesh_)
);
break;
}
@ -152,7 +152,7 @@ bool Foam::fv::fixedTemperatureConstraint::read(const dictionary& dict)
{
Tuniform_.reset
(
Function1<scalar>::New(Tuniform_->name(), dict).ptr()
Function1<scalar>::New(Tuniform_->name(), dict, &mesh_)
);
}

View File

@ -213,8 +213,8 @@ Foam::fv::actuationDiskSource::actuationDiskSource
[&](const vector& vec){ return mag(vec) > VSMALL; }
).normalise()
),
UvsCpPtr_(Function1<scalar>::New("Cp", coeffs_)),
UvsCtPtr_(Function1<scalar>::New("Ct", coeffs_)),
UvsCpPtr_(Function1<scalar>::New("Cp", coeffs_, &mesh)),
UvsCtPtr_(Function1<scalar>::New("Ct", coeffs_, &mesh)),
monitorCells_()
{
setMonitorCells(coeffs_);

View File

@ -39,7 +39,7 @@ void Foam::fv::jouleHeatingSource::initialiseSigma
if (dict.found("sigma"))
{
// Sigma to be defined using a Function1 type
sigmaVsTPtr = Function1<Type>::New("sigma", dict);
sigmaVsTPtr = Function1<Type>::New("sigma", dict, &mesh_);
auto tsigma = tmp<VolFieldType>::New
(

View File

@ -91,8 +91,8 @@ void Foam::fv::SemiImplicitSource<Type>::setFieldData(const dictionary& dict)
else
{
const dictionary& Sdict = dEntry.dict();
Su_.set(count, Function1<Type>::New("Su", Sdict));
Sp_.set(count, Function1<scalar>::New("Sp", Sdict));
Su_.set(count, Function1<Type>::New("Su", Sdict, &mesh_));
Sp_.set(count, Function1<scalar>::New("Sp", Sdict, &mesh_));
}
++count;

View File

@ -59,7 +59,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
(
"flowRateProfile",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
Umag_
@ -68,7 +68,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
(
"Umag",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
thetaInner_
@ -77,7 +77,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
(
"thetaInner",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
thetaOuter_
@ -86,7 +86,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
(
"thetaOuter",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
sizeDistribution_

View File

@ -80,7 +80,7 @@ void Foam::ConeNozzleInjection<CloudType>::setInjectionMethod()
(
"position",
this->coeffDict(),
&this->owner().db().time()
&this->owner().mesh()
)
);
break;
@ -114,7 +114,7 @@ void Foam::ConeNozzleInjection<CloudType>::setFlowType()
(
"Pinj",
this->coeffDict(),
&this->owner().db().time()
&this->owner().mesh()
)
);
break;
@ -127,7 +127,7 @@ void Foam::ConeNozzleInjection<CloudType>::setFlowType()
(
"Cd",
this->coeffDict(),
&this->owner().db().time()
&this->owner().mesh()
)
);
break;
@ -175,7 +175,7 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
(
"flowRateProfile",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
thetaInner_
@ -184,7 +184,7 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
(
"thetaInner",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
thetaOuter_
@ -193,7 +193,7 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
(
"thetaOuter",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
sizeDistribution_

View File

@ -56,7 +56,7 @@ Foam::InflationInjection<CloudType>::InflationInjection
(
"flowRateProfile",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
growthRate_
@ -65,7 +65,7 @@ Foam::InflationInjection<CloudType>::InflationInjection
(
"growthRate",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
newParticles_(),

View File

@ -345,7 +345,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
(
"massFlowRate",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
);
massTotal_ = massFlowRate_->value(owner.db().time().value());

View File

@ -52,7 +52,7 @@ Foam::PatchFlowRateInjection<CloudType>::PatchFlowRateInjection
(
"concentration",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
parcelConcentration_

View File

@ -53,7 +53,7 @@ Foam::PatchInjection<CloudType>::PatchInjection
(
"flowRateProfile",
this->coeffDict(),
&owner.db().time()
&owner.mesh()
)
),
sizeDistribution_

View File

@ -72,7 +72,7 @@ adjointRotatingWallVelocityFvPatchVectorField
adjointWallVelocityFvPatchVectorField(p, iF, dict),
origin_(dict.get<vector>("origin")),
axis_(dict.get<vector>("axis")),
omega_(Function1<scalar>::New("omega", dict))
omega_(Function1<scalar>::New("omega", dict, &db()))
{}

View File

@ -113,7 +113,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
otherPhaseName_(dict.get<word>("otherPhase")),
phaseType_(phaseTypeNames_.get("phaseType", dict)),
relax_(Function1<scalar>::New("relax", dict)),
relax_(Function1<scalar>::New("relax", dict, &db())),
AbyV_(p.size(), 0),
alphatConv_(p.size(), 0),
dDep_(p.size(), 1e-5),

View File

@ -51,7 +51,7 @@ Foam::saturationModels::function1::function1
saturationModel(db),
function_
(
Function1<scalar>::New("function", dict)
Function1<scalar>::New("function", dict, &db)
)
{}

View File

@ -58,7 +58,7 @@ perturbedTemperatureDependentContactAngleForce
)
:
contactAngleForce(typeName, film, dict),
thetaPtr_(Function1<scalar>::New("theta", coeffDict_)),
thetaPtr_(Function1<scalar>::New("theta", coeffDict_, &film.primaryMesh())),
rndGen_(label(0)),
distribution_
(

View File

@ -78,9 +78,9 @@ inclinedFilmNusseltHeightFvPatchScalarField
(
dict.getOrDefault<word>("filmRegion", "surfaceFilmProperties")
),
GammaMean_(Function1<scalar>::New("GammaMean", dict)),
a_(Function1<scalar>::New("a", dict)),
omega_(Function1<scalar>::New("omega", dict))
GammaMean_(Function1<scalar>::New("GammaMean", dict, &db())),
a_(Function1<scalar>::New("a", dict, &db())),
omega_(Function1<scalar>::New("omega", dict, &db()))
{}

View File

@ -78,9 +78,9 @@ inclinedFilmNusseltInletVelocityFvPatchVectorField
(
dict.getOrDefault<word>("filmRegion", "surfaceFilmProperties")
),
GammaMean_(Function1<scalar>::New("GammaMean", dict)),
a_(Function1<scalar>::New("a", dict)),
omega_(Function1<scalar>::New("omega", dict))
GammaMean_(Function1<scalar>::New("GammaMean", dict, &db())),
a_(Function1<scalar>::New("a", dict, &db())),
omega_(Function1<scalar>::New("omega", dict, &db()))
{}

View File

@ -58,7 +58,7 @@ perturbedTemperatureDependentContactAngleForce
)
:
contactAngleForce(typeName, film, dict),
thetaPtr_(Function1<scalar>::New("theta", coeffDict_)),
thetaPtr_(Function1<scalar>::New("theta", coeffDict_, &film.regionMesh())),
rndGen_(label(0)),
distribution_
(

View File

@ -57,7 +57,7 @@ temperatureDependentContactAngleForce::temperatureDependentContactAngleForce
)
:
contactAngleForce(typeName, film, dict),
thetaPtr_(Function1<scalar>::New("theta", coeffDict_))
thetaPtr_(Function1<scalar>::New("theta", coeffDict_, &film.regionMesh()))
{}

View File

@ -62,7 +62,7 @@ function1Viscosity::function1Viscosity
viscosity_(filmViscosityModel::New(film, coeffDict_, mu)),
function_
(
Function1<scalar>::New("function", coeffDict_)
Function1<scalar>::New("function", coeffDict_, &film.regionMesh())
)
{}

View File

@ -133,7 +133,7 @@ waxSolventEvaporation::waxSolventEvaporation
YInfZero_(coeffDict_.getOrDefault("YInfZero", false)),
activityCoeff_
(
Function1<scalar>::New("activityCoeff", coeffDict_)
Function1<scalar>::New("activityCoeff", coeffDict_, &film.regionMesh())
)
{}

View File

@ -119,7 +119,10 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
test_(coeffDict().getOrDefault("test", false)),
rhoInf_(1.0),
rhoName_(coeffDict().getOrDefault<word>("rho", "rho")),
ramp_(Function1<scalar>::NewIfPresent("ramp", coeffDict())),
ramp_
(
Function1<scalar>::NewIfPresent("ramp", coeffDict(), word::null, &mesh)
),
curTimeIndex_(-1),
cOfGdisplacement_
(

View File

@ -126,7 +126,7 @@ void Foam::radiation::fvDOM::initialise()
(
"spectralDistribution",
coeffs_,
&mesh_.time()
&mesh_
)
);

View File

@ -373,7 +373,7 @@ void Foam::radiation::solarLoad::initialise(const dictionary& coeffs)
(
"spectralDistribution",
coeffs,
&mesh_.time()
&mesh_
)
);

View File

@ -207,7 +207,7 @@ void Foam::solarCalculator::initialise()
(
"directSolarRad",
dict_,
&mesh_.time()
&mesh_
)
);
@ -217,7 +217,7 @@ void Foam::solarCalculator::initialise()
(
"diffuseSolarRad",
dict_,
&mesh_.time()
&mesh_
)
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -65,7 +65,12 @@ Foam::viscosityModels::strainRateFunction::strainRateFunction
),
strainRateFunction_
(
Function1<scalar>::New("function", strainRateFunctionCoeffs_)
Function1<scalar>::New
(
"function",
strainRateFunctionCoeffs_,
&U_.db()
)
),
nu_
(
@ -134,7 +139,8 @@ bool Foam::viscosityModels::strainRateFunction::read
strainRateFunction_ = Function1<scalar>::New
(
"function",
strainRateFunctionCoeffs_
strainRateFunctionCoeffs_,
&U_.db()
);
return true;

View File

@ -57,7 +57,7 @@ Foam::surfaceTensionModels::temperatureDependent::temperatureDependent
:
surfaceTensionModel(mesh),
TName_(dict.getOrDefault<word>("T", "T")),
sigma_(Function1<scalar>::New("sigma", dict))
sigma_(Function1<scalar>::New("sigma", dict, &mesh))
{}
@ -112,7 +112,7 @@ bool Foam::surfaceTensionModels::temperatureDependent::readDict
const dictionary& sigmaDict = surfaceTensionModel::sigmaDict(dict);
TName_ = sigmaDict.getOrDefault<word>("T", "T");
sigma_ = Function1<scalar>::New("sigma", sigmaDict);
sigma_ = Function1<scalar>::New("sigma", sigmaDict, &mesh_);
return true;
}

View File

@ -56,7 +56,7 @@ temperatureDependentAlphaContactAngleFvPatchScalarField
:
alphaContactAngleTwoPhaseFvPatchScalarField(p, iF, dict),
TName_(dict.getOrDefault<word>("T", "T")),
theta0_(Function1<scalar>::New("theta0", dict))
theta0_(Function1<scalar>::New("theta0", dict, &db()))
{
evaluate();
}