mixedFvPatchField: Added optional 'valuesRequired' argument to the dictionary constructor
so that derived classes can call the dictionary constructor without reading the refValue, refGradient or valueFraction entries. This ensures that the fvPatchField dictionary constructor is called, setting optional entries like 'libs' as required.
This commit is contained in:
@ -60,7 +60,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
UName_(dict.lookupOrDefault<word>("U", "U")),
|
||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
||||
|
||||
@ -61,7 +61,7 @@ JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
restitutionCoefficient_
|
||||
(
|
||||
"restitutionCoefficient",
|
||||
|
||||
@ -62,7 +62,7 @@ coupledTemperatureFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")),
|
||||
qrNbrName_(dict.lookupOrDefault<word>("qrNbr", "none")),
|
||||
qrName_(dict.lookupOrDefault<word>("qr", "none")),
|
||||
|
||||
@ -70,7 +70,7 @@ externalTemperatureFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
haveQ_(dict.found("Q")),
|
||||
Q_(haveQ_ ? dict.lookup<scalar>("Q") : NaN),
|
||||
haveq_(dict.found("q")),
|
||||
|
||||
@ -68,7 +68,7 @@ thermalBaffle1DFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
TName_("T"),
|
||||
baffleActivated_(dict.lookupOrDefault<bool>("baffleActivated", true)),
|
||||
thickness_(),
|
||||
|
||||
@ -56,7 +56,7 @@ totalFlowRateAdvectiveDiffusiveFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<scalar>(p, iF),
|
||||
mixedFvPatchField<scalar>(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
rhoName_(dict.lookupOrDefault<word>("rho", "none")),
|
||||
massFluxFraction_(dict.lookupOrDefault<scalar>("massFluxFraction", 1.0))
|
||||
|
||||
@ -46,15 +46,52 @@ Foam::mixedFvPatchField<Type>::mixedFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const bool valuesRequired
|
||||
)
|
||||
:
|
||||
fvPatchField<Type>(p, iF, dict, false),
|
||||
refValue_("refValue", dict, p.size()),
|
||||
refGrad_("refGradient", dict, p.size()),
|
||||
valueFraction_("valueFraction", dict, p.size())
|
||||
refValue_(p.size()),
|
||||
refGrad_(p.size()),
|
||||
valueFraction_(p.size())
|
||||
{
|
||||
if (valuesRequired)
|
||||
{
|
||||
if (dict.found("refValue"))
|
||||
{
|
||||
refValue_ = Field<Type>("refValue", dict, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Essential entry 'refValue' missing"
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
if (dict.found("refGradient"))
|
||||
{
|
||||
refGrad_ = Field<Type>("refGradient", dict, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Essential entry 'refGradient' missing"
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
if (dict.found("valueFraction"))
|
||||
{
|
||||
valueFraction_ = Field<scalar>("valueFraction", dict, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Essential entry 'valueFraction' missing"
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -114,7 +114,8 @@ public:
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const dictionary&
|
||||
const dictionary&,
|
||||
const bool valuesRequired=true
|
||||
);
|
||||
|
||||
//- Construct by mapping the given mixedFvPatchField onto a new patch
|
||||
|
||||
@ -62,7 +62,7 @@ Foam::advectiveFvPatchField<Type>::advectiveFvPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<Type>(p, iF),
|
||||
mixedFvPatchField<Type>(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||
fieldInf_(Zero),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -471,7 +471,7 @@ externalCoupledMixedFvPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<Type>(p, iF),
|
||||
mixedFvPatchField<Type>(p, iF, dict, false),
|
||||
commsDir_(dict.lookup("commsDir")),
|
||||
fName_(dict.lookup("file")),
|
||||
waitInterval_(dict.lookupOrDefault("waitInterval", 1)),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -50,7 +50,7 @@ freestreamPressureFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
UName_(dict.lookupOrDefault<word>("U", "U")),
|
||||
supersonic_
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,7 +45,7 @@ Foam::freestreamVelocityFvPatchVectorField::freestreamVelocityFvPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchVectorField(p, iF)
|
||||
mixedFvPatchVectorField(p, iF, dict, false)
|
||||
{
|
||||
freestreamValue() = vectorField("freestreamValue", dict, p.size());
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Foam::inletOutletFvPatchField<Type>::inletOutletFvPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<Type>(p, iF),
|
||||
mixedFvPatchField<Type>(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi"))
|
||||
{
|
||||
this->refValue() = Field<Type>("inletValue", dict, p.size());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -51,7 +51,7 @@ Foam::outletInletFvPatchField<Type>::outletInletFvPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<Type>(p, iF),
|
||||
mixedFvPatchField<Type>(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi"))
|
||||
{
|
||||
this->refValue() = Field<Type>("outletValue", dict, p.size());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,7 +56,7 @@ outletPhaseMeanVelocityFvPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<vector>(p, iF),
|
||||
mixedFvPatchField<vector>(p, iF, dict, false),
|
||||
UnMean_(Function1<scalar>::New("UnMean", dict)),
|
||||
alphaName_(dict.lookup("alpha"))
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -59,7 +59,7 @@ phaseHydrostaticPressureFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
phaseFraction_(dict.lookupOrDefault<word>("phaseFraction", "alpha")),
|
||||
rho_(dict.lookup<scalar>("rho")),
|
||||
pRefValue_(dict.lookup<scalar>("pRefValue")),
|
||||
|
||||
@ -57,7 +57,7 @@ pressureDirectedInletOutletVelocityFvPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchVectorField(p, iF),
|
||||
mixedFvPatchVectorField(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||
inletDir_("inletDirection", dict, p.size())
|
||||
|
||||
@ -57,7 +57,7 @@ pressureInletOutletParSlipVelocityFvPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchVectorField(p, iF),
|
||||
mixedFvPatchVectorField(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
||||
{
|
||||
|
||||
@ -57,7 +57,7 @@ pressureNormalInletOutletVelocityFvPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchVectorField(p, iF),
|
||||
mixedFvPatchVectorField(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -60,7 +60,7 @@ supersonicFreestreamFvPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchVectorField(p, iF),
|
||||
mixedFvPatchVectorField(p, iF, dict, false),
|
||||
TName_(dict.lookupOrDefault<word>("T", "T")),
|
||||
pName_(dict.lookupOrDefault<word>("p", "p")),
|
||||
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
||||
|
||||
@ -54,7 +54,7 @@ transonicEntrainmentPressureFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
|
||||
@ -51,7 +51,7 @@ Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<Type>(p, iF),
|
||||
mixedFvPatchField<Type>(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
uniformInletValue_(Function1<Type>::New("uniformInletValue", dict))
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,7 +38,7 @@ variableHeightFlowRateFvPatchScalarField
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<scalar>(p, iF),
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
phiName_("phi"),
|
||||
lowerBound_(0.0),
|
||||
upperBound_(1.0)
|
||||
@ -57,7 +57,7 @@ variableHeightFlowRateFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
lowerBound_(dict.lookup<scalar>("lowerBound")),
|
||||
upperBound_(dict.lookup<scalar>("upperBound"))
|
||||
|
||||
@ -72,6 +72,7 @@ Foam::fvPatchField<Type>::fvPatchField
|
||||
)
|
||||
:
|
||||
Field<Type>(p.size()),
|
||||
libs_(dict.lookupOrDefault("libs", fileNameList::null())),
|
||||
patch_(p),
|
||||
internalField_(iF),
|
||||
updated_(false),
|
||||
|
||||
@ -168,14 +168,7 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
||||
}
|
||||
}
|
||||
|
||||
tmp<fvPatchField<Type>> ptf(cstrIter()(p, iF, dict));
|
||||
|
||||
if (dict.found("libs"))
|
||||
{
|
||||
dict.lookup("libs") >> ptf.ref().libs_;
|
||||
}
|
||||
|
||||
return ptf;
|
||||
return cstrIter()(p, iF, dict);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
radiationCoupledBase(p, dict),
|
||||
TName_(dict.lookupOrDefault<word>("T", "T"))
|
||||
{
|
||||
|
||||
@ -57,7 +57,7 @@ MarshakRadiationFixedTemperatureFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
radiationCoupledBase(p, dict),
|
||||
Trad_("Trad", dict, p.size())
|
||||
{
|
||||
|
||||
@ -61,7 +61,7 @@ greyDiffusiveRadiationMixedFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
radiationCoupledBase(p, dict),
|
||||
TName_(dict.lookupOrDefault<word>("T", "T"))
|
||||
{
|
||||
|
||||
@ -62,7 +62,7 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
radiationCoupledBase(p, dict),
|
||||
TName_(dict.lookupOrDefault<word>("T", "T"))
|
||||
{
|
||||
|
||||
@ -100,7 +100,7 @@ specieTransferMassFractionFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
mixedFvPatchScalarField(p, iF, dict, false),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
UName_(dict.lookupOrDefault<word>("U", "U")),
|
||||
phiYp_(p.size(), 0),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -55,7 +55,7 @@ Foam::waveInletOutletFvPatchField<Type>::waveInletOutletFvPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<Type>(p, iF),
|
||||
mixedFvPatchField<Type>(p, iF, dict, false),
|
||||
inletValueAbove_(Function1<Type>::New("inletValueAbove", dict)),
|
||||
inletValueBelow_(Function1<Type>::New("inletValueBelow", dict)),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi"))
|
||||
|
||||
Reference in New Issue
Block a user