exprFixedValueFvPatchField.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) 2019-2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::exprFixedValueFvPatchField
28 
29 Description
30  A fixed value boundary condition with expressions.
31 
32 Usage
33  \table
34  Property | Description | Required | Default
35  value | fixed value | yes |
36  valueExpr | expression for uniformValue | yes |
37  \endtable
38 
39 Note
40  Can also just use uniformFixedValueFvPatchField with an expression
41  for the PatchFunction1.
42 
43 SourceFiles
44  exprFixedValueFvPatchField.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef exprFixedValueFvPatchField_H
49 #define exprFixedValueFvPatchField_H
50 
51 #include "fixedValueFvPatchField.H"
52 #include "patchExprFieldBase.H"
53 #include "patchExprDriver.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class exprFixedValueFvPatchField Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Type>
65 class exprFixedValueFvPatchField
66 :
67  public fixedValueFvPatchField<Type>,
68  public expressions::patchExprFieldBase
69 {
70  //- The parent boundary condition type
71  typedef fixedValueFvPatchField<Type> parent_bctype;
72 
73 
74 protected:
75 
76  // Protected Data
77 
78  //- Dictionary contents for the boundary condition
80 
81  //- The expression driver
83 
84 
85  // Protected Member Functions
86 
87  //- Set debug ON if "debug" is enabled
88  void setDebug();
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("exprFixedValue");
95 
96 
97  // Constructors
98 
99  //- Construct from patch and internal field
101  (
102  const fvPatch& p,
104  );
105 
106  //- Construct from patch, internal field and dictionary
108  (
109  const fvPatch&,
111  const dictionary& dict,
112  const bool valueRequired=true
113  );
114 
115  //- Construct by mapping onto a new patch
117  (
119  const fvPatch&,
121  const fvPatchFieldMapper&
122  );
123 
124  //- Construct as copy
126  (
128  );
129 
130 
131  //- Construct and return a clone
132  virtual tmp<fvPatchField<Type>> clone() const
133  {
134  return tmp<fvPatchField<Type>>
135  (
137  );
138  }
139 
140  //- Construct as copy setting internal field reference
142  (
145  );
146 
147  //- Construct and return a clone setting internal field reference
149  (
151  ) const
152  {
153  return tmp<fvPatchField<Type>>
154  (
155  new exprFixedValueFvPatchField<Type>(*this, iF)
156  );
157  }
158 
159 
160  // Member Functions
161 
162  //- Update the coefficients associated with the patch field
163  virtual void updateCoeffs();
164 
165  //- Write
166  virtual void write(Ostream& os) const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #ifdef NoRepository
178 #endif
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
patchExprDriver.H
Foam::exprFixedValueFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: exprFixedValueFvPatchField.H:146
Foam::exprFixedValueFvPatchField::exprFixedValueFvPatchField
exprFixedValueFvPatchField(const fvPatch &p, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: exprFixedValueFvPatchField.C:48
patchExprFieldBase.H
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
Foam::exprFixedValueFvPatchField::write
virtual void write(Ostream &os) const
Write.
Definition: exprFixedValueFvPatchField.C:226
Foam::expressions::patchExprFieldBase
Base class for managing patches with expressions. The expected input supports value,...
Definition: patchExprFieldBase.H:83
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::exprFixedValueFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: exprFixedValueFvPatchField.C:187
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::expressions::patchExpr::parseDriver
Driver for patch expressions.
Definition: patchExprDriver.H:159
Foam::exprFixedValueFvPatchField::driver_
expressions::patchExpr::parseDriver driver_
The expression driver.
Definition: exprFixedValueFvPatchField.H:96
Foam::exprFixedValueFvPatchField
A fixed value boundary condition with expressions.
Definition: exprFixedValueFvPatchField.H:79
exprFixedValueFvPatchField.C
Foam::exprFixedValueFvPatchField::dict_
dictionary dict_
Dictionary contents for the boundary condition.
Definition: exprFixedValueFvPatchField.H:93
fixedValueFvPatchField.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::exprFixedValueFvPatchField::TypeName
TypeName("exprFixedValue")
Runtime type information.
Foam::exprFixedValueFvPatchField::setDebug
void setDebug()
Set debug ON if "debug" is enabled.
Definition: exprFixedValueFvPatchField.C:35
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54