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-2017 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::porosityModels::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]
66  dimensionedVector alphaXYZ_;
67 
68  //- Beta coefficient XYZ components (user-supplied) [1/m]
69  dimensionedVector betaXYZ_;
70 
71  //- Model alpha coefficient - converted from alphaXYZ [1/s]
72  List<tensorField> alpha_;
73 
74  //- Model beta coefficient - converted from betaXYZ [1/m]
75  List<tensorField> beta_;
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  (
144  fvVectorMatrix& UEqn,
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 // ************************************************************************* //
dictionary dict
U
Definition: pEqn.H:83
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:60
virtual tmp< vectorField > force(const volVectorField &U, const volScalarField &rho, const volScalarField &mu)
Return the force over the cell zone(s)
virtual ~fixedCoeff()
Destructor.
Definition: fixedCoeff.C:128
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
virtual void calcTransformModelData()
Transform the model data wrt mesh changes.
Definition: fixedCoeff.C:134
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Fixed coefficient form of porosity model.
Definition: fixedCoeff.H:58
TypeName("fixedCoeff")
Runtime type information.
const dimensionedScalar mu
Atomic mass unit.
virtual void correct(fvVectorMatrix &UEqn) const
Add resistance.
Definition: fixedCoeff.C:207
const word & name() const
Return const access to the porosity model name.
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
bool writeData(Ostream &os) const
Write.
Definition: fixedCoeff.C:266
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const
Calculate the porosity force.
Definition: fixedCoeff.C:188
Top level model for porosity models.
Definition: porosityModel.H:55
Namespace for OpenFOAM.