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 | Copyright (C) 2011-2016 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 Group
28  grpCoupledBoundaryConditions
29 
30 Description
31  This boundary condition provides a jump condition, using the \c cyclic
32  condition as a base.
33 
34  The porous baffle introduces a pressure jump defined by:
35 
36  \f[
37  \Delta p = -(D \mu U + 0.5 I \rho |U|^2 )L
38  \f]
39 
40  where
41 
42  \vartable
43  p | pressure [Pa]
44  \rho | density [kg/m3]
45  \mu | laminar viscosity [Pa s]
46  D | Darcy coefficient
47  I | inertial coefficient
48  L | porous media length in the flow direction
49  \endvartable
50 
51 
52 Usage
53  \table
54  Property | Description | Required | Default value
55  patchType | underlying patch type should be \c cyclic| yes |
56  phi | flux field name | no | phi
57  rho | density field name | no | rho
58  D | Darcy coefficient | yes |
59  I | inertial coefficient | yes |
60  length | porous media length in the flow direction | yes |
61  \endtable
62 
63  Example of the boundary condition specification:
64  \verbatim
65  <patchName>
66  {
67  type porousBafflePressure;
68  patchType cyclic;
69  jump uniform 0;
70  D 0.001;
71  I 1000000;
72  length 0.1;
73  value uniform 0;
74  }
75  \endverbatim
76 
77 Note
78  The underlying \c patchType should be set to \c cyclic
79 
80 SourceFiles
81  porousBafflePressureFvPatchField.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef porousBafflePressureFvPatchField_H
86 #define porousBafflePressureFvPatchField_H
87 
88 #include "fixedJumpFvPatchField.H"
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 namespace Foam
93 {
94 
95 /*---------------------------------------------------------------------------*\
96  Class porousBafflePressureFvPatchField Declaration
97 \*---------------------------------------------------------------------------*/
98 
99 class porousBafflePressureFvPatchField
100 :
101  public fixedJumpFvPatchField<scalar>
102 {
103  // Private data
104 
105  //- Name of flux field (default = phi)
106  const word phiName_;
107 
108  //- Name of density field (default = rho)
109  const word rhoName_;
110 
111  //- Darcy pressure loss coefficient
112  scalar D_;
113 
114  //- Inertia pressure lost coefficient
115  scalar I_;
116 
117  //- Porous media length
118  scalar length_;
119 
120 
121 public:
122 
123  //- Runtime type information
124  TypeName("porousBafflePressure");
125 
126 
127  // Constructors
128 
129  //- Construct from patch and internal field
131  (
132  const fvPatch&,
133  const DimensionedField<scalar, volMesh>&
134  );
135 
136  //- Construct from patch, internal field and dictionary
138  (
139  const fvPatch&,
140  const DimensionedField<scalar, volMesh>&,
141  const dictionary&
142  );
143 
144  //- Construct by mapping given porousBafflePressureFvPatchField
145  // onto a new patch
147  (
149  const fvPatch&,
150  const DimensionedField<scalar, volMesh>&,
151  const fvPatchFieldMapper&
152  );
153 
154  //- Construct as copy
156  (
158  );
159 
160  //- Construct and return a clone
161  virtual tmp<fvPatchField<scalar>> clone() const
162  {
164  (
166  );
167  }
168 
169  //- Construct as copy setting internal field reference
171  (
174  );
175 
176  //- Construct and return a clone setting internal field reference
178  (
180  ) const
181  {
183  (
184  new porousBafflePressureFvPatchField(*this, iF)
185  );
186  }
187 
188 
189  // Member functions
190 
191 
192  // Evaluation functions
193 
194  //- Update the coefficients associated with the patch field
195  virtual void updateCoeffs();
196 
197 
198  //- Write
199  virtual void write(Ostream&) const;
200 };
201 
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
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.