STYLE: use readValueEntry in BCs. Assign Zero for refValue/refGrad

This commit is contained in:
Mark Olesen 2023-03-14 17:39:28 +01:00
parent e5e1440020
commit 188e61af16
55 changed files with 124 additions and 240 deletions

View File

@ -93,10 +93,7 @@ CONSTRUCT
/* /*
//Initialise with the value entry if evaluation is not possible //Initialise with the value entry if evaluation is not possible
FVPATCHF::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
FIELD("value", dict, p.size())
);
this->refValue() = *this; this->refValue() = *this;
*/ */
} }

View File

@ -52,8 +52,8 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField
mixingLength_(0.0), mixingLength_(0.0),
Cmu_(0.0) Cmu_(0.0)
{ {
this->refValue() = 0.0; this->refValue() = Zero;
this->refGrad() = 0.0; this->refGrad() = Zero;
this->valueFraction() = 0.0; this->valueFraction() = 0.0;
} }
@ -92,10 +92,10 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField
{ {
this->phiName_ = dict.getOrDefault<word>("phi", "phi"); this->phiName_ = dict.getOrDefault<word>("phi", "phi");
fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
this->refValue() = 0.0; this->refValue() = Zero;
this->refGrad() = 0.0; this->refGrad() = Zero;
this->valueFraction() = 0.0; this->valueFraction() = 0.0;
} }

View File

@ -51,8 +51,8 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField
mixingLength_(0.0), mixingLength_(0.0),
kName_("undefined-k") kName_("undefined-k")
{ {
this->refValue() = 0.0; this->refValue() = Zero;
this->refGrad() = 0.0; this->refGrad() = Zero;
this->valueFraction() = 0.0; this->valueFraction() = 0.0;
} }
@ -84,10 +84,10 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField
{ {
this->phiName_ = dict.getOrDefault<word>("phi", "phi"); this->phiName_ = dict.getOrDefault<word>("phi", "phi");
fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
this->refValue() = 0.0; this->refValue() = Zero;
this->refGrad() = 0.0; this->refGrad() = Zero;
this->valueFraction() = 0.0; this->valueFraction() = 0.0;
} }

View File

@ -71,7 +71,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
if (!initABL_) if (!initABL_)
{ {
scalarField::operator=(scalarField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
} }
else else
{ {

View File

@ -70,7 +70,7 @@ atmBoundaryLayerInletKFvPatchScalarField
if (!initABL_) if (!initABL_)
{ {
scalarField::operator=(scalarField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
} }
else else
{ {

View File

@ -69,7 +69,7 @@ atmBoundaryLayerInletOmegaFvPatchScalarField
if (!initABL_) if (!initABL_)
{ {
scalarField::operator=(scalarField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
} }
else else
{ {

View File

@ -70,7 +70,7 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
if (!initABL_) if (!initABL_)
{ {
vectorField::operator=(vectorField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
} }
else else
{ {

View File

@ -242,7 +242,7 @@ Foam::displacementLayeredMotionMotionSolver::faceZoneEvaluate
if (type == "fixedValue") if (type == "fixedValue")
{ {
fld = vectorField("value", dict, meshPoints.size()); fld.assign("value", dict, meshPoints.size());
} }
else if (type == "timeVaryingUniformFixedValue") else if (type == "timeVaryingUniformFixedValue")
{ {

View File

@ -77,8 +77,7 @@ SRFFreestreamVelocityFvPatchVectorField
UInf_(dict.get<vector>("UInf")) UInf_(dict.get<vector>("UInf"))
{ {
this->phiName_ = dict.getOrDefault<word>("phi", "phi"); this->phiName_ = dict.getOrDefault<word>("phi", "phi");
this->readValueEntry(dict, IOobjectOption::MUST_READ);
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
} }

View File

@ -72,7 +72,7 @@ fixedNormalInletOutletVelocityFvPatchVectorField
) )
{ {
fvPatchFieldBase::readDict(dict); fvPatchFieldBase::readDict(dict);
fvPatchVectorField::operator=(vectorField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
refValue() = normalVelocity(); refValue() = normalVelocity();
refGrad() = Zero; refGrad() = Zero;
valueFraction() = Zero; valueFraction() = Zero;

View File

@ -177,23 +177,24 @@ public:
// Member Functions // Member Functions
// Access //- Same as refValue()
const Field<Type>& freestreamValue() const { return this->refValue(); } const Field<Type>& freestreamValue() const { return this->refValue(); }
//- Same as refValue()
Field<Type>& freestreamValue() { return this->refValue(); } Field<Type>& freestreamValue() { return this->refValue(); }
// Mapping functions // Mapping Functions
//- Map (and resize as needed) from self given a mapping object //- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper& mapper); virtual void autoMap(const fvPatchFieldMapper& mapper);
//- Reverse map the given fvPatchField onto this fvPatchField //- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap virtual void rmap
( (
const fvPatchField<Type>& ptf, const fvPatchField<Type>& ptf,
const labelList& addr const labelList& addr
); );
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field

View File

@ -55,15 +55,15 @@ freestreamPressureFvPatchScalarField
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
UName_(dict.getOrDefault<word>("U", "U")) UName_(dict.getOrDefault<word>("U", "U"))
{ {
freestreamValue() = scalarField("freestreamValue", dict, p.size()); // freestreamValue() and refValue() are identical
freestreamValue().assign("freestreamValue", dict, p.size());
refGrad() = Zero;
valueFraction() = 0;
if (!this->readValueEntry(dict)) if (!this->readValueEntry(dict))
{ {
fvPatchScalarField::operator=(freestreamValue()); fvPatchScalarField::operator=(freestreamValue());
} }
refGrad() = Zero;
valueFraction() = 0;
} }

View File

@ -157,24 +157,17 @@ public:
} }
// Member functions // Member Functions
const scalarField& freestreamValue() const //- Same as refValue()
{ const scalarField& freestreamValue() const { return refValue(); }
return refValue();
}
scalarField& freestreamValue() //- Same as refValue()
{ scalarField& freestreamValue() { return refValue(); }
return refValue();
}
// Evaluation functions //- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream&) const;

View File

@ -49,15 +49,15 @@ Foam::freestreamVelocityFvPatchVectorField::freestreamVelocityFvPatchVectorField
: :
mixedFvPatchVectorField(p, iF) mixedFvPatchVectorField(p, iF)
{ {
freestreamValue() = vectorField("freestreamValue", dict, p.size()); // freestreamValue() and refValue() are identical
freestreamValue().assign("freestreamValue", dict, p.size());
refGrad() = Zero;
valueFraction() = 1;
if (!this->readValueEntry(dict)) if (!this->readValueEntry(dict))
{ {
fvPatchVectorField::operator=(freestreamValue()); fvPatchVectorField::operator=(freestreamValue());
} }
refGrad() = Zero;
valueFraction() = 1;
} }

View File

@ -151,24 +151,17 @@ public:
} }
// Member functions // Member Functions
const vectorField& freestreamValue() const //- Same as refValue()
{ const vectorField& freestreamValue() const { return refValue(); }
return refValue();
}
vectorField& freestreamValue() //- Same as refValue()
{ vectorField& freestreamValue() { return refValue(); }
return refValue();
}
// Evaluation functions //- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream&) const;

View File

@ -82,7 +82,7 @@ pressureDirectedInletOutletVelocityFvPatchVectorField
inletDir_("inletDirection", dict, p.size()) inletDir_("inletDirection", dict, p.size())
{ {
fvPatchFieldBase::readDict(dict); fvPatchFieldBase::readDict(dict);
fvPatchVectorField::operator=(vectorField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
refValue() = *this; refValue() = *this;
refGrad() = Zero; refGrad() = Zero;
valueFraction() = 0.0; valueFraction() = 0.0;

View File

@ -80,7 +80,7 @@ pressureInletOutletParSlipVelocityFvPatchVectorField
rhoName_(dict.getOrDefault<word>("rho", "rho")) rhoName_(dict.getOrDefault<word>("rho", "rho"))
{ {
fvPatchFieldBase::readDict(dict); fvPatchFieldBase::readDict(dict);
fvPatchVectorField::operator=(vectorField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
refValue() = *this; refValue() = *this;
refGrad() = Zero; refGrad() = Zero;
valueFraction() = 0.0; valueFraction() = 0.0;

View File

@ -81,7 +81,7 @@ pressureInletOutletVelocityFvPatchVectorField
phiName_(dict.getOrDefault<word>("phi", "phi")) phiName_(dict.getOrDefault<word>("phi", "phi"))
{ {
fvPatchFieldBase::readDict(dict); fvPatchFieldBase::readDict(dict);
fvPatchVectorField::operator=(vectorField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
if (dict.found("tangentialVelocity")) if (dict.found("tangentialVelocity"))
{ {

View File

@ -80,7 +80,7 @@ pressureNormalInletOutletVelocityFvPatchVectorField
rhoName_(dict.getOrDefault<word>("rho", "rho")) rhoName_(dict.getOrDefault<word>("rho", "rho"))
{ {
fvPatchFieldBase::readDict(dict); fvPatchFieldBase::readDict(dict);
fvPatchVectorField::operator=(vectorField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
refValue() = *this; refValue() = *this;
refGrad() = Zero; refGrad() = Zero;
valueFraction() = 0.0; valueFraction() = 0.0;

View File

@ -84,7 +84,7 @@ pressurePermeableAlphaInletOutletVelocityFvPatchVectorField
alphaMin_(dict.getOrDefault<scalar>("alphaMin", 1)) alphaMin_(dict.getOrDefault<scalar>("alphaMin", 1))
{ {
fvPatchFieldBase::readDict(dict); fvPatchFieldBase::readDict(dict);
fvPatchVectorField::operator=(vectorField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
refValue() = Zero; refValue() = Zero;
refGrad() = Zero; refGrad() = Zero;
valueFraction() = 1.0; valueFraction() = 1.0;

View File

@ -45,8 +45,8 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField
intensity_(0.0), intensity_(0.0),
UName_("U") UName_("U")
{ {
this->refValue() = 0.0; this->refValue() = Zero;
this->refGrad() = 0.0; this->refGrad() = Zero;
this->valueFraction() = 0.0; this->valueFraction() = 0.0;
} }
@ -91,10 +91,10 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField
<< exit(FatalError); << exit(FatalError);
} }
fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
this->refValue() = 0.0; this->refValue() = Zero;
this->refGrad() = 0.0; this->refGrad() = Zero;
this->valueFraction() = 0.0; this->valueFraction() = 0.0;
} }

View File

@ -113,7 +113,7 @@ Foam::mappedVariableThicknessWallPolyPatch::mappedVariableThicknessWallPolyPatch
) )
: :
mappedWallPolyPatch(name, dict, index, bm, patchType), mappedWallPolyPatch(name, dict, index, bm, patchType),
thickness_(scalarField("thickness", dict, this->size())) thickness_("thickness", dict, this->size())
{} {}
@ -157,13 +157,6 @@ Foam::mappedVariableThicknessWallPolyPatch::mappedVariableThicknessWallPolyPatch
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::mappedVariableThicknessWallPolyPatch::
~mappedVariableThicknessWallPolyPatch()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::mappedVariableThicknessWallPolyPatch:: void Foam::mappedVariableThicknessWallPolyPatch::

View File

@ -37,17 +37,15 @@ SourceFiles
#ifndef mappedVariableThicknessWallPolyPatch_H #ifndef mappedVariableThicknessWallPolyPatch_H
#define mappedVariableThicknessWallPolyPatch_H #define mappedVariableThicknessWallPolyPatch_H
#include "scalarField.H"
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "mappedWallPolyPatch.H" #include "mappedWallPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
class polyMesh;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class mappedVariableThicknessWallPolyPatch Declaration Class mappedVariableThicknessWallPolyPatch Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -60,7 +58,7 @@ class mappedVariableThicknessWallPolyPatch
// Private data // Private data
//- Thickness //- Thickness
scalarList thickness_; scalarField thickness_;
public: public:
@ -205,24 +203,16 @@ public:
//- Destructor //- Destructor
virtual ~mappedVariableThicknessWallPolyPatch(); virtual ~mappedVariableThicknessWallPolyPatch() = default;
// Member functions // Member Functions
//- Return non const thickness //- Return thickness (non-const access)
scalarList& thickness() scalarField& thickness() noexcept { return thickness_; }
{
return thickness_;
}
//- Return const thickness
const scalarList& thickness() const
{
return thickness_;
}
//- Return thickness (const access)
const scalarField& thickness() const noexcept { return thickness_; }
//- Write the polyPatch data as a dictionary //- Write the polyPatch data as a dictionary
void write(Ostream&) const; void write(Ostream&) const;

View File

@ -73,10 +73,7 @@ adjointFarFieldPressureFvPatchScalarField
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<scalar>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -69,10 +69,7 @@ adjointFarFieldVelocityFvPatchVectorField
fixedValueFvPatchVectorField(p, iF), fixedValueFvPatchVectorField(p, iF),
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<vector>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
vectorField("value", dict, p.size())
);
} }

View File

@ -71,10 +71,7 @@ adjointInletVelocityFvPatchVectorField
fixedValueFvPatchVectorField(p, iF), fixedValueFvPatchVectorField(p, iF),
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<vector>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
vectorField("value", dict, p.size())
);
} }

View File

@ -74,10 +74,7 @@ adjointOutletPressureFvPatchScalarField
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<scalar>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -131,10 +131,7 @@ adjointOutletVelocityFvPatchVectorField
fixedValueFvPatchVectorField(p, iF), fixedValueFvPatchVectorField(p, iF),
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<vector>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
vectorField("value", dict, p.size())
);
} }

View File

@ -71,10 +71,7 @@ adjointOutletVelocityFluxFvPatchVectorField
fixedValueFvPatchVectorField(p, iF), fixedValueFvPatchVectorField(p, iF),
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<vector>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
vectorField("value", dict, p.size())
);
} }

View File

@ -77,10 +77,7 @@ adjointWallVelocityFvPatchVectorField
kappa_(dict.getOrDefault<scalar>("kappa", 0.41)), kappa_(dict.getOrDefault<scalar>("kappa", 0.41)),
E_(dict.getOrDefault<scalar>("E", 9.8)) E_(dict.getOrDefault<scalar>("E", 9.8))
{ {
fvPatchField<vector>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
vectorField("value", dict, p.size())
);
} }

View File

@ -70,10 +70,7 @@ adjointWallVelocityLowReFvPatchVectorField
fixedValueFvPatchVectorField(p, iF), fixedValueFvPatchVectorField(p, iF),
adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointVectorBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<vector>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
vectorField("value", dict, p.size())
);
} }

View File

@ -77,10 +77,7 @@ adjointFarFieldNuaTildaFvPatchScalarField
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<scalar>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -76,10 +76,7 @@ adjointFarFieldTMVar1FvPatchScalarField
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<scalar>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -76,10 +76,7 @@ adjointFarFieldTMVar2FvPatchScalarField
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<scalar>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -72,10 +72,7 @@ adjointOutletKaFvPatchScalarField::adjointOutletKaFvPatchScalarField
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<scalar>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -73,10 +73,7 @@ adjointOutletNuaTildaFvPatchScalarField::adjointOutletNuaTildaFvPatchScalarField
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<scalar>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -76,10 +76,7 @@ adjointOutletNuaTildaFluxFvPatchScalarField
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<scalar>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -72,10 +72,7 @@ adjointOutletWaFvPatchScalarField::adjointOutletWaFvPatchScalarField
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName")) adjointScalarBoundaryCondition(p, iF, dict.get<word>("solverName"))
{ {
fvPatchField<scalar>::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -51,8 +51,8 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
dmdt_(p.size(), 0), dmdt_(p.size(), Zero),
mDotL_(p.size(), 0) mDotL_(p.size(), Zero)
{} {}
@ -65,19 +65,9 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(p, iF, dict), fixedValueFvPatchScalarField(p, iF, dict),
dmdt_(p.size(), 0), dmdt_("dmdt", dict, p.size(), IOobjectOption::LAZY_READ),
mDotL_(p.size(), 0) mDotL_("mDotL", dict, p.size(), IOobjectOption::LAZY_READ)
{ {}
if (dict.found("dmdt"))
{
dmdt_ = scalarField("dmdt", dict, p.size());
}
if (dict.found("mDotL"))
{
dmdt_ = scalarField("mDotL", dict, p.size());
}
}
alphatPhaseChangeWallFunctionFvPatchScalarField:: alphatPhaseChangeWallFunctionFvPatchScalarField::

View File

@ -91,10 +91,7 @@ JohnsonJacksonParticleSlipFvPatchVectorField
<< abort(FatalError); << abort(FatalError);
} }
fvPatchVectorField::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
vectorField("value", dict, p.size())
);
} }

View File

@ -105,10 +105,7 @@ JohnsonJacksonParticleThetaFvPatchScalarField
<< abort(FatalError); << abort(FatalError);
} }
fvPatchScalarField::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -91,10 +91,7 @@ JohnsonJacksonParticleSlipFvPatchVectorField
<< abort(FatalError); << abort(FatalError);
} }
fvPatchVectorField::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
vectorField("value", dict, p.size())
);
} }

View File

@ -105,10 +105,7 @@ JohnsonJacksonParticleThetaFvPatchScalarField
<< abort(FatalError); << abort(FatalError);
} }
fvPatchScalarField::operator= this->readValueEntry(dict, IOobjectOption::MUST_READ);
(
scalarField("value", dict, p.size())
);
} }

View File

@ -83,11 +83,11 @@ lumpedMassWallTemperatureFvPatchScalarField
mass_(dict.get<scalar>("mass")), mass_(dict.get<scalar>("mass")),
curTimeIndex_(-1) curTimeIndex_(-1)
{ {
refGrad() = 0.0; fvPatchFieldBase::readDict(dict);
this->readValueEntry(dict, IOobjectOption::MUST_READ);
refValue() = *this;
refGrad() = Zero;
valueFraction() = 1.0; valueFraction() = 1.0;
refValue() = scalarField("value", dict, p.size());
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
} }

View File

@ -66,7 +66,7 @@ semiPermeableBaffleMassFractionFvPatchScalarField
c_(dict.getOrDefault<scalar>("c", 0)), c_(dict.getOrDefault<scalar>("c", 0)),
phiName_(dict.getOrDefault<word>("phi", "phi")) phiName_(dict.getOrDefault<word>("phi", "phi"))
{ {
fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
refValue() = Zero; refValue() = Zero;
refGrad() = Zero; refGrad() = Zero;

View File

@ -86,7 +86,7 @@ semiPermeableBaffleVelocityFvPatchVectorField
fixedValueFvPatchVectorField(p, iF), fixedValueFvPatchVectorField(p, iF),
rhoName_(dict.getOrDefault<word>("rho", "rho")) rhoName_(dict.getOrDefault<word>("rho", "rho"))
{ {
fvPatchVectorField::operator==(vectorField("value", dict, p.size())); this->readValueEntry(dict, IOobjectOption::MUST_READ);
} }

View File

@ -57,8 +57,8 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
), ),
TnbrName_("undefined-Tnbr") TnbrName_("undefined-Tnbr")
{ {
this->refValue() = 0.0; this->refValue() = Zero;
this->refGrad() = 0.0; this->refGrad() = Zero;
this->valueFraction() = 1.0; this->valueFraction() = 1.0;
} }
@ -153,7 +153,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
{ {
// Start from user entered data. Assume fixedValue. // Start from user entered data. Assume fixedValue.
refValue() = *this; refValue() = *this;
refGrad() = 0.0; refGrad() = Zero;
valueFraction() = 1.0; valueFraction() = 1.0;
} }
@ -377,7 +377,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
// - mixFraction = nbrKDelta / (nbrKDelta + myKDelta()) // - mixFraction = nbrKDelta / (nbrKDelta + myKDelta())
this->refValue() = nbrIntFld; this->refValue() = nbrIntFld;
this->refGrad() = 0.0; this->refGrad() = Zero;
this->valueFraction() = nbrKDelta/(nbrKDelta + myKDelta()); this->valueFraction() = nbrKDelta/(nbrKDelta + myKDelta());
mixedFvPatchScalarField::updateCoeffs(); mixedFvPatchScalarField::updateCoeffs();

View File

@ -62,8 +62,8 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
qrName_("undefined-qr"), qrName_("undefined-qr"),
thermalInertia_(false) thermalInertia_(false)
{ {
this->refValue() = 0.0; this->refValue() = Zero;
this->refGrad() = 0.0; this->refGrad() = Zero;
this->valueFraction() = 1.0; this->valueFraction() = 1.0;
this->source() = 0.0; this->source() = 0.0;
} }
@ -201,7 +201,7 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
{ {
// Start from user entered data. Assume fixedValue. // Start from user entered data. Assume fixedValue.
refValue() = *this; refValue() = *this;
refGrad() = 0.0; refGrad() = Zero;
valueFraction() = 1.0; valueFraction() = 1.0;
} }

View File

@ -42,8 +42,8 @@ Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField
Tinf_(p.size(), Zero), Tinf_(p.size(), Zero),
alphaWall_(p.size(), Zero) alphaWall_(p.size(), Zero)
{ {
refValue() = 0.0; refValue() = Zero;
refGrad() = 0.0; refGrad() = Zero;
valueFraction() = 0.0; valueFraction() = 0.0;
} }
@ -74,7 +74,7 @@ Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField
alphaWall_("alphaWall", dict, p.size()) alphaWall_("alphaWall", dict, p.size())
{ {
refValue() = Tinf_; refValue() = Tinf_;
refGrad() = 0.0; refGrad() = Zero;
valueFraction() = 0.0; valueFraction() = 0.0;
if (!this->readValueEntry(dict)) if (!this->readValueEntry(dict))

View File

@ -46,8 +46,8 @@ mixedEnergyFvPatchScalarField
mixedFvPatchScalarField(p, iF) mixedFvPatchScalarField(p, iF)
{ {
valueFraction() = 0.0; valueFraction() = 0.0;
refValue() = 0.0; refValue() = Zero;
refGrad() = 0.0; refGrad() = Zero;
source() = 0.0; source() = 0.0;
} }

View File

@ -53,8 +53,8 @@ greyDiffusiveRadiationMixedFvPatchScalarField
qRadExt_(0), qRadExt_(0),
qRadExtDir_(Zero) qRadExtDir_(Zero)
{ {
refValue() = 0.0; refValue() = Zero;
refGrad() = 0.0; refGrad() = Zero;
valueFraction() = 1.0; valueFraction() = 1.0;
} }
@ -95,8 +95,8 @@ greyDiffusiveRadiationMixedFvPatchScalarField
} }
else else
{ {
refValue() = 0.0; refValue() = Zero;
refGrad() = 0.0; refGrad() = Zero;
valueFraction() = 1.0; valueFraction() = 1.0;
fvPatchScalarField::operator=(refValue()); fvPatchScalarField::operator=(refValue());

View File

@ -50,8 +50,8 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField
: :
mixedFvPatchScalarField(p, iF) mixedFvPatchScalarField(p, iF)
{ {
refValue() = 0.0; refValue() = Zero;
refGrad() = 0.0; refGrad() = Zero;
valueFraction() = 1.0; valueFraction() = 1.0;
} }

View File

@ -82,12 +82,7 @@ Foam::enthalpySorptionFvPatchScalarField::enthalpySorptionFvPatchScalarField
speciesName_(dict.get<word>("species")), speciesName_(dict.get<word>("species")),
pName_(dict.getOrDefault<word>("p", "p")), pName_(dict.getOrDefault<word>("p", "p")),
TName_(dict.getOrDefault<word>("T", "T")), TName_(dict.getOrDefault<word>("T", "T")),
dhdt_ dhdt_("dhdt", dict, p.size(), IOobjectOption::LAZY_READ)
(
dict.found("dhdt")
? scalarField("dhdt", dict, p.size())
: scalarField(p.size(), 0)
)
{ {
switch (enthalpyModel_) switch (enthalpyModel_)
{ {

View File

@ -42,9 +42,9 @@ mixedUnburntEnthalpyFvPatchScalarField
: :
mixedFvPatchScalarField(p, iF) mixedFvPatchScalarField(p, iF)
{ {
refValue() = Zero;
refGrad() = Zero;
valueFraction() = 0.0; valueFraction() = 0.0;
refValue() = 0.0;
refGrad() = 0.0;
} }

View File

@ -174,18 +174,8 @@ Foam::speciesSorptionFvPatchScalarField::speciesSorptionFvPatchScalarField
max_(dict.getCheck<scalar>("max", scalarMinMax::ge(0))), max_(dict.getCheck<scalar>("max", scalarMinMax::ge(0))),
rhoS_(dict.get<scalar>("rhoS")), rhoS_(dict.get<scalar>("rhoS")),
pName_(dict.getOrDefault<word>("p", "p")), pName_(dict.getOrDefault<word>("p", "p")),
dfldp_ dfldp_("dfldp", dict, p.size(), IOobjectOption::LAZY_READ),
( mass_("mass", dict, p.size(), IOobjectOption::LAZY_READ)
dict.found("dfldp")
? scalarField("dfldp", dict, p.size())
: scalarField(p.size(), 0)
),
mass_
(
dict.found("mass")
? scalarField("mass", dict, p.size())
: scalarField(p.size(), 0)
)
{ {
if (!this->readValueEntry(dict)) if (!this->readValueEntry(dict))
{ {