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
FVPATCHF::operator=
(
FIELD("value", dict, p.size())
);
this->readValueEntry(dict, IOobjectOption::MUST_READ);
this->refValue() = *this;
*/
}

View File

@ -52,8 +52,8 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField
mixingLength_(0.0),
Cmu_(0.0)
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->refValue() = Zero;
this->refGrad() = Zero;
this->valueFraction() = 0.0;
}
@ -92,10 +92,10 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField
{
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->refGrad() = 0.0;
this->refValue() = Zero;
this->refGrad() = Zero;
this->valueFraction() = 0.0;
}

View File

@ -51,8 +51,8 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField
mixingLength_(0.0),
kName_("undefined-k")
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->refValue() = Zero;
this->refGrad() = Zero;
this->valueFraction() = 0.0;
}
@ -84,10 +84,10 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField
{
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->refGrad() = 0.0;
this->refValue() = Zero;
this->refGrad() = Zero;
this->valueFraction() = 0.0;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,15 +55,15 @@ freestreamPressureFvPatchScalarField
mixedFvPatchScalarField(p, iF),
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))
{
fvPatchScalarField::operator=(freestreamValue());
}
refGrad() = Zero;
valueFraction() = 0;
}

View File

@ -157,24 +157,17 @@ public:
}
// Member functions
// Member Functions
const scalarField& freestreamValue() const
{
return refValue();
}
//- Same as refValue()
const scalarField& freestreamValue() const { return refValue(); }
scalarField& freestreamValue()
{
return refValue();
}
//- Same as refValue()
scalarField& freestreamValue() { 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
virtual void write(Ostream&) const;

View File

@ -49,15 +49,15 @@ Foam::freestreamVelocityFvPatchVectorField::freestreamVelocityFvPatchVectorField
:
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))
{
fvPatchVectorField::operator=(freestreamValue());
}
refGrad() = Zero;
valueFraction() = 1;
}

View File

@ -151,24 +151,17 @@ public:
}
// Member functions
// Member Functions
const vectorField& freestreamValue() const
{
return refValue();
}
//- Same as refValue()
const vectorField& freestreamValue() const { return refValue(); }
vectorField& freestreamValue()
{
return refValue();
}
//- Same as refValue()
vectorField& freestreamValue() { 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
virtual void write(Ostream&) const;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -113,7 +113,7 @@ Foam::mappedVariableThicknessWallPolyPatch::mappedVariableThicknessWallPolyPatch
)
:
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 * * * * * * * * * * * * * //
void Foam::mappedVariableThicknessWallPolyPatch::

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -83,11 +83,11 @@ lumpedMassWallTemperatureFvPatchScalarField
mass_(dict.get<scalar>("mass")),
curTimeIndex_(-1)
{
refGrad() = 0.0;
fvPatchFieldBase::readDict(dict);
this->readValueEntry(dict, IOobjectOption::MUST_READ);
refValue() = *this;
refGrad() = Zero;
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)),
phiName_(dict.getOrDefault<word>("phi", "phi"))
{
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
this->readValueEntry(dict, IOobjectOption::MUST_READ);
refValue() = Zero;
refGrad() = Zero;

View File

@ -86,7 +86,7 @@ semiPermeableBaffleVelocityFvPatchVectorField
fixedValueFvPatchVectorField(p, iF),
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")
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->refValue() = Zero;
this->refGrad() = Zero;
this->valueFraction() = 1.0;
}
@ -153,7 +153,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
{
// Start from user entered data. Assume fixedValue.
refValue() = *this;
refGrad() = 0.0;
refGrad() = Zero;
valueFraction() = 1.0;
}
@ -377,7 +377,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
// - mixFraction = nbrKDelta / (nbrKDelta + myKDelta())
this->refValue() = nbrIntFld;
this->refGrad() = 0.0;
this->refGrad() = Zero;
this->valueFraction() = nbrKDelta/(nbrKDelta + myKDelta());
mixedFvPatchScalarField::updateCoeffs();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -42,9 +42,9 @@ mixedUnburntEnthalpyFvPatchScalarField
:
mixedFvPatchScalarField(p, iF)
{
refValue() = Zero;
refGrad() = Zero;
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))),
rhoS_(dict.get<scalar>("rhoS")),
pName_(dict.getOrDefault<word>("p", "p")),
dfldp_
(
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)
)
dfldp_("dfldp", dict, p.size(), IOobjectOption::LAZY_READ),
mass_("mass", dict, p.size(), IOobjectOption::LAZY_READ)
{
if (!this->readValueEntry(dict))
{