diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H index c325c8552924547325a18e03c51f3b83d8cab699..e8f269edbba41ccdc1fcc5859f773707a2dd2d56 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H @@ -30,6 +30,8 @@ Class Description A FixedValue boundary condition for pointField. + The "value" entry is normally MUST_READ. + SourceFiles fixedValuePointPatchField.C @@ -92,13 +94,13 @@ public: const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, const dictionary& dict, - const bool valueReqd + const bool needValue ) : fixedValuePointPatchField ( p, iF, dict, - (valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) + (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) ) {} diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H index 377be7993047c3729435ade1efff1c89bee19cbd..a4f7c2b205fd1df2378458664a33ac5e29a96a6f 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H @@ -123,13 +123,13 @@ public: const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, const dictionary& dict, - const bool valueReqd + const bool needValue ) : valuePointPatchField ( p, iF, dict, - (valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) + (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) ) {} diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C index da66b10349caac8bf7d100eee85831cd151dc873..46336accf7ecfbf8e4c43447a86831b57d76ec1e 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C @@ -54,10 +54,10 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, const dictionary& dict, - const bool valueRequired + const bool needValue ) : - fixedJumpFvPatchField<scalar>(p, iF, dict, false), + fixedJumpFvPatchField<scalar>(p, iF, dict, false), // needValue = false phiName_(dict.getOrDefault<word>("phi", "phi")), rhoName_(dict.getOrDefault<word>("rho", "rho")), D_(Function1<scalar>::New("D", dict, &db())), @@ -65,7 +65,7 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField length_(dict.get<scalar>("length")), uniformJump_(dict.getOrDefault("uniformJump", false)) { - if (valueRequired) + if (needValue) { if (!this->readValueEntry(dict)) { diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H index e99ee74e9ab0f6ccc701d541bbe5a098eb529009..ad9c2c60cd38f5ed3bf10fb91562dced459061c9 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H @@ -163,7 +163,7 @@ public: const fvPatch&, const DimensionedField<scalar, volMesh>&, const dictionary&, - const bool valueRequired = true + const bool needValue = true ); //- Construct by mapping given porousBafflePressureFvPatchField diff --git a/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H index dcee956514f0179ba8ecb59e41af5fe7b57193d2..3d31ef2ebe80a9096a290859b418c21cd3fa1ef0 100644 --- a/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H @@ -95,7 +95,8 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- Not implemented slicedFaPatchField ( const faPatch&, @@ -103,8 +104,8 @@ public: const dictionary& ); - //- Construct by mapping the given sliced patch field - //- onto a new patch + //- Construct by mapping the given patch field onto a new patch. + //- Not implemented slicedFaPatchField ( const slicedFaPatchField<Type>&, diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.C b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.C index b7cc020fe8bda6221a261270de1d5b9bf14556b8..daeae4a111d79f7db916f705063e7f27f04961b7 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.C +++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.C @@ -38,7 +38,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField const DimensionedField<Type, areaMesh>& iF ) : - faPatchField<Type>(p, iF, Field<Type>()) + faPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field {} @@ -51,7 +51,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField const faPatchFieldMapper& ) : - faPatchField<Type>(p, iF, Field<Type>()) + faPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field { if (!isType<emptyFaPatch>(p)) { @@ -74,8 +74,11 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField const dictionary& dict ) : - faPatchField<Type>(p, iF, Field<Type>()) + faPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field { + // Empty means empty, so no patchType override + // with faPatchFieldBase::readDict(dict); + if (!isA<emptyFaPatch>(p)) { FatalIOErrorInFunction(dict) @@ -92,21 +95,21 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField template<class Type> Foam::emptyFaPatchField<Type>::emptyFaPatchField ( - const emptyFaPatchField<Type>& ptf + const emptyFaPatchField<Type>& ptf, + const DimensionedField<Type, areaMesh>& iF ) : - faPatchField<Type>(ptf.patch(), ptf.internalField(), Field<Type>()) + faPatchField<Type>(ptf.patch(), iF, Field<Type>()) // zero-sized {} template<class Type> Foam::emptyFaPatchField<Type>::emptyFaPatchField ( - const emptyFaPatchField<Type>& ptf, - const DimensionedField<Type, areaMesh>& iF + const emptyFaPatchField<Type>& ptf ) : - faPatchField<Type>(ptf.patch(), iF, Field<Type>()) + emptyFaPatchField<Type>(ptf, ptf.internalField()) {} diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H index de754592bebdd746a0d0216ffc7f4dcfbb42654d..ef6b2d9e36a5be2d31501aecaf64f748eb3f2be0 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H @@ -38,8 +38,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef emptyFaPatchField_H -#define emptyFaPatchField_H +#ifndef Foam_emptyFaPatchField_H +#define Foam_emptyFaPatchField_H #include "faPatchField.H" #include "emptyFaPatch.H" @@ -74,7 +74,8 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. emptyFaPatchField ( const faPatch&, diff --git a/src/finiteArea/fields/faPatchFields/derived/clampedPlate/clampedPlateFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/clampedPlate/clampedPlateFaPatchField.H index 4cb191c158f54cffd75c61227f80b2cf766a28b5..ca38463e0244102088b17fe64d8d1a8383e0f323 100644 --- a/src/finiteArea/fields/faPatchFields/derived/clampedPlate/clampedPlateFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/clampedPlate/clampedPlateFaPatchField.H @@ -183,7 +183,7 @@ public: // IO - //- Write + //- Write includes "value" entry virtual void write(Ostream&) const; }; diff --git a/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H b/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H index 8a6c8dffb94aa3105e124155fce3d52d844d6c4c..8c01ccf621182a4f814784d458793494179baecf 100644 --- a/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H +++ b/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H @@ -159,7 +159,7 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - //- Write + //- Write includes "value" entry virtual void write(Ostream&) const; }; diff --git a/src/finiteArea/fields/faPatchFields/derived/fixedValueOutflow/fixedValueOutflowFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/fixedValueOutflow/fixedValueOutflowFaPatchField.H index 80b1522c26e9fbda07d681f8ae49a2b7ca0b614b..ef3eb57580ac0d9051140d67ef7812ed3eca8739 100644 --- a/src/finiteArea/fields/faPatchFields/derived/fixedValueOutflow/fixedValueOutflowFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/fixedValueOutflow/fixedValueOutflowFaPatchField.H @@ -150,11 +150,11 @@ public: virtual tmp<Field<Type>> gradientBoundaryCoeffs() const; - //- Write + //- Write includes "value" entry virtual void write(Ostream&) const; - // Member operators + // Member Operators virtual void operator=(const UList<Type>&) {} diff --git a/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.H index 02cb6831c730a4949f7b708fe3c126ea588e12e1..0464beaa09d1f28074e20449dbce6c9211a4cefc 100644 --- a/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.H @@ -168,7 +168,7 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - //- Write + //- Write includes "value" entry virtual void write(Ostream&) const; }; diff --git a/src/finiteArea/fields/faPatchFields/derived/outletInlet/outletInletFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/outletInlet/outletInletFaPatchField.H index e46a1d25b228e0aeb02292c282ac9dac84d55c83..922f27e39be0dbcf1c2dfc83bdf8e8812abaad9b 100644 --- a/src/finiteArea/fields/faPatchFields/derived/outletInlet/outletInletFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/outletInlet/outletInletFaPatchField.H @@ -163,7 +163,7 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - //- Write + //- Write includes "value" entry virtual void write(Ostream&) const; }; diff --git a/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H index 1e56baf866a6bd012ae3ec7354789c76b6959e58..2dd84e81da6246b2dc272fb75184f64881465e57 100644 --- a/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H @@ -183,7 +183,7 @@ public: // IO - //- Write + //- Write includes "value" entry virtual void write(Ostream&) const; }; diff --git a/src/finiteArea/fields/faPatchFields/derived/uniformFixedGradient/uniformFixedGradientFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/uniformFixedGradient/uniformFixedGradientFaPatchField.H index 4c049d4f45b55bbaf84b83a52625b6119af49db3..2490f1f6224eb23f803708f3ff563e21aa004092 100644 --- a/src/finiteArea/fields/faPatchFields/derived/uniformFixedGradient/uniformFixedGradientFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/uniformFixedGradient/uniformFixedGradientFaPatchField.H @@ -161,12 +161,12 @@ public: } - // Member functions + // Member Functions //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - //- Write + //- Write includes "value" entry virtual void write(Ostream& os) const; }; diff --git a/src/finiteArea/fields/faPatchFields/derived/uniformFixedValue/uniformFixedValueFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/uniformFixedValue/uniformFixedValueFaPatchField.H index 3bb102745874767572a9f11522e0a911e4e8f4cf..cc21bfa0b3b2f01141de6a5a2b74346cd2a8b20e 100644 --- a/src/finiteArea/fields/faPatchFields/derived/uniformFixedValue/uniformFixedValueFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/uniformFixedValue/uniformFixedValueFaPatchField.H @@ -167,7 +167,7 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - //- Write + //- Write includes "value" entry virtual void write(Ostream& os) const; }; diff --git a/src/finiteArea/fields/faPatchFields/derived/uniformMixed/uniformMixedFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/uniformMixed/uniformMixedFaPatchField.H index ab3182b3a4721fd2d0f6ae815ac448cf7c9e4cc4..08d3a4a6b2958e06760d06b27b46319ad287240a 100644 --- a/src/finiteArea/fields/faPatchFields/derived/uniformMixed/uniformMixedFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/uniformMixed/uniformMixedFaPatchField.H @@ -188,7 +188,7 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - //- Write + //- Write includes "value" entry (for visualisation / restart) virtual void write(Ostream& os) const; }; diff --git a/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.C b/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.C index 3032a855edb5241fb7544bb42714c37600a856a1..d77ef591d5dac8d81c087a01bad6f9669c4de222 100644 --- a/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.C +++ b/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.C @@ -37,7 +37,7 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField const DimensionedField<Type, edgeMesh>& iF ) : - faePatchField<Type>(p, iF, Field<Type>()) + faePatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field {} @@ -50,7 +50,7 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField const faPatchFieldMapper& ) : - faePatchField<Type>(p, iF, Field<Type>()) + faePatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field { if (!isType<emptyFaPatch>(this->patch())) { @@ -72,8 +72,11 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField const dictionary& dict ) : - faePatchField<Type>(p, iF, Field<Type>()) + faePatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field { + // Empty means empty, so no patchType override + // with faePatchFieldBase::readDict(dict); + if (!isType<emptyFaPatch>(p)) { FatalIOErrorInFunction(dict) @@ -87,21 +90,21 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField template<class Type> Foam::emptyFaePatchField<Type>::emptyFaePatchField ( - const emptyFaePatchField<Type>& ptf + const emptyFaePatchField<Type>& ptf, + const DimensionedField<Type, edgeMesh>& iF ) : - faePatchField<Type>(ptf.patch(), ptf.internalField(), Field<Type>()) + faePatchField<Type>(ptf.patch(), iF, Field<Type>()) // zero-sized {} template<class Type> Foam::emptyFaePatchField<Type>::emptyFaePatchField ( - const emptyFaePatchField<Type>& ptf, - const DimensionedField<Type, edgeMesh>& iF + const emptyFaePatchField<Type>& ptf ) : - faePatchField<Type>(ptf.patch(), iF, Field<Type>()) + emptyFaePatchField<Type>(ptf, ptf.internalField()) {} diff --git a/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.H b/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.H index 6c7004db9f771f5a2e88d62f798960b4e0bdeffc..3d9afcace4677eb67bc5b92f92069a7e305547ae 100644 --- a/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.H @@ -73,7 +73,8 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. emptyFaePatchField ( const faPatch&, diff --git a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H index 33e2c8784e876b476b831a4d3f0ba85740dbf967..9c9fabaf73e01b1cae694f62b06730679b2b7366 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H @@ -30,7 +30,8 @@ Group grpConstraintBoundaryConditions Description - A symmetry patch + A symmetry patch. + The "value" entry is NO_READ, NO_WRITE. SourceFiles basicSymmetryFvPatchField.C @@ -57,7 +58,6 @@ class basicSymmetryFvPatchField : public transformFvPatchField<Type> { - public: // Constructors @@ -69,7 +69,8 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. basicSymmetryFvPatchField ( const fvPatch&, @@ -77,8 +78,8 @@ public: const dictionary& ); - //- Construct by mapping given basicSymmetryFvPatchField onto a new - // patch + //- Construct by mapping given basicSymmetry patch field + //- onto a new patch basicSymmetryFvPatchField ( const basicSymmetryFvPatchField<Type>&, diff --git a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.H index ab2abde60d927cafbc9e35f1fb0830955d749bbf..89edb5effa1f5492b3e0184f6413ce4ab47480f2 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.H @@ -36,6 +36,11 @@ Description e.g. \c updateCoeffs or \c evaluate. Usage + \table + Property | Description | Required | Default + value | field value | yes | + \endtable + Example of the boundary condition specification: \verbatim <patchName> @@ -99,13 +104,13 @@ public: const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict, - const bool valueReqd + const bool needValue ) : calculatedFvPatchField ( p, iF, dict, - (valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) + (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) ) {} @@ -178,7 +183,7 @@ public: tmp<Field<Type>> gradientBoundaryCoeffs() const; - //- Write + //- Write includes "value" entry virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H index 155a20cb7e71e686293160975b13714d41092d9d..23ff2481f59312803aaa48d5cb234cb7f21296f6 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H @@ -33,6 +33,8 @@ Group Description Abstract base class for coupled patches. + The "value" entry is usually MUST_READ and always WRITE. + SourceFiles coupledFvPatchField.C @@ -98,13 +100,13 @@ public: const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict, - const bool valueReqd + const bool needValue ) : coupledFvPatchField ( p, iF, dict, - (valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) + (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) ) {} @@ -144,8 +146,7 @@ public: // Access - //- Return true if this patch field is derived from - // coupledFvPatchField<Type>. + //- True if this patch field is derived from coupledFvPatchField. virtual bool coupled() const { return true; @@ -268,7 +269,7 @@ public: ) const = 0; - //- Write + //- Write includes "value" entry virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C index 8a567b715084e293fc3a2c39659157adcbd48c68..7ce790c829002a9f72229adaa94d083aee4aecc1 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C @@ -92,21 +92,21 @@ Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField template<class Type> Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField ( - const fixedValueFvPatchField<Type>& ptf + const fixedValueFvPatchField<Type>& ptf, + const DimensionedField<Type, volMesh>& iF ) : - fvPatchField<Type>(ptf) + fvPatchField<Type>(ptf, iF) {} template<class Type> Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField ( - const fixedValueFvPatchField<Type>& ptf, - const DimensionedField<Type, volMesh>& iF + const fixedValueFvPatchField<Type>& ptf ) : - fvPatchField<Type>(ptf, iF) + fixedValueFvPatchField<Type>(ptf, ptf.internalField()) {} diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H index 1abd1eb2b3c86b63cac3eb2666cc23f9c60635cd..7c2fa1bcc8e3c879c7ae60739017bd09fe699191 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H @@ -111,13 +111,13 @@ public: const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict, - const bool valueReqd + const bool needValue ) : fixedValueFvPatchField ( p, iF, dict, - (valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) + (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) ) {} @@ -168,6 +168,9 @@ public: //- False: this patch field is not altered by assignment. virtual bool assignable() const { return false; } + //- Write includes "value" entry + virtual void write(Ostream&) const; + // Evaluation functions @@ -194,11 +197,7 @@ public: virtual tmp<Field<Type>> gradientBoundaryCoeffs() const; - //- Write - virtual void write(Ostream&) const; - - - // Member operators + // Member Operators virtual void operator=(const UList<Type>&) {} diff --git a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H index 0576d3cccea0bf0edcfc8e5d0c8aa322a217897b..9211155c7107c70f4d5ae4bed7e6dfb47293ce11 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H @@ -30,15 +30,16 @@ Group grpGenericBoundaryConditions Description - Foam::transformFvPatchField + Intermediate layer (not used directly as a user boundary condition). + The "value" entry is NO_READ, NO_WRITE. SourceFiles transformFvPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef transformFvPatchField_H -#define transformFvPatchField_H +#ifndef Foam_transformFvPatchField_H +#define Foam_transformFvPatchField_H #include "fvPatchField.H" @@ -56,7 +57,6 @@ class transformFvPatchField : public fvPatchField<Type> { - public: //- Runtime type information @@ -72,7 +72,8 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. transformFvPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C index 487bdb8dff59a34fd3ac5ce3c3057ee7455a63fa..40356e5682e3c150d46259e84038589bdbc61f73 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C @@ -51,7 +51,7 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict, - const bool valueRequired + const bool needValue ) : coupledFvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ), @@ -68,7 +68,7 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField << exit(FatalIOError); } - if (valueRequired) + if (needValue) { this->evaluate(Pstream::commsTypes::blocking); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H index 7b265ce60498b71f70b10b60d1a5a3219c0b6291..b8199cb28eccaf38815d89da8d71d9770a2b94fb 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H @@ -34,6 +34,8 @@ Description This boundary condition enforces a cyclic condition between a pair of boundaries. + The "value" entry is NO_READ. + Usage Example of the boundary condition specification: \verbatim @@ -75,7 +77,7 @@ class cyclicFvPatchField virtual public cyclicLduInterfaceField, public coupledFvPatchField<Type> { - // Private data + // Private Data //- Local reference cast into the cyclic patch const cyclicFvPatch& cyclicPatch_; @@ -113,7 +115,7 @@ public: const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&, - const bool valueRequired = true + const bool needValue = true //!< evaluate ); //- Construct by mapping given cyclicFvPatchField onto a new patch @@ -154,7 +156,7 @@ public: } - // Member functions + // Member Functions // Access diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.C index 215d3655b8215d143dce65a5d323594f47ea03ee..051ef0b8f89d1442d2af208188ffd427456834e9 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.C @@ -61,7 +61,7 @@ Foam::cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField const dictionary& dict ) : - cyclicFvPatchField<Type>(p, iF, dict) + cyclicFvPatchField<Type>(p, iF, dict) // needValue (evaluate) = true {} diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H index da0eb6fef09d9de4b01ebb2b6d276cd2528da9b9..3283b60e5e1e720844dcc47bcb77fe9c354058c9 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H @@ -33,6 +33,8 @@ Description This boundary condition is a light wrapper around the cyclicFvPatchField condition, providing no new functionality. + The "value" entry is NO_READ. + Usage Example of the boundary condition specification: \verbatim @@ -50,8 +52,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef cyclicSlipFvPatchField_H -#define cyclicSlipFvPatchField_H +#ifndef Foam_cyclicSlipFvPatchField_H +#define Foam_cyclicSlipFvPatchField_H #include "cyclicFvPatchField.H" #include "cyclicSlipFvPatch.H" @@ -70,7 +72,6 @@ class cyclicSlipFvPatchField : public cyclicFvPatchField<Type> { - public: //- Runtime type information @@ -86,7 +87,8 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. cyclicSlipFvPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.C index 846c33a2165735f18fef78602acbd051f6ee55bc..5bbc2ddd6f20dde9ff378aaccdd7f87ad8179c2a 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,7 +38,7 @@ Foam::emptyFvPatchField<Type>::emptyFvPatchField const DimensionedField<Type, volMesh>& iF ) : - fvPatchField<Type>(p, iF, Field<Type>(0)) + fvPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field {} @@ -50,7 +51,7 @@ Foam::emptyFvPatchField<Type>::emptyFvPatchField const fvPatchFieldMapper& ) : - fvPatchField<Type>(p, iF, Field<Type>(0)) + fvPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field { if (!isType<emptyFvPatch>(p)) { @@ -73,8 +74,11 @@ Foam::emptyFvPatchField<Type>::emptyFvPatchField const dictionary& dict ) : - fvPatchField<Type>(p, iF, Field<Type>(0)) + fvPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field { + // Empty means empty, so no patchType override + // with fvPatchFieldBase::readDict(dict); + if (!isType<emptyFvPatch>(p)) { FatalIOErrorInFunction(dict) @@ -91,26 +95,21 @@ Foam::emptyFvPatchField<Type>::emptyFvPatchField template<class Type> Foam::emptyFvPatchField<Type>::emptyFvPatchField ( - const emptyFvPatchField<Type>& ptf + const emptyFvPatchField<Type>& ptf, + const DimensionedField<Type, volMesh>& iF ) : - fvPatchField<Type> - ( - ptf.patch(), - ptf.internalField(), - Field<Type>(0) - ) + fvPatchField<Type>(ptf.patch(), iF, Field<Type>()) // zero-sized {} template<class Type> Foam::emptyFvPatchField<Type>::emptyFvPatchField ( - const emptyFvPatchField<Type>& ptf, - const DimensionedField<Type, volMesh>& iF + const emptyFvPatchField<Type>& ptf ) : - fvPatchField<Type>(ptf.patch(), iF, Field<Type>(0)) + emptyFvPatchField<Type>(ptf, ptf.internalField()) {} diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H index d86c9084cb400b3f473755f674aab1d9843fa91a..b22e96584c71584740db2aa6f2fe0179dc3ce4ec 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H @@ -33,7 +33,9 @@ Description This boundary condition provides an 'empty' condition for reduced dimensions cases, i.e. 1- and 2-D geometries. Apply this condition to patches whose normal is aligned to geometric directions that do not - constitue solution directions. + constitute solution directions. + + The "value" entry is NO_READ, NO_WRITE. Usage Example of the boundary condition specification: @@ -84,7 +86,8 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. emptyFvPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C index 2b5e3a364bb4bec03af58f155c68a0b28dce5395..fb9a97b3487e81b28e244be93f06ab35d2ffafa7 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,14 +60,11 @@ Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict, - const bool valueRequired + const bool needValue ) : - cyclicFvPatchField<Type>(p, iF, dict, valueRequired) -{ - // Call this evaluation in derived classes - //this->evaluate(Pstream::commsTypes::blocking); -} + cyclicFvPatchField<Type>(p, iF, dict, needValue) +{} template<class Type> diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H index 28c803b6591ea4e617502e79ced080de7f224544..199215c62823a7def4e94a74b6a8a655219fdf22 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H @@ -34,6 +34,8 @@ Description This boundary condition provides a base class for coupled-cyclic conditions with a specified 'jump' (or offset) between the values + The "value" entry is NO_READ. + See also Foam::cyclicFvPatchField @@ -42,8 +44,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef jumpCyclicFvPatchField_H -#define jumpCyclicFvPatchField_H +#ifndef Foam_jumpCyclicFvPatchField_H +#define Foam_jumpCyclicFvPatchField_H #include "cyclicFvPatchField.H" @@ -61,7 +63,6 @@ class jumpCyclicFvPatchField : public cyclicFvPatchField<Type> { - public: //- Runtime type information @@ -77,13 +78,14 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. jumpCyclicFvPatchField ( const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&, - const bool valueRequired = true + const bool needValue = true //!< evaluate ); //- Construct by mapping given jumpCyclicFvPatchField onto a new patch diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.C index f4ac86faf38d72d2a7ee5c4d60a1ecc8a5e5acf3..04cb2a9220c74809a23a4fc000c31c365df385f8 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.C @@ -50,7 +50,7 @@ nonuniformTransformCyclicFvPatchField const dictionary& dict ) : - cyclicFvPatchField<Type>(p, iF, dict) + cyclicFvPatchField<Type>(p, iF, dict) // needValue (evaluate) = true {} diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H index 9f325feb1bd2bab9a8e912ba0e35fc20686936dc..fa4b6f670176540cfef1a2c5c9ea5f1e51d239da 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H @@ -33,6 +33,8 @@ Description This boundary condition enforces a cyclic condition between a pair of boundaries, incorporating a non-uniform transformation. + The "value" entry is NO_READ. + SourceFiles nonuniformTransformCyclicFvPatchField.C nonuniformTransformCyclicFvPatchFields.H @@ -41,8 +43,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef nonuniformTransformCyclicFvPatchField_H -#define nonuniformTransformCyclicFvPatchField_H +#ifndef Foam_nonuniformTransformCyclicFvPatchField_H +#define Foam_nonuniformTransformCyclicFvPatchField_H #include "cyclicFvPatchField.H" #include "nonuniformTransformCyclicFvPatch.H" @@ -61,8 +63,6 @@ class nonuniformTransformCyclicFvPatchField : public cyclicFvPatchField<Type> { - // Private data - public: //- Runtime type information @@ -78,7 +78,8 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. nonuniformTransformCyclicFvPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C index a4c1e57ea735ef100f17465d418d6e1550d47daf..793b638cc6ea54a9c59f0b8bea57a3b715455498 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C @@ -28,7 +28,6 @@ License #include "processorFvPatchField.H" #include "processorFvPatch.H" -#include "demandDrivenData.H" #include "transformField.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.C index c03c65b7449362610f3661ef36bf37888ebce9b6..5c3f68ec4b969bbd0c1ce44ef86b7d24ca702c51 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.C @@ -135,11 +135,4 @@ Foam::processorCyclicFvPatchField<Type>::processorCyclicFvPatchField {} -// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // - -template<class Type> -Foam::processorCyclicFvPatchField<Type>::~processorCyclicFvPatchField() -{} - - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H index 08e018d2cb7cd47487e550914b05cfa759086259..8287cd4359474875a0afa4013f01677d014bb2be 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H @@ -73,7 +73,7 @@ class processorCyclicFvPatchField : public processorFvPatchField<Type> { - // Private data + // Private Data //- Local reference cast into the processor patch const processorCyclicFvPatch& procPatch_; @@ -146,10 +146,10 @@ public: //- Destructor - virtual ~processorCyclicFvPatchField(); + virtual ~processorCyclicFvPatchField() = default; - // Member functions + // Member Functions // Access diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H index 0727afe5f81f6e4eb4f94871b5d2bd7b064aece3..6f2ec33e0daa96921bcb523f2e6ef1166930c8f7 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H @@ -69,7 +69,6 @@ class symmetryFvPatchField : public basicSymmetryFvPatchField<Type> { - public: //- Runtime type information diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.C index e3fd64d58d2c4d87511e6137efd6a2680158bb0e..8c2b3eb61c59f563cbbbcdafd9a233d391633cc0 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,7 +32,6 @@ License #include "symmTransform.H" #include "diagTensor.H" - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> @@ -41,7 +41,7 @@ Foam::wedgeFvPatchField<Type>::wedgeFvPatchField const DimensionedField<Type, volMesh>& iF ) : - transformFvPatchField<Type>(p, iF) + parent_bctype(p, iF) {} @@ -54,7 +54,7 @@ Foam::wedgeFvPatchField<Type>::wedgeFvPatchField const fvPatchFieldMapper& mapper ) : - transformFvPatchField<Type>(ptf, p, iF, mapper) + parent_bctype(ptf, p, iF, mapper) { if (!isType<wedgeFvPatch>(this->patch())) { @@ -77,7 +77,7 @@ Foam::wedgeFvPatchField<Type>::wedgeFvPatchField const dictionary& dict ) : - transformFvPatchField<Type>(p, iF, dict) + parent_bctype(p, iF, dict) // "value" is NO_READ { if (!isType<wedgeFvPatch>(p)) { @@ -97,21 +97,21 @@ Foam::wedgeFvPatchField<Type>::wedgeFvPatchField template<class Type> Foam::wedgeFvPatchField<Type>::wedgeFvPatchField ( - const wedgeFvPatchField<Type>& ptf + const wedgeFvPatchField<Type>& ptf, + const DimensionedField<Type, volMesh>& iF ) : - transformFvPatchField<Type>(ptf) + parent_bctype(ptf, iF) {} template<class Type> Foam::wedgeFvPatchField<Type>::wedgeFvPatchField ( - const wedgeFvPatchField<Type>& ptf, - const DimensionedField<Type, volMesh>& iF + const wedgeFvPatchField<Type>& ptf ) : - transformFvPatchField<Type>(ptf, iF) + wedgeFvPatchField<Type>(ptf, ptf.internalField()) {} diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.H index 36c2252e7ec9e866b2cfec9de4ab02eb4ec6a497..6d8e34e98b9a1870858836f3027179ea03193af1 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.H @@ -33,6 +33,8 @@ Description This boundary condition is similar to the cyclic condition, except that it is applied to 2-D geometries. + The "value" entry is NO_READ, NO_WRITE. + Usage Example of the boundary condition specification: \verbatim @@ -50,8 +52,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef wedgeFvPatchField_H -#define wedgeFvPatchField_H +#ifndef Foam_wedgeFvPatchField_H +#define Foam_wedgeFvPatchField_H #include "transformFvPatchField.H" #include "wedgeFvPatch.H" @@ -70,6 +72,9 @@ class wedgeFvPatchField : public transformFvPatchField<Type> { + //- The parent boundary condition type + typedef transformFvPatchField<Type> parent_bctype; + public: @@ -86,7 +91,8 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. wedgeFvPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C index 39b7394febdbcfdb31e4cd82629ff77b2ea5e8d2..921199406e935025fb1adf1282c9790e43a21e4f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C @@ -67,7 +67,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField const dictionary& dict ) : - uniformJumpFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired + uniformJumpFvPatchField<Type>(p, iF, dict, false), // needValue = false phiName_(dict.getOrDefault<word>("phi", "phi")), rhoName_(dict.getOrDefault<word>("rho", "rho")), uniformJump_(dict.getOrDefault("uniformJump", false)), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index e55831b999c200ef4c67c69b7defc7d423f2e264..8d62f14c27399d9ec044e099f54c2d39d0d60cb3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -70,10 +70,10 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict, - const bool valueRequired + const bool needValue ) : - jumpCyclicFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired + jumpCyclicFvPatchField<Type>(p, iF, dict, false), // needValue = false jump_(p.size(), Zero), jump0_(p.size(), Zero), minJump_(dict.getOrDefault<Type>("minJump", pTraits<Type>::min)), @@ -82,7 +82,7 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField { if (this->cyclicPatch().owner()) { - if (valueRequired) + if (needValue) { jump_.assign("jump", dict, p.size(), IOobjectOption::MUST_READ); } @@ -90,7 +90,7 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField jump0_.assign("jump0", dict, p.size(), IOobjectOption::LAZY_READ); } - if (valueRequired) + if (needValue) { if (!this->readValueEntry(dict)) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H index f9e340bbccdb3bd5e028382b5dbaae953eb94352..441b420dea7d1733a4752a4bea2d043cce298687 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H @@ -128,7 +128,7 @@ public: const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&, - const bool valueRequired = true + const bool needValue = true ); //- Construct by mapping given fixedJumpFvPatchField onto a diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C index 557ffce4949d020d798a0c3cb4c2bbdeecf5a040..32c993eaa1f81ba196d21c2a797ed4512d50a0eb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C @@ -39,7 +39,7 @@ Foam::fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField ) : parent_bctype(p, iF), - fixedValue_(p.size(), Zero), + fixedValue_(p.size(), Foam::zero{}), writeValue_(false) {} @@ -72,6 +72,7 @@ Foam::fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField writeValue_(dict.getOrDefault("writeValue", false)) { fvPatchFieldBase::readDict(dict); + evaluate(); } @@ -181,11 +182,13 @@ template<class Type> void Foam::fixedNormalSlipFvPatchField<Type>::write(Ostream& os) const { this->parent_bctype::write(os); - fixedValue_.writeEntry("fixedValue", os); - if (writeValue_) { os.writeEntry("writeValue", "true"); + } + fixedValue_.writeEntry("fixedValue", os); + if (writeValue_) + { fvPatchField<Type>::writeValueEntry(os); } } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H index 7fe1f594902eb6958fd6ea7fa2f808985745fcb3..8fdfb7e7fd68a33f36f8c969da21f600207758f9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H @@ -36,6 +36,8 @@ Description The tangential component is treated as slip, i.e. copied from the internal field. + The "value" entry is NO_READ, optional write. + Usage Example of the boundary condition specification: \verbatim @@ -76,8 +78,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef fixedNormalSlipFvPatchField_H -#define fixedNormalSlipFvPatchField_H +#ifndef Foam_fixedNormalSlipFvPatchField_H +#define Foam_fixedNormalSlipFvPatchField_H #include "transformFvPatchField.H" @@ -123,7 +125,8 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. fixedNormalSlipFvPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C index cfb77c5732e19ef6fb0cf2a2fcc1b6b227866607..b11935b557b1114afdebca9fdfe9723c6fffaef1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C @@ -39,7 +39,7 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField ) : parent_bctype(p, iF), - refValue_(p.size(), Zero), + refValue_(p.size(), Foam::zero{}), valueFraction_(p.size(), 1.0), writeValue_(false) {} @@ -70,7 +70,7 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField ) : parent_bctype(p, iF), - refValue_(p.size(), Zero), + refValue_(p.size(), Foam::zero{}), valueFraction_("valueFraction", dict, p.size()), writeValue_(dict.getOrDefault("writeValue", false)) { @@ -86,10 +86,11 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField template<class Type> Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField ( - const partialSlipFvPatchField<Type>& ptf + const partialSlipFvPatchField<Type>& ptf, + const DimensionedField<Type, volMesh>& iF ) : - parent_bctype(ptf), + parent_bctype(ptf, iF), refValue_(ptf.refValue_), valueFraction_(ptf.valueFraction_), writeValue_(ptf.writeValue_) @@ -99,14 +100,10 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField template<class Type> Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField ( - const partialSlipFvPatchField<Type>& ptf, - const DimensionedField<Type, volMesh>& iF + const partialSlipFvPatchField<Type>& ptf ) : - parent_bctype(ptf, iF), - refValue_(ptf.refValue_), - valueFraction_(ptf.valueFraction_), - writeValue_(ptf.writeValue_) + partialSlipFvPatchField<Type>(ptf, ptf.internalField()) {} @@ -204,12 +201,14 @@ template<class Type> void Foam::partialSlipFvPatchField<Type>::write(Ostream& os) const { this->parent_bctype::write(os); + if (writeValue_) + { + os.writeEntry("writeValue", "true"); + } refValue_.writeEntry("refValue", os); valueFraction_.writeEntry("valueFraction", os); - if (writeValue_) { - os.writeEntry("writeValue", "true"); fvPatchField<Type>::writeValueEntry(os); } } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H index eb5ed46922c82596da51002371f47b061eb6aca2..a81ce92912c03a1dc90f91939d7714e6154ed741 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H @@ -31,8 +31,10 @@ Group grpWallBoundaryConditions grpGenericBoundaryConditions Description - This boundary condition provides a partial slip condition. The amount of - slip is controlled by a user-supplied field. + This boundary condition provides a partial slip condition. + The amount of slip is controlled by a user-supplied field. + + The "value" entry is NO_READ, optional write. Usage \table @@ -50,7 +52,6 @@ Usage type partialSlip; refValue uniform 0.001; valueFraction uniform 0.1; - value uniform 0; } \endverbatim @@ -62,8 +63,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef partialSlipFvPatchField_H -#define partialSlipFvPatchField_H +#ifndef Foam_partialSlipFvPatchField_H +#define Foam_partialSlipFvPatchField_H #include "transformFvPatchField.H" @@ -112,7 +113,8 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. partialSlipFvPatchField ( const fvPatch&, @@ -120,7 +122,8 @@ public: const dictionary& ); - //- Construct by mapping given partialSlipFvPatchField onto a new patch + //- Construct by mapping given partialSlip patch field + //- onto a new patch partialSlipFvPatchField ( const partialSlipFvPatchField<Type>&, @@ -163,6 +166,7 @@ public: //- False: this patch field is not altered by assignment virtual bool assignable() const { return false; } + // Access virtual Field<Type>& refValue() diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C index 1f117d268c6f182078e04761385e1b74d91a8988..deca4b47322b89145567b37dc8a7429478aa8ae6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C @@ -62,13 +62,13 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict, - const bool valueRequired + const bool needValue ) : - fixedJumpFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired + fixedJumpFvPatchField<Type>(p, iF, dict, false), // needValue = false jumpTable_() { - if (valueRequired) + if (needValue) { if (this->cyclicPatch().owner()) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H index 09be775aed2ad636241c73aff504d93502b86b05..a953274fc93abef3a5eec9f214d06b728df84407 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H @@ -118,7 +118,7 @@ public: const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&, - const bool valueRequired = true + const bool needValue = true ); //- Construct by mapping given uniformJumpFvPatchField onto a diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 9056467691a7ca626e7eede7e29aff8364b9cd0b..993433fd61e7b568ea4d82558cb054780022d192 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -430,13 +430,13 @@ public: const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict, - const bool valueReqd + const bool needValue ) : fvPatchField ( p, iF, dict, - (valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) + (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) ) {} diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C index ed1536312cec3c99ea56916ee9c1e4d6135f80bd..0cfa7e3ef0fa128dcf249ba534a3b888a527ccac 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2021-2023 OpenCFD Ltd. + Copyright (C) 2021-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -131,4 +131,14 @@ Foam::fvsPatchField<Type>::NewCalculatedType } +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void Foam::calculatedFvsPatchField<Type>::write(Ostream& os) const +{ + fvsPatchField<Type>::write(os); + fvsPatchField<Type>::writeValueEntry(os); +} + + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.H index bd8b64db01a6ab26cc091bacb7cb7f8e95911281..9d690368d676526a5aa19226565edfae6f54fc32 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,7 +28,25 @@ Class Foam::calculatedFvsPatchField Description - Foam::calculatedFvsPatchField + This boundary condition is not designed to be evaluated; it is assmued + that the value is assigned via field assignment. + + The "value" entry is MUST_READ. + +Usage + \table + Property | Description | Required | Default + value | Patch face values | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + <patchName> + { + type calculated; + value uniform (0 0 0); // Required value entry + } + \endverbatim SourceFiles calculatedFvsPatchField.C @@ -118,6 +137,9 @@ public: //- True: this patch field fixes a value. virtual bool fixesValue() const { return true; } + + //- Write includes "value" entry + virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.C index 5c3d033a66c4ed404b8a8674daf6767ab0b41af2..2f1d0d712ac6046fc29eeead9a826072227bc575 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -57,10 +58,11 @@ Foam::coupledFvsPatchField<Type>::coupledFvsPatchField ( const fvPatch& p, const DimensionedField<Type, surfaceMesh>& iF, - const dictionary& dict + const dictionary& dict, + IOobjectOption::readOption requireValue ) : - fvsPatchField<Type>(p, iF, dict) + fvsPatchField<Type>(p, iF, dict, requireValue) {} @@ -98,4 +100,15 @@ Foam::coupledFvsPatchField<Type>::coupledFvsPatchField {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void Foam::coupledFvsPatchField<Type>::write(Ostream& os) const +{ + fvsPatchField<Type>::write(os); + fvsPatchField<Type>::writeValueEntry(os); +} + + + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.H index 221630943f636d9d2908195006b10d8454a50222..b6ce0ea9f0c99f58c5104cf91aeb7ce22afbd383 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,15 +28,17 @@ Class Foam::coupledFvsPatchField Description - Foam::coupledFvsPatchField + Abstract base class for coupled patches. + + The "value" entry is usually MUST_READ and always WRITE. SourceFiles coupledFvsPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef coupledFvsPatchField_H -#define coupledFvsPatchField_H +#ifndef Foam_coupledFvsPatchField_H +#define Foam_coupledFvsPatchField_H #include "fvsPatchField.H" #include "coupledFvPatch.H" @@ -46,7 +49,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class coupledFvsPatch Declaration + Class coupledFvsPatchField Declaration \*---------------------------------------------------------------------------*/ template<class Type> @@ -54,7 +57,6 @@ class coupledFvsPatchField : public fvsPatchField<Type> { - public: //- Runtime type information @@ -83,7 +85,8 @@ public: ( const fvPatch&, const DimensionedField<Type, surfaceMesh>&, - const dictionary& + const dictionary&, + IOobjectOption::readOption requireValue = IOobjectOption::MUST_READ ); //- Construct by mapping the given coupledFvsPatchField onto a new patch @@ -118,16 +121,16 @@ public: ) const = 0; - // Member functions + // Member Functions - // Access + //- True if this patch field is derived from coupledFvsPatchField + virtual bool coupled() const + { + return true; + } - //- Return true if this patch field is derived from - // coupledFvsPatchField<Type>. - virtual bool coupled() const - { - return true; - } + //- Write includes "value" entry + virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.C index f457b1d07dfb784d711320786c2b57d0299a1452..2d061f7ced0167f079ddbcdee4f05b1145592dcb 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -57,7 +58,8 @@ Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField ( const fvPatch& p, const DimensionedField<Type, surfaceMesh>& iF, - const dictionary& dict + const dictionary& dict, + IOobjectOption::readOption requireValue ) : fvsPatchField<Type>(p, iF, dict, IOobjectOption::MUST_READ) @@ -80,21 +82,21 @@ Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField template<class Type> Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField ( - const fixedValueFvsPatchField<Type>& ptf + const fixedValueFvsPatchField<Type>& ptf, + const DimensionedField<Type, surfaceMesh>& iF ) : - fvsPatchField<Type>(ptf) + fvsPatchField<Type>(ptf, iF) {} template<class Type> Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField ( - const fixedValueFvsPatchField<Type>& ptf, - const DimensionedField<Type, surfaceMesh>& iF + const fixedValueFvsPatchField<Type>& ptf ) : - fvsPatchField<Type>(ptf, iF) + fixedValueFvsPatchField<Type>(ptf, ptf.internalField()) {} @@ -138,4 +140,12 @@ Foam::fixedValueFvsPatchField<Type>::gradientBoundaryCoeffs() const } +template<class Type> +void Foam::fixedValueFvsPatchField<Type>::write(Ostream& os) const +{ + fvsPatchField<Type>::write(os); + fvsPatchField<Type>::writeValueEntry(os); +} + + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H index ab5ec9dc4271daefa2d93afbf8b0938fadf6046f..5934499fe0861b84697f6a4c5db9034bbd12d95e 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,15 +28,33 @@ Class Foam::fixedValueFvsPatchField Description - Foam::fixedValueFvsPatchField + This boundary condition supplies a fixed value constraint, and is the base + class for a number of other boundary conditions. + + The "value" entry is MUST_READ. + +Usage + \table + Property | Description | Required | Default + value | Patch face values | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + <patchName> + { + type fixedValue; + value uniform 0; // Example for scalar field usage + } + \endverbatim SourceFiles fixedValueFvsPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef fixedValueFvsPatchField_H -#define fixedValueFvsPatchField_H +#ifndef Foam_fixedValueFvsPatchField_H +#define Foam_fixedValueFvsPatchField_H #include "fvsPatchField.H" @@ -45,7 +64,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class fixedValueFvsPatch Declaration + Class fixedValueFvsPatchField Declaration \*---------------------------------------------------------------------------*/ template<class Type> @@ -81,7 +100,8 @@ public: ( const fvPatch&, const DimensionedField<Type, surfaceMesh>&, - const dictionary& + const dictionary&, + IOobjectOption::readOption requireValue = IOobjectOption::MUST_READ ); //- Construct by mapping the given fixedValue patch field @@ -127,6 +147,9 @@ public: //- True: this patch field fixes a value. virtual bool fixesValue() const { return true; } + //- Write includes "value" entry + virtual void write(Ostream&) const; + // Evaluation functions @@ -153,7 +176,7 @@ public: virtual tmp<Field<Type>> gradientBoundaryCoeffs() const; - // Member operators + // Member Operators virtual void operator=(const UList<Type>&) {} diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C index 717918883f4457d3c69008814575e27805596bc2..de49ba50a5dd0c1e55feee4276337349f95e5dd5 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2023 OpenCFD Ltd. + Copyright (C) 2023-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -131,4 +131,14 @@ Foam::slicedFvsPatchField<Type>::~slicedFvsPatchField() } +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void Foam::slicedFvsPatchField<Type>::write(Ostream& os) const +{ + fvsPatchField<Type>::write(os); + fvsPatchField<Type>::writeValueEntry(os); +} + + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H index 42c92679d924a84ab18df8ed917ff149bafc2c40..3a82030519bbe9f4f5e638ea3dd7dd0a1c6931d3 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2023 OpenCFD Ltd. + Copyright (C) 2023-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -89,7 +89,8 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + // Not implemented. slicedFvsPatchField ( const fvPatch&, @@ -98,6 +99,7 @@ public: ); //- Construct by mapping the given sliced patch field onto a new patch + // Not implemented. slicedFvsPatchField ( const slicedFvsPatchField<Type>&, @@ -141,6 +143,9 @@ public: //- True: this patch field fixes a value. virtual bool fixesValue() const { return true; } + //- Write includes "value" entry + virtual void write(Ostream&) const; + // Member Operators diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchField.H index c609d02df916c15cd1c4db4ebf6a59b59845c464..384638a754749bacf31d2c449651d2911c25f8b5 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchField.H @@ -27,15 +27,27 @@ Class Foam::cyclicFvsPatchField Description - Foam::cyclicFvsPatchField + This boundary condition enforces a cyclic condition between a pair of + boundaries. + + The "value" entry is NO_READ, but is written. + +Usage + Example of the boundary condition specification: + \verbatim + <patchName> + { + type cyclic; + } + \endverbatim SourceFiles cyclicFvsPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef cyclicFvsPatchField_H -#define cyclicFvsPatchField_H +#ifndef Foam_cyclicFvsPatchField_H +#define Foam_cyclicFvsPatchField_H #include "coupledFvsPatchField.H" #include "cyclicFvPatch.H" @@ -46,7 +58,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class cyclicFvsPatch Declaration + Class cyclicFvsPatchField Declaration \*---------------------------------------------------------------------------*/ template<class Type> @@ -54,7 +66,7 @@ class cyclicFvsPatchField : public coupledFvsPatchField<Type> { - // Private data + // Private Data //- Local reference cast into the cyclic patch const cyclicFvPatch& cyclicPatch_; @@ -75,7 +87,8 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. cyclicFvsPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.C index 1a63a8b724540d0a2ef79ea04d7debaa43c8d0bc..96fb0a15bc3069648b41fd102a6245cf3333db02 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.C @@ -117,7 +117,7 @@ bool Foam::cyclicACMIFvsPatchField<Type>::coupled() const { if ( - Pstream::parRun() + UPstream::parRun() || ( this->cyclicACMIPatch_.size() && this->cyclicACMIPatch_.cyclicACMIPatch().neighbPatch().size() diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.H index da9480eb7fdbd8bc9b7f7e0111040f155884aa11..b16faeb228f0d12a98a76cc741317d8152c0cdfc 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.H @@ -27,7 +27,9 @@ Class Foam::cyclicACMIFvsPatchField Description - Foam::cyclicACMIFvsPatchField + This boundary condition enforces a cyclic condition between a pair of + boundaries, whereby communication between the patches is performed using + an arbitrarily coupled mesh interface (ACMI) interpolation. SourceFiles cyclicACMIFvsPatchField.C @@ -54,7 +56,7 @@ class cyclicACMIFvsPatchField : public coupledFvsPatchField<Type> { - // Private data + // Private Data //- Local reference cast into the cyclic patch const cyclicACMIFvPatch& cyclicACMIPatch_; @@ -75,7 +77,8 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is MUST_READ. cyclicACMIFvsPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H index 2550303c7300d6440a18f6ba7dd4229e2ec196ed..59bdcab69f25af3151c26988595c318db95bbc20 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H @@ -27,7 +27,11 @@ Class Foam::cyclicAMIFvsPatchField Description - Foam::cyclicAMIFvsPatchField + This boundary condition enforces a cyclic condition between a pair of + boundaries, whereby communication between the patches is performed using + an arbitrary mesh interface (AMI) interpolation. + + The "value" entry is MUST_READ. SourceFiles cyclicAMIFvsPatchField.C @@ -54,7 +58,7 @@ class cyclicAMIFvsPatchField : public coupledFvsPatchField<Type> { - // Private data + // Private Data //- Local reference cast into the cyclic patch const cyclicAMIFvPatch& cyclicAMIPatch_; @@ -75,7 +79,8 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is MUST_READ. cyclicAMIFvsPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.C index 489cb7de84d1129a5a4da6a89a84d18c90ebee05..5c1d93d7d531b24bdb89e9173714c7daa7b5e0cf 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,7 +39,7 @@ Foam::emptyFvsPatchField<Type>::emptyFvsPatchField const DimensionedField<Type, surfaceMesh>& iF ) : - fvsPatchField<Type>(p, iF, Field<Type>(0)) + fvsPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field {} @@ -50,8 +51,11 @@ Foam::emptyFvsPatchField<Type>::emptyFvsPatchField const dictionary& dict ) : - fvsPatchField<Type>(p, iF, Field<Type>(0)) + fvsPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field { + // Empty means empty, so no patchType override + // with fvsPatchFieldBase::readDict(dict); + if (!isType<emptyFvPatch>(p)) { FatalIOErrorInFunction(dict) @@ -71,7 +75,7 @@ Foam::emptyFvsPatchField<Type>::emptyFvsPatchField const fvPatchFieldMapper& ) : - fvsPatchField<Type>(p, iF, Field<Type>(0)) + fvsPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field { if (!isType<emptyFvPatch>(this->patch())) { @@ -88,26 +92,21 @@ Foam::emptyFvsPatchField<Type>::emptyFvsPatchField template<class Type> Foam::emptyFvsPatchField<Type>::emptyFvsPatchField ( - const emptyFvsPatchField<Type>& ptf + const emptyFvsPatchField<Type>& ptf, + const DimensionedField<Type, surfaceMesh>& iF ) : - fvsPatchField<Type> - ( - ptf.patch(), - ptf.internalField(), - Field<Type>(0) - ) + fvsPatchField<Type>(ptf.patch(), iF, Field<Type>()) // zero-sized {} template<class Type> Foam::emptyFvsPatchField<Type>::emptyFvsPatchField ( - const emptyFvsPatchField<Type>& ptf, - const DimensionedField<Type, surfaceMesh>& iF + const emptyFvsPatchField<Type>& ptf ) : - fvsPatchField<Type>(ptf.patch(), iF, Field<Type>(0)) + emptyFvsPatchField<Type>(ptf, ptf.internalField()) {} diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H index 764132185232c4f1092e885da94a49e6b49a3dd8..6a703550751c1e37d8985418f3d79e670df2dc8e 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H @@ -27,7 +27,19 @@ Class Foam::emptyFvsPatchField Description - Foam::emptyFvsPatchField + This boundary condition provides an 'empty' condition for reduced + dimensions cases. + + The "value" entry is NO_READ, NO_WRITE. + +Usage + Example of the boundary condition specification: + \verbatim + <patchName> + { + type empty; + } + \endverbatim SourceFiles emptyFvsPatchField.C @@ -69,7 +81,8 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. emptyFvsPatchField ( const fvPatch&, @@ -115,9 +128,9 @@ public: } - // Member functions + // Member Functions - // Mapping functions + // Mapping Functions //- Map (and resize as needed) from self given a mapping object virtual void autoMap diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.C index f5a44ebd4cb39c0015e429312e1b1a174b51124b..4d538caa6b7d1a9144cfbcd0822ae100f2ee6d72 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.C @@ -122,11 +122,4 @@ Foam::processorFvsPatchField<Type>::processorFvsPatchField {} -// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // - -template<class Type> -Foam::processorFvsPatchField<Type>::~processorFvsPatchField() -{} - - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.H index dd96291ee6823f633075c289eab0fba950b8abfb..8a4fb3a093e701556b77930cf9aae9dc1d6aabf2 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,15 +28,26 @@ Class Foam::processorFvsPatchField Description - Foam::processorFvsPatchField + This boundary condition enables processor communication across patches. + + The "value" entry is MUST_READ. + + Example of the boundary condition specification: + \verbatim + <patchName> + { + type processor; + value uniform (0 0 0); // Mandatory + } + \endverbatim SourceFiles processorFvsPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef processorFvsPatchField_H -#define processorFvsPatchField_H +#ifndef Foam_processorFvsPatchField_H +#define Foam_processorFvsPatchField_H #include "coupledFvsPatchField.H" #include "processorFvPatch.H" @@ -54,7 +66,7 @@ class processorFvsPatchField : public coupledFvsPatchField<Type> { - // Private data + // Private Data //- Local reference cast into the processor patch const processorFvPatch& procPatch_; @@ -83,7 +95,8 @@ public: const Field<Type>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is MUST_READ. processorFvsPatchField ( const fvPatch&, @@ -127,15 +140,15 @@ public: //- Destructor - virtual ~processorFvsPatchField(); + virtual ~processorFvsPatchField() = default; // Member Functions - //- Return true if running parallel + //- True if running parallel virtual bool coupled() const { - return Pstream::parRun(); + return UPstream::parRun(); } }; diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.C index 69dda610a3d8f08904d4d2de1ac01d8b23e4ce62..af904a50fbc97d8391367eb1dd8fa2a22e95e5de 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.C @@ -122,11 +122,4 @@ Foam::processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField {} -// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // - -template<class Type> -Foam::processorCyclicFvsPatchField<Type>::~processorCyclicFvsPatchField() -{} - - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.H index 4368b03621c6365a22d6e15e9a34a7087a6c4578..8ebb8fbb215af224d8456a2970d8a1de9179ce9c 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.H @@ -27,15 +27,18 @@ Class Foam::processorCyclicFvsPatchField Description - Foam::processorCyclicFvsPatchField + This boundary condition enables processor communication across cyclic + patches. + + The "value" entry is MUST_READ. SourceFiles processorCyclicFvsPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef processorCyclicFvsPatchField_H -#define processorCyclicFvsPatchField_H +#ifndef Foam_processorCyclicFvsPatchField_H +#define Foam_processorCyclicFvsPatchField_H #include "coupledFvsPatchField.H" #include "processorCyclicFvPatch.H" @@ -54,7 +57,7 @@ class processorCyclicFvsPatchField : public coupledFvsPatchField<Type> { - // Private data + // Private Data //- Local reference cast into the processor patch const processorCyclicFvPatch& procPatch_; @@ -83,7 +86,8 @@ public: const Field<Type>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is MUST_READ. processorCyclicFvsPatchField ( const fvPatch&, @@ -91,8 +95,7 @@ public: const dictionary& ); - //- Construct by mapping given processorCyclicFvsPatchField onto a - // new patch + //- Construct by mapping given patch field onto a new patch processorCyclicFvsPatchField ( const processorCyclicFvsPatchField<Type>&, @@ -128,15 +131,15 @@ public: //- Destructor - virtual ~processorCyclicFvsPatchField(); + virtual ~processorCyclicFvsPatchField() = default; // Member Functions - //- Return true if running parallel + //- True if running parallel virtual bool coupled() const { - return Pstream::parRun(); + return UPstream::parRun(); } }; diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.C index 1f65f735ce2a33ce2c5d417e0c5c4856b137c428..071abfefee309d289eecc4b21c6ede9154b5a4eb 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,7 +49,7 @@ Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField const dictionary& dict ) : - fvsPatchField<Type>(p, iF, dict) + fvsPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ) { if (!isType<symmetryFvPatch>(p)) { @@ -86,21 +87,21 @@ Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField template<class Type> Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField ( - const symmetryFvsPatchField<Type>& ptf + const symmetryFvsPatchField<Type>& ptf, + const DimensionedField<Type, surfaceMesh>& iF ) : - fvsPatchField<Type>(ptf) + fvsPatchField<Type>(ptf, iF) {} template<class Type> Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField ( - const symmetryFvsPatchField<Type>& ptf, - const DimensionedField<Type, surfaceMesh>& iF + const symmetryFvsPatchField<Type>& ptf ) : - fvsPatchField<Type>(ptf, iF) + symmetryFvsPatchField<Type>(ptf, ptf.internalField()) {} diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.H index 4fa95f968069ea13bdf1aa5102cf89f87f35c6c8..4142b0d70fa3702008f95119ca6656c576b7e674 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,15 +28,26 @@ Class Foam::symmetryFvsPatchField Description - Foam::symmetryFvsPatchField + This boundary condition enforces a symmetry constraint + + The "value" entry is NO_READ, NO_WRITE. + +Usage + Example of the boundary condition specification: + \verbatim + <patchName> + { + type symmetry; + } + \endverbatim SourceFiles symmetryFvsPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef symmetryFvsPatchField_H -#define symmetryFvsPatchField_H +#ifndef Foam_symmetryFvsPatchField_H +#define Foam_symmetryFvsPatchField_H #include "fvsPatchField.H" #include "symmetryFvPatch.H" @@ -54,7 +66,6 @@ class symmetryFvsPatchField : public fvsPatchField<Type> { - public: //- Runtime type information @@ -71,6 +82,7 @@ public: ); //- Construct from patch, internal field and dictionary + //- The "value" entry is NO_READ. symmetryFvsPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.C index 60bf14ab437f6c2e482d321c90ef0ea2716cba98..80d4b9378d41b0448cfbf2a5b4484a45b523710b 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2015 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,7 +49,7 @@ Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField const dictionary& dict ) : - fvsPatchField<Type>(p, iF, dict) + fvsPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ) { if (!isType<symmetryPlaneFvPatch>(p)) { @@ -86,21 +87,21 @@ Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField template<class Type> Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField ( - const symmetryPlaneFvsPatchField<Type>& ptf + const symmetryPlaneFvsPatchField<Type>& ptf, + const DimensionedField<Type, surfaceMesh>& iF ) : - fvsPatchField<Type>(ptf) + fvsPatchField<Type>(ptf, iF) {} template<class Type> Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField ( - const symmetryPlaneFvsPatchField<Type>& ptf, - const DimensionedField<Type, surfaceMesh>& iF + const symmetryPlaneFvsPatchField<Type>& ptf ) : - fvsPatchField<Type>(ptf, iF) + symmetryPlaneFvsPatchField<Type>(ptf, ptf.internalField()) {} diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H index cf3f253e054984253605a2284435c07b6a50dd4a..717506e082aa03f44d61423c7c59d5593d6f74ad 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H @@ -27,15 +27,26 @@ Class Foam::symmetryPlaneFvsPatchField Description - Foam::symmetryPlaneFvsPatchField + This boundary condition enforces a symmetryPlane constraint + + The "value" entry is NO_READ, NO_WRITE. + +Usage + Example of the boundary condition specification: + \verbatim + <patchName> + { + type symmetryPlane; + } + \endverbatim SourceFiles symmetryPlaneFvsPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef symmetryPlaneFvsPatchField_H -#define symmetryPlaneFvsPatchField_H +#ifndef Foam_symmetryPlaneFvsPatchField_H +#define Foam_symmetryPlaneFvsPatchField_H #include "fvsPatchField.H" #include "symmetryPlaneFvPatch.H" @@ -54,7 +65,6 @@ class symmetryPlaneFvsPatchField : public fvsPatchField<Type> { - public: //- Runtime type information @@ -70,7 +80,8 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. symmetryPlaneFvsPatchField ( const fvPatch&, @@ -78,8 +89,7 @@ public: const dictionary& ); - //- Construct by mapping given symmetryPlaneFvsPatchField - // onto a new patch + //- Construct by mapping given patch field onto a new patch symmetryPlaneFvsPatchField ( const symmetryPlaneFvsPatchField<Type>&, diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.C index 9c243442b5ad5538f0ea7e832eecf2fa7643f268..df57e01f614edd85d5b04eb2988f371879a6211a 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,7 +49,7 @@ Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField const dictionary& dict ) : - fvsPatchField<Type>(p, iF, dict) + fvsPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ) { if (!isType<wedgeFvPatch>(p)) { @@ -86,21 +87,21 @@ Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField template<class Type> Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField ( - const wedgeFvsPatchField<Type>& ptf + const wedgeFvsPatchField<Type>& ptf, + const DimensionedField<Type, surfaceMesh>& iF ) : - fvsPatchField<Type>(ptf) + fvsPatchField<Type>(ptf, iF) {} template<class Type> Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField ( - const wedgeFvsPatchField<Type>& ptf, - const DimensionedField<Type, surfaceMesh>& iF + const wedgeFvsPatchField<Type>& ptf ) : - fvsPatchField<Type>(ptf, iF) + wedgeFvsPatchField<Type>(ptf, ptf.internalField()) {} diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.H index 9c5ce9eb72a6b1f89fcff36ab09c6f0fd8c3285c..aeb04ff0bc3f6d92b46f808fd94abccf019a06d2 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,15 +28,27 @@ Class Foam::wedgeFvsPatchField Description - Foam::wedgeFvsPatchField + This boundary condition is similar to the cyclic condition, except that + it is applied to 2-D geometries. + + The "value" entry is NO_READ, NO_WRITE. + +Usage + Example of the boundary condition specification: + \verbatim + <patchName> + { + type wedge; + } + \endverbatim SourceFiles wedgeFvsPatchField.C \*---------------------------------------------------------------------------*/ -#ifndef wedgeFvsPatchField_H -#define wedgeFvsPatchField_H +#ifndef Foam_wedgeFvsPatchField_H +#define Foam_wedgeFvsPatchField_H #include "fvsPatchField.H" #include "wedgeFvPatch.H" @@ -54,7 +67,6 @@ class wedgeFvsPatchField : public fvsPatchField<Type> { - public: //- Runtime type information @@ -70,7 +82,8 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct from patch, internal field and dictionary + //- Construct from patch, internal field and dictionary. + //- The "value" entry is NO_READ. wedgeFvsPatchField ( const fvPatch&, diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C index b197203cb222fdda2ded6a875b342957b9fbdc23..027b488214a9d01d8b78705ac71d2e1c473e47b8 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C @@ -207,7 +207,6 @@ template<class Type> void Foam::fvsPatchField<Type>::write(Ostream& os) const { os.writeEntry("type", type()); - Field<Type>::writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H index 26f2f4beb5d0b59c5501f661db23c4f4ab394037..ddb7dfa8b61f798ef575a896f221364269d87b98 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H @@ -343,13 +343,13 @@ public: const fvPatch& p, const DimensionedField<Type, surfaceMesh>& iF, const dictionary& dict, - const bool valueReqd + const bool needValue ) : fvsPatchField ( p, iF, dict, - (valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) + (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) ) {} @@ -541,7 +541,7 @@ public: {} - //- Write + //- Write the patch "type" virtual void write(Ostream& os) const; //- Check against given patch field diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/specularRadiation/specularRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/specularRadiation/specularRadiationMixedFvPatchScalarField.C index d7485533589a30de249b90d09ad9ff2702c3654a..7b7f5c100c12509aa43ad718091b3df64f2adeeb 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/specularRadiation/specularRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/specularRadiation/specularRadiationMixedFvPatchScalarField.C @@ -449,7 +449,7 @@ void specularRadiationMixedFvPatchScalarField::write(Ostream& os) const { mixedFvPatchScalarField::write(os); os.writeEntryIfDifferent<bool>("interpolate", false, interpolate_); - this->writeEntry("value", os); + this->writeValueEntry(os); }