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