porousBafflePressureFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::porousBafflePressureFvPatchField
26 
27 Description
28  This boundary condition provides a jump condition, using the \c cyclic
29  condition as a base.
30 
31  The porous baffle introduces a pressure jump defined by:
32 
33  \f[
34  \Delta p = -(D \mu U + 0.5 I \rho |U|^2 )L
35  \f]
36 
37  where
38 
39  \vartable
40  p | pressure [Pa]
41  \rho | density [kg/m^3]
42  \mu | laminar viscosity [Pa s]
43  D | Darcy coefficient
44  I | inertial coefficient
45  L | porous media length in the flow direction
46  \endvartable
47 
48 
49 Usage
50  \table
51  Property | Description | Required | Default value
52  patchType | underlying patch type should be \c cyclic| yes |
53  phi | flux field name | no | phi
54  rho | density field name | no | rho
55  D | Darcy coefficient | yes |
56  I | inertial coefficient | yes |
57  length | porous media length in the flow direction | yes |
58  \endtable
59 
60  Example of the boundary condition specification:
61  \verbatim
62  <patchName>
63  {
64  type porousBafflePressure;
65  patchType cyclic;
66  jump uniform 0;
67  D 0.001;
68  I 1000000;
69  length 0.1;
70  value uniform 0;
71  }
72  \endverbatim
73 
74 Note
75  The underlying \c patchType should be set to \c cyclic
76 
77 SourceFiles
78  porousBafflePressureFvPatchField.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef porousBafflePressureFvPatchField_H
83 #define porousBafflePressureFvPatchField_H
84 
85 #include "fixedJumpFvPatchField.H"
86 
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89 namespace Foam
90 {
91 
92 /*---------------------------------------------------------------------------*\
93  Class porousBafflePressureFvPatchField Declaration
94 \*---------------------------------------------------------------------------*/
95 
96 class porousBafflePressureFvPatchField
97 :
98  public fixedJumpFvPatchField<scalar>
99 {
100  // Private Data
101 
102  //- Name of flux field (default = phi)
103  const word phiName_;
104 
105  //- Name of density field (default = rho)
106  const word rhoName_;
107 
108  //- Darcy pressure loss coefficient
109  scalar D_;
110 
111  //- Inertia pressure lost coefficient
112  scalar I_;
113 
114  //- Porous media length
115  scalar length_;
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("porousBafflePressure");
122 
123 
124  // Constructors
125 
126  //- Construct from patch and internal field
128  (
129  const fvPatch&,
130  const DimensionedField<scalar, volMesh>&
131  );
132 
133  //- Construct from patch, internal field and dictionary
135  (
136  const fvPatch&,
137  const DimensionedField<scalar, volMesh>&,
138  const dictionary&
139  );
140 
141  //- Construct by mapping given porousBafflePressureFvPatchField
142  // onto a new patch
144  (
146  const fvPatch&,
147  const DimensionedField<scalar, volMesh>&,
148  const fvPatchFieldMapper&
149  );
150 
151  //- Copy constructor
153  (
155  );
156 
157  //- Construct and return a clone
158  virtual tmp<fvPatchField<scalar>> clone() const
159  {
161  (
163  );
164  }
165 
166  //- Copy constructor setting internal field reference
168  (
171  );
172 
173  //- Construct and return a clone setting internal field reference
175  (
177  ) const
178  {
180  (
181  new porousBafflePressureFvPatchField(*this, iF)
182  );
183  }
184 
185 
186  // Member Functions
187 
188 
189  // Evaluation functions
190 
191  //- Update the coefficients associated with the patch field
192  virtual void updateCoeffs();
193 
194 
195  //- Write
196  virtual void write(Ostream&) const;
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
TypeName("porousBafflePressure")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual tmp< fvPatchField< scalar > > clone() const
Construct and return a clone.
This boundary condition provides a jump condition, using the cyclic condition as a base...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
porousBafflePressureFvPatchField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.