interRegionExplicitPorositySource.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::interRegionExplicitPorositySource
26 
27 Description
28  Inter-region explicit porosity source.
29 
30  Sources described by, for example using the DarcyForchheimer model:
31 
32  \verbatim
33  interRegionExplicitPorositySourceCoeffs
34  {
35  type DarcyForchheimer;
36  DarcyForchheimerCoeffs
37  {
38  d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
39  f f [0 -1 0 0 0 0 0] (0 0 0);
40 
41  coordinateSystem
42  {
43  e1 (0.70710678 0.70710678 0);
44  e2 (0 0 1);
45  }
46  }
47  }
48  \endverbatim
49 
50 Note
51  The porous region must be selected as a cellZone.
52 
53 SourceFiles
54  interRegionExplicitPorositySource.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef interRegionExplicitPorositySource_H
59 #define interRegionExplicitPorositySource_H
60 
61 #include "interRegionOption.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 class porosityModel;
69 
70 namespace fv
71 {
72 
73 
74 /*---------------------------------------------------------------------------*\
75  Class interRegionExplicitPorositySource Declaration
76 \*---------------------------------------------------------------------------*/
77 
79 :
80  public interRegionOption
81 {
82 
83 protected:
84 
85  // Protected data
86 
87  //- Run-time selectable porosity model
89 
90  //- First iteration
91  bool firstIter_;
92 
93  //- Velocity field name, default = U
94  word UName_;
95 
96  //- Dynamic viscosity field name (compressible case only)
97  // default = thermo:mu
98  word muName_;
99 
100 
101  // Protected Member Functions
102 
103  //- Initialise
104  void initialise();
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("interRegionExplicitPorositySource");
111 
112 
113  // Constructors
114 
115  //- Construct from components
117  (
118  const word& name,
119  const word& modelType,
120  const dictionary& dict,
121  const fvMesh& mesh
122  );
123 
124  //- Disallow default bitwise copy construction
126  (
128  );
129 
130 
131  //- Destructor
133  {}
134 
135 
136  // Member Functions
137 
138  // Add explicit and implicit contributions
139 
140  //- Vector
141  virtual void addSup
142  (
143  fvMatrix<vector>& eqn,
144  const label fieldi
145  );
146 
147 
148  // Add explicit and implicit contributions to compressible equation
149 
150  //- Vector
151  virtual void addSup
152  (
153  const volScalarField& rho,
154  fvMatrix<vector>& eqn,
155  const label fieldi
156  );
157 
158 
159  // IO
160 
161  //- Read dictionary
162  virtual bool read(const dictionary& dict);
163 
164 
165  // Member Operators
166 
167  //- Disallow default bitwise assignment
168  void operator=(const interRegionExplicitPorositySource&) = delete;
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace fv
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
dictionary dict
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
Base class for inter-region exchange.
virtual bool read(const dictionary &dict)
Read dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Vector.
void operator=(const interRegionExplicitPorositySource &)=delete
Disallow default bitwise assignment.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
interRegionExplicitPorositySource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
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
TypeName("interRegionExplicitPorositySource")
Runtime type information.
word muName_
Dynamic viscosity field name (compressible case only)
autoPtr< porosityModel > porosityPtr_
Run-time selectable porosity model.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Namespace for OpenFOAM.