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-2020 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  //- Disallow copy without setting internal field reference
153  (
155  ) = delete;
156 
157  //- Copy constructor setting internal field reference
159  (
162  );
163 
164  //- Construct and return a clone setting internal field reference
166  (
168  ) const
169  {
171  (
172  new porousBafflePressureFvPatchField(*this, iF)
173  );
174  }
175 
176 
177  // Member Functions
178 
179 
180  // Evaluation functions
181 
182  //- Update the coefficients associated with the patch field
183  virtual void updateCoeffs();
184 
185 
186  //- Write
187  virtual void write(Ostream&) const;
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
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:54
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
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
Namespace for OpenFOAM.