DarcyForchheimer.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) 2012-2015 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::DarcyForchheimer
26 
27 Description
28  Darcy-Forchheimer law porosity model, given by:
29 
30  \f[
31  S = - (\mu d + \frac{\rho |U|}{2} f) U
32  \f]
33 
34  where
35  \vartable
36  d | Darcy coefficient [1/m2]
37  f | Forchheimer coefficient [1/m]
38  \endvartable
39 
40  Since negative Darcy/Forchheimer parameters are invalid, they can be used
41  to specify a multiplier (of the max component).
42 
43  The orientation of the porous region is defined with the same notation as
44  a co-ordinate system, but only a Cartesian co-ordinate system is valid.
45 
46 SourceFiles
47  DarcyForchheimer.C
48  DarcyForchheimerTemplates.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef DarcyForchheimer_H
53 #define DarcyForchheimer_H
54 
55 #include "porosityModel.H"
56 #include "dimensionedTensor.H"
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 namespace porosityModels
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class DarcyForchheimer Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 class DarcyForchheimer
70 :
71  public porosityModel
72 {
73  // Private data
74 
75  //- Darcy coeffient XYZ components (user-supplied) [1/m2]
77 
78  //- Forchheimer coeffient XYZ components (user-supplied) [1/m]
80 
81  //- Darcy coefficient - converted from dXYZ [1/m2]
83 
84  //- Forchheimer coefficient - converted from fXYZ [1/m]
86 
87  //- Name of density field
88  word rhoName_;
89 
90  //- Name of dynamic viscosity field
91  word muName_;
92 
93  //- Name of kinematic viscosity field
94  word nuName_;
95 
96 
97  // Private Member Functions
98 
99  //- Apply
100  template<class RhoFieldType>
101  void apply
102  (
103  scalarField& Udiag,
104  vectorField& Usource,
105  const scalarField& V,
106  const RhoFieldType& rho,
107  const scalarField& mu,
108  const vectorField& U
109  ) const;
110 
111  //- Apply
112  template<class RhoFieldType>
113  void apply
114  (
115  tensorField& AU,
116  const RhoFieldType& rho,
117  const scalarField& mu,
118  const vectorField& U
119  ) const;
120 
121  //- Disallow default bitwise copy construct
123 
124  //- Disallow default bitwise assignment
125  void operator=(const DarcyForchheimer&);
126 
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("DarcyForchheimer");
132 
133  //- Constructor
135  (
136  const word& name,
137  const word& modelType,
138  const fvMesh& mesh,
139  const dictionary& dict,
140  const word& cellZoneName
141  );
142 
143  //- Destructor
144  virtual ~DarcyForchheimer();
145 
146 
147  // Member Functions
148 
149  //- Transform the model data wrt mesh changes
150  virtual void calcTransformModelData();
151 
152  //- Calculate the porosity force
153  virtual void calcForce
154  (
155  const volVectorField& U,
156  const volScalarField& rho,
157  const volScalarField& mu,
159  ) const;
160 
161  //- Add resistance
162  virtual void correct(fvVectorMatrix& UEqn) const;
163 
164  //- Add resistance
165  virtual void correct
166  (
168  const volScalarField& rho,
169  const volScalarField& mu
170  ) const;
171 
172  //- Add resistance
173  virtual void correct
174  (
175  const fvVectorMatrix& UEqn,
176  volTensorField& AU
177  ) const;
178 
179 
180  // I-O
181 
182  //- Write
183  bool writeData(Ostream& os) const;
184 };
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace porosityModels
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #ifdef NoRepository
194  #include "DarcyForchheimerTemplates.C"
195 #endif
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::constant::physicoChemical::mu
const dimensionedScalar mu
Atomic mass unit.
Definition: createFields.H:13
DarcyForchheimer
Darcy-Forchheimer law porosity model, given by:
Foam::porosityModel::name
const word & name() const
Return const access to the porosity model name.
Definition: porosityModelI.H:26
DarcyForchheimerTemplates.C
Foam::porosityModels::DarcyForchheimer::fXYZ_
dimensionedVector fXYZ_
Forchheimer coeffient XYZ components (user-supplied) [1/m].
Definition: DarcyForchheimer.H:86
Foam::porosityModels::DarcyForchheimer::F_
List< tensorField > F_
Forchheimer coefficient - converted from fXYZ [1/m].
Definition: DarcyForchheimer.H:92
porosityModel.H
Foam::porosityModels::DarcyForchheimer
Definition: DarcyForchheimer.H:76
Foam::porosityModels::DarcyForchheimer::operator=
void operator=(const DarcyForchheimer &)
Disallow default bitwise assignment.
U
U
Definition: pEqn.H:46
Foam::porosityModels::DarcyForchheimer::calcTransformModelData
virtual void calcTransformModelData()
Transform the model data wrt mesh changes.
Definition: DarcyForchheimer.C:78
Foam::porosityModels::DarcyForchheimer::muName_
word muName_
Name of dynamic viscosity field.
Definition: DarcyForchheimer.H:98
Foam::porosityModels::DarcyForchheimer::nuName_
word nuName_
Name of kinematic viscosity field.
Definition: DarcyForchheimer.H:101
Foam::porosityModels::DarcyForchheimer::~DarcyForchheimer
virtual ~DarcyForchheimer()
Destructor.
Definition: DarcyForchheimer.C:72
Foam::porosityModels::DarcyForchheimer::writeData
bool writeData(Ostream &os) const
Write.
Definition: DarcyForchheimer.C:301
Foam::porosityModel::force
virtual tmp< vectorField > force(const volVectorField &U, const volScalarField &rho, const volScalarField &mu)
Return the force over the cell zone(s)
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::porosityModels::DarcyForchheimer::D_
List< tensorField > D_
Darcy coefficient - converted from dXYZ [1/m2].
Definition: DarcyForchheimer.H:89
UEqn
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
Foam::porosityModels::DarcyForchheimer::dXYZ_
dimensionedVector dXYZ_
Darcy coeffient XYZ components (user-supplied) [1/m2].
Definition: DarcyForchheimer.H:83
Foam::porosityModels::DarcyForchheimer::rhoName_
word rhoName_
Name of density field.
Definition: DarcyForchheimer.H:95
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
rho
rho
Definition: pEqn.H:3
Foam::porosityModel
Top level model for porosity models.
Definition: porosityModel.H:55
Foam::porosityModels::DarcyForchheimer::correct
virtual void correct(fvVectorMatrix &UEqn) const
Add resistance.
Definition: DarcyForchheimer.C:190
Foam::porosityModels::DarcyForchheimer::TypeName
TypeName("DarcyForchheimer")
Runtime type information.
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
dimensionedTensor.H
Foam::porosityModels::DarcyForchheimer::apply
void apply(scalarField &Udiag, vectorField &Usource, const scalarField &V, const RhoFieldType &rho, const scalarField &mu, const vectorField &U) const
Apply.
Definition: DarcyForchheimerTemplates.C:30
Foam::porosityModels::DarcyForchheimer::DarcyForchheimer
DarcyForchheimer(const DarcyForchheimer &)
Disallow default bitwise copy construct.
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
Foam::porosityModels::DarcyForchheimer::calcForce
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const
Calculate the porosity force.
Definition: DarcyForchheimer.C:172
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52