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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::calculatedFvPatchField
29 
30 Group
31  grpGenericBoundaryConditions
32 
33 Description
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 
38 Usage
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 
53 SourceFiles
54  calculatedFvPatchField.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef Foam_calculatedFvPatchField_H
59 #define Foam_calculatedFvPatchField_H
60 
61 #include "fvPatchField.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class calculatedFvPatchField Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 template<class Type>
73 class calculatedFvPatchField
74 :
75  public fvPatchField<Type>
76 {
77 public:
78 
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  {}
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
147  (
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;
169 
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 // ************************************************************************* //
dictionary dict
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
TypeName("calculated")
Runtime type information.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool fixesValue() const
True: this patch field fixes a value.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual void write(Ostream &) const
Write includes "value" entry.
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
A FieldMapper for finite-volume patch fields.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
calculatedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
readOption
Enumeration defining read preferences.