Loading...
Searching...
No Matches
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
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 const bool needValue = true
167 );
168
169 //- Construct by mapping given porousBafflePressureFvPatchField
170 //- onto a new patch
172 (
174 const fvPatch&,
175 const DimensionedField<scalar, volMesh>&,
176 const fvPatchFieldMapper&
177 );
178
179 //- Construct as copy
181 (
183 );
184
185 //- Construct as copy setting internal field reference
187 (
189 const DimensionedField<scalar, volMesh>&
190 );
191
192 //- Return a clone
193 virtual tmp<fvPatchField<scalar>> clone() const
194 {
195 return fvPatchField<scalar>::Clone(*this);
196 }
197
198 //- Clone with an internal field reference
199 virtual tmp<fvPatchField<scalar>> clone
200 (
201 const DimensionedField<scalar, volMesh>& iF
202 ) const
204 return fvPatchField<scalar>::Clone(*this, iF);
205 }
206
207
208 // Member Functions
209
210 // Evaluation
211
212 //- Update the coefficients associated with the patch field
213 virtual void updateCoeffs();
214
215 // I-O
216
217 //- Write
218 virtual void write(Ostream&) const;
219};
220
221
222// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223
224} // End namespace Foam
225
226// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227
228#endif
229
230// ************************************************************************* //
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:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition provides a jump condition, using the cyclic condition as a base.
fixedJumpFvPatchField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
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
Clone with an internal field reference.
virtual tmp< fvPatchField< scalar > > clone() const
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:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68