fixedCoeff.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2021 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 
99 public:
100 
101  //- Runtime type information
102  TypeName("fixedCoeff");
103 
104  // Constructors
105 
106  fixedCoeff
107  (
108  const word& name,
109  const word& modelType,
110  const fvMesh& mesh,
111  const dictionary& dict,
112  const word& cellZoneName
113  );
114 
115  //- Disallow default bitwise copy construction
116  fixedCoeff(const fixedCoeff&) = delete;
117 
118 
119  //- Destructor
120  virtual ~fixedCoeff();
121 
122 
123  // Member Functions
124 
125  //- Transform the model data wrt mesh changes
126  virtual void calcTransformModelData();
127 
128  //- Calculate the porosity force
129  virtual void calcForce
130  (
131  const volVectorField& U,
132  const volScalarField& rho,
133  const volScalarField& mu,
135  ) const;
136 
137  //- Add resistance
138  virtual void correct(fvVectorMatrix& UEqn) const;
139 
140  //- Add resistance
141  virtual void correct
142  (
143  const fvVectorMatrix& UEqn,
144  volTensorField& AU
145  ) const;
146 
147 
148  // I-O
149 
150  //- Write
151  bool writeData(Ostream& os) const;
152 
153 
154  // Member Operators
155 
156  //- Disallow default bitwise assignment
157  void operator=(const fixedCoeff&) = delete;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace porosityModels
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
fixedCoeff(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict, const word &cellZoneName)
Definition: fixedCoeff.C:105
const dictionary & dict() const
Return dictionary used for model construction.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
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
virtual ~fixedCoeff()
Destructor.
Definition: fixedCoeff.C:128
virtual tmp< vectorField > force(const volVectorField &U, const volScalarField &rho, const volScalarField &mu) const
Return the force over the cell zone(s)
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:54
const dimensionedScalar mu
Atomic mass unit.
Fixed coefficient form of porosity model.
Definition: fixedCoeff.H:58
TypeName("fixedCoeff")
Runtime type information.
U
Definition: pEqn.H:72
void operator=(const fixedCoeff &)=delete
Disallow default bitwise assignment.
virtual void correct(fvVectorMatrix &UEqn) const
Add resistance.
Definition: fixedCoeff.C:210
const word & name() const
Return const access to the porosity model name.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
bool writeData(Ostream &os) const
Write.
Definition: fixedCoeff.C:247
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const
Calculate the porosity force.
Definition: fixedCoeff.C:191
Top level model for porosity models.
Definition: porosityModel.H:54
Namespace for OpenFOAM.
fvVectorMatrix & UEqn
Definition: UEqn.H:13