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 assmued
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  Example of the boundary condition specification:
40  \verbatim
41  <patchName>
42  {
43  type calculated;
44  value uniform (0 0 0); // Required value entry
45  }
46  \endverbatim
47 
48 SourceFiles
49  calculatedFvPatchField.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef Foam_calculatedFvPatchField_H
54 #define Foam_calculatedFvPatchField_H
55 
56 #include "fvPatchField.H"
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class calculatedFvPatchField Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 template<class Type>
69 :
70  public fvPatchField<Type>
71 {
72 public:
73 
74  //- Runtime type information
75  TypeName("calculated"); // fieldTypes::calculatedTypeName_()
76 
77 
78  // Constructors
79 
80  //- Construct from patch and internal field
82  (
83  const fvPatch&,
85  );
86 
87  //- Construct from patch, internal field and dictionary
89  (
90  const fvPatch&,
92  const dictionary&,
94  );
95 
96  //- Compatibility (prefer with readOption)
98  (
99  const fvPatch& p,
101  const dictionary& dict,
102  const bool valueReqd
103  )
104  :
106  (
107  p, iF, dict,
108  (valueReqd? IOobjectOption::MUST_READ : IOobjectOption::NO_READ)
109  )
110  {}
111 
112  //- Construct by mapping given patch field onto a new patch
114  (
116  const fvPatch&,
118  const fvPatchFieldMapper&
119  );
120 
121  //- Construct as copy
123  (
125  );
126 
127  //- Construct and return a clone
128  virtual tmp<fvPatchField<Type>> clone() const
129  {
130  return tmp<fvPatchField<Type>>
131  (
133  );
134  }
135 
136  //- Construct as copy setting internal field reference
138  (
141  );
142 
143  //- Construct and return a clone setting internal field reference
145  (
147  ) const
148  {
149  return tmp<fvPatchField<Type>>
150  (
151  new calculatedFvPatchField<Type>(*this, iF)
152  );
153  }
154 
155 
156  // Member Functions
157 
158  //- True: this patch field fixes a value.
159  virtual bool fixesValue() const { return true; }
160 
161 
162  // Evaluation functions
163 
164  //- Return the matrix diagonal coefficients corresponding to the
165  // evaluation of the value of this patchField with given weights
167  (
168  const tmp<scalarField>&
169  ) const;
170 
171  //- Return the matrix source coefficients corresponding to the
172  // evaluation of the value of this patchField with given weights
174  (
175  const tmp<scalarField>&
176  ) const;
177 
178  //- Return the matrix diagonal coefficients corresponding to the
179  // evaluation of the gradient of this patchField
181 
182  //- Return the matrix source coefficients corresponding to the
183  // evaluation of the gradient of this patchField
185 
186 
187  //- Write
188  virtual void write(Ostream&) const;
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #ifdef NoRepository
199  #include "calculatedFvPatchField.C"
200 #endif
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
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
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
A FieldMapper for finite-volume patch fields.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
This boundary condition is not designed to be evaluated; it is assmued 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...
Definition: areaFieldsFwd.H:42
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
readOption
Enumeration defining read preferences.