Loading...
Searching...
No Matches
calculatedFvPatchField.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::calculatedFvPatchField
29
30Group
31 grpGenericBoundaryConditions
32
33Description
34 This boundary condition is not designed to be evaluated; it is assumed
35 that the value is assigned via field assignment, and not via a call to
36 e.g. \c updateCoeffs or \c evaluate.
37
38Usage
39 \table
40 Property | Description | Required | Default
41 value | field value | yes |
42 \endtable
43
44 Example of the boundary condition specification:
45 \verbatim
46 <patchName>
47 {
48 type calculated;
49 value uniform (0 0 0); // Required value entry
50 }
51 \endverbatim
52
53SourceFiles
54 calculatedFvPatchField.C
55
56\*---------------------------------------------------------------------------*/
57
58#ifndef Foam_calculatedFvPatchField_H
59#define Foam_calculatedFvPatchField_H
60
61#include "fvPatchField.H"
62
63// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64
65namespace Foam
66{
67
68/*---------------------------------------------------------------------------*\
69 Class calculatedFvPatchField Declaration
70\*---------------------------------------------------------------------------*/
71
72template<class Type>
74:
75 public fvPatchField<Type>
76{
77public:
79 //- Runtime type information
80 TypeName("calculated"); // fieldTypes::calculatedTypeName_()
81
82
83 // Constructors
84
85 //- Construct from patch and internal field
87 (
88 const fvPatch&,
90 );
91
92 //- Construct from patch, internal field and dictionary
94 (
95 const fvPatch&,
97 const dictionary&,
99 );
100
101 //- Compatibility (prefer with readOption)
103 (
104 const fvPatch& p,
106 const dictionary& dict,
107 const bool needValue
108 )
109 :
111 (
112 p, iF, dict,
113 (needValue? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
114 )
115 {}
116
117 //- Construct by mapping given patch field onto a new patch
119 (
121 const fvPatch&,
123 const fvPatchFieldMapper&
124 );
125
126 //- Construct as copy
128 (
130 );
131
132 //- Construct as copy setting internal field reference
134 (
137 );
138
139 //- Return a clone
140 virtual tmp<fvPatchField<Type>> clone() const
141 {
142 return fvPatchField<Type>::Clone(*this);
143 }
144
145 //- Clone with an internal field reference
146 virtual tmp<fvPatchField<Type>> clone
147 (
148 const DimensionedField<Type, volMesh>& iF
149 ) const
150 {
151 return fvPatchField<Type>::Clone(*this, iF);
152 }
153
154
155 // Member Functions
156
157 //- True: this patch field fixes a value.
158 virtual bool fixesValue() const { return true; }
159
160
161 // Evaluation functions
162
163 //- Return the matrix diagonal coefficients corresponding to the
164 // evaluation of the value of this patchField with given weights
166 (
167 const tmp<scalarField>&
168 ) const;
170 //- Return the matrix source coefficients corresponding to the
171 // evaluation of the value of this patchField with given weights
173 (
174 const tmp<scalarField>&
175 ) const;
176
177 //- Return the matrix diagonal coefficients corresponding to the
178 // evaluation of the gradient of this patchField
180
181 //- Return the matrix source coefficients corresponding to the
182 // evaluation of the gradient of this patchField
184
185
186 //- Write includes "value" entry
187 virtual void write(Ostream&) const;
188};
189
190
191// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192
193} // End namespace Foam
194
195// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196
197#ifdef NoRepository
198 #include "calculatedFvPatchField.C"
199#endif
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203#endif
204
205// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
virtual bool fixesValue() const
True: this patch field fixes a value.
calculatedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
calculatedFvPatchField(const fvPatch &p, const DimensionedField< Type, volMesh > &iF, const dictionary &dict, const bool needValue)
Compatibility (prefer with readOption).
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
TypeName("calculated")
Runtime type information.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
volScalarField & p
Namespace for OpenFOAM.
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68