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
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)
)
{}

View File

@ -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)
)
{}

View File

@ -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))
{

View File

@ -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

View File

@ -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>&,

View File

@ -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())
{}

View File

@ -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&,

View File

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

View File

@ -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;
};

View File

@ -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>&) {}

View File

@ -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;
};

View File

@ -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;
};

View File

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

View File

@ -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;
};

View File

@ -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;
};

View File

@ -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;
};

View File

@ -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())
{}

View File

@ -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&,

View File

@ -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>&,

View File

@ -31,11 +31,16 @@ Group
grpGenericBoundaryConditions
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
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;
};

View File

@ -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;
};

View File

@ -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())
{}

View File

@ -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>&) {}

View File

@ -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&,

View File

@ -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);
}
@ -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
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

View File

@ -61,7 +61,7 @@ Foam::cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
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
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&,

View File

@ -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())
{}

View File

@ -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&,

View File

@ -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>

View File

@ -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

View File

@ -50,7 +50,7 @@ nonuniformTransformCyclicFvPatchField
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
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&,

View File

@ -28,7 +28,6 @@ License
#include "processorFvPatchField.H"
#include "processorFvPatch.H"
#include "demandDrivenData.H"
#include "transformField.H"
// * * * * * * * * * * * * * * * * 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>
{
// 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

View File

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

View File

@ -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())
{}

View File

@ -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&,

View File

@ -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)),

View File

@ -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))
{

View File

@ -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

View File

@ -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);
}
}

View File

@ -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&,

View File

@ -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);
refValue_.writeEntry("refValue", os);
valueFraction_.writeEntry("valueFraction", os);
if (writeValue_)
{
os.writeEntry("writeValue", "true");
}
refValue_.writeEntry("refValue", os);
valueFraction_.writeEntry("valueFraction", os);
if (writeValue_)
{
fvPatchField<Type>::writeValueEntry(os);
}
}

View File

@ -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()

View File

@ -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())
{

View File

@ -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

View File

@ -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)
)
{}

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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 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
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;
};

View File

@ -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,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 |
-------------------------------------------------------------------------------
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;
};

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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>&) {}

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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

View File

@ -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&,

View File

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

View File

@ -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&,

View File

@ -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&,

View File

@ -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())
{}

View File

@ -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

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 |
-------------------------------------------------------------------------------
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();
}
};

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
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();
}
};

View File

@ -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))
{
@ -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>
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 |
-------------------------------------------------------------------------------
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&,

View File

@ -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))
{
@ -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>
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
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>&,

View File

@ -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))
{
@ -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>
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 |
-------------------------------------------------------------------------------
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&,

View File

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

View File

@ -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

View File

@ -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);
}