1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
25 Foam::porousBafflePressureFvPatchField
28 Foam::porousBafflePressureFvPatchField
29 the porous baffle operates on a cyclic patch and introduce a jump on the p
32 deltaP = -(I*mu*U + 0.5*D*rho*magSqr(U)*L)
36 I is the inertial coefficient
37 D is the darcy coeafficient
38 L is the porous media lenght in the flow direction
41 porousBafflePressureFvPatchField.C
43 \*---------------------------------------------------------------------------*/
45 #ifndef porousBafflePressureFvPatchField_H
46 #define porousBafflePressureFvPatchField_H
48 #include "fixedJumpFvPatchField.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 /*---------------------------------------------------------------------------*\
56 Class porousBafflePressureFvPatchField Declaration
57 \*---------------------------------------------------------------------------*/
60 class porousBafflePressureFvPatchField
62 public fixedJumpFvPatchField<Type>
66 //- Darcy pressure lost coefficient
69 //- Inertia pressure lost coefficient
72 //- Porous media length
78 //- Runtime type information
79 TypeName("porousBafflePressure");
84 //- Construct from patch and internal field
85 porousBafflePressureFvPatchField
88 const DimensionedField<Type, volMesh>&
91 //- Construct from patch, internal field and dictionary
92 porousBafflePressureFvPatchField
95 const DimensionedField<Type, volMesh>&,
99 //- Construct by mapping given porousBafflePressureFvPatchField
101 porousBafflePressureFvPatchField
103 const porousBafflePressureFvPatchField<Type>&,
105 const DimensionedField<Type, volMesh>&,
106 const fvPatchFieldMapper&
109 //- Construct as copy
110 porousBafflePressureFvPatchField
112 const porousBafflePressureFvPatchField<Type>&
115 //- Construct and return a clone
116 virtual tmp<fvPatchField<Type> > clone() const
118 return tmp<fvPatchField<Type> >
120 new porousBafflePressureFvPatchField<Type>(*this)
124 //- Construct as copy setting internal field reference
125 porousBafflePressureFvPatchField
127 const porousBafflePressureFvPatchField<Type>&,
128 const DimensionedField<Type, volMesh>&
131 //- Construct and return a clone setting internal field reference
132 virtual tmp<fvPatchField<Type> > clone
134 const DimensionedField<Type, volMesh>& iF
137 return tmp<fvPatchField<Type> >
139 new porousBafflePressureFvPatchField<Type>(*this, iF)
147 // Evaluation functions
149 //- Update the coefficients associated with the patch field
150 virtual void updateCoeffs();
154 virtual void write(Ostream&) const;
158 //- Specialisation of the jump-condition for the pressure
160 void porousBafflePressureFvPatchField<scalar>::updateCoeffs();
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 # include "porousBafflePressureFvPatchField.C"
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 // ************************************************************************* //