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  Original code Copyright (C) 2009-2018 Bernhard Gschaider
9  Copyright (C) 2019 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::exprFixedValueFvPatchField
29 
30 Description
31  A fixed value boundary condition with expressions.
32 
33 Usage
34  \table
35  Property | Description | Required | Default
36  value | fixed value | yes |
37  valueExpr | expression for fixed value | yes |
38  \endtable
39 
40 SourceFiles
41  exprFixedValueFvPatchField.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef exprFixedValueFvPatchField_H
46 #define exprFixedValueFvPatchField_H
47 
48 #include "fixedValueFvPatchField.H"
49 #include "patchExprFieldBase.H"
50 #include "patchExprDriver.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class exprFixedValueFvPatchField Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class Type>
62 class exprFixedValueFvPatchField
63 :
64  public fixedValueFvPatchField<Type>,
65  public expressions::patchExprFieldBase
66 {
67 protected:
68 
69  // Protected Data
70 
71  //- The expression driver
72  expressions::patchExpr::parseDriver driver_;
73 
74 
75  // Protected Member Functions
76 
77  //- Set debug ON if "debug" is enabled
78  void setDebug();
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("exprFixedValue");
85 
86 
87  // Constructors
88 
89  //- Construct from patch and internal field
91  (
92  const fvPatch& p,
94  );
95 
96  //- Construct from patch, internal field and dictionary
98  (
99  const fvPatch&,
101  const dictionary& dict,
102  const bool valueRequired=true
103  );
104 
105  //- Construct by mapping given exprFixedValueFvPatchField
106  //- onto a new patch
108  (
110  const fvPatch&,
112  const fvPatchFieldMapper&
113  );
114 
115  //- Construct as copy
117  (
119  );
120 
121 
122  //- Construct and return a clone
123  virtual tmp<fvPatchField<Type>> clone() const
124  {
125  return tmp<fvPatchField<Type>>
126  (
128  );
129  }
130 
131  //- Construct as copy setting internal field reference
133  (
136  );
137 
138  //- Construct and return a clone setting internal field reference
140  (
142  ) const
143  {
144  return tmp<fvPatchField<Type>>
145  (
146  new exprFixedValueFvPatchField<Type>(*this, iF)
147  );
148  }
149 
150 
151  // Member Functions
152 
153  //- Update the coefficients associated with the patch field
154  virtual void updateCoeffs();
155 
156  //- Write
157  virtual void write(Ostream& os) const;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #ifdef NoRepository
169 #endif
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
patchExprDriver.H
Foam::exprFixedValueFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: exprFixedValueFvPatchField.H:137
Foam::exprFixedValueFvPatchField::exprFixedValueFvPatchField
exprFixedValueFvPatchField(const fvPatch &p, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: exprFixedValueFvPatchField.C:47
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:206
Foam::expressions::patchExprFieldBase
Base class for managing patches with expressions. The expected input supports values,...
Definition: patchExprFieldBase.H:89
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:162
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::expressions::patchExpr::parseDriver
Driver for patch expressions.
Definition: patchExprDriver.H:140
Foam::exprFixedValueFvPatchField::driver_
expressions::patchExpr::parseDriver driver_
The expression driver.
Definition: exprFixedValueFvPatchField.H:86
Foam::exprFixedValueFvPatchField
A fixed value boundary condition with expressions.
Definition: exprFixedValueFvPatchField.H:76
exprFixedValueFvPatchField.C
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:34
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54