mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support zeroValue boundary condition
- a special case of fixedValue with a value of zero:
* non-assignable
* no mapping needed
* value internal coeffs are zero
* value boundary coeffs are zero
This commit is contained in:
committed by
Mattijs Janssens
parent
f96c5fafb0
commit
4cc8423c94
@ -805,6 +805,7 @@ $(basicPointPatchFields)/coupled/coupledPointPatchFields.C
|
||||
$(basicPointPatchFields)/value/valuePointPatchFields.C
|
||||
$(basicPointPatchFields)/fixedValue/fixedValuePointPatchFields.C
|
||||
$(basicPointPatchFields)/zeroGradient/zeroGradientPointPatchFields.C
|
||||
$(basicPointPatchFields)/zeroValue/zeroValuePointPatchFields.C
|
||||
|
||||
constraintPointPatchFields = $(pointPatchFields)/constraint
|
||||
$(constraintPointPatchFields)/cyclic/cyclicPointPatchFields.C
|
||||
|
||||
@ -69,6 +69,11 @@ const Foam::word Foam::fieldTypes::zeroGradientType
|
||||
Foam::fieldTypes::zeroGradientTypeName_()
|
||||
);
|
||||
|
||||
const Foam::word Foam::fieldTypes::zeroValueType
|
||||
(
|
||||
Foam::fieldTypes::zeroValueTypeName_()
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -120,6 +120,12 @@ inline const char* zeroGradientTypeName_() noexcept { return "zeroGradient"; }
|
||||
//- A \c zeroGradient patch field type
|
||||
extern const word zeroGradientType;
|
||||
|
||||
//- A \c zeroValue patch field type
|
||||
inline const char* zeroValueTypeName_() noexcept { return "zeroValue"; }
|
||||
|
||||
//- A \c zeroValue patch field type
|
||||
extern const word zeroValueType;
|
||||
|
||||
} // End namespace fieldTypes
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,7 +37,7 @@ Foam::fixedValuePointPatchField<Type>::fixedValuePointPatchField
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
valuePointPatchField<Type>(p, iF)
|
||||
parent_bctype(p, iF)
|
||||
{}
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ Foam::fixedValuePointPatchField<Type>::fixedValuePointPatchField
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
valuePointPatchField<Type>(p, iF, value)
|
||||
parent_bctype(p, iF, value)
|
||||
{}
|
||||
|
||||
|
||||
@ -62,31 +62,44 @@ Foam::fixedValuePointPatchField<Type>::fixedValuePointPatchField
|
||||
IOobjectOption::readOption requireValue
|
||||
)
|
||||
:
|
||||
valuePointPatchField<Type>(p, iF, dict, requireValue)
|
||||
parent_bctype(p, iF, dict, requireValue)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValuePointPatchField<Type>::fixedValuePointPatchField
|
||||
(
|
||||
const fixedValuePointPatchField<Type>& ptf,
|
||||
const fixedValuePointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const pointPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
valuePointPatchField<Type>(ptf, p, iF, mapper)
|
||||
parent_bctype(pfld, p, iF, mapper)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValuePointPatchField<Type>::fixedValuePointPatchField
|
||||
(
|
||||
const fixedValuePointPatchField<Type>& ptf,
|
||||
const fixedValuePointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
parent_bctype(pfld, p, iF, value)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValuePointPatchField<Type>::fixedValuePointPatchField
|
||||
(
|
||||
const fixedValuePointPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
valuePointPatchField<Type>(ptf, iF)
|
||||
parent_bctype(pfld, iF)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -56,6 +56,9 @@ class fixedValuePointPatchField
|
||||
:
|
||||
public valuePointPatchField<Type>
|
||||
{
|
||||
//- The parent boundary condition type
|
||||
typedef valuePointPatchField<Type> parent_bctype;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -113,13 +116,30 @@ public:
|
||||
const pointPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
//- Copy construct onto patch with internal field reference
|
||||
//- and specified value
|
||||
fixedValuePointPatchField
|
||||
(
|
||||
const fixedValuePointPatchField<Type>&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
const fixedValuePointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
fixedValuePointPatchField
|
||||
(
|
||||
const fixedValuePointPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
fixedValuePointPatchField(const fixedValuePointPatchField<Type>& pfld)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Return a clone
|
||||
virtual autoPtr<pointPatchField<Type>> clone() const
|
||||
{
|
||||
@ -148,9 +168,8 @@ public:
|
||||
// Member Operators
|
||||
|
||||
// Disable assignment operators
|
||||
|
||||
virtual void operator=(const Field<Type>&){}
|
||||
virtual void operator=(const Type&){}
|
||||
virtual void operator=(const Field<Type>&) {}
|
||||
virtual void operator=(const Type&) {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -129,26 +129,40 @@ Foam::valuePointPatchField<Type>::valuePointPatchField
|
||||
template<class Type>
|
||||
Foam::valuePointPatchField<Type>::valuePointPatchField
|
||||
(
|
||||
const valuePointPatchField<Type>& ptf,
|
||||
const valuePointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const pointPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
pointPatchField<Type>(ptf, p, iF, mapper),
|
||||
Field<Type>(ptf, mapper)
|
||||
pointPatchField<Type>(pfld, p, iF, mapper),
|
||||
Field<Type>(pfld, mapper)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::valuePointPatchField<Type>::valuePointPatchField
|
||||
(
|
||||
const valuePointPatchField<Type>& ptf,
|
||||
const valuePointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
pointPatchField<Type>(pfld, p, iF, value),
|
||||
Field<Type>(p.size(), value)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::valuePointPatchField<Type>::valuePointPatchField
|
||||
(
|
||||
const valuePointPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
pointPatchField<Type>(ptf, iF),
|
||||
Field<Type>(ptf)
|
||||
pointPatchField<Type>(pfld, iF),
|
||||
Field<Type>(pfld)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2020-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -142,13 +142,24 @@ public:
|
||||
const pointPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
//- Copy construct onto patch with internal field reference
|
||||
//- and specified value
|
||||
valuePointPatchField
|
||||
(
|
||||
const valuePointPatchField<Type>&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
const valuePointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
valuePointPatchField
|
||||
(
|
||||
const valuePointPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
);
|
||||
|
||||
|
||||
//- Return a clone
|
||||
virtual autoPtr<pointPatchField<Type>> clone() const
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2014 OpenFOAM Foundation
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -26,24 +26,24 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zeroFixedValuePointPatchField.H"
|
||||
#include "zeroValuePointPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
|
||||
Foam::zeroValuePointPatchField<Type>::zeroValuePointPatchField
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
fixedValuePointPatchField<Type>(p, iF, Type(Zero))
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
|
||||
Foam::zeroValuePointPatchField<Type>::zeroValuePointPatchField
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
@ -51,48 +51,45 @@ Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
fixedValuePointPatchField<Type>(p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>& ptf,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const pointPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
// Field is zero : no mapping needed
|
||||
fixedValuePointPatchField<Type>(p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>& ptf
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(ptf)
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{
|
||||
// Field is zero. For safety, re-assign
|
||||
valuePointPatchField<Type>::operator=(Type(Zero));
|
||||
pointPatchFieldBase::readDict(dict);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
|
||||
Foam::zeroValuePointPatchField<Type>::zeroValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>& ptf,
|
||||
const zeroValuePointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const pointPatchFieldMapper&
|
||||
)
|
||||
:
|
||||
// Field is zero. No mapping
|
||||
parent_bctype(pfld, p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValuePointPatchField<Type>::zeroValuePointPatchField
|
||||
(
|
||||
const zeroValuePointPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(ptf, iF)
|
||||
// Field is zero
|
||||
parent_bctype(pfld, pfld.patch(), iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void Foam::zeroValuePointPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
// Field is zero. For safety, re-assign
|
||||
valuePointPatchField<Type>::operator=(Type(Zero));
|
||||
pointPatchField<Type>::write(os);
|
||||
// Without writeValueEntry() since the value == zero
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2014 OpenFOAM Foundation
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -24,26 +25,26 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::zeroFixedValuePointPatchField
|
||||
Foam::zeroValuePointPatchField
|
||||
|
||||
Description
|
||||
Enables the specification of a zero fixed value boundary condition.
|
||||
Specifies a zero fixed value boundary condition
|
||||
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
inlet
|
||||
{
|
||||
type zeroFixedValue;
|
||||
type zeroValue;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
zeroFixedValuePointPatchField.C
|
||||
zeroValuePointPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_zeroFixedValuePointPatchField_H
|
||||
#define Foam_zeroFixedValuePointPatchField_H
|
||||
#ifndef Foam_zeroValuePointPatchField_H
|
||||
#define Foam_zeroValuePointPatchField_H
|
||||
|
||||
#include "fixedValuePointPatchField.H"
|
||||
|
||||
@ -53,58 +54,62 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class zeroFixedValuePointPatchField Declaration
|
||||
Class zeroValuePointPatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class zeroFixedValuePointPatchField
|
||||
class zeroValuePointPatchField
|
||||
:
|
||||
public fixedValuePointPatchField<Type>
|
||||
{
|
||||
//- The parent boundary condition type
|
||||
typedef fixedValuePointPatchField<Type> parent_bctype;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("zeroFixedValue");
|
||||
TypeName("zeroValue");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
zeroFixedValuePointPatchField
|
||||
zeroValuePointPatchField
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
zeroFixedValuePointPatchField
|
||||
zeroValuePointPatchField
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given patch field onto a new patch
|
||||
zeroFixedValuePointPatchField
|
||||
//- Copy construct onto a new patch
|
||||
zeroValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>&,
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&,
|
||||
const zeroValuePointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const pointPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
zeroFixedValuePointPatchField
|
||||
//- Copy construct with internal field reference
|
||||
zeroValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>&
|
||||
const zeroValuePointPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
);
|
||||
//- Copy construct
|
||||
zeroValuePointPatchField(const zeroValuePointPatchField<Type>& pfld)
|
||||
:
|
||||
zeroValuePointPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Return a clone
|
||||
virtual autoPtr<pointPatchField<Type>> clone() const
|
||||
@ -120,6 +125,39 @@ public:
|
||||
{
|
||||
return pointPatchField<Type>::Clone(*this, iF);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- True: this patch field fixes a value.
|
||||
virtual bool fixesValue() const { return true; }
|
||||
|
||||
//- False: this patch field is not altered by assignment.
|
||||
virtual bool assignable() const { return false; }
|
||||
|
||||
//- Write (without "value" entry)
|
||||
virtual void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Disable assignment operators
|
||||
virtual void operator=(const valuePointPatchField<Type>&) {}
|
||||
virtual void operator=(const pointPatchField<Type>&) {}
|
||||
virtual void operator=(const Field<Type>&) {}
|
||||
virtual void operator=(const Type&) {}
|
||||
|
||||
// Disable forced assignment operators
|
||||
virtual void operator==(const valuePointPatchField<Type>&) {}
|
||||
virtual void operator==(const pointPatchField<Type>&) {}
|
||||
virtual void operator==(const Field<Type>&) {}
|
||||
virtual void operator==(const Type&) {}
|
||||
|
||||
// Prevent automatic comparison rewriting (c++20)
|
||||
bool operator!=(const valuePointPatchField<Type>&) const = delete;
|
||||
bool operator!=(const pointPatchField<Type>&) const = delete;
|
||||
bool operator!=(const Field<Type>&) const = delete;
|
||||
bool operator!=(const Type&) const = delete;
|
||||
};
|
||||
|
||||
|
||||
@ -130,7 +168,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "zeroFixedValuePointPatchField.C"
|
||||
#include "zeroValuePointPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -25,21 +25,15 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zeroFixedValuePointPatchFields.H"
|
||||
#include "zeroValuePointPatchFields.H"
|
||||
#include "pointPatchFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFields(zeroFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
makePointPatchFields(zeroValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -23,20 +23,12 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
InClass
|
||||
Foam::zeroFixedValuePointPatchFields
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
zeroFixedValuePointPatchFields.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef zeroFixedValuePointPatchFields_H
|
||||
#define zeroFixedValuePointPatchFields_H
|
||||
#ifndef Foam_zeroValuePointPatchFields_H
|
||||
#define Foam_zeroValuePointPatchFields_H
|
||||
|
||||
#include "zeroFixedValuePointPatchField.H"
|
||||
#include "zeroValuePointPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -46,7 +38,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFieldTypedefs(zeroFixedValue);
|
||||
makePointPatchFieldTypedefs(zeroValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -60,13 +60,13 @@ Foam::pointPatchField<Type>::pointPatchField
|
||||
template<class Type>
|
||||
Foam::pointPatchField<Type>::pointPatchField
|
||||
(
|
||||
const pointPatchField<Type>& ptf,
|
||||
const pointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const pointPatchFieldMapper&
|
||||
)
|
||||
:
|
||||
pointPatchFieldBase(ptf, p),
|
||||
pointPatchFieldBase(pfld, p),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
@ -74,22 +74,25 @@ Foam::pointPatchField<Type>::pointPatchField
|
||||
template<class Type>
|
||||
Foam::pointPatchField<Type>::pointPatchField
|
||||
(
|
||||
const pointPatchField<Type>& ptf
|
||||
const pointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const Type&
|
||||
)
|
||||
:
|
||||
pointPatchFieldBase(ptf),
|
||||
internalField_(ptf.internalField_)
|
||||
pointPatchFieldBase(pfld, p),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::pointPatchField<Type>::pointPatchField
|
||||
(
|
||||
const pointPatchField<Type>& ptf,
|
||||
const pointPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
pointPatchFieldBase(ptf),
|
||||
pointPatchFieldBase(pfld),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
|
||||
@ -150,6 +150,12 @@ public:
|
||||
return Foam::fieldTypes::zeroGradientType;
|
||||
}
|
||||
|
||||
//- The type name for \c zeroValue patch fields
|
||||
static const word& zeroValueType() noexcept
|
||||
{
|
||||
return Foam::fieldTypes::zeroValueType;
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -351,16 +357,29 @@ public:
|
||||
const pointPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
pointPatchField(const pointPatchField<Type>&);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
//- Copy construct onto a new patch with (unused) value
|
||||
pointPatchField
|
||||
(
|
||||
const pointPatchField<Type>&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
const pointPatchField<Type>& pfld,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const Type& value /* (unused) */
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
pointPatchField
|
||||
(
|
||||
const pointPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
pointPatchField(const pointPatchField<Type>& pfld)
|
||||
:
|
||||
pointPatchField(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Clone patch field with its own internal field reference
|
||||
virtual autoPtr<pointPatchField<Type>> clone() const = 0;
|
||||
|
||||
@ -590,22 +609,19 @@ public:
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
);
|
||||
|
||||
//- Initialise the evaluation of the patch field after a local
|
||||
// operation
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
//- Initialise the evaluation of the patch field after a local operation
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
//- Evaluate the patch field after a local operation (e.g. *=)
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
//- Evaluate the patch field after a local operation (e.g. *=)
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// Other
|
||||
|
||||
@ -48,12 +48,13 @@ basicFaPatchFields = $(faPatchFields)/basic
|
||||
$(basicFaPatchFields)/calculated/calculatedFaPatchFields.C
|
||||
$(basicFaPatchFields)/extrapolatedCalculated/extrapolatedCalculatedFaPatchFields.C
|
||||
$(basicFaPatchFields)/coupled/coupledFaPatchFields.C
|
||||
$(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchFields.C
|
||||
$(basicFaPatchFields)/fixedValue/fixedValueFaPatchFields.C
|
||||
$(basicFaPatchFields)/fixedGradient/fixedGradientFaPatchFields.C
|
||||
$(basicFaPatchFields)/mixed/mixedFaPatchFields.C
|
||||
$(basicFaPatchFields)/sliced/slicedFaPatchFields.C
|
||||
$(basicFaPatchFields)/transform/transformFaPatchFields.C
|
||||
$(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchFields.C
|
||||
$(basicFaPatchFields)/zeroValue/zeroValueFaPatchFields.C
|
||||
|
||||
constraintFaPatchFields = $(faPatchFields)/constraint
|
||||
$(constraintFaPatchFields)/empty/emptyFaPatchFields.C
|
||||
@ -84,6 +85,7 @@ $(basicFaePatchFields)/calculated/calculatedFaePatchFields.C
|
||||
$(basicFaePatchFields)/coupled/coupledFaePatchFields.C
|
||||
$(basicFaePatchFields)/fixedValue/fixedValueFaePatchFields.C
|
||||
$(basicFaePatchFields)/sliced/slicedFaePatchFields.C
|
||||
$(basicFaePatchFields)/zeroValue/zeroValueFaePatchFields.C
|
||||
|
||||
constraintFaePatchFields = $(faePatchFields)/constraint
|
||||
$(constraintFaePatchFields)/empty/emptyFaePatchFields.C
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -65,17 +66,6 @@ Foam::fixedValueFaPatchField<Type>::fixedValueFaPatchField
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValueFaPatchField<Type>::fixedValueFaPatchField
|
||||
(
|
||||
const fixedValueFaPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(ptf, iF)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValueFaPatchField<Type>::fixedValueFaPatchField
|
||||
(
|
||||
@ -92,10 +82,24 @@ Foam::fixedValueFaPatchField<Type>::fixedValueFaPatchField
|
||||
template<class Type>
|
||||
Foam::fixedValueFaPatchField<Type>::fixedValueFaPatchField
|
||||
(
|
||||
const fixedValueFaPatchField<Type>& ptf
|
||||
const fixedValueFaPatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(ptf)
|
||||
faPatchField<Type>(pfld, p, iF, value)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValueFaPatchField<Type>::fixedValueFaPatchField
|
||||
(
|
||||
const fixedValueFaPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
faPatchField<Type>(pfld, iF)
|
||||
{}
|
||||
|
||||
|
||||
@ -108,6 +112,7 @@ Foam::fixedValueFaPatchField<Type>::valueInternalCoeffs
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
// No contribution from internal values
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -100,19 +100,30 @@ public:
|
||||
const faPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
//- Copy construct onto a new patch with internal field reference
|
||||
//- and specified value
|
||||
fixedValueFaPatchField
|
||||
(
|
||||
const fixedValueFaPatchField<Type>&
|
||||
const fixedValueFaPatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
//- Copy construct with internal field reference
|
||||
fixedValueFaPatchField
|
||||
(
|
||||
const fixedValueFaPatchField<Type>&,
|
||||
const DimensionedField<Type, areaMesh>&
|
||||
const fixedValueFaPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
fixedValueFaPatchField(const fixedValueFaPatchField<Type>& pfld)
|
||||
:
|
||||
fixedValueFaPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Return clone
|
||||
virtual tmp<faPatchField<Type>> clone() const
|
||||
{
|
||||
|
||||
@ -0,0 +1,136 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zeroValueFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFaPatchField<Type>::zeroValueFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFaPatchField<Type>::zeroValueFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{
|
||||
faPatchFieldBase::readDict(dict);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFaPatchField<Type>::zeroValueFaPatchField
|
||||
(
|
||||
const zeroValueFaPatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const faPatchFieldMapper&
|
||||
)
|
||||
:
|
||||
// Field is zero. No mapping
|
||||
parent_bctype(pfld, p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFaPatchField<Type>::zeroValueFaPatchField
|
||||
(
|
||||
const zeroValueFaPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(pfld, pfld.patch(), iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFaPatchField<Type>::valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
// No contribution from internal values
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFaPatchField<Type>::valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
// Patch field is zero
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFaPatchField<Type>::gradientInternalCoeffs() const
|
||||
{
|
||||
return -pTraits<Type>::one*this->patch().deltaCoeffs();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFaPatchField<Type>::gradientBoundaryCoeffs() const
|
||||
{
|
||||
// Patch field is zero
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::zeroValueFaPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
faPatchField<Type>::write(os);
|
||||
// Without writeValueEntry() since the value == zero
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,222 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::zeroValueFaPatchField
|
||||
|
||||
Description
|
||||
Specifies a zero fixed value boundary condition.
|
||||
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
inlet
|
||||
{
|
||||
type zeroValue;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
zeroValueFaPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_zeroValueFaPatchField_H
|
||||
#define Foam_zeroValueFaPatchField_H
|
||||
|
||||
#include "fixedValueFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class zeroValueFaPatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class zeroValueFaPatchField
|
||||
:
|
||||
public fixedValueFaPatchField<Type>
|
||||
{
|
||||
//- The parent boundary condition type
|
||||
typedef fixedValueFaPatchField<Type> parent_bctype;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("zeroValue");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
zeroValueFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
zeroValueFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Copy construct onto a new patch (no mapping needed)
|
||||
zeroValueFaPatchField
|
||||
(
|
||||
const zeroValueFaPatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const faPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
zeroValueFaPatchField
|
||||
(
|
||||
const zeroValueFaPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
zeroValueFaPatchField(const zeroValueFaPatchField<Type>& pfld)
|
||||
:
|
||||
zeroValueFaPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<faPatchField<Type>> clone() const
|
||||
{
|
||||
return tmp<faPatchField<Type>>
|
||||
(
|
||||
new zeroValueFaPatchField<Type>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<faPatchField<Type>> clone
|
||||
(
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<faPatchField<Type>>
|
||||
(
|
||||
new zeroValueFaPatchField<Type>(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- True: this patch field fixes a value.
|
||||
virtual bool fixesValue() const { return true; }
|
||||
|
||||
//- False: this patch field is not altered by assignment.
|
||||
virtual bool assignable() const { return false; }
|
||||
|
||||
//- Write (without "value" entry)
|
||||
virtual void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Evaluation Functions
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
//- evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
//- evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
//- evaluation of the gradient of this patchField
|
||||
virtual tmp<Field<Type>> gradientInternalCoeffs() const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
//- evaluation of the gradient of this patchField
|
||||
virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Disable assignment operators
|
||||
virtual void operator=(const UList<Type>&) {}
|
||||
|
||||
virtual void operator=(const faPatchField<Type>&) {}
|
||||
virtual void operator+=(const faPatchField<Type>&) {}
|
||||
virtual void operator-=(const faPatchField<Type>&) {}
|
||||
virtual void operator*=(const faPatchField<scalar>&) {}
|
||||
virtual void operator/=(const faPatchField<scalar>&) {}
|
||||
|
||||
virtual void operator+=(const Field<Type>&) {}
|
||||
virtual void operator-=(const Field<Type>&) {}
|
||||
|
||||
virtual void operator*=(const Field<scalar>&) {}
|
||||
virtual void operator/=(const Field<scalar>&) {}
|
||||
|
||||
virtual void operator=(const Type&) {}
|
||||
virtual void operator+=(const Type&) {}
|
||||
virtual void operator-=(const Type&) {}
|
||||
virtual void operator*=(const scalar) {}
|
||||
virtual void operator/=(const scalar) {}
|
||||
|
||||
|
||||
// Disable forced assignment operators
|
||||
virtual void operator==(const faPatchField<Type>&) {}
|
||||
virtual void operator==(const Field<Type>&) {}
|
||||
virtual void operator==(const Type&) {}
|
||||
|
||||
// Prevent automatic comparison rewriting (c++20)
|
||||
bool operator!=(const faPatchField<Type>&) const = delete;
|
||||
bool operator!=(const Field<Type>&) const = delete;
|
||||
bool operator!=(const Type&) const = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "zeroValueFaPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "faPatchFields.H"
|
||||
#include "zeroValueFaPatchFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "areaFaMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeFaPatchFields(zeroValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_zeroValueFaPatchFields_H
|
||||
#define Foam_zeroValueFaPatchFields_H
|
||||
|
||||
#include "zeroValueFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeFaPatchTypeFieldTypedefs(zeroValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -168,24 +168,27 @@ Foam::faPatchField<Type>::faPatchField
|
||||
template<class Type>
|
||||
Foam::faPatchField<Type>::faPatchField
|
||||
(
|
||||
const faPatchField<Type>& ptf
|
||||
const faPatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
faPatchFieldBase(ptf),
|
||||
Field<Type>(ptf),
|
||||
internalField_(ptf.internalField_)
|
||||
faPatchFieldBase(pfld, p),
|
||||
Field<Type>(p.size(), value),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::faPatchField<Type>::faPatchField
|
||||
(
|
||||
const faPatchField<Type>& ptf,
|
||||
const faPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
faPatchFieldBase(ptf),
|
||||
Field<Type>(ptf),
|
||||
faPatchFieldBase(pfld),
|
||||
Field<Type>(pfld),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
|
||||
@ -162,6 +162,12 @@ public:
|
||||
return Foam::fieldTypes::zeroGradientType;
|
||||
}
|
||||
|
||||
//- The type name for \c zeroValue patch fields
|
||||
static const word& zeroValueType() noexcept
|
||||
{
|
||||
return Foam::fieldTypes::zeroValueType;
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -403,16 +409,30 @@ public:
|
||||
const faPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
faPatchField(const faPatchField<Type>&);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
//- Copy construct onto a new patch with internal field reference
|
||||
//- and specified value
|
||||
faPatchField
|
||||
(
|
||||
const faPatchField<Type>&,
|
||||
const DimensionedField<Type, areaMesh>&
|
||||
const faPatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
faPatchField
|
||||
(
|
||||
const faPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
faPatchField(const faPatchField<Type>& pfld)
|
||||
:
|
||||
faPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Clone patch field with its own internal field reference
|
||||
virtual tmp<faPatchField<Type>> clone() const
|
||||
{
|
||||
@ -622,7 +642,7 @@ public:
|
||||
//- evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueInternalCoeffs
|
||||
(
|
||||
const tmp<Field<scalar>>&
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
@ -633,7 +653,7 @@ public:
|
||||
//- evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<Field<scalar>>&
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
|
||||
@ -66,17 +66,6 @@ Foam::fixedValueFaePatchField<Type>::fixedValueFaePatchField
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValueFaePatchField<Type>::fixedValueFaePatchField
|
||||
(
|
||||
const fixedValueFaePatchField<Type>& ptf,
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(ptf, iF)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValueFaePatchField<Type>::fixedValueFaePatchField
|
||||
(
|
||||
@ -93,10 +82,24 @@ Foam::fixedValueFaePatchField<Type>::fixedValueFaePatchField
|
||||
template<class Type>
|
||||
Foam::fixedValueFaePatchField<Type>::fixedValueFaePatchField
|
||||
(
|
||||
const fixedValueFaePatchField<Type>& ptf
|
||||
const fixedValueFaePatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(ptf)
|
||||
faePatchField<Type>(pfld, p, iF, value)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValueFaePatchField<Type>::fixedValueFaePatchField
|
||||
(
|
||||
const fixedValueFaePatchField<Type>& pfld,
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
)
|
||||
:
|
||||
faePatchField<Type>(pfld, iF)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -100,19 +100,29 @@ public:
|
||||
const faPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
//- Copy construct onto new patch with specified value
|
||||
fixedValueFaePatchField
|
||||
(
|
||||
const fixedValueFaePatchField<Type>&
|
||||
const fixedValueFaePatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
fixedValueFaePatchField
|
||||
(
|
||||
const fixedValueFaePatchField<Type>&,
|
||||
const DimensionedField<Type, edgeMesh>&
|
||||
const fixedValueFaePatchField<Type>& pfld,
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
fixedValueFaePatchField(const fixedValueFaePatchField<Type>& pfld)
|
||||
:
|
||||
fixedValueFaePatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Return clone
|
||||
virtual tmp<faePatchField<Type>> clone() const
|
||||
{
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zeroValueFaePatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFaePatchField<Type>::zeroValueFaePatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFaePatchField<Type>::zeroValueFaePatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{
|
||||
faePatchFieldBase::readDict(dict);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFaePatchField<Type>::zeroValueFaePatchField
|
||||
(
|
||||
const zeroValueFaePatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const faPatchFieldMapper&
|
||||
)
|
||||
:
|
||||
// Field is zero. No mapping
|
||||
parent_bctype(pfld, p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFaePatchField<Type>::zeroValueFaePatchField
|
||||
(
|
||||
const zeroValueFaePatchField<Type>& pfld,
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(pfld, pfld.patch(), iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void Foam::zeroValueFaePatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
faePatchField<Type>::write(os);
|
||||
// Without writeValueEntry() since the value == zero
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,197 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::zeroValueFaePatchField
|
||||
|
||||
Description
|
||||
Specifies a zero fixed value boundary condition.
|
||||
|
||||
Usage
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
<patchName>
|
||||
{
|
||||
type zeroValue;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
zeroValueFaePatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_zeroValueFaePatchField_H
|
||||
#define Foam_zeroValueFaePatchField_H
|
||||
|
||||
#include "fixedValueFaePatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class zeroValueFaePatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class zeroValueFaePatchField
|
||||
:
|
||||
public fixedValueFaePatchField<Type>
|
||||
{
|
||||
//- The parent boundary condition type
|
||||
typedef fixedValueFaePatchField<Type> parent_bctype;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("zeroValue");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
zeroValueFaePatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
zeroValueFaePatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Copy construct onto a new patch (no mapping needed)
|
||||
//- onto a new patch
|
||||
zeroValueFaePatchField
|
||||
(
|
||||
const zeroValueFaePatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const faPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
zeroValueFaePatchField
|
||||
(
|
||||
const zeroValueFaePatchField<Type>& pfld,
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
zeroValueFaePatchField(const zeroValueFaePatchField<Type>& pfld)
|
||||
:
|
||||
zeroValueFaePatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Return clone
|
||||
virtual tmp<faePatchField<Type>> clone() const
|
||||
{
|
||||
return faePatchField<Type>::Clone(*this);
|
||||
}
|
||||
|
||||
//- Clone with an internal field reference
|
||||
virtual tmp<faePatchField<Type>> clone
|
||||
(
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
) const
|
||||
{
|
||||
return faePatchField<Type>::Clone(*this, iF);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~zeroValueFaePatchField() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- True: this patch field fixes a value.
|
||||
virtual bool fixesValue() const { return true; }
|
||||
|
||||
//- False: this patch field is not altered by assignment.
|
||||
virtual bool assignable() const { return false; }
|
||||
|
||||
//- Write (without "value" entry)
|
||||
virtual void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Disable assignment operators
|
||||
virtual void operator=(const UList<Type>&) {}
|
||||
|
||||
virtual void operator=(const faePatchField<Type>&) {}
|
||||
virtual void operator+=(const faePatchField<Type>&) {}
|
||||
virtual void operator-=(const faePatchField<Type>&) {}
|
||||
virtual void operator*=(const faePatchField<scalar>&) {}
|
||||
virtual void operator/=(const faePatchField<scalar>&) {}
|
||||
|
||||
virtual void operator+=(const Field<Type>&) {}
|
||||
virtual void operator-=(const Field<Type>&) {}
|
||||
|
||||
virtual void operator*=(const Field<scalar>&) {}
|
||||
virtual void operator/=(const Field<scalar>&) {}
|
||||
|
||||
virtual void operator=(const Type&) {}
|
||||
virtual void operator+=(const Type&) {}
|
||||
virtual void operator-=(const Type&) {}
|
||||
virtual void operator*=(const scalar) {}
|
||||
virtual void operator/=(const scalar) {}
|
||||
|
||||
|
||||
// Disable forced assignment operators
|
||||
virtual void operator==(const faePatchField<Type>&) {}
|
||||
virtual void operator==(const Field<Type>&) {}
|
||||
virtual void operator==(const Type&) {}
|
||||
|
||||
// Prevent automatic comparison rewriting (c++20)
|
||||
bool operator!=(const faePatchField<Type>&) const = delete;
|
||||
bool operator!=(const Field<Type>&) const = delete;
|
||||
bool operator!=(const Type&) const = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "zeroValueFaePatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zeroValueFaePatchFields.H"
|
||||
#include "faePatchFields.H"
|
||||
#include "edgeFaMesh.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeFaePatchFields(zeroValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_zeroValueFaePatchFields_H
|
||||
#define Foam_zeroValueFaePatchFields_H
|
||||
|
||||
#include "zeroValueFaePatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeFaePatchTypeFieldTypedefs(zeroValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -158,24 +158,27 @@ Foam::faePatchField<Type>::faePatchField
|
||||
template<class Type>
|
||||
Foam::faePatchField<Type>::faePatchField
|
||||
(
|
||||
const faePatchField<Type>& ptf
|
||||
const faePatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
faePatchFieldBase(ptf),
|
||||
Field<Type>(ptf),
|
||||
internalField_(ptf.internalField_)
|
||||
faePatchFieldBase(pfld, p),
|
||||
Field<Type>(p.size(), value),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::faePatchField<Type>::faePatchField
|
||||
(
|
||||
const faePatchField<Type>& ptf,
|
||||
const faePatchField<Type>& pfld,
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
)
|
||||
:
|
||||
faePatchFieldBase(ptf),
|
||||
Field<Type>(ptf),
|
||||
faePatchFieldBase(pfld),
|
||||
Field<Type>(pfld),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019-2024 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -144,6 +144,12 @@ public:
|
||||
return Foam::fieldTypes::calculatedType;
|
||||
}
|
||||
|
||||
//- The type name for \c zeroValue patch fields
|
||||
static const word& zeroValueType() noexcept
|
||||
{
|
||||
return Foam::fieldTypes::zeroValueType;
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -381,16 +387,29 @@ public:
|
||||
const faPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
faePatchField(const faePatchField<Type>&);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
//- Copy construct onto new patch with specified value
|
||||
faePatchField
|
||||
(
|
||||
const faePatchField<Type>&,
|
||||
const DimensionedField<Type, edgeMesh>&
|
||||
const faePatchField<Type>& pfld,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, edgeMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
faePatchField
|
||||
(
|
||||
const faePatchField<Type>& pfld,
|
||||
const DimensionedField<Type, edgeMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
faePatchField(const faePatchField<Type>& pfld)
|
||||
:
|
||||
faePatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Clone patch field with its own internal field reference
|
||||
virtual tmp<faePatchField<Type>> clone() const
|
||||
{
|
||||
|
||||
@ -138,6 +138,7 @@ $(basicFvPatchFields)/mixed/mixedFvPatchFields.C
|
||||
$(basicFvPatchFields)/sliced/slicedFvPatchFields.C
|
||||
$(basicFvPatchFields)/transform/transformFvPatchFields.C
|
||||
$(basicFvPatchFields)/zeroGradient/zeroGradientFvPatchFields.C
|
||||
$(basicFvPatchFields)/zeroValue/zeroValueFvPatchFields.C
|
||||
|
||||
constraintFvPatchFields = $(fvPatchFields)/constraint
|
||||
$(constraintFvPatchFields)/cyclic/cyclicFvPatchFields.C
|
||||
@ -263,6 +264,7 @@ $(basicFvsPatchFields)/calculated/calculatedFvsPatchFields.C
|
||||
$(basicFvsPatchFields)/coupled/coupledFvsPatchFields.C
|
||||
$(basicFvsPatchFields)/fixedValue/fixedValueFvsPatchFields.C
|
||||
$(basicFvsPatchFields)/sliced/slicedFvsPatchFields.C
|
||||
$(basicFvsPatchFields)/zeroValue/zeroValueFvsPatchFields.C
|
||||
|
||||
constraintFvsPatchFields = $(fvsPatchFields)/constraint
|
||||
$(constraintFvsPatchFields)/cyclic/cyclicFvsPatchFields.C
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -92,21 +92,24 @@ Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
|
||||
template<class Type>
|
||||
Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
|
||||
(
|
||||
const fixedValueFvPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
const fixedValueFvPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
fvPatchField<Type>(ptf, iF)
|
||||
fvPatchField<Type>(pfld, p, iF, value)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
|
||||
(
|
||||
const fixedValueFvPatchField<Type>& ptf
|
||||
const fixedValueFvPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(ptf, ptf.internalField())
|
||||
fvPatchField<Type>(pfld, iF)
|
||||
{}
|
||||
|
||||
|
||||
@ -119,6 +122,7 @@ Foam::fixedValueFvPatchField<Type>::valueInternalCoeffs
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
// No contribution from internal values
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -131,19 +131,30 @@ public:
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
//- Construct onto a new patch with internal field reference
|
||||
//- and specified value
|
||||
fixedValueFvPatchField
|
||||
(
|
||||
const fixedValueFvPatchField<Type>&
|
||||
const fixedValueFvPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
//- Copy construct with internal field reference
|
||||
fixedValueFvPatchField
|
||||
(
|
||||
const fixedValueFvPatchField<Type>&,
|
||||
const DimensionedField<Type, volMesh>&
|
||||
const fixedValueFvPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
fixedValueFvPatchField(const fixedValueFvPatchField<Type>& pfld)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Return a clone
|
||||
virtual tmp<fvPatchField<Type>> clone() const
|
||||
{
|
||||
@ -199,6 +210,7 @@ public:
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Disable assignment operators
|
||||
virtual void operator=(const UList<Type>&) {}
|
||||
|
||||
virtual void operator=(const fvPatchField<Type>&) {}
|
||||
|
||||
@ -0,0 +1,136 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zeroValueFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFvPatchField<Type>::zeroValueFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFvPatchField<Type>::zeroValueFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFvPatchField<Type>::zeroValueFvPatchField
|
||||
(
|
||||
const zeroValueFvPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper&
|
||||
)
|
||||
:
|
||||
// Field is zero. No mapping
|
||||
parent_bctype(pfld, p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFvPatchField<Type>::zeroValueFvPatchField
|
||||
(
|
||||
const zeroValueFvPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(pfld, pfld.patch(), iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFvPatchField<Type>::valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
// No contribution from internal values
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFvPatchField<Type>::valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
// Patch field is zero
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFvPatchField<Type>::gradientInternalCoeffs() const
|
||||
{
|
||||
return -pTraits<Type>::one*this->patch().deltaCoeffs();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFvPatchField<Type>::gradientBoundaryCoeffs() const
|
||||
{
|
||||
// Patch field is zero
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::zeroValueFvPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<Type>::write(os);
|
||||
// Without writeValueEntry() since the value == zero
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,226 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::zeroValueFvPatchField
|
||||
|
||||
Group
|
||||
grpGenericBoundaryConditions
|
||||
|
||||
Description
|
||||
Specifies a zero fixed value boundary condition.
|
||||
|
||||
Usage
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
<patchName>
|
||||
{
|
||||
type zeroValue;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
zeroValueFvPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_zeroValueFvPatchField_H
|
||||
#define Foam_zeroValueFvPatchField_H
|
||||
|
||||
#include "fixedValueFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class zeroValueFvPatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class zeroValueFvPatchField
|
||||
:
|
||||
public fixedValueFvPatchField<Type>
|
||||
{
|
||||
//- The parent boundary condition type
|
||||
typedef fixedValueFvPatchField<Type> parent_bctype;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("zeroValue");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
zeroValueFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
zeroValueFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Copy construct onto a new patch (no mapping needed)
|
||||
zeroValueFvPatchField
|
||||
(
|
||||
const zeroValueFvPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
zeroValueFvPatchField
|
||||
(
|
||||
const zeroValueFvPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
zeroValueFvPatchField(const zeroValueFvPatchField<Type>& pfld)
|
||||
:
|
||||
zeroValueFvPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchField<Type>> clone() const
|
||||
{
|
||||
return tmp<fvPatchField<Type>>
|
||||
(
|
||||
new zeroValueFvPatchField<Type>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchField<Type>> clone
|
||||
(
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchField<Type>>
|
||||
(
|
||||
new zeroValueFvPatchField<Type>(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- True: this patch field fixes a value.
|
||||
virtual bool fixesValue() const { return true; }
|
||||
|
||||
//- False: this patch field is not altered by assignment.
|
||||
virtual bool assignable() const { return false; }
|
||||
|
||||
//- Write (without "value" entry)
|
||||
virtual void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Evaluation Functions
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
//- evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
//- evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
//- evaluation of the gradient of this patchField
|
||||
virtual tmp<Field<Type>> gradientInternalCoeffs() const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
//- evaluation of the gradient of this patchField
|
||||
virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Disable assignment operators
|
||||
virtual void operator=(const UList<Type>&) {}
|
||||
|
||||
virtual void operator=(const fvPatchField<Type>&) {}
|
||||
virtual void operator+=(const fvPatchField<Type>&) {}
|
||||
virtual void operator-=(const fvPatchField<Type>&) {}
|
||||
virtual void operator*=(const fvPatchField<scalar>&) {}
|
||||
virtual void operator/=(const fvPatchField<scalar>&) {}
|
||||
|
||||
virtual void operator+=(const Field<Type>&) {}
|
||||
virtual void operator-=(const Field<Type>&) {}
|
||||
|
||||
virtual void operator*=(const Field<scalar>&) {}
|
||||
virtual void operator/=(const Field<scalar>&) {}
|
||||
|
||||
virtual void operator=(const Type&) {}
|
||||
virtual void operator+=(const Type&) {}
|
||||
virtual void operator-=(const Type&) {}
|
||||
virtual void operator*=(const scalar) {}
|
||||
virtual void operator/=(const scalar) {}
|
||||
|
||||
|
||||
// Disable forced assignment operators
|
||||
virtual void operator==(const fvPatchField<Type>&) {}
|
||||
virtual void operator==(const Field<Type>&) {}
|
||||
virtual void operator==(const Type&) {}
|
||||
|
||||
// Prevent automatic comparison rewriting (c++20)
|
||||
bool operator!=(const fvPatchField<Type>&) const = delete;
|
||||
bool operator!=(const Field<Type>&) const = delete;
|
||||
bool operator!=(const Type&) const = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "zeroValueFvPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zeroValueFvPatchFields.H"
|
||||
#include "volFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchFields(zeroValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_zeroValueFvPatchFields_H
|
||||
#define Foam_zeroValueFvPatchFields_H
|
||||
|
||||
#include "zeroValueFvPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(zeroValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -37,7 +37,8 @@ Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(p, iF, Zero)
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Zero)
|
||||
{}
|
||||
|
||||
|
||||
@ -48,7 +49,8 @@ Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(p, iF, Zero)
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Zero)
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
}
|
||||
@ -56,32 +58,25 @@ Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
|
||||
|
||||
Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
|
||||
(
|
||||
const noSlipFvPatchVectorField& ptf,
|
||||
const noSlipFvPatchVectorField& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
const fvPatchFieldMapper&
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(p, iF, Zero)
|
||||
// Field is zero. No mapping
|
||||
parent_bctype(pfld, p, iF, Zero)
|
||||
{}
|
||||
|
||||
|
||||
Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
|
||||
(
|
||||
const noSlipFvPatchVectorField& mwvpvf
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(mwvpvf)
|
||||
{}
|
||||
|
||||
|
||||
Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
|
||||
(
|
||||
const noSlipFvPatchVectorField& mwvpvf,
|
||||
const noSlipFvPatchVectorField& pfld,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(mwvpvf, iF)
|
||||
// Field is zero
|
||||
parent_bctype(pfld, pfld.patch(), iF, Zero)
|
||||
{}
|
||||
|
||||
|
||||
@ -90,6 +85,7 @@ Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
|
||||
void Foam::noSlipFvPatchVectorField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<vector>::write(os);
|
||||
// Without writeValueEntry() since the value == zero
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -30,27 +30,28 @@ Group
|
||||
grpWallBoundaryConditions
|
||||
|
||||
Description
|
||||
This boundary condition fixes the velocity to zero at walls.
|
||||
This boundary condition fixes the velocity to zero (eg, at walls).
|
||||
|
||||
Usage
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
<patchName>
|
||||
{
|
||||
type noSlip;
|
||||
type noSlip;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
See also
|
||||
Foam::fixedValueFvPatchVectorField
|
||||
Foam::zeroValueFvPatchVectorField
|
||||
|
||||
SourceFiles
|
||||
noSlipFvPatchVectorField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef noSlipFvPatchVectorField_H
|
||||
#define noSlipFvPatchVectorField_H
|
||||
#ifndef Foam_noSlipFvPatchVectorField_H
|
||||
#define Foam_noSlipFvPatchVectorField_H
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
|
||||
@ -60,13 +61,15 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class noSlipFvPatchVectorField Declaration
|
||||
Class noSlipFvPatchVectorField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class noSlipFvPatchVectorField
|
||||
:
|
||||
public fixedValueFvPatchVectorField
|
||||
{
|
||||
//- The parent boundary condition type
|
||||
typedef fixedValueFvPatchVectorField parent_bctype;
|
||||
|
||||
public:
|
||||
|
||||
@ -92,7 +95,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct by mapping given noSlipFvPatchVectorField
|
||||
// onto a new patch
|
||||
//- onto a new patch
|
||||
noSlipFvPatchVectorField
|
||||
(
|
||||
const noSlipFvPatchVectorField&,
|
||||
@ -101,18 +104,19 @@ public:
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
//- Copy construct with internal field reference
|
||||
noSlipFvPatchVectorField
|
||||
(
|
||||
const noSlipFvPatchVectorField&
|
||||
const noSlipFvPatchVectorField& pfld,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
noSlipFvPatchVectorField
|
||||
(
|
||||
const noSlipFvPatchVectorField&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
//- Copy construct
|
||||
noSlipFvPatchVectorField(const noSlipFvPatchVectorField& pfld)
|
||||
:
|
||||
noSlipFvPatchVectorField(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Return a clone
|
||||
virtual tmp<fvPatchField<vector>> clone() const
|
||||
@ -130,7 +134,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
// Member Functions
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
@ -187,12 +187,15 @@ Foam::fvPatchField<Type>::fvPatchField
|
||||
template<class Type>
|
||||
Foam::fvPatchField<Type>::fvPatchField
|
||||
(
|
||||
const fvPatchField<Type>& ptf
|
||||
const fvPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
fvPatchFieldBase(ptf),
|
||||
Field<Type>(ptf),
|
||||
internalField_(ptf.internalField_)
|
||||
fvPatchFieldBase(pfld, p),
|
||||
Field<Type>(p.size(), value),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -169,6 +169,12 @@ public:
|
||||
return Foam::fieldTypes::zeroGradientType;
|
||||
}
|
||||
|
||||
//- The type name for \c zeroValue patch fields
|
||||
static const word& zeroValueType() noexcept
|
||||
{
|
||||
return Foam::fieldTypes::zeroValueType;
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -455,16 +461,30 @@ public:
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
fvPatchField(const fvPatchField<Type>&);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
//- Copy construct onto a new patch with internal field reference
|
||||
//- and specified value
|
||||
fvPatchField
|
||||
(
|
||||
const fvPatchField<Type>&,
|
||||
const DimensionedField<Type, volMesh>&
|
||||
const fvPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
fvPatchField
|
||||
(
|
||||
const fvPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
fvPatchField(const fvPatchField<Type>& pfld)
|
||||
:
|
||||
fvPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Clone patch field with its own internal field reference
|
||||
virtual tmp<fvPatchField<Type>> clone() const
|
||||
{
|
||||
@ -673,7 +693,7 @@ public:
|
||||
// evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueInternalCoeffs
|
||||
(
|
||||
const tmp<Field<scalar>>&
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
@ -684,7 +704,7 @@ public:
|
||||
// evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<Field<scalar>>&
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2024 OpenCFD Ltd.
|
||||
Copyright (C) 2024-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -82,21 +82,24 @@ Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
|
||||
template<class Type>
|
||||
Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
|
||||
(
|
||||
const fixedValueFvsPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, surfaceMesh>& iF
|
||||
const fixedValueFvsPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
fvsPatchField<Type>(ptf, iF)
|
||||
fvsPatchField<Type>(pfld, p, iF, value)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
|
||||
(
|
||||
const fixedValueFvsPatchField<Type>& ptf
|
||||
const fixedValueFvsPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, surfaceMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvsPatchField<Type>(ptf, ptf.internalField())
|
||||
fvsPatchField<Type>(pfld, iF)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -114,18 +114,30 @@ public:
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
//- Copy construct onto a new patch with internal field reference
|
||||
//- and specified value
|
||||
fixedValueFvsPatchField
|
||||
(
|
||||
const fixedValueFvsPatchField<Type>&
|
||||
const fixedValueFvsPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
fixedValueFvsPatchField
|
||||
(
|
||||
const fixedValueFvsPatchField<Type>&,
|
||||
const DimensionedField<Type, surfaceMesh>&
|
||||
const fixedValueFvsPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, surfaceMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
fixedValueFvsPatchField(const fixedValueFvsPatchField<Type>& pfld)
|
||||
:
|
||||
fixedValueFvsPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Return clone
|
||||
virtual tmp<fvsPatchField<Type>> clone() const
|
||||
{
|
||||
|
||||
@ -0,0 +1,136 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zeroValueFvsPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFvsPatchField<Type>::zeroValueFvsPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFvsPatchField<Type>::zeroValueFvsPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(p, iF, Type(Zero))
|
||||
{
|
||||
fvsPatchFieldBase::readDict(dict);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFvsPatchField<Type>::zeroValueFvsPatchField
|
||||
(
|
||||
const zeroValueFvsPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF,
|
||||
const fvPatchFieldMapper&
|
||||
)
|
||||
:
|
||||
// Field is zero. No mapping
|
||||
parent_bctype(pfld, p, iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::zeroValueFvsPatchField<Type>::zeroValueFvsPatchField
|
||||
(
|
||||
const zeroValueFvsPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, surfaceMesh>& iF
|
||||
)
|
||||
:
|
||||
// Field is zero
|
||||
parent_bctype(pfld, pfld.patch(), iF, Type(Zero))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFvsPatchField<Type>::valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
// No contribution from internal values
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFvsPatchField<Type>::valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
// Patch field is zero
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFvsPatchField<Type>::gradientInternalCoeffs() const
|
||||
{
|
||||
return -pTraits<Type>::one*this->patch().deltaCoeffs();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::zeroValueFvsPatchField<Type>::gradientBoundaryCoeffs() const
|
||||
{
|
||||
// Patch field is zero
|
||||
return tmp<Field<Type>>::New(this->size(), Foam::zero{});
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::zeroValueFvsPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvsPatchField<Type>::write(os);
|
||||
// Without writeValueEntry() since the value == zero
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,217 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::zeroValueFvsPatchField
|
||||
|
||||
Description
|
||||
Specifies a zero fixed value boundary condition.
|
||||
|
||||
Usage
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
<patchName>
|
||||
{
|
||||
type zeroValue;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
zeroValueFvsPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_zeroValueFvsPatchField_H
|
||||
#define Foam_zeroValueFvsPatchField_H
|
||||
|
||||
#include "fixedValueFvsPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class zeroValueFvsPatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class zeroValueFvsPatchField
|
||||
:
|
||||
public fixedValueFvsPatchField<Type>
|
||||
{
|
||||
//- The parent boundary condition type
|
||||
typedef fixedValueFvsPatchField<Type> parent_bctype;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("zeroValue");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
zeroValueFvsPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
zeroValueFvsPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Copy construct onto a new patch (no mapping needed)
|
||||
zeroValueFvsPatchField
|
||||
(
|
||||
const zeroValueFvsPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Copy construct with internal field reference
|
||||
zeroValueFvsPatchField
|
||||
(
|
||||
const zeroValueFvsPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, surfaceMesh>& iF
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
zeroValueFvsPatchField(const zeroValueFvsPatchField<Type>& pfld)
|
||||
:
|
||||
zeroValueFvsPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Return clone
|
||||
virtual tmp<fvsPatchField<Type>> clone() const
|
||||
{
|
||||
return fvsPatchField<Type>::Clone(*this);
|
||||
}
|
||||
|
||||
//- Clone with an internal field reference
|
||||
virtual tmp<fvsPatchField<Type>> clone
|
||||
(
|
||||
const DimensionedField<Type, surfaceMesh>& iF
|
||||
) const
|
||||
{
|
||||
return fvsPatchField<Type>::Clone(*this, iF);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- True: this patch field fixes a value.
|
||||
virtual bool fixesValue() const { return true; }
|
||||
|
||||
//- False: this patch field is not altered by assignment.
|
||||
virtual bool assignable() const { return false; }
|
||||
|
||||
//- Write (without "value" entry)
|
||||
virtual void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Evaluation Functions
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
//- evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
//- evaluation of the value of this patchField with given weights
|
||||
virtual tmp<Field<Type>> valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
//- evaluation of the gradient of this patchField
|
||||
virtual tmp<Field<Type>> gradientInternalCoeffs() const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
//- evaluation of the gradient of this patchField
|
||||
virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Disable assignment operators
|
||||
virtual void operator=(const UList<Type>&) {}
|
||||
|
||||
virtual void operator=(const fvsPatchField<Type>&) {}
|
||||
virtual void operator+=(const fvsPatchField<Type>&) {}
|
||||
virtual void operator-=(const fvsPatchField<Type>&) {}
|
||||
virtual void operator*=(const fvsPatchField<scalar>&) {}
|
||||
virtual void operator/=(const fvsPatchField<scalar>&) {}
|
||||
|
||||
virtual void operator+=(const Field<Type>&) {}
|
||||
virtual void operator-=(const Field<Type>&) {}
|
||||
|
||||
virtual void operator*=(const Field<scalar>&) {}
|
||||
virtual void operator/=(const Field<scalar>&) {}
|
||||
|
||||
virtual void operator=(const Type&) {}
|
||||
virtual void operator+=(const Type&) {}
|
||||
virtual void operator-=(const Type&) {}
|
||||
virtual void operator*=(const scalar) {}
|
||||
virtual void operator/=(const scalar) {}
|
||||
|
||||
|
||||
// Disable forced assignment operators
|
||||
virtual void operator==(const fvsPatchField<Type>&) {}
|
||||
virtual void operator==(const Field<Type>&) {}
|
||||
virtual void operator==(const Type&) {}
|
||||
|
||||
// Prevent automatic comparison rewriting (c++20)
|
||||
bool operator!=(const fvPatchField<Type>&) const = delete;
|
||||
bool operator!=(const Field<Type>&) const = delete;
|
||||
bool operator!=(const Type&) const = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "zeroValueFvsPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "zeroValueFvsPatchFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeFvsPatchFields(zeroValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_zeroValueFvsPatchFields_H
|
||||
#define Foam_zeroValueFvsPatchFields_H
|
||||
|
||||
#include "zeroValueFvsPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeFvsPatchTypeFieldTypedefs(zeroValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -155,23 +155,29 @@ Foam::fvsPatchField<Type>::fvsPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fvsPatchField<Type>::fvsPatchField(const fvsPatchField<Type>& ptf)
|
||||
Foam::fvsPatchField<Type>::fvsPatchField
|
||||
(
|
||||
const fvsPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF,
|
||||
const Type& value
|
||||
)
|
||||
:
|
||||
fvsPatchFieldBase(ptf),
|
||||
Field<Type>(ptf),
|
||||
internalField_(ptf.internalField_)
|
||||
fvsPatchFieldBase(pfld, p),
|
||||
Field<Type>(p.size(), value),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::fvsPatchField<Type>::fvsPatchField
|
||||
(
|
||||
const fvsPatchField<Type>& ptf,
|
||||
const fvsPatchField<Type>& pfld,
|
||||
const DimensionedField<Type, surfaceMesh>& iF
|
||||
)
|
||||
:
|
||||
fvsPatchFieldBase(ptf),
|
||||
Field<Type>(ptf),
|
||||
fvsPatchFieldBase(pfld),
|
||||
Field<Type>(pfld),
|
||||
internalField_(iF)
|
||||
{}
|
||||
|
||||
|
||||
@ -139,6 +139,12 @@ public:
|
||||
return Foam::fieldTypes::calculatedType;
|
||||
}
|
||||
|
||||
//- The type name for \c zeroValue patch fields
|
||||
static const word& zeroValueType() noexcept
|
||||
{
|
||||
return Foam::fieldTypes::zeroValueType;
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -398,16 +404,30 @@ public:
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
fvsPatchField(const fvsPatchField<Type>&);
|
||||
//- Construct onto new patch with internal field reference
|
||||
//- and specified value
|
||||
fvsPatchField
|
||||
(
|
||||
const fvsPatchField<Type>& pfld,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, surfaceMesh>& iF,
|
||||
const Type& value
|
||||
);
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
//- Copy construct with internal field reference
|
||||
fvsPatchField
|
||||
(
|
||||
const fvsPatchField<Type>&,
|
||||
const DimensionedField<Type, surfaceMesh>&
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
fvsPatchField(const fvsPatchField<Type>& pfld)
|
||||
:
|
||||
fvsPatchField<Type>(pfld, pfld.internalField())
|
||||
{}
|
||||
|
||||
|
||||
//- Clone patch field with its own internal field reference
|
||||
virtual tmp<fvsPatchField<Type>> clone() const
|
||||
{
|
||||
@ -541,42 +561,40 @@ public:
|
||||
);
|
||||
|
||||
|
||||
// Evaluation Functions
|
||||
// Evaluation Functions
|
||||
|
||||
//- Initialise the evaluation of the patch field
|
||||
virtual void initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
//- Initialise the evaluation of the patch field
|
||||
virtual void initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
//- Evaluate the patch field, sets Updated to false
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
//- Evaluate the patch field, sets Updated to false
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
//- Initialise the evaluation of the patch field after a local
|
||||
// operation
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
//- Initialise the evaluation of the patch field after a local
|
||||
// operation
|
||||
virtual void initEvaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
//- Evaluate the patch field after a local operation (e.g. *=)
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType =
|
||||
Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
//- Evaluate the patch field after a local operation (e.g. *=)
|
||||
virtual void evaluateLocal
|
||||
(
|
||||
const Pstream::commsTypes commsType = Pstream::commsTypes::buffered
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// Other
|
||||
|
||||
//- Write the patch "type"
|
||||
virtual void write(Ostream& os) const;
|
||||
|
||||
|
||||
@ -33,7 +33,6 @@ externalDisplacementMeshMover/externalDisplacementMeshMover.C
|
||||
externalDisplacementMeshMover/medialAxisMeshMover.C
|
||||
externalDisplacementMeshMover/displacementMotionSolverMeshMover.C
|
||||
/* externalDisplacementMeshMover/pointSmoothingMeshMover.C */
|
||||
externalDisplacementMeshMover/zeroFixedValue/zeroFixedValuePointPatchFields.C
|
||||
externalDisplacementMeshMover/fieldSmoother/fieldSmoother.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libsnappyHexMesh
|
||||
|
||||
@ -28,7 +28,7 @@ License
|
||||
|
||||
#include "externalDisplacementMeshMover.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "zeroFixedValuePointPatchFields.H"
|
||||
#include "zeroValuePointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -50,20 +50,16 @@ Foam::labelList Foam::externalDisplacementMeshMover::getFixedValueBCs
|
||||
|
||||
forAll(field.boundaryField(), patchI)
|
||||
{
|
||||
const pointPatchField<vector>& patchField =
|
||||
field.boundaryField()[patchI];
|
||||
const auto& patchField = field.boundaryField()[patchI];
|
||||
|
||||
if (isA<valuePointPatchField<vector>>(patchField))
|
||||
if (isA<zeroValuePointPatchField<vector>>(patchField))
|
||||
{
|
||||
if (isA<zeroFixedValuePointPatchField<vector>>(patchField))
|
||||
{
|
||||
// Special condition of fixed boundary condition. Does not
|
||||
// get adapted
|
||||
}
|
||||
else
|
||||
{
|
||||
adaptPatchIDs.append(patchI);
|
||||
}
|
||||
// Special condition of fixed boundary condition. Does not
|
||||
// get adapted
|
||||
}
|
||||
else if (isA<valuePointPatchField<vector>>(patchField))
|
||||
{
|
||||
adaptPatchIDs.append(patchI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ License
|
||||
#include "PatchTools.H"
|
||||
#include "OBJstream.H"
|
||||
#include "PointData.H"
|
||||
#include "zeroFixedValuePointPatchFields.H"
|
||||
#include "zeroValuePointPatchFields.H"
|
||||
#include "pointSet.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -34,7 +34,7 @@ Description
|
||||
|
||||
This fraction is then used to scale the motion. Use
|
||||
- fixedValue on all moving patches
|
||||
- zeroFixedValue on stationary patches
|
||||
- zeroValue on stationary patches
|
||||
- slip on all slipping patches
|
||||
Note that the fixedValue boundary conditions might be changed by this
|
||||
solver to enforce consistency and a valid resulting mesh.
|
||||
|
||||
@ -53,7 +53,7 @@ Description
|
||||
#include "PatchTools.H"
|
||||
#include "slipPointPatchFields.H"
|
||||
#include "fixedValuePointPatchFields.H"
|
||||
#include "zeroFixedValuePointPatchFields.H"
|
||||
#include "zeroValuePointPatchFields.H"
|
||||
#include "calculatedPointPatchFields.H"
|
||||
#include "cyclicSlipPointPatchFields.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
@ -1148,8 +1148,7 @@ Foam::snappyLayerDriver::makeLayerDisplacementField
|
||||
// >0 layers: fixedValue which gets adapted
|
||||
if (numLayers[patchi] == 0)
|
||||
{
|
||||
patchFieldTypes[patchi] =
|
||||
zeroFixedValuePointPatchVectorField::typeName;
|
||||
patchFieldTypes[patchi] = zeroValuePointPatchVectorField::typeName;
|
||||
}
|
||||
else if (numLayers[patchi] > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user