BUG: fvsPatchFields reading/writing the "value" entry (fixes #3144)

- manual revert for 44d0fbd594.

  Unless required for post-processing the "value" entry should not
  written if it is not mandatory for reading.

  This is especially crucial with an 'empty' patch field where the
  field (size 0) has a different size from the patch.

- the changes made align fvsPatchField behaviour with fvPatchField
This commit is contained in:
Mark Olesen
2024-04-18 12:55:40 +02:00
parent 5fb1181bb2
commit 8a8b5db977
77 changed files with 525 additions and 327 deletions

View File

@ -30,6 +30,8 @@ Class
Description Description
A FixedValue boundary condition for pointField. A FixedValue boundary condition for pointField.
The "value" entry is normally MUST_READ.
SourceFiles SourceFiles
fixedValuePointPatchField.C fixedValuePointPatchField.C
@ -92,13 +94,13 @@ public:
const pointPatch& p, const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF, const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict, const dictionary& dict,
const bool valueReqd const bool needValue
) )
: :
fixedValuePointPatchField fixedValuePointPatchField
( (
p, iF, dict, p, iF, dict,
(valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
) )
{} {}

View File

@ -123,13 +123,13 @@ public:
const pointPatch& p, const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF, const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict, const dictionary& dict,
const bool valueReqd const bool needValue
) )
: :
valuePointPatchField valuePointPatchField
( (
p, iF, dict, p, iF, dict,
(valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
) )
{} {}

View File

@ -54,10 +54,10 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict, 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")), phiName_(dict.getOrDefault<word>("phi", "phi")),
rhoName_(dict.getOrDefault<word>("rho", "rho")), rhoName_(dict.getOrDefault<word>("rho", "rho")),
D_(Function1<scalar>::New("D", dict, &db())), D_(Function1<scalar>::New("D", dict, &db())),
@ -65,7 +65,7 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField
length_(dict.get<scalar>("length")), length_(dict.get<scalar>("length")),
uniformJump_(dict.getOrDefault("uniformJump", false)) uniformJump_(dict.getOrDefault("uniformJump", false))
{ {
if (valueRequired) if (needValue)
{ {
if (!this->readValueEntry(dict)) if (!this->readValueEntry(dict))
{ {

View File

@ -163,7 +163,7 @@ public:
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const dictionary&, const dictionary&,
const bool valueRequired = true const bool needValue = true
); );
//- Construct by mapping given porousBafflePressureFvPatchField //- Construct by mapping given porousBafflePressureFvPatchField

View File

@ -95,7 +95,8 @@ public:
const DimensionedField<Type, areaMesh>& const DimensionedField<Type, areaMesh>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary.
//- Not implemented
slicedFaPatchField slicedFaPatchField
( (
const faPatch&, const faPatch&,
@ -103,8 +104,8 @@ public:
const dictionary& const dictionary&
); );
//- Construct by mapping the given sliced patch field //- Construct by mapping the given patch field onto a new patch.
//- onto a new patch //- Not implemented
slicedFaPatchField slicedFaPatchField
( (
const slicedFaPatchField<Type>&, const slicedFaPatchField<Type>&,

View File

@ -38,7 +38,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
const DimensionedField<Type, areaMesh>& iF 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& const faPatchFieldMapper&
) )
: :
faPatchField<Type>(p, iF, Field<Type>()) faPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field
{ {
if (!isType<emptyFaPatch>(p)) if (!isType<emptyFaPatch>(p))
{ {
@ -74,8 +74,11 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
const dictionary& dict 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)) if (!isA<emptyFaPatch>(p))
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
@ -92,21 +95,21 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
template<class Type> template<class Type>
Foam::emptyFaPatchField<Type>::emptyFaPatchField 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> template<class Type>
Foam::emptyFaPatchField<Type>::emptyFaPatchField Foam::emptyFaPatchField<Type>::emptyFaPatchField
( (
const emptyFaPatchField<Type>& ptf, const emptyFaPatchField<Type>& ptf
const DimensionedField<Type, areaMesh>& iF
) )
: :
faPatchField<Type>(ptf.patch(), iF, Field<Type>()) emptyFaPatchField<Type>(ptf, ptf.internalField())
{} {}

View File

@ -38,8 +38,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef emptyFaPatchField_H #ifndef Foam_emptyFaPatchField_H
#define emptyFaPatchField_H #define Foam_emptyFaPatchField_H
#include "faPatchField.H" #include "faPatchField.H"
#include "emptyFaPatch.H" #include "emptyFaPatch.H"
@ -74,7 +74,8 @@ public:
const DimensionedField<Type, areaMesh>& 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 emptyFaPatchField
( (
const faPatch&, const faPatch&,

View File

@ -183,7 +183,7 @@ public:
// IO // IO
//- Write //- Write includes "value" entry
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -159,7 +159,7 @@ public:
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write includes "value" entry
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -150,11 +150,11 @@ public:
virtual tmp<Field<Type>> gradientBoundaryCoeffs() const; virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
//- Write //- Write includes "value" entry
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
// Member operators // Member Operators
virtual void operator=(const UList<Type>&) {} virtual void operator=(const UList<Type>&) {}

View File

@ -168,7 +168,7 @@ public:
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write includes "value" entry
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -163,7 +163,7 @@ public:
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write includes "value" entry
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -183,7 +183,7 @@ public:
// IO // IO
//- Write //- Write includes "value" entry
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -161,12 +161,12 @@ public:
} }
// Member functions // Member Functions
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write includes "value" entry
virtual void write(Ostream& os) const; virtual void write(Ostream& os) const;
}; };

View File

@ -167,7 +167,7 @@ public:
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write includes "value" entry
virtual void write(Ostream& os) const; virtual void write(Ostream& os) const;
}; };

View File

@ -188,7 +188,7 @@ public:
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write includes "value" entry (for visualisation / restart)
virtual void write(Ostream& os) const; virtual void write(Ostream& os) const;
}; };

View File

@ -37,7 +37,7 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField
const DimensionedField<Type, edgeMesh>& iF 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& const faPatchFieldMapper&
) )
: :
faePatchField<Type>(p, iF, Field<Type>()) faePatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field
{ {
if (!isType<emptyFaPatch>(this->patch())) if (!isType<emptyFaPatch>(this->patch()))
{ {
@ -72,8 +72,11 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField
const dictionary& dict 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)) if (!isType<emptyFaPatch>(p))
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
@ -87,21 +90,21 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField
template<class Type> template<class Type>
Foam::emptyFaePatchField<Type>::emptyFaePatchField 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> template<class Type>
Foam::emptyFaePatchField<Type>::emptyFaePatchField Foam::emptyFaePatchField<Type>::emptyFaePatchField
( (
const emptyFaePatchField<Type>& ptf, const emptyFaePatchField<Type>& ptf
const DimensionedField<Type, edgeMesh>& iF
) )
: :
faePatchField<Type>(ptf.patch(), iF, Field<Type>()) emptyFaePatchField<Type>(ptf, ptf.internalField())
{} {}

View File

@ -73,7 +73,8 @@ public:
const DimensionedField<Type, edgeMesh>& 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 emptyFaePatchField
( (
const faPatch&, const faPatch&,

View File

@ -30,7 +30,8 @@ Group
grpConstraintBoundaryConditions grpConstraintBoundaryConditions
Description Description
A symmetry patch A symmetry patch.
The "value" entry is NO_READ, NO_WRITE.
SourceFiles SourceFiles
basicSymmetryFvPatchField.C basicSymmetryFvPatchField.C
@ -57,7 +58,6 @@ class basicSymmetryFvPatchField
: :
public transformFvPatchField<Type> public transformFvPatchField<Type>
{ {
public: public:
// Constructors // Constructors
@ -69,7 +69,8 @@ public:
const DimensionedField<Type, volMesh>& 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 basicSymmetryFvPatchField
( (
const fvPatch&, const fvPatch&,
@ -77,8 +78,8 @@ public:
const dictionary& const dictionary&
); );
//- Construct by mapping given basicSymmetryFvPatchField onto a new //- Construct by mapping given basicSymmetry patch field
// patch //- onto a new patch
basicSymmetryFvPatchField basicSymmetryFvPatchField
( (
const basicSymmetryFvPatchField<Type>&, const basicSymmetryFvPatchField<Type>&,

View File

@ -31,11 +31,16 @@ Group
grpGenericBoundaryConditions grpGenericBoundaryConditions
Description Description
This boundary condition is not designed to be evaluated; it is assmued This boundary condition is not designed to be evaluated; it is assumed
that the value is assigned via field assignment, and not via a call to that the value is assigned via field assignment, and not via a call to
e.g. \c updateCoeffs or \c evaluate. e.g. \c updateCoeffs or \c evaluate.
Usage Usage
\table
Property | Description | Required | Default
value | field value | yes |
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
@ -99,13 +104,13 @@ public:
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const dictionary& dict, const dictionary& dict,
const bool valueReqd const bool needValue
) )
: :
calculatedFvPatchField calculatedFvPatchField
( (
p, iF, dict, 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; tmp<Field<Type>> gradientBoundaryCoeffs() const;
//- Write //- Write includes "value" entry
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -33,6 +33,8 @@ Group
Description Description
Abstract base class for coupled patches. Abstract base class for coupled patches.
The "value" entry is usually MUST_READ and always WRITE.
SourceFiles SourceFiles
coupledFvPatchField.C coupledFvPatchField.C
@ -98,13 +100,13 @@ public:
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const dictionary& dict, const dictionary& dict,
const bool valueReqd const bool needValue
) )
: :
coupledFvPatchField coupledFvPatchField
( (
p, iF, dict, p, iF, dict,
(valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
) )
{} {}
@ -144,8 +146,7 @@ public:
// Access // Access
//- Return true if this patch field is derived from //- True if this patch field is derived from coupledFvPatchField.
// coupledFvPatchField<Type>.
virtual bool coupled() const virtual bool coupled() const
{ {
return true; return true;
@ -268,7 +269,7 @@ public:
) const = 0; ) const = 0;
//- Write //- Write includes "value" entry
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -92,21 +92,21 @@ Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
template<class Type> template<class Type>
Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField 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> template<class Type>
Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
( (
const fixedValueFvPatchField<Type>& ptf, const fixedValueFvPatchField<Type>& ptf
const DimensionedField<Type, volMesh>& iF
) )
: :
fvPatchField<Type>(ptf, iF) fixedValueFvPatchField<Type>(ptf, ptf.internalField())
{} {}

View File

@ -111,13 +111,13 @@ public:
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const dictionary& dict, const dictionary& dict,
const bool valueReqd const bool needValue
) )
: :
fixedValueFvPatchField fixedValueFvPatchField
( (
p, iF, dict, 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. //- False: this patch field is not altered by assignment.
virtual bool assignable() const { return false; } virtual bool assignable() const { return false; }
//- Write includes "value" entry
virtual void write(Ostream&) const;
// Evaluation functions // Evaluation functions
@ -194,11 +197,7 @@ public:
virtual tmp<Field<Type>> gradientBoundaryCoeffs() const; virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
//- Write // Member Operators
virtual void write(Ostream&) const;
// Member operators
virtual void operator=(const UList<Type>&) {} virtual void operator=(const UList<Type>&) {}

View File

@ -30,15 +30,16 @@ Group
grpGenericBoundaryConditions grpGenericBoundaryConditions
Description Description
Foam::transformFvPatchField Intermediate layer (not used directly as a user boundary condition).
The "value" entry is NO_READ, NO_WRITE.
SourceFiles SourceFiles
transformFvPatchField.C transformFvPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef transformFvPatchField_H #ifndef Foam_transformFvPatchField_H
#define transformFvPatchField_H #define Foam_transformFvPatchField_H
#include "fvPatchField.H" #include "fvPatchField.H"
@ -56,7 +57,6 @@ class transformFvPatchField
: :
public fvPatchField<Type> public fvPatchField<Type>
{ {
public: public:
//- Runtime type information //- Runtime type information
@ -72,7 +72,8 @@ public:
const DimensionedField<Type, volMesh>& 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 transformFvPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -51,7 +51,7 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const dictionary& dict, const dictionary& dict,
const bool valueRequired const bool needValue
) )
: :
coupledFvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ), coupledFvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ),
@ -68,7 +68,7 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
<< exit(FatalIOError); << exit(FatalIOError);
} }
if (valueRequired) if (needValue)
{ {
this->evaluate(Pstream::commsTypes::blocking); this->evaluate(Pstream::commsTypes::blocking);
} }
@ -324,4 +324,5 @@ void Foam::cyclicFvPatchField<Type>::manipulateMatrix
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -34,6 +34,8 @@ Description
This boundary condition enforces a cyclic condition between a pair of This boundary condition enforces a cyclic condition between a pair of
boundaries. boundaries.
The "value" entry is NO_READ.
Usage Usage
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
@ -75,7 +77,7 @@ class cyclicFvPatchField
virtual public cyclicLduInterfaceField, virtual public cyclicLduInterfaceField,
public coupledFvPatchField<Type> public coupledFvPatchField<Type>
{ {
// Private data // Private Data
//- Local reference cast into the cyclic patch //- Local reference cast into the cyclic patch
const cyclicFvPatch& cyclicPatch_; const cyclicFvPatch& cyclicPatch_;
@ -113,7 +115,7 @@ public:
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const dictionary&, const dictionary&,
const bool valueRequired = true const bool needValue = true //!< evaluate
); );
//- Construct by mapping given cyclicFvPatchField onto a new patch //- Construct by mapping given cyclicFvPatchField onto a new patch
@ -154,7 +156,7 @@ public:
} }
// Member functions // Member Functions
// Access // Access

View File

@ -61,7 +61,7 @@ Foam::cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
cyclicFvPatchField<Type>(p, iF, dict) cyclicFvPatchField<Type>(p, iF, dict) // needValue (evaluate) = true
{} {}

View File

@ -33,6 +33,8 @@ Description
This boundary condition is a light wrapper around the cyclicFvPatchField This boundary condition is a light wrapper around the cyclicFvPatchField
condition, providing no new functionality. condition, providing no new functionality.
The "value" entry is NO_READ.
Usage Usage
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
@ -50,8 +52,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef cyclicSlipFvPatchField_H #ifndef Foam_cyclicSlipFvPatchField_H
#define cyclicSlipFvPatchField_H #define Foam_cyclicSlipFvPatchField_H
#include "cyclicFvPatchField.H" #include "cyclicFvPatchField.H"
#include "cyclicSlipFvPatch.H" #include "cyclicSlipFvPatch.H"
@ -70,7 +72,6 @@ class cyclicSlipFvPatchField
: :
public cyclicFvPatchField<Type> public cyclicFvPatchField<Type>
{ {
public: public:
//- Runtime type information //- Runtime type information
@ -86,7 +87,8 @@ public:
const DimensionedField<Type, volMesh>& 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 cyclicSlipFvPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -37,7 +38,7 @@ Foam::emptyFvPatchField<Type>::emptyFvPatchField
const DimensionedField<Type, volMesh>& iF 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& const fvPatchFieldMapper&
) )
: :
fvPatchField<Type>(p, iF, Field<Type>(0)) fvPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field
{ {
if (!isType<emptyFvPatch>(p)) if (!isType<emptyFvPatch>(p))
{ {
@ -73,8 +74,11 @@ Foam::emptyFvPatchField<Type>::emptyFvPatchField
const dictionary& dict 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)) if (!isType<emptyFvPatch>(p))
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
@ -91,26 +95,21 @@ Foam::emptyFvPatchField<Type>::emptyFvPatchField
template<class Type> template<class Type>
Foam::emptyFvPatchField<Type>::emptyFvPatchField Foam::emptyFvPatchField<Type>::emptyFvPatchField
( (
const emptyFvPatchField<Type>& ptf const emptyFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
) )
: :
fvPatchField<Type> fvPatchField<Type>(ptf.patch(), iF, Field<Type>()) // zero-sized
(
ptf.patch(),
ptf.internalField(),
Field<Type>(0)
)
{} {}
template<class Type> template<class Type>
Foam::emptyFvPatchField<Type>::emptyFvPatchField Foam::emptyFvPatchField<Type>::emptyFvPatchField
( (
const emptyFvPatchField<Type>& ptf, const emptyFvPatchField<Type>& ptf
const DimensionedField<Type, volMesh>& iF
) )
: :
fvPatchField<Type>(ptf.patch(), iF, Field<Type>(0)) emptyFvPatchField<Type>(ptf, ptf.internalField())
{} {}

View File

@ -33,7 +33,9 @@ Description
This boundary condition provides an 'empty' condition for reduced This boundary condition provides an 'empty' condition for reduced
dimensions cases, i.e. 1- and 2-D geometries. Apply this condition to dimensions cases, i.e. 1- and 2-D geometries. Apply this condition to
patches whose normal is aligned to geometric directions that do not 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 Usage
Example of the boundary condition specification: Example of the boundary condition specification:
@ -84,7 +86,8 @@ public:
const DimensionedField<Type, volMesh>& 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 emptyFvPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -60,14 +60,11 @@ Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const dictionary& dict, const dictionary& dict,
const bool valueRequired const bool needValue
) )
: :
cyclicFvPatchField<Type>(p, iF, dict, valueRequired) cyclicFvPatchField<Type>(p, iF, dict, needValue)
{ {}
// Call this evaluation in derived classes
//this->evaluate(Pstream::commsTypes::blocking);
}
template<class Type> template<class Type>

View File

@ -34,6 +34,8 @@ Description
This boundary condition provides a base class for coupled-cyclic This boundary condition provides a base class for coupled-cyclic
conditions with a specified 'jump' (or offset) between the values conditions with a specified 'jump' (or offset) between the values
The "value" entry is NO_READ.
See also See also
Foam::cyclicFvPatchField Foam::cyclicFvPatchField
@ -42,8 +44,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef jumpCyclicFvPatchField_H #ifndef Foam_jumpCyclicFvPatchField_H
#define jumpCyclicFvPatchField_H #define Foam_jumpCyclicFvPatchField_H
#include "cyclicFvPatchField.H" #include "cyclicFvPatchField.H"
@ -61,7 +63,6 @@ class jumpCyclicFvPatchField
: :
public cyclicFvPatchField<Type> public cyclicFvPatchField<Type>
{ {
public: public:
//- Runtime type information //- Runtime type information
@ -77,13 +78,14 @@ public:
const DimensionedField<Type, volMesh>& 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 jumpCyclicFvPatchField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const dictionary&, const dictionary&,
const bool valueRequired = true const bool needValue = true //!< evaluate
); );
//- Construct by mapping given jumpCyclicFvPatchField onto a new patch //- Construct by mapping given jumpCyclicFvPatchField onto a new patch

View File

@ -50,7 +50,7 @@ nonuniformTransformCyclicFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
cyclicFvPatchField<Type>(p, iF, dict) cyclicFvPatchField<Type>(p, iF, dict) // needValue (evaluate) = true
{} {}

View File

@ -33,6 +33,8 @@ Description
This boundary condition enforces a cyclic condition between a pair of This boundary condition enforces a cyclic condition between a pair of
boundaries, incorporating a non-uniform transformation. boundaries, incorporating a non-uniform transformation.
The "value" entry is NO_READ.
SourceFiles SourceFiles
nonuniformTransformCyclicFvPatchField.C nonuniformTransformCyclicFvPatchField.C
nonuniformTransformCyclicFvPatchFields.H nonuniformTransformCyclicFvPatchFields.H
@ -41,8 +43,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvPatchField_H #ifndef Foam_nonuniformTransformCyclicFvPatchField_H
#define nonuniformTransformCyclicFvPatchField_H #define Foam_nonuniformTransformCyclicFvPatchField_H
#include "cyclicFvPatchField.H" #include "cyclicFvPatchField.H"
#include "nonuniformTransformCyclicFvPatch.H" #include "nonuniformTransformCyclicFvPatch.H"
@ -61,8 +63,6 @@ class nonuniformTransformCyclicFvPatchField
: :
public cyclicFvPatchField<Type> public cyclicFvPatchField<Type>
{ {
// Private data
public: public:
//- Runtime type information //- Runtime type information
@ -78,7 +78,8 @@ public:
const DimensionedField<Type, volMesh>& 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 nonuniformTransformCyclicFvPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -28,7 +28,6 @@ License
#include "processorFvPatchField.H" #include "processorFvPatchField.H"
#include "processorFvPatch.H" #include "processorFvPatch.H"
#include "demandDrivenData.H"
#include "transformField.H" #include "transformField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -135,11 +135,4 @@ Foam::processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
{} {}
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
template<class Type>
Foam::processorCyclicFvPatchField<Type>::~processorCyclicFvPatchField()
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -73,7 +73,7 @@ class processorCyclicFvPatchField
: :
public processorFvPatchField<Type> public processorFvPatchField<Type>
{ {
// Private data // Private Data
//- Local reference cast into the processor patch //- Local reference cast into the processor patch
const processorCyclicFvPatch& procPatch_; const processorCyclicFvPatch& procPatch_;
@ -146,10 +146,10 @@ public:
//- Destructor //- Destructor
virtual ~processorCyclicFvPatchField(); virtual ~processorCyclicFvPatchField() = default;
// Member functions // Member Functions
// Access // Access

View File

@ -69,7 +69,6 @@ class symmetryFvPatchField
: :
public basicSymmetryFvPatchField<Type> public basicSymmetryFvPatchField<Type>
{ {
public: public:
//- Runtime type information //- Runtime type information

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -31,7 +32,6 @@ License
#include "symmTransform.H" #include "symmTransform.H"
#include "diagTensor.H" #include "diagTensor.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
@ -41,7 +41,7 @@ Foam::wedgeFvPatchField<Type>::wedgeFvPatchField
const DimensionedField<Type, volMesh>& iF const DimensionedField<Type, volMesh>& iF
) )
: :
transformFvPatchField<Type>(p, iF) parent_bctype(p, iF)
{} {}
@ -54,7 +54,7 @@ Foam::wedgeFvPatchField<Type>::wedgeFvPatchField
const fvPatchFieldMapper& mapper const fvPatchFieldMapper& mapper
) )
: :
transformFvPatchField<Type>(ptf, p, iF, mapper) parent_bctype(ptf, p, iF, mapper)
{ {
if (!isType<wedgeFvPatch>(this->patch())) if (!isType<wedgeFvPatch>(this->patch()))
{ {
@ -77,7 +77,7 @@ Foam::wedgeFvPatchField<Type>::wedgeFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
transformFvPatchField<Type>(p, iF, dict) parent_bctype(p, iF, dict) // "value" is NO_READ
{ {
if (!isType<wedgeFvPatch>(p)) if (!isType<wedgeFvPatch>(p))
{ {
@ -97,21 +97,21 @@ Foam::wedgeFvPatchField<Type>::wedgeFvPatchField
template<class Type> template<class Type>
Foam::wedgeFvPatchField<Type>::wedgeFvPatchField 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> template<class Type>
Foam::wedgeFvPatchField<Type>::wedgeFvPatchField Foam::wedgeFvPatchField<Type>::wedgeFvPatchField
( (
const wedgeFvPatchField<Type>& ptf, const wedgeFvPatchField<Type>& ptf
const DimensionedField<Type, volMesh>& iF
) )
: :
transformFvPatchField<Type>(ptf, iF) wedgeFvPatchField<Type>(ptf, ptf.internalField())
{} {}

View File

@ -33,6 +33,8 @@ Description
This boundary condition is similar to the cyclic condition, except that This boundary condition is similar to the cyclic condition, except that
it is applied to 2-D geometries. it is applied to 2-D geometries.
The "value" entry is NO_READ, NO_WRITE.
Usage Usage
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
@ -50,8 +52,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef wedgeFvPatchField_H #ifndef Foam_wedgeFvPatchField_H
#define wedgeFvPatchField_H #define Foam_wedgeFvPatchField_H
#include "transformFvPatchField.H" #include "transformFvPatchField.H"
#include "wedgeFvPatch.H" #include "wedgeFvPatch.H"
@ -70,6 +72,9 @@ class wedgeFvPatchField
: :
public transformFvPatchField<Type> public transformFvPatchField<Type>
{ {
//- The parent boundary condition type
typedef transformFvPatchField<Type> parent_bctype;
public: public:
@ -86,7 +91,8 @@ public:
const DimensionedField<Type, volMesh>& 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 wedgeFvPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -67,7 +67,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const dictionary& dict 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")), phiName_(dict.getOrDefault<word>("phi", "phi")),
rhoName_(dict.getOrDefault<word>("rho", "rho")), rhoName_(dict.getOrDefault<word>("rho", "rho")),
uniformJump_(dict.getOrDefault("uniformJump", false)), uniformJump_(dict.getOrDefault("uniformJump", false)),

View File

@ -70,10 +70,10 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const dictionary& dict, 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), jump_(p.size(), Zero),
jump0_(p.size(), Zero), jump0_(p.size(), Zero),
minJump_(dict.getOrDefault<Type>("minJump", pTraits<Type>::min)), minJump_(dict.getOrDefault<Type>("minJump", pTraits<Type>::min)),
@ -82,7 +82,7 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
{ {
if (this->cyclicPatch().owner()) if (this->cyclicPatch().owner())
{ {
if (valueRequired) if (needValue)
{ {
jump_.assign("jump", dict, p.size(), IOobjectOption::MUST_READ); 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); jump0_.assign("jump0", dict, p.size(), IOobjectOption::LAZY_READ);
} }
if (valueRequired) if (needValue)
{ {
if (!this->readValueEntry(dict)) if (!this->readValueEntry(dict))
{ {

View File

@ -128,7 +128,7 @@ public:
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const dictionary&, const dictionary&,
const bool valueRequired = true const bool needValue = true
); );
//- Construct by mapping given fixedJumpFvPatchField onto a //- Construct by mapping given fixedJumpFvPatchField onto a

View File

@ -39,7 +39,7 @@ Foam::fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField
) )
: :
parent_bctype(p, iF), parent_bctype(p, iF),
fixedValue_(p.size(), Zero), fixedValue_(p.size(), Foam::zero{}),
writeValue_(false) writeValue_(false)
{} {}
@ -72,6 +72,7 @@ Foam::fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField
writeValue_(dict.getOrDefault("writeValue", false)) writeValue_(dict.getOrDefault("writeValue", false))
{ {
fvPatchFieldBase::readDict(dict); fvPatchFieldBase::readDict(dict);
evaluate(); evaluate();
} }
@ -181,11 +182,13 @@ template<class Type>
void Foam::fixedNormalSlipFvPatchField<Type>::write(Ostream& os) const void Foam::fixedNormalSlipFvPatchField<Type>::write(Ostream& os) const
{ {
this->parent_bctype::write(os); this->parent_bctype::write(os);
fixedValue_.writeEntry("fixedValue", os);
if (writeValue_) if (writeValue_)
{ {
os.writeEntry("writeValue", "true"); os.writeEntry("writeValue", "true");
}
fixedValue_.writeEntry("fixedValue", os);
if (writeValue_)
{
fvPatchField<Type>::writeValueEntry(os); fvPatchField<Type>::writeValueEntry(os);
} }
} }

View File

@ -36,6 +36,8 @@ Description
The tangential component is treated as slip, i.e. copied from the internal The tangential component is treated as slip, i.e. copied from the internal
field. field.
The "value" entry is NO_READ, optional write.
Usage Usage
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
@ -76,8 +78,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef fixedNormalSlipFvPatchField_H #ifndef Foam_fixedNormalSlipFvPatchField_H
#define fixedNormalSlipFvPatchField_H #define Foam_fixedNormalSlipFvPatchField_H
#include "transformFvPatchField.H" #include "transformFvPatchField.H"
@ -123,7 +125,8 @@ public:
const DimensionedField<Type, volMesh>& 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 fixedNormalSlipFvPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -39,7 +39,7 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
) )
: :
parent_bctype(p, iF), parent_bctype(p, iF),
refValue_(p.size(), Zero), refValue_(p.size(), Foam::zero{}),
valueFraction_(p.size(), 1.0), valueFraction_(p.size(), 1.0),
writeValue_(false) writeValue_(false)
{} {}
@ -70,7 +70,7 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
) )
: :
parent_bctype(p, iF), parent_bctype(p, iF),
refValue_(p.size(), Zero), refValue_(p.size(), Foam::zero{}),
valueFraction_("valueFraction", dict, p.size()), valueFraction_("valueFraction", dict, p.size()),
writeValue_(dict.getOrDefault("writeValue", false)) writeValue_(dict.getOrDefault("writeValue", false))
{ {
@ -86,10 +86,11 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
template<class Type> template<class Type>
Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField 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_), refValue_(ptf.refValue_),
valueFraction_(ptf.valueFraction_), valueFraction_(ptf.valueFraction_),
writeValue_(ptf.writeValue_) writeValue_(ptf.writeValue_)
@ -99,14 +100,10 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
template<class Type> template<class Type>
Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
( (
const partialSlipFvPatchField<Type>& ptf, const partialSlipFvPatchField<Type>& ptf
const DimensionedField<Type, volMesh>& iF
) )
: :
parent_bctype(ptf, iF), partialSlipFvPatchField<Type>(ptf, ptf.internalField())
refValue_(ptf.refValue_),
valueFraction_(ptf.valueFraction_),
writeValue_(ptf.writeValue_)
{} {}
@ -204,12 +201,14 @@ template<class Type>
void Foam::partialSlipFvPatchField<Type>::write(Ostream& os) const void Foam::partialSlipFvPatchField<Type>::write(Ostream& os) const
{ {
this->parent_bctype::write(os); this->parent_bctype::write(os);
refValue_.writeEntry("refValue", os);
valueFraction_.writeEntry("valueFraction", os);
if (writeValue_) if (writeValue_)
{ {
os.writeEntry("writeValue", "true"); os.writeEntry("writeValue", "true");
}
refValue_.writeEntry("refValue", os);
valueFraction_.writeEntry("valueFraction", os);
if (writeValue_)
{
fvPatchField<Type>::writeValueEntry(os); fvPatchField<Type>::writeValueEntry(os);
} }
} }

View File

@ -31,8 +31,10 @@ Group
grpWallBoundaryConditions grpGenericBoundaryConditions grpWallBoundaryConditions grpGenericBoundaryConditions
Description Description
This boundary condition provides a partial slip condition. The amount of This boundary condition provides a partial slip condition.
slip is controlled by a user-supplied field. The amount of slip is controlled by a user-supplied field.
The "value" entry is NO_READ, optional write.
Usage Usage
\table \table
@ -50,7 +52,6 @@ Usage
type partialSlip; type partialSlip;
refValue uniform 0.001; refValue uniform 0.001;
valueFraction uniform 0.1; valueFraction uniform 0.1;
value uniform 0;
} }
\endverbatim \endverbatim
@ -62,8 +63,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef partialSlipFvPatchField_H #ifndef Foam_partialSlipFvPatchField_H
#define partialSlipFvPatchField_H #define Foam_partialSlipFvPatchField_H
#include "transformFvPatchField.H" #include "transformFvPatchField.H"
@ -112,7 +113,8 @@ public:
const DimensionedField<Type, volMesh>& 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 partialSlipFvPatchField
( (
const fvPatch&, const fvPatch&,
@ -120,7 +122,8 @@ public:
const dictionary& const dictionary&
); );
//- Construct by mapping given partialSlipFvPatchField onto a new patch //- Construct by mapping given partialSlip patch field
//- onto a new patch
partialSlipFvPatchField partialSlipFvPatchField
( (
const partialSlipFvPatchField<Type>&, const partialSlipFvPatchField<Type>&,
@ -163,6 +166,7 @@ public:
//- False: this patch field is not altered by assignment //- False: this patch field is not altered by assignment
virtual bool assignable() const { return false; } virtual bool assignable() const { return false; }
// Access // Access
virtual Field<Type>& refValue() virtual Field<Type>& refValue()

View File

@ -62,13 +62,13 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const dictionary& dict, 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_() jumpTable_()
{ {
if (valueRequired) if (needValue)
{ {
if (this->cyclicPatch().owner()) if (this->cyclicPatch().owner())
{ {

View File

@ -118,7 +118,7 @@ public:
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const dictionary&, const dictionary&,
const bool valueRequired = true const bool needValue = true
); );
//- Construct by mapping given uniformJumpFvPatchField onto a //- Construct by mapping given uniformJumpFvPatchField onto a

View File

@ -430,13 +430,13 @@ public:
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const dictionary& dict, const dictionary& dict,
const bool valueReqd const bool needValue
) )
: :
fvPatchField fvPatchField
( (
p, iF, dict, p, iF, dict,
(valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ) (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
) )
{} {}

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021-2023 OpenCFD Ltd. Copyright (C) 2021-2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. 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);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,7 +28,25 @@ Class
Foam::calculatedFvsPatchField Foam::calculatedFvsPatchField
Description Description
Foam::calculatedFvsPatchField This boundary condition is not designed to be evaluated; it is assumed
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 SourceFiles
calculatedFvsPatchField.C calculatedFvsPatchField.C
@ -118,6 +137,9 @@ public:
//- True: this patch field fixes a value. //- True: this patch field fixes a value.
virtual bool fixesValue() const { return true; } virtual bool fixesValue() const { return true; }
//- Write includes "value" entry
virtual void write(Ostream&) const;
}; };

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -57,10 +58,11 @@ Foam::coupledFvsPatchField<Type>::coupledFvsPatchField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF, 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,14 @@ 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);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,15 +28,17 @@ Class
Foam::coupledFvsPatchField Foam::coupledFvsPatchField
Description Description
Foam::coupledFvsPatchField Abstract base class for coupled patches.
The "value" entry is usually MUST_READ and always WRITE.
SourceFiles SourceFiles
coupledFvsPatchField.C coupledFvsPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef coupledFvsPatchField_H #ifndef Foam_coupledFvsPatchField_H
#define coupledFvsPatchField_H #define Foam_coupledFvsPatchField_H
#include "fvsPatchField.H" #include "fvsPatchField.H"
#include "coupledFvPatch.H" #include "coupledFvPatch.H"
@ -46,7 +49,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class coupledFvsPatch Declaration Class coupledFvsPatchField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class Type> template<class Type>
@ -54,7 +57,6 @@ class coupledFvsPatchField
: :
public fvsPatchField<Type> public fvsPatchField<Type>
{ {
public: public:
//- Runtime type information //- Runtime type information
@ -83,7 +85,8 @@ public:
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, surfaceMesh>&, const DimensionedField<Type, surfaceMesh>&,
const dictionary& const dictionary&,
IOobjectOption::readOption requireValue = IOobjectOption::MUST_READ
); );
//- Construct by mapping the given coupledFvsPatchField onto a new patch //- Construct by mapping the given coupledFvsPatchField onto a new patch
@ -118,16 +121,16 @@ public:
) const = 0; ) const = 0;
// Member functions // Member Functions
// Access //- True if this patch field is derived from coupledFvsPatchField
//- Return true if this patch field is derived from
// coupledFvsPatchField<Type>.
virtual bool coupled() const virtual bool coupled() const
{ {
return true; return true;
} }
//- Write includes "value" entry
virtual void write(Ostream&) const;
}; };

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -57,7 +58,8 @@ Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF, const DimensionedField<Type, surfaceMesh>& iF,
const dictionary& dict const dictionary& dict,
IOobjectOption::readOption requireValue
) )
: :
fvsPatchField<Type>(p, iF, dict, IOobjectOption::MUST_READ) fvsPatchField<Type>(p, iF, dict, IOobjectOption::MUST_READ)
@ -80,21 +82,21 @@ Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
template<class Type> template<class Type>
Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField 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> template<class Type>
Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
( (
const fixedValueFvsPatchField<Type>& ptf, const fixedValueFvsPatchField<Type>& ptf
const DimensionedField<Type, surfaceMesh>& iF
) )
: :
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);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,15 +28,33 @@ Class
Foam::fixedValueFvsPatchField Foam::fixedValueFvsPatchField
Description 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 SourceFiles
fixedValueFvsPatchField.C fixedValueFvsPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef fixedValueFvsPatchField_H #ifndef Foam_fixedValueFvsPatchField_H
#define fixedValueFvsPatchField_H #define Foam_fixedValueFvsPatchField_H
#include "fvsPatchField.H" #include "fvsPatchField.H"
@ -45,7 +64,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class fixedValueFvsPatch Declaration Class fixedValueFvsPatchField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class Type> template<class Type>
@ -81,7 +100,8 @@ public:
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, surfaceMesh>&, const DimensionedField<Type, surfaceMesh>&,
const dictionary& const dictionary&,
IOobjectOption::readOption requireValue = IOobjectOption::MUST_READ
); );
//- Construct by mapping the given fixedValue patch field //- Construct by mapping the given fixedValue patch field
@ -127,6 +147,9 @@ public:
//- True: this patch field fixes a value. //- True: this patch field fixes a value.
virtual bool fixesValue() const { return true; } virtual bool fixesValue() const { return true; }
//- Write includes "value" entry
virtual void write(Ostream&) const;
// Evaluation functions // Evaluation functions
@ -153,7 +176,7 @@ public:
virtual tmp<Field<Type>> gradientBoundaryCoeffs() const; virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
// Member operators // Member Operators
virtual void operator=(const UList<Type>&) {} virtual void operator=(const UList<Type>&) {}

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd. Copyright (C) 2023-2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. 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);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd. Copyright (C) 2023-2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -89,7 +89,8 @@ public:
const DimensionedField<Type, surfaceMesh>& const DimensionedField<Type, surfaceMesh>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary.
// Not implemented.
slicedFvsPatchField slicedFvsPatchField
( (
const fvPatch&, const fvPatch&,
@ -98,6 +99,7 @@ public:
); );
//- Construct by mapping the given sliced patch field onto a new patch //- Construct by mapping the given sliced patch field onto a new patch
// Not implemented.
slicedFvsPatchField slicedFvsPatchField
( (
const slicedFvsPatchField<Type>&, const slicedFvsPatchField<Type>&,
@ -141,6 +143,9 @@ public:
//- True: this patch field fixes a value. //- True: this patch field fixes a value.
virtual bool fixesValue() const { return true; } virtual bool fixesValue() const { return true; }
//- Write includes "value" entry
virtual void write(Ostream&) const;
// Member Operators // Member Operators

View File

@ -27,15 +27,27 @@ Class
Foam::cyclicFvsPatchField Foam::cyclicFvsPatchField
Description 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 SourceFiles
cyclicFvsPatchField.C cyclicFvsPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef cyclicFvsPatchField_H #ifndef Foam_cyclicFvsPatchField_H
#define cyclicFvsPatchField_H #define Foam_cyclicFvsPatchField_H
#include "coupledFvsPatchField.H" #include "coupledFvsPatchField.H"
#include "cyclicFvPatch.H" #include "cyclicFvPatch.H"
@ -46,7 +58,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class cyclicFvsPatch Declaration Class cyclicFvsPatchField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class Type> template<class Type>
@ -54,7 +66,7 @@ class cyclicFvsPatchField
: :
public coupledFvsPatchField<Type> public coupledFvsPatchField<Type>
{ {
// Private data // Private Data
//- Local reference cast into the cyclic patch //- Local reference cast into the cyclic patch
const cyclicFvPatch& cyclicPatch_; const cyclicFvPatch& cyclicPatch_;
@ -75,7 +87,8 @@ public:
const DimensionedField<Type, surfaceMesh>& 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 cyclicFvsPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -117,7 +117,7 @@ bool Foam::cyclicACMIFvsPatchField<Type>::coupled() const
{ {
if if
( (
Pstream::parRun() UPstream::parRun()
|| ( || (
this->cyclicACMIPatch_.size() this->cyclicACMIPatch_.size()
&& this->cyclicACMIPatch_.cyclicACMIPatch().neighbPatch().size() && this->cyclicACMIPatch_.cyclicACMIPatch().neighbPatch().size()

View File

@ -27,7 +27,9 @@ Class
Foam::cyclicACMIFvsPatchField Foam::cyclicACMIFvsPatchField
Description 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 SourceFiles
cyclicACMIFvsPatchField.C cyclicACMIFvsPatchField.C
@ -54,7 +56,7 @@ class cyclicACMIFvsPatchField
: :
public coupledFvsPatchField<Type> public coupledFvsPatchField<Type>
{ {
// Private data // Private Data
//- Local reference cast into the cyclic patch //- Local reference cast into the cyclic patch
const cyclicACMIFvPatch& cyclicACMIPatch_; const cyclicACMIFvPatch& cyclicACMIPatch_;
@ -75,7 +77,8 @@ public:
const DimensionedField<Type, surfaceMesh>& 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 cyclicACMIFvsPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -27,7 +27,11 @@ Class
Foam::cyclicAMIFvsPatchField Foam::cyclicAMIFvsPatchField
Description 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 SourceFiles
cyclicAMIFvsPatchField.C cyclicAMIFvsPatchField.C
@ -54,7 +58,7 @@ class cyclicAMIFvsPatchField
: :
public coupledFvsPatchField<Type> public coupledFvsPatchField<Type>
{ {
// Private data // Private Data
//- Local reference cast into the cyclic patch //- Local reference cast into the cyclic patch
const cyclicAMIFvPatch& cyclicAMIPatch_; const cyclicAMIFvPatch& cyclicAMIPatch_;
@ -75,7 +79,8 @@ public:
const DimensionedField<Type, surfaceMesh>& 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 cyclicAMIFvsPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -38,7 +39,7 @@ Foam::emptyFvsPatchField<Type>::emptyFvsPatchField
const DimensionedField<Type, surfaceMesh>& iF 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 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)) if (!isType<emptyFvPatch>(p))
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
@ -71,7 +75,7 @@ Foam::emptyFvsPatchField<Type>::emptyFvsPatchField
const fvPatchFieldMapper& const fvPatchFieldMapper&
) )
: :
fvsPatchField<Type>(p, iF, Field<Type>(0)) fvsPatchField<Type>(p, iF, Field<Type>()) // zero-sized patch field
{ {
if (!isType<emptyFvPatch>(this->patch())) if (!isType<emptyFvPatch>(this->patch()))
{ {
@ -88,26 +92,21 @@ Foam::emptyFvsPatchField<Type>::emptyFvsPatchField
template<class Type> template<class Type>
Foam::emptyFvsPatchField<Type>::emptyFvsPatchField Foam::emptyFvsPatchField<Type>::emptyFvsPatchField
( (
const emptyFvsPatchField<Type>& ptf const emptyFvsPatchField<Type>& ptf,
const DimensionedField<Type, surfaceMesh>& iF
) )
: :
fvsPatchField<Type> fvsPatchField<Type>(ptf.patch(), iF, Field<Type>()) // zero-sized
(
ptf.patch(),
ptf.internalField(),
Field<Type>(0)
)
{} {}
template<class Type> template<class Type>
Foam::emptyFvsPatchField<Type>::emptyFvsPatchField Foam::emptyFvsPatchField<Type>::emptyFvsPatchField
( (
const emptyFvsPatchField<Type>& ptf, const emptyFvsPatchField<Type>& ptf
const DimensionedField<Type, surfaceMesh>& iF
) )
: :
fvsPatchField<Type>(ptf.patch(), iF, Field<Type>(0)) emptyFvsPatchField<Type>(ptf, ptf.internalField())
{} {}

View File

@ -27,7 +27,19 @@ Class
Foam::emptyFvsPatchField Foam::emptyFvsPatchField
Description 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 SourceFiles
emptyFvsPatchField.C emptyFvsPatchField.C
@ -69,7 +81,8 @@ public:
const DimensionedField<Type, surfaceMesh>& 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 emptyFvsPatchField
( (
const fvPatch&, 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 //- Map (and resize as needed) from self given a mapping object
virtual void autoMap virtual void autoMap

View File

@ -122,11 +122,4 @@ Foam::processorFvsPatchField<Type>::processorFvsPatchField
{} {}
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
template<class Type>
Foam::processorFvsPatchField<Type>::~processorFvsPatchField()
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,15 +28,26 @@ Class
Foam::processorFvsPatchField Foam::processorFvsPatchField
Description 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 SourceFiles
processorFvsPatchField.C processorFvsPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef processorFvsPatchField_H #ifndef Foam_processorFvsPatchField_H
#define processorFvsPatchField_H #define Foam_processorFvsPatchField_H
#include "coupledFvsPatchField.H" #include "coupledFvsPatchField.H"
#include "processorFvPatch.H" #include "processorFvPatch.H"
@ -54,7 +66,7 @@ class processorFvsPatchField
: :
public coupledFvsPatchField<Type> public coupledFvsPatchField<Type>
{ {
// Private data // Private Data
//- Local reference cast into the processor patch //- Local reference cast into the processor patch
const processorFvPatch& procPatch_; const processorFvPatch& procPatch_;
@ -83,7 +95,8 @@ public:
const Field<Type>& const Field<Type>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary.
//- The "value" entry is MUST_READ.
processorFvsPatchField processorFvsPatchField
( (
const fvPatch&, const fvPatch&,
@ -127,15 +140,15 @@ public:
//- Destructor //- Destructor
virtual ~processorFvsPatchField(); virtual ~processorFvsPatchField() = default;
// Member Functions // Member Functions
//- Return true if running parallel //- True if running parallel
virtual bool coupled() const virtual bool coupled() const
{ {
return Pstream::parRun(); return UPstream::parRun();
} }
}; };

View File

@ -122,11 +122,4 @@ Foam::processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField
{} {}
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
template<class Type>
Foam::processorCyclicFvsPatchField<Type>::~processorCyclicFvsPatchField()
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -27,15 +27,18 @@ Class
Foam::processorCyclicFvsPatchField Foam::processorCyclicFvsPatchField
Description Description
Foam::processorCyclicFvsPatchField This boundary condition enables processor communication across cyclic
patches.
The "value" entry is MUST_READ.
SourceFiles SourceFiles
processorCyclicFvsPatchField.C processorCyclicFvsPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef processorCyclicFvsPatchField_H #ifndef Foam_processorCyclicFvsPatchField_H
#define processorCyclicFvsPatchField_H #define Foam_processorCyclicFvsPatchField_H
#include "coupledFvsPatchField.H" #include "coupledFvsPatchField.H"
#include "processorCyclicFvPatch.H" #include "processorCyclicFvPatch.H"
@ -54,7 +57,7 @@ class processorCyclicFvsPatchField
: :
public coupledFvsPatchField<Type> public coupledFvsPatchField<Type>
{ {
// Private data // Private Data
//- Local reference cast into the processor patch //- Local reference cast into the processor patch
const processorCyclicFvPatch& procPatch_; const processorCyclicFvPatch& procPatch_;
@ -83,7 +86,8 @@ public:
const Field<Type>& const Field<Type>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary.
//- The "value" entry is MUST_READ.
processorCyclicFvsPatchField processorCyclicFvsPatchField
( (
const fvPatch&, const fvPatch&,
@ -91,8 +95,7 @@ public:
const dictionary& const dictionary&
); );
//- Construct by mapping given processorCyclicFvsPatchField onto a //- Construct by mapping given patch field onto a new patch
// new patch
processorCyclicFvsPatchField processorCyclicFvsPatchField
( (
const processorCyclicFvsPatchField<Type>&, const processorCyclicFvsPatchField<Type>&,
@ -128,15 +131,15 @@ public:
//- Destructor //- Destructor
virtual ~processorCyclicFvsPatchField(); virtual ~processorCyclicFvsPatchField() = default;
// Member Functions // Member Functions
//- Return true if running parallel //- True if running parallel
virtual bool coupled() const virtual bool coupled() const
{ {
return Pstream::parRun(); return UPstream::parRun();
} }
}; };

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -48,7 +49,7 @@ Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField
const dictionary& dict const dictionary& dict
) )
: :
fvsPatchField<Type>(p, iF, dict) fvsPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
{ {
if (!isType<symmetryFvPatch>(p)) if (!isType<symmetryFvPatch>(p))
{ {
@ -83,16 +84,6 @@ Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField
} }
template<class Type>
Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField
(
const symmetryFvsPatchField<Type>& ptf
)
:
fvsPatchField<Type>(ptf)
{}
template<class Type> template<class Type>
Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField
( (
@ -104,4 +95,14 @@ Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField
{} {}
template<class Type>
Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField
(
const symmetryFvsPatchField<Type>& ptf
)
:
symmetryFvsPatchField<Type>(ptf, ptf.internalField())
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,15 +28,26 @@ Class
Foam::symmetryFvsPatchField Foam::symmetryFvsPatchField
Description 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 SourceFiles
symmetryFvsPatchField.C symmetryFvsPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef symmetryFvsPatchField_H #ifndef Foam_symmetryFvsPatchField_H
#define symmetryFvsPatchField_H #define Foam_symmetryFvsPatchField_H
#include "fvsPatchField.H" #include "fvsPatchField.H"
#include "symmetryFvPatch.H" #include "symmetryFvPatch.H"
@ -54,7 +66,6 @@ class symmetryFvsPatchField
: :
public fvsPatchField<Type> public fvsPatchField<Type>
{ {
public: public:
//- Runtime type information //- Runtime type information
@ -71,6 +82,7 @@ public:
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary
//- The "value" entry is NO_READ.
symmetryFvsPatchField symmetryFvsPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2015 OpenFOAM Foundation Copyright (C) 2013-2015 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -48,7 +49,7 @@ Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
const dictionary& dict const dictionary& dict
) )
: :
fvsPatchField<Type>(p, iF, dict) fvsPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
{ {
if (!isType<symmetryPlaneFvPatch>(p)) if (!isType<symmetryPlaneFvPatch>(p))
{ {
@ -83,16 +84,6 @@ Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
} }
template<class Type>
Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
(
const symmetryPlaneFvsPatchField<Type>& ptf
)
:
fvsPatchField<Type>(ptf)
{}
template<class Type> template<class Type>
Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
( (
@ -104,4 +95,14 @@ Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
{} {}
template<class Type>
Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
(
const symmetryPlaneFvsPatchField<Type>& ptf
)
:
symmetryPlaneFvsPatchField<Type>(ptf, ptf.internalField())
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -27,15 +27,26 @@ Class
Foam::symmetryPlaneFvsPatchField Foam::symmetryPlaneFvsPatchField
Description 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 SourceFiles
symmetryPlaneFvsPatchField.C symmetryPlaneFvsPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef symmetryPlaneFvsPatchField_H #ifndef Foam_symmetryPlaneFvsPatchField_H
#define symmetryPlaneFvsPatchField_H #define Foam_symmetryPlaneFvsPatchField_H
#include "fvsPatchField.H" #include "fvsPatchField.H"
#include "symmetryPlaneFvPatch.H" #include "symmetryPlaneFvPatch.H"
@ -54,7 +65,6 @@ class symmetryPlaneFvsPatchField
: :
public fvsPatchField<Type> public fvsPatchField<Type>
{ {
public: public:
//- Runtime type information //- Runtime type information
@ -70,7 +80,8 @@ public:
const DimensionedField<Type, surfaceMesh>& 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 symmetryPlaneFvsPatchField
( (
const fvPatch&, const fvPatch&,
@ -78,8 +89,7 @@ public:
const dictionary& const dictionary&
); );
//- Construct by mapping given symmetryPlaneFvsPatchField //- Construct by mapping given patch field onto a new patch
// onto a new patch
symmetryPlaneFvsPatchField symmetryPlaneFvsPatchField
( (
const symmetryPlaneFvsPatchField<Type>&, const symmetryPlaneFvsPatchField<Type>&,

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -48,7 +49,7 @@ Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField
const dictionary& dict const dictionary& dict
) )
: :
fvsPatchField<Type>(p, iF, dict) fvsPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
{ {
if (!isType<wedgeFvPatch>(p)) if (!isType<wedgeFvPatch>(p))
{ {
@ -83,16 +84,6 @@ Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField
} }
template<class Type>
Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField
(
const wedgeFvsPatchField<Type>& ptf
)
:
fvsPatchField<Type>(ptf)
{}
template<class Type> template<class Type>
Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField
( (
@ -104,4 +95,14 @@ Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField
{} {}
template<class Type>
Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField
(
const wedgeFvsPatchField<Type>& ptf
)
:
wedgeFvsPatchField<Type>(ptf, ptf.internalField())
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,15 +28,27 @@ Class
Foam::wedgeFvsPatchField Foam::wedgeFvsPatchField
Description 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 SourceFiles
wedgeFvsPatchField.C wedgeFvsPatchField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef wedgeFvsPatchField_H #ifndef Foam_wedgeFvsPatchField_H
#define wedgeFvsPatchField_H #define Foam_wedgeFvsPatchField_H
#include "fvsPatchField.H" #include "fvsPatchField.H"
#include "wedgeFvPatch.H" #include "wedgeFvPatch.H"
@ -54,7 +67,6 @@ class wedgeFvsPatchField
: :
public fvsPatchField<Type> public fvsPatchField<Type>
{ {
public: public:
//- Runtime type information //- Runtime type information
@ -70,7 +82,8 @@ public:
const DimensionedField<Type, surfaceMesh>& 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 wedgeFvsPatchField
( (
const fvPatch&, const fvPatch&,

View File

@ -207,7 +207,6 @@ template<class Type>
void Foam::fvsPatchField<Type>::write(Ostream& os) const void Foam::fvsPatchField<Type>::write(Ostream& os) const
{ {
os.writeEntry("type", type()); os.writeEntry("type", type());
Field<Type>::writeEntry("value", os);
} }

View File

@ -343,13 +343,13 @@ public:
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF, const DimensionedField<Type, surfaceMesh>& iF,
const dictionary& dict, const dictionary& dict,
const bool valueReqd const bool needValue
) )
: :
fvsPatchField fvsPatchField
( (
p, iF, dict, 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; virtual void write(Ostream& os) const;
//- Check against given patch field //- Check against given patch field

View File

@ -449,7 +449,7 @@ void specularRadiationMixedFvPatchScalarField::write(Ostream& os) const
{ {
mixedFvPatchScalarField::write(os); mixedFvPatchScalarField::write(os);
os.writeEntryIfDifferent<bool>("interpolate", false, interpolate_); os.writeEntryIfDifferent<bool>("interpolate", false, interpolate_);
this->writeEntry("value", os); this->writeValueEntry(os);
} }