porousBafflePressureFvPatchField.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) 2016-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::porousBafflePressureFvPatchField
29
30Group
31 grpCoupledBoundaryConditions
32
33Description
34 This boundary condition provides a jump condition,
35 using the \c cyclic condition as a base.
36
37 The porous baffle introduces a pressure jump defined by:
38
39 \f[
40 \Delta p = -(D \mu U + 0.5 I \rho |U|^2 )L
41 \f]
42
43 where
44 \vartable
45 p | pressure [Pa]
46 \rho | density [kg/m3]
47 \mu | laminar viscosity [Pa s]
48 D | Darcy coefficient
49 I | inertial coefficient
50 L | porous media length in the flow direction
51 \endvartable
52
53Usage
54 Example of the boundary condition specification:
55 \verbatim
56 <patchName>
57 {
58 // Mandatory entries
59 type porousBafflePressure;
60 D 0.001;
61 I 1000000;
62 length 0.1;
63
64 // Optional entries
65 phi phi;
66 rho rho;
67 uniformJump false;
68 value uniform 0;
69
70 // Inherited entries
71 patchType cyclic;
72 jump uniform 0;
73 ...
74 }
75 \endverbatim
76
77 where the entries mean:
78 \table
79 Property | Description | Type | Reqd | Deflt
80 type | Type name: porousBafflePressure | word | yes | -
81 D | Darcy coefficient | Function1<scalar> | yes | -
82 I | Inertial coefficient | Function1<scalar> | yes | -
83 length | Porous media length in the flow direction <!--
84 --> | scalar | yes | -
85 uniformJump | Flag to apply a uniform pressure drop on <!--
86 --> the patch based on the | bool | no | false
87 phi | Name of flux field | word | no | phi
88 rho | Name of density field | word | no | rho
89 patchType | Underlying patch type should be \c cyclic | word | yes | -
90 jump | Jump value | scalarField | yes | -
91 \endtable
92
93 The inherited entries are elaborated in:
94 - \link fixedJumpFvPatchField.H \endlink
95 - \link Function1.H \endlink
96
97Note
98 The underlying \c patchType should be set to \c cyclic.
99
100SourceFiles
101 porousBafflePressureFvPatchField.C
102
103\*---------------------------------------------------------------------------*/
104
105#ifndef porousBafflePressureFvPatchField_H
106#define porousBafflePressureFvPatchField_H
107
109#include "Function1.H"
110
111// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112
113namespace Foam
114{
115
116/*---------------------------------------------------------------------------*\
117 Class porousBafflePressureFvPatchField Declaration
118\*---------------------------------------------------------------------------*/
119
120class porousBafflePressureFvPatchField
121:
122 public fixedJumpFvPatchField<scalar>
123{
124 // Private Data
125
126 //- Name of flux field (default = phi)
127 const word phiName_;
128
129 //- Name of density field (default = rho)
130 const word rhoName_;
131
132 //- Darcy pressure loss coefficient
133 autoPtr<Function1<scalar>> D_;
134
135 //- Inertia pressure lost coefficient
136 autoPtr<Function1<scalar>> I_;
137
138 //- Porous media length
139 scalar length_;
140
141 //- Aplies uniform pressure drop
142 bool uniformJump_;
143
144
145public:
146
147 //- Runtime type information
148 TypeName("porousBafflePressure");
149
150
151 // Constructors
152
153 //- Construct from patch and internal field
155 (
156 const fvPatch&,
157 const DimensionedField<scalar, volMesh>&
158 );
159
160 //- Construct from patch, internal field and dictionary
162 (
163 const fvPatch&,
164 const DimensionedField<scalar, volMesh>&,
165 const dictionary&
166 );
167
168 //- Construct by mapping given porousBafflePressureFvPatchField
169 //- onto a new patch
171 (
172 const porousBafflePressureFvPatchField&,
173 const fvPatch&,
174 const DimensionedField<scalar, volMesh>&,
175 const fvPatchFieldMapper&
176 );
177
178 //- Construct as copy
180 (
181 const porousBafflePressureFvPatchField&
182 );
183
184 //- Construct and return a clone
185 virtual tmp<fvPatchField<scalar>> clone() const
186 {
187 return tmp<fvPatchField<scalar>>
188 (
190 );
191 }
192
193 //- Construct as copy setting internal field reference
195 (
196 const porousBafflePressureFvPatchField&,
197 const DimensionedField<scalar, volMesh>&
198 );
199
200 //- Construct and return a clone setting internal field reference
201 virtual tmp<fvPatchField<scalar>> clone
202 (
203 const DimensionedField<scalar, volMesh>& iF
204 ) const
205 {
206 return tmp<fvPatchField<scalar>>
209 );
210 }
211
212
213 // Member Functions
214
215 // Evaluation
216
217 //- Update the coefficients associated with the patch field
218 virtual void updateCoeffs();
219
220 // I-O
221
222 //- Write
223 virtual void write(Ostream&) const;
224};
225
226
227// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228
229} // End namespace Foam
230
231// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232
233#endif
234
235// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition provides a jump condition, using the cyclic condition as a base.
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary condition provides a jump condition, using the cyclic condition as a base.
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual tmp< fvPatchField< scalar > > clone() const
Construct and return a clone.
TypeName("porousBafflePressure")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
porousBafflePressureFvPatchField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73