BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / turbulenceModels / derivedFvPatchFields / porousBafflePressure / porousBafflePressureFvPatchField.H
blob8e0dccd0cc824874a7f81eec921840696519ad57
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Class
25     Foam::porousBafflePressureFvPatchField
27 Description
28     Foam::porousBafflePressureFvPatchField
29     the porous baffle operates on a cyclic patch and introduce a jump on the p
30     field as follow:
32     deltaP = -(I*mu*U + 0.5*D*rho*magSqr(U)*L)
34     where:
36     I is the inertial coefficient
37     D is the darcy coeafficient
38     L is the porous media lenght in the flow direction
40 SourceFiles
41     porousBafflePressureFvPatchField.C
43 \*---------------------------------------------------------------------------*/
45 #ifndef porousBafflePressureFvPatchField_H
46 #define porousBafflePressureFvPatchField_H
48 #include "fixedJumpFvPatchField.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace Foam
55 /*---------------------------------------------------------------------------*\
56                 Class porousBafflePressureFvPatchField Declaration
57 \*---------------------------------------------------------------------------*/
59 template<class Type>
60 class porousBafflePressureFvPatchField
62     public fixedJumpFvPatchField<Type>
64     // Private data
66         //- Darcy pressure lost coefficient
67         scalar D_;
69         //- Inertia pressure lost coefficient
70         scalar I_;
72         //- Porous media length
73         scalar length_;
76 public:
78     //- Runtime type information
79     TypeName("porousBafflePressure");
82     // Constructors
84         //- Construct from patch and internal field
85         porousBafflePressureFvPatchField
86         (
87             const fvPatch&,
88             const DimensionedField<Type, volMesh>&
89         );
91         //- Construct from patch, internal field and dictionary
92         porousBafflePressureFvPatchField
93         (
94             const fvPatch&,
95             const DimensionedField<Type, volMesh>&,
96             const dictionary&
97         );
99         //- Construct by mapping given porousBafflePressureFvPatchField
100         // onto a new patch
101         porousBafflePressureFvPatchField
102         (
103             const porousBafflePressureFvPatchField<Type>&,
104             const fvPatch&,
105             const DimensionedField<Type, volMesh>&,
106             const fvPatchFieldMapper&
107         );
109         //- Construct as copy
110         porousBafflePressureFvPatchField
111         (
112             const porousBafflePressureFvPatchField<Type>&
113         );
115         //- Construct and return a clone
116         virtual tmp<fvPatchField<Type> > clone() const
117         {
118             return tmp<fvPatchField<Type> >
119             (
120                 new porousBafflePressureFvPatchField<Type>(*this)
121             );
122         }
124         //- Construct as copy setting internal field reference
125         porousBafflePressureFvPatchField
126         (
127             const porousBafflePressureFvPatchField<Type>&,
128             const DimensionedField<Type, volMesh>&
129         );
131         //- Construct and return a clone setting internal field reference
132         virtual tmp<fvPatchField<Type> > clone
133         (
134             const DimensionedField<Type, volMesh>& iF
135         ) const
136         {
137             return tmp<fvPatchField<Type> >
138             (
139                 new porousBafflePressureFvPatchField<Type>(*this, iF)
140             );
141         }
144     // Member functions
147         // Evaluation functions
149             //- Update the coefficients associated with the patch field
150             virtual void updateCoeffs();
153         //- Write
154         virtual void write(Ostream&) const;
158 //- Specialisation of the jump-condition for the pressure
159 template<>
160 void porousBafflePressureFvPatchField<scalar>::updateCoeffs();
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #ifdef NoRepository
170 #   include "porousBafflePressureFvPatchField.C"
171 #endif
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 #endif
177 // ************************************************************************* //