explicitPorositySource.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-2019 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::fv::explicitPorositySource
26 
27 Description
28  Explicit porosity source
29 
30 Usage
31  Example usage, here employing the Darcy-Forchheimer model:
32  \verbatim
33  explicitPorositySourceCoeffs
34  {
35  type DarcyForchheimer;
36 
37  DarcyForchheimerCoeffs
38  {
39  d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
40  f f [0 -1 0 0 0 0 0] (0 0 0);
41 
42  coordinateSystem
43  {
44  type cartesian;
45  origin (0 0 0);
46  coordinateRotation
47  {
48  type axesRotation;
49  e1 (0.70710678 0.70710678 0);
50  e2 (0 0 1);
51  }
52  }
53  }
54  }
55  \endverbatim
56 
57 Note:
58  The porous region must be selected as a cellZone.
59 
60 SourceFiles
61  explicitPorositySource.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef explicitPorositySource_H
66 #define explicitPorositySource_H
67 
68 #include "cellSetOption.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 class porosityModel;
76 
77 namespace fv
78 {
79 
80 
81 /*---------------------------------------------------------------------------*\
82  Class explicitPorositySource Declaration
83 \*---------------------------------------------------------------------------*/
84 
86 :
87  public cellSetOption
88 {
89 protected:
90 
91  // Protected data
92 
93  //- Run-time selectable porosity model
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("explicitPorositySource");
101 
102 
103  // Constructors
104 
105  //- Construct from components
107  (
108  const word& name,
109  const word& modelType,
110  const dictionary& dict,
111  const fvMesh& mesh
112  );
113 
114  //- Disallow default bitwise copy construction
116 
117 
118  //- Destructor
119  virtual ~explicitPorositySource()
120  {}
121 
122 
123  // Member Functions
125  const porosityModel& model() const
126  {
127  return porosityPtr_();
128  }
129 
130  // Add explicit and implicit contributions
131 
132  //- Add implicit contribution to momentum equation
133  virtual void addSup
134  (
135  fvMatrix<vector>& eqn,
136  const label fieldi
137  );
138 
139  //- Add implicit contribution to compressible momentum equation
140  virtual void addSup
141  (
142  const volScalarField& rho,
143  fvMatrix<vector>& eqn,
144  const label fieldi
145  );
146 
147  //- Add implicit contribution to phase momentum equation
148  virtual void addSup
149  (
150  const volScalarField& alpha,
151  const volScalarField& rho,
152  fvMatrix<vector>& eqn,
153  const label fieldi
154  );
155 
156 
157  // IO
158 
159  //- Read dictionary
160  virtual bool read(const dictionary& dict);
161 
162 
163  // Member Operators
164 
165  //- Disallow default bitwise assignment
166  void operator=(const explicitPorositySource&) = delete;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace fv
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
dictionary dict
virtual ~explicitPorositySource()
Destructor.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
void operator=(const explicitPorositySource &)=delete
Disallow default bitwise assignment.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
const porosityModel & model() const
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
virtual bool read(const dictionary &dict)
Read dictionary.
explicitPorositySource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Add implicit contribution to momentum equation.
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
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Cell-set options abstract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:69
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
autoPtr< porosityModel > porosityPtr_
Run-time selectable porosity model.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Top level model for porosity models.
Definition: porosityModel.H:55
Namespace for OpenFOAM.
TypeName("explicitPorositySource")
Runtime type information.