exprMixedFvPatchField.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::exprMixedFvPatchField
29 
30 Description
31  A mixed boundary condition with expressions.
32 
33 Usage
34  \table
35  Property | Description | Required | Default
36  valueExpr | expression for fixed value | no | 0
37  gradientExpr | expression for patch normal gradient | no | 0
38  fractionExpr | expression for value weighting | no | 1
39  \endtable
40 
41 SourceFiles
42  exprMixedFvPatchField.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef exprMixedFvPatchField_H
47 #define exprMixedFvPatchField_H
48 
49 #include "mixedFvPatchField.H"
50 #include "patchExprFieldBase.H"
51 #include "patchExprDriver.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class exprMixedFvPatchField Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class Type>
63 class exprMixedFvPatchField
64 :
65  public mixedFvPatchField<Type>,
66  public expressions::patchExprFieldBase
67 {
68 protected:
69 
70  // Protected Data
71 
72  //- The expression driver
73  expressions::patchExpr::parseDriver driver_;
74 
75 
76  // Protected Member Functions
77 
78  //- Set debug ON if "debug" is enabled
79  void setDebug();
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("exprMixed");
86 
87 
88  // Constructors
89 
90  //- Construct from patch and internal field
92  (
93  const fvPatch& p,
95  );
96 
97  //- Construct from patch, internal field and dictionary
99  (
100  const fvPatch&,
102  const dictionary& dict
103  );
104 
105  //- Construct by mapping given exprMixedFvPatchField onto a new patch
107  (
109  const fvPatch&,
111  const fvPatchFieldMapper&
112  );
113 
114  //- Construct as copy
116  (
118  );
119 
120  //- Construct and return a clone
121  virtual tmp<fvPatchField<Type>> clone() const
122  {
123  return tmp<fvPatchField<Type>>
124  (
125  new exprMixedFvPatchField<Type>(*this)
126  );
127  }
128 
129  //- Construct as copy setting internal field reference
131  (
134  );
135 
136  //- Construct and return a clone setting internal field reference
137  virtual tmp<fvPatchField<Type> > clone
138  (
140  ) const
141  {
142  return tmp<fvPatchField<Type>>
143  (
144  new exprMixedFvPatchField<Type>(*this, iF)
145  );
146  }
147 
148 
149  // Member Functions
150 
151  //- Update the coefficients associated with the patch field
152  virtual void updateCoeffs();
153 
154  //- Write
155  virtual void write(Ostream& os) const;
156 };
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #ifdef NoRepository
165  #include "exprMixedFvPatchField.C"
166 #endif
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::exprMixedFvPatchField::write
virtual void write(Ostream &os) const
Write.
Definition: exprMixedFvPatchField.C:300
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
patchExprDriver.H
Foam::exprMixedFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: exprMixedFvPatchField.H:140
Foam::exprMixedFvPatchField::exprMixedFvPatchField
exprMixedFvPatchField(const fvPatch &p, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: exprMixedFvPatchField.C:46
mixedFvPatchField.H
patchExprFieldBase.H
Foam::exprMixedFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: exprMixedFvPatchField.C:235
Foam::exprMixedFvPatchField::TypeName
TypeName("exprMixed")
Runtime type information.
Foam::exprMixedFvPatchField::driver_
expressions::patchExpr::parseDriver driver_
The expression driver.
Definition: exprMixedFvPatchField.H:92
Foam::expressions::patchExprFieldBase
Base class for managing patches with expressions. The expected input supports values,...
Definition: patchExprFieldBase.H:88
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
dict
dictionary dict
Definition: searchingEngine.H:14
exprMixedFvPatchField.C
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::mixedFvPatchField
This boundary condition provides a base class for 'mixed' type boundary conditions,...
Definition: mixedFvPatchField.H:123
Foam::exprMixedFvPatchField::setDebug
void setDebug()
Set debug ON if "debug" is enabled.
Definition: exprMixedFvPatchField.C:33
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::exprMixedFvPatchField
A mixed boundary condition with expressions.
Definition: exprMixedFvPatchField.H:82
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54