fixedCoeff.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::fixedCoeff
26 
27 Description
28  Fixed coefficient form of porosity model
29 
30  \f[
31  S = - \rho_ref (\alpha + \beta |U|) U
32  \f]
33 
34  In the case of compressible flow, a value for the reference density is
35  required
36 
37 SourceFiles
38  fixedCoeff.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef fixedCoeff_H
43 #define fixedCoeff_H
44 
45 #include "porosityModel.H"
46 #include "dimensionedTensor.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace porosityModels
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class fixedCoeff Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class fixedCoeff
60 :
61  public porosityModel
62 {
63  // Private data
64 
65  //- Alpha coefficient XYZ components (user-supplied) [1/s]
67 
68  //- Beta coefficient XYZ components (user-supplied) [1/m]
70 
71  //- Model alpha coefficient - converted from alphaXYZ [1/s]
73 
74  //- Model beta coefficient - converted from betaXYZ [1/m]
76 
77 
78  // Private Member Functions
79 
80  //- Apply
81  void apply
82  (
83  scalarField& Udiag,
84  vectorField& Usource,
85  const scalarField& V,
86  const vectorField& U,
87  const scalar rho
88  ) const;
89 
90  //- Apply
91  void apply
92  (
93  tensorField& AU,
94  const vectorField& U,
95  const scalar rho
96  ) const;
97 
98  //- Disallow default bitwise copy construct
99  fixedCoeff(const fixedCoeff&);
100 
101  //- Disallow default bitwise assignment
102  void operator=(const fixedCoeff&);
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("fixedCoeff");
109 
110  //- Constructor
111  fixedCoeff
112  (
113  const word& name,
114  const word& modelType,
115  const fvMesh& mesh,
116  const dictionary& dict,
117  const word& cellZoneName
118  );
119 
120  //- Destructor
121  virtual ~fixedCoeff();
122 
123 
124  // Member Functions
125 
126  //- Transform the model data wrt mesh changes
127  virtual void calcTransformModelData();
128 
129  //- Calculate the porosity force
130  virtual void calcForce
131  (
132  const volVectorField& U,
133  const volScalarField& rho,
134  const volScalarField& mu,
136  ) const;
137 
138  //- Add resistance
139  virtual void correct(fvVectorMatrix& UEqn) const;
140 
141  //- Add resistance
142  virtual void correct
143  (
145  const volScalarField& rho,
146  const volScalarField& mu
147  ) const;
148 
149  //- Add resistance
150  virtual void correct
151  (
152  const fvVectorMatrix& UEqn,
153  volTensorField& AU
154  ) const;
155 
156 
157  // I-O
158 
159  //- Write
160  bool writeData(Ostream& os) const;
161 };
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace porosityModels
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
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
Foam::porosityModels::fixedCoeff::calcForce
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const
Calculate the porosity force.
Definition: fixedCoeff.C:188
Foam::porosityModel::name
const word & name() const
Return const access to the porosity model name.
Definition: porosityModelI.H:26
Foam::porosityModels::fixedCoeff::betaXYZ_
dimensionedVector betaXYZ_
Beta coefficient XYZ components (user-supplied) [1/m].
Definition: fixedCoeff.H:68
Foam::porosityModels::fixedCoeff::fixedCoeff
fixedCoeff(const fixedCoeff &)
Disallow default bitwise copy construct.
Foam::porosityModels::fixedCoeff::operator=
void operator=(const fixedCoeff &)
Disallow default bitwise assignment.
porosityModel.H
Foam::porosityModels::fixedCoeff
Definition: fixedCoeff.H:58
U
U
Definition: pEqn.H:46
Foam::porosityModels::fixedCoeff::alpha_
List< tensorField > alpha_
Model alpha coefficient - converted from alphaXYZ [1/s].
Definition: fixedCoeff.H:71
Foam::porosityModels::fixedCoeff::TypeName
TypeName("fixedCoeff")
Runtime type information.
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::porosityModels::fixedCoeff::writeData
bool writeData(Ostream &os) const
Write.
Definition: fixedCoeff.C:266
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
UEqn
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
Foam::porosityModels::fixedCoeff::calcTransformModelData
virtual void calcTransformModelData()
Transform the model data wrt mesh changes.
Definition: fixedCoeff.C:134
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
Foam::porosityModels::fixedCoeff::apply
void apply(scalarField &Udiag, vectorField &Usource, const scalarField &V, const vectorField &U, const scalar rho) const
Apply.
Definition: fixedCoeff.C:45
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
Foam::porosityModels::fixedCoeff::~fixedCoeff
virtual ~fixedCoeff()
Destructor.
Definition: fixedCoeff.C:128
rho
rho
Definition: pEqn.H:3
Foam::porosityModel
Top level model for porosity models.
Definition: porosityModel.H:55
Foam::porosityModels::fixedCoeff::beta_
List< tensorField > beta_
Model beta coefficient - converted from betaXYZ [1/m].
Definition: fixedCoeff.H:74
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::fixedCoeff::correct
virtual void correct(fvVectorMatrix &UEqn) const
Add resistance.
Definition: fixedCoeff.C:207
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
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
Foam::porosityModels::fixedCoeff::alphaXYZ_
dimensionedVector alphaXYZ_
Alpha coefficient XYZ components (user-supplied) [1/s].
Definition: fixedCoeff.H:65