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-2018 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 
90 protected:
91 
92  // Protected data
93 
94  //- Run-time selectable porosity model
96 
97 
98 private:
99 
100  // Private Member Functions
101 
102  //- Disallow default bitwise copy construct
104 
105  //- Disallow default bitwise assignment
106  void operator=(const explicitPorositySource&);
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("explicitPorositySource");
113 
114 
115  // Constructors
116 
117  //- Construct from components
119  (
120  const word& name,
121  const word& modelType,
122  const dictionary& dict,
123  const fvMesh& mesh
124  );
125 
126 
127  //- Destructor
128  virtual ~explicitPorositySource()
129  {}
130 
131 
132  // Member Functions
134  const porosityModel& model() const
135  {
136  return porosityPtr_();
137  }
138 
139  // Add explicit and implicit contributions
140 
141  //- Add implicit contribution to momentum equation
142  virtual void addSup
143  (
144  fvMatrix<vector>& eqn,
145  const label fieldi
146  );
147 
148  //- Add implicit contribution to compressible momentum equation
149  virtual void addSup
150  (
151  const volScalarField& rho,
152  fvMatrix<vector>& eqn,
153  const label fieldi
154  );
155 
156  //- Add implicit contribution to phase momentum equation
157  virtual void addSup
158  (
159  const volScalarField& alpha,
160  const volScalarField& rho,
161  fvMatrix<vector>& eqn,
162  const label fieldi
163  );
164 
165 
166  // IO
167 
168  //- Read dictionary
169  virtual bool read(const dictionary& dict);
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace fv
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
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:137
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.
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 abtract 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.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Top level model for porosity models.
Definition: porosityModel.H:55
Namespace for OpenFOAM.
TypeName("explicitPorositySource")
Runtime type information.