diff --git a/etc/codeTemplates/BC/BC.C b/etc/codeTemplates/BC/BC.C index 7dc8098b375f637655f6358a1a86bf1c47b89d4c..045b57b800609a548a6966a2d27ef41bc405a98b 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 dfdff55615585b2f5f0d65a9920bdca3df799af8..0ef4be29a2ec4f066541f69333c560f212ac4027 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<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; } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 1fec48c218bf4c539c1575c6542ae4e8d78ba477..0869cb3724564bd44bc2352e7856cac90d3a6761 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<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; } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C index 1c4216ed16aa704aa79220056d2d649a1fa2391d..9250dec1374414f9246bec5b6b1880c1eecd929c 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 1590676c7b3f98eef04d529236fcf5acff2b0b8e..1bda2bbd54422b874ee9246515a13bbd8d4bfaae 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 12aff01673760cad5034a9f479db53bb33e80c19..4d46621c3b365af1d39df85df080e5e73ec294f4 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 51eacba6a095d76393c7b8cf7421108c24f8afa2..43177f1bf95922da544b57037c637719de9f1faa 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 fefa520f8875b96d37be673eedb94198212c2af9..5b88d28c57265ef576651d4d7f3dcd209ec01c15 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 da50a57f7eb1a8f940709067c688edf714301b3b..b2f876dffe942b4f9806518a3801f94883f51e79 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<vector>("UInf")) { this->phiName_ = dict.getOrDefault<word>("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 bb58e321233d32fd7562b1dc285df3f1d276c153..cc33808dd1202a264ce2e5ae5a0a533bf177ecd0 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 7a86c6db2e98cd344299d3bbc615d228218629f9..76f5707391dbee9b8c89d3d37e1b3d87a107e86b 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<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 diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C index aafa59a625a5bdf4819ef4fb3fc4054df7770f2b..c75f5add6baf24d65c62aaf260980a0a30a72ae2 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<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; } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H index e93b26223a48f7b76f9e5756a98fff437958a5f9..1922113c0b7c11aa0d37cafb4975e22e883b93a1 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 3a147e988685db8d1e30080f033d3d797f06bdc3..0a0af10b84de9a21598ae3aed53cf8a088a71e71 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 26bf7ee809d43844258aedf6be74529637adc109..aadeeb81c206de55e00032b4773fe761de51f68d 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 b2cef93cf2bf39336e31251df571cd7ae9228a5b..fa386466a5e682c7bf09ba5b4224d541e8e78bcc 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 d3b21000803d9de77f5209d0e64c99ef102f2d42..f7d0249a65828ec45409410c9f51f9367907b615 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<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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C index 94d7392f3117ab76ef9162fd0042040a60992935..b158e6bce45cab9b6736757590406421ec600357 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<word>("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 e0ea49b05dcd17995a0fbf94d9e2900297791ef6..32be116c66d1fd0b5f0bbfe0393796deb226c539 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<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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C index 0a23414a40b0410d0e5b9e0b8216f022ca0251c7..21e8dab8e6de20eb99bbfbedbd1ccc6fe04bda76 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<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; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C index 06f5809c0de4590f814268387b355abd7e64a78f..1f92652f09310812e7cc6c147d1e1a5c3bf7b19c 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 ca9193e569bbf7583644790e64f31149dbb6bbff..8107096ab0c8e2f6b9e0e6874fe5635a19436579 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 ac97145f35ad4ba5afcf0f3e8d4182716274cfe0..e089e28526fd9be761cb9d4b13a33cf0f41a235c 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(); - - - // Member functions + virtual ~mappedVariableThicknessWallPolyPatch() = default; - //- Return non const thickness - scalarList& thickness() - { - return thickness_; - } + // Member Functions - //- 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 c4dea30df3dd02325817c581d6166aa2521c0905..7f40afe8a4d82289b54616994f4218d65c836c86 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<word>("solverName")) { - fvPatchField<scalar>::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 71e56b53594bd5eb2c46b42919a6f5702a4e6e6d..b39a0a2c97cb8a94d573bbbb0d5f4fb8200f6096 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<word>("solverName")) { - fvPatchField<vector>::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 869b4c9dec5754d78edb5d59154c55e9a9b87ef3..d6a6d3fa437fead0ddbf8c7156b77651243a4df4 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<word>("solverName")) { - fvPatchField<vector>::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 0e80d181e247cb5c91d8c31118ba5f5e6f10bf2e..b0bf3c563e61590d7cab8de7bf89c48aebff2001 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<word>("solverName")) { - fvPatchField<scalar>::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 49adb64b193fa5476e3156673cbef176011a1b92..41d715afa4c91ca5b6bb46ff122bf20454c28156 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<word>("solverName")) { - fvPatchField<vector>::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 dd385480e3e2683507078c579936b43a4b3d0102..597cc61d62c540ef82694604b7599f8f36e231dc 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<word>("solverName")) { - fvPatchField<vector>::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 2ee1f2a8483baa20d091df9c4f1df78359bdf2b0..0172840bb03f01e65e680a2dda7bbfa24ee757a2 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<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); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.C index fb54a88b1a2c07f558b4f9c5d6037289c19cfee0..bc4e70af268d680776a4c679703911fca7735030 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<word>("solverName")) { - fvPatchField<vector>::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 13340dc1b609dfa6d0a3b80b4af2a4244cfd70b2..05dd9aba11ca1284e74c93616ea1afb262103296 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<word>("solverName")) { - fvPatchField<scalar>::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 35d9034a0c83aa22d62d946378d1f569a228f5b8..13db68bb8987d434713e0adaf306ca0174bacfd0 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<word>("solverName")) { - fvPatchField<scalar>::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 b51d8be81243886388c6fe9df8ee63128a4e630c..7f269509aeac5a1f7b30960cb0ed290c1425dbcd 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<word>("solverName")) { - fvPatchField<scalar>::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 dbbfac545113cad6ee6b1b71b26248d912109a32..4c49cb09b1e91a52ce2e78e7902236ac7b29b621 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<word>("solverName")) { - fvPatchField<scalar>::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 32cc4f76c9bee921a64760c0b313564e9cc3d1f4..78c4b1dae61ab79c5f6c4b230bb39dfdaa131c64 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<word>("solverName")) { - fvPatchField<scalar>::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 2382fa4e17b2060524a1c092ad499596cb082f60..758b23c65d832a6da4a405aa4816361b7387c317 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<word>("solverName")) { - fvPatchField<scalar>::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 68fab059d3e19a4b45657d8e07e103581a3cb8b0..0809fc0b2564caa10b96d8e54f6fa996c45a1ac7 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<word>("solverName")) { - fvPatchField<scalar>::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 dae81c48d9f8270a64192964f7f95dda9adcd7df..21d19c3bcb2f622e80859e2c6bf8f443553d609c 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 a1d4580da78161ae179a3ee2340e0880a5aa6ef8..add9f321a1f64431f874418b48360e28720ae840 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 d46037600c94ec30e422c11cb77eabdb464fe5c0..ce782fc76279c0ec3b9cc5f8776ef91ae2a60a7d 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 84d56ae63615615e1f357d02f5a2ff1fdb9765b0..8c4d5335be6ab72b5c03c8b5ac3018ac148cff85 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 69472671352753e9c0679b0193a020973b86729d..a073bada84d8689db207328f737246406659af86 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 2d1ecc121ce69c4f235fd3cc4d251b6fb66ca39f..d2ddbbe2e20b27858adbae14cde1f5da7882313d 100644 --- a/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.C @@ -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())); } diff --git a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C index d9d00a8bd3fa0df2aee252f920a54c83e3b27144..ce75942e27a0643b8c29a18199526eb7bab80ca1 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<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; diff --git a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C index 579989b7f16927483f5f0b5b4e1a5e5413154597..a4d24cead9fd54d3d9d512dbdd67d4167cdb155c 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<word>("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 e23e941453faceb183249630a3b0b02cab430e6b..379eb0b991e942cdaea627544bf02c99eadf425d 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 ced3437922a34dd4c53de7b829390da49d48d040..7e5da847ca9da7020a9a01ded227c8f6cab96081 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 d8862abdad2af5a4ed057a87cf2f0527fec0d0ae..2c435144f0597102d0d82aa6881b5bc7192e0961 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 4e0a680fb28c9d22595367ca76a9754fe737461a..0f755657ed9339eacc832935bef8dd7ffcf4c387 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 ccf1d365ad73d052090d07d2859e0b02db60b506..cb6dc1b7c7e06b30b161bab25944a788c4885219 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 0c4c68caf398227c3e1e6d35efc7d9eef2d1b6de..b6ae35082aa72ba872eced556b89af56bf3123f4 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 9cf248c50da21ff47e1d6e8b62d0197734f7d06f..a3caadc95aa61ea5fb272eb715d58775a427327c 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<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_) { diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C index ab14754c6cdc04c50860757f0f7d0fb6b853ca5a..b0c64d90fed4ec9f20be4bee3e23fa935a28154e 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 efbce74bae95560bf96fedb2672c907e005ec32a..f1275de1bcb64746447184d47507eba4c80b85b0 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<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)) {