diff --git a/etc/codeTemplates/BC/BC.C b/etc/codeTemplates/BC/BC.C index 7dc8098b37..045b57b800 100644 --- a/etc/codeTemplates/BC/BC.C +++ b/etc/codeTemplates/BC/BC.C @@ -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; */ } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index dfdff55615..0ef4be29a2 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -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("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; } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 1fec48c218..0869cb3724 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -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("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; } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C index 1c4216ed16..9250dec137 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C @@ -71,7 +71,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField if (!initABL_) { - scalarField::operator=(scalarField("value", dict, p.size())); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } else { diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C index 1590676c7b..1bda2bbd54 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C @@ -70,7 +70,7 @@ atmBoundaryLayerInletKFvPatchScalarField if (!initABL_) { - scalarField::operator=(scalarField("value", dict, p.size())); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } else { diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletOmega/atmBoundaryLayerInletOmegaFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletOmega/atmBoundaryLayerInletOmegaFvPatchScalarField.C index 12aff01673..4d46621c3b 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletOmega/atmBoundaryLayerInletOmegaFvPatchScalarField.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletOmega/atmBoundaryLayerInletOmegaFvPatchScalarField.C @@ -69,7 +69,7 @@ atmBoundaryLayerInletOmegaFvPatchScalarField if (!initABL_) { - scalarField::operator=(scalarField("value", dict, p.size())); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } else { diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C index 51eacba6a0..43177f1bf9 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C @@ -70,7 +70,7 @@ atmBoundaryLayerInletVelocityFvPatchVectorField if (!initABL_) { - vectorField::operator=(vectorField("value", dict, p.size())); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } else { diff --git a/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C index fefa520f88..5b88d28c57 100644 --- a/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C +++ b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C @@ -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") { diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C index da50a57f7e..b2f876dffe 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C @@ -77,8 +77,7 @@ SRFFreestreamVelocityFvPatchVectorField UInf_(dict.get("UInf")) { this->phiName_ = dict.getOrDefault("phi", "phi"); - - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C index bb58e32123..cc33808dd1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C @@ -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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.H index 7a86c6db2e..76f5707391 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.H @@ -177,23 +177,24 @@ public: // Member Functions - // Access - + //- Same as refValue() const Field& freestreamValue() const { return this->refValue(); } + + //- Same as refValue() Field& 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& ptf, - const labelList& addr - ); + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchField& ptf, + const labelList& addr + ); //- Update the coefficients associated with the patch field diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C index aafa59a625..c75f5add6b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C @@ -55,15 +55,15 @@ freestreamPressureFvPatchScalarField mixedFvPatchScalarField(p, iF), UName_(dict.getOrDefault("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; } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H index e93b26223a..1922113c0b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H @@ -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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.C index 3a147e9886..0a0af10b84 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.C @@ -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; } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.H index 26bf7ee809..aadeeb81c2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.H @@ -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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C index b2cef93cf2..fa386466a5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C @@ -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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C index d3b2100080..f7d0249a65 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C @@ -80,7 +80,7 @@ pressureInletOutletParSlipVelocityFvPatchVectorField rhoName_(dict.getOrDefault("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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C index 94d7392f31..b158e6bce4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C @@ -81,7 +81,7 @@ pressureInletOutletVelocityFvPatchVectorField phiName_(dict.getOrDefault("phi", "phi")) { fvPatchFieldBase::readDict(dict); - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); + this->readValueEntry(dict, IOobjectOption::MUST_READ); if (dict.found("tangentialVelocity")) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C index e0ea49b05d..32be116c66 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C @@ -80,7 +80,7 @@ pressureNormalInletOutletVelocityFvPatchVectorField rhoName_(dict.getOrDefault("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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C index 0a23414a40..21e8dab8e6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C @@ -84,7 +84,7 @@ pressurePermeableAlphaInletOutletVelocityFvPatchVectorField alphaMin_(dict.getOrDefault("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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C index 06f5809c0d..1f92652f09 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C @@ -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; } diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.C b/src/meshTools/mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.C index ca9193e569..8107096ab0 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.C +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.C @@ -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:: diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.H b/src/meshTools/mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.H index ac97145f35..e089e28526 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.H +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.H @@ -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; diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.C index c4dea30df3..7f40afe8a4 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.C @@ -73,10 +73,7 @@ adjointFarFieldPressureFvPatchScalarField fixedValueFvPatchScalarField(p, iF), adjointScalarBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldVelocity/adjointFarFieldVelocityFvPatchVectorField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldVelocity/adjointFarFieldVelocityFvPatchVectorField.C index 71e56b5359..b39a0a2c97 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldVelocity/adjointFarFieldVelocityFvPatchVectorField.C +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldVelocity/adjointFarFieldVelocityFvPatchVectorField.C @@ -69,10 +69,7 @@ adjointFarFieldVelocityFvPatchVectorField fixedValueFvPatchVectorField(p, iF), adjointVectorBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - vectorField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointInletVelocity/adjointInletVelocityFvPatchVectorField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointInletVelocity/adjointInletVelocityFvPatchVectorField.C index 869b4c9dec..d6a6d3fa43 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointInletVelocity/adjointInletVelocityFvPatchVectorField.C +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointInletVelocity/adjointInletVelocityFvPatchVectorField.C @@ -71,10 +71,7 @@ adjointInletVelocityFvPatchVectorField fixedValueFvPatchVectorField(p, iF), adjointVectorBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - vectorField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C index 0e80d181e2..b0bf3c563e 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C @@ -74,10 +74,7 @@ adjointOutletPressureFvPatchScalarField fixedValueFvPatchScalarField(p, iF), adjointScalarBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C index 49adb64b19..41d715afa4 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C @@ -131,10 +131,7 @@ adjointOutletVelocityFvPatchVectorField fixedValueFvPatchVectorField(p, iF), adjointVectorBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - vectorField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocityFlux/adjointOutletVelocityFluxFvPatchVectorField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocityFlux/adjointOutletVelocityFluxFvPatchVectorField.C index dd385480e3..597cc61d62 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocityFlux/adjointOutletVelocityFluxFvPatchVectorField.C +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocityFlux/adjointOutletVelocityFluxFvPatchVectorField.C @@ -71,10 +71,7 @@ adjointOutletVelocityFluxFvPatchVectorField fixedValueFvPatchVectorField(p, iF), adjointVectorBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - vectorField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocity/adjointWallVelocityFvPatchVectorField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocity/adjointWallVelocityFvPatchVectorField.C index 2ee1f2a848..0172840bb0 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocity/adjointWallVelocityFvPatchVectorField.C +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocity/adjointWallVelocityFvPatchVectorField.C @@ -77,10 +77,7 @@ adjointWallVelocityFvPatchVectorField kappa_(dict.getOrDefault("kappa", 0.41)), E_(dict.getOrDefault("E", 9.8)) { - fvPatchField::operator= - ( - vectorField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.C index fb54a88b1a..bc4e70af26 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.C +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.C @@ -70,10 +70,7 @@ adjointWallVelocityLowReFvPatchVectorField fixedValueFvPatchVectorField(p, iF), adjointVectorBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - vectorField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldNuaTilda/adjointFarFieldNuaTildaFvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldNuaTilda/adjointFarFieldNuaTildaFvPatchScalarField.C index 13340dc1b6..05dd9aba11 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldNuaTilda/adjointFarFieldNuaTildaFvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldNuaTilda/adjointFarFieldNuaTildaFvPatchScalarField.C @@ -77,10 +77,7 @@ adjointFarFieldNuaTildaFvPatchScalarField fixedValueFvPatchScalarField(p, iF), adjointScalarBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar1/adjointFarFieldTMVar1FvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar1/adjointFarFieldTMVar1FvPatchScalarField.C index 35d9034a0c..13db68bb89 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar1/adjointFarFieldTMVar1FvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar1/adjointFarFieldTMVar1FvPatchScalarField.C @@ -76,10 +76,7 @@ adjointFarFieldTMVar1FvPatchScalarField fixedValueFvPatchScalarField(p, iF), adjointScalarBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar2/adjointFarFieldTMVar2FvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar2/adjointFarFieldTMVar2FvPatchScalarField.C index b51d8be812..7f269509ae 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar2/adjointFarFieldTMVar2FvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar2/adjointFarFieldTMVar2FvPatchScalarField.C @@ -76,10 +76,7 @@ adjointFarFieldTMVar2FvPatchScalarField fixedValueFvPatchScalarField(p, iF), adjointScalarBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletKa/adjointOutletKaFvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletKa/adjointOutletKaFvPatchScalarField.C index dbbfac5451..4c49cb09b1 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletKa/adjointOutletKaFvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletKa/adjointOutletKaFvPatchScalarField.C @@ -72,10 +72,7 @@ adjointOutletKaFvPatchScalarField::adjointOutletKaFvPatchScalarField fixedValueFvPatchScalarField(p, iF), adjointScalarBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTilda/adjointOutletNuaTildaFvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTilda/adjointOutletNuaTildaFvPatchScalarField.C index 32cc4f76c9..78c4b1dae6 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTilda/adjointOutletNuaTildaFvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTilda/adjointOutletNuaTildaFvPatchScalarField.C @@ -73,10 +73,7 @@ adjointOutletNuaTildaFvPatchScalarField::adjointOutletNuaTildaFvPatchScalarField fixedValueFvPatchScalarField(p, iF), adjointScalarBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTildaFlux/adjointOutletNuaTildaFluxFvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTildaFlux/adjointOutletNuaTildaFluxFvPatchScalarField.C index 2382fa4e17..758b23c65d 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTildaFlux/adjointOutletNuaTildaFluxFvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTildaFlux/adjointOutletNuaTildaFluxFvPatchScalarField.C @@ -76,10 +76,7 @@ adjointOutletNuaTildaFluxFvPatchScalarField fixedValueFvPatchScalarField(p, iF), adjointScalarBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletWa/adjointOutletWaFvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletWa/adjointOutletWaFvPatchScalarField.C index 68fab059d3..0809fc0b25 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletWa/adjointOutletWaFvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletWa/adjointOutletWaFvPatchScalarField.C @@ -72,10 +72,7 @@ adjointOutletWaFvPatchScalarField::adjointOutletWaFvPatchScalarField fixedValueFvPatchScalarField(p, iF), adjointScalarBoundaryCondition(p, iF, dict.get("solverName")) { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C index dae81c48d9..21d19c3bcb 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C @@ -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:: diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index a1d4580da7..add9f321a1 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -91,10 +91,7 @@ JohnsonJacksonParticleSlipFvPatchVectorField << abort(FatalError); } - fvPatchVectorField::operator= - ( - vectorField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index d46037600c..ce782fc762 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -105,10 +105,7 @@ JohnsonJacksonParticleThetaFvPatchScalarField << abort(FatalError); } - fvPatchScalarField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index 84d56ae636..8c4d5335be 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -91,10 +91,7 @@ JohnsonJacksonParticleSlipFvPatchVectorField << abort(FatalError); } - fvPatchVectorField::operator= - ( - vectorField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index 6947267135..a073bada84 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -105,10 +105,7 @@ JohnsonJacksonParticleThetaFvPatchScalarField << abort(FatalError); } - fvPatchScalarField::operator= - ( - scalarField("value", dict, p.size()) - ); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.C index 2d1ecc121c..d2ddbbe2e2 100644 --- a/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.C @@ -83,11 +83,11 @@ lumpedMassWallTemperatureFvPatchScalarField mass_(dict.get("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())); } diff --git a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C index d9d00a8bd3..ce75942e27 100644 --- a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C @@ -66,7 +66,7 @@ semiPermeableBaffleMassFractionFvPatchScalarField c_(dict.getOrDefault("c", 0)), phiName_(dict.getOrDefault("phi", "phi")) { - fvPatchScalarField::operator=(scalarField("value", dict, p.size())); + this->readValueEntry(dict, IOobjectOption::MUST_READ); refValue() = Zero; refGrad() = Zero; diff --git a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C index 579989b7f1..a4d24cead9 100644 --- a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C +++ b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C @@ -86,7 +86,7 @@ semiPermeableBaffleVelocityFvPatchVectorField fixedValueFvPatchVectorField(p, iF), rhoName_(dict.getOrDefault("rho", "rho")) { - fvPatchVectorField::operator==(vectorField("value", dict, p.size())); + this->readValueEntry(dict, IOobjectOption::MUST_READ); } diff --git a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index e23e941453..379eb0b991 100644 --- a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -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(); diff --git a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C index ced3437922..7e5da847ca 100644 --- a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C @@ -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; } diff --git a/src/thermoTools/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C index d8862abdad..2c435144f0 100644 --- a/src/thermoTools/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C @@ -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)) diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C index 4e0a680fb2..0f755657ed 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C @@ -46,8 +46,8 @@ mixedEnergyFvPatchScalarField mixedFvPatchScalarField(p, iF) { valueFraction() = 0.0; - refValue() = 0.0; - refGrad() = 0.0; + refValue() = Zero; + refGrad() = Zero; source() = 0.0; } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index ccf1d365ad..cb6dc1b7c7 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -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()); diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index 0c4c68caf3..b6ae35082a 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -50,8 +50,8 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField : mixedFvPatchScalarField(p, iF) { - refValue() = 0.0; - refGrad() = 0.0; + refValue() = Zero; + refGrad() = Zero; valueFraction() = 1.0; } diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.C index 9cf248c50d..a3caadc95a 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.C @@ -82,12 +82,7 @@ Foam::enthalpySorptionFvPatchScalarField::enthalpySorptionFvPatchScalarField speciesName_(dict.get("species")), pName_(dict.getOrDefault("p", "p")), TName_(dict.getOrDefault("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_) { diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C index ab14754c6c..b0c64d90fe 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C @@ -42,9 +42,9 @@ mixedUnburntEnthalpyFvPatchScalarField : mixedFvPatchScalarField(p, iF) { + refValue() = Zero; + refGrad() = Zero; valueFraction() = 0.0; - refValue() = 0.0; - refGrad() = 0.0; } diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.C index efbce74bae..f1275de1bc 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.C @@ -174,18 +174,8 @@ Foam::speciesSorptionFvPatchScalarField::speciesSorptionFvPatchScalarField max_(dict.getCheck("max", scalarMinMax::ge(0))), rhoS_(dict.get("rhoS")), pName_(dict.getOrDefault("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)) {