interRegionExplicitPorositySource.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2012-2016 OpenFOAM Foundation
9 Copyright (C) 2019-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::fv::interRegionExplicitPorositySource
29
30Group
31 grpFvOptionsSources
32
33Description
34 Applies inter-region explicit porosity source.
35
36Usage
37 Minimal example by using \c constant/fvOptions:
38 \verbatim
39 interRegionExplicitPorositySource1
40 {
41 // Mandatory entries (unmodifiable)
42 type interRegionExplicitPorositySource;
43
44 interRegionExplicitPorositySourceCoeffs
45 {
46 // Mandatory entries (unmodifiable)
47 type <porosityModel>;
48
49 // Optional entries (runtime modifiable)
50 U U;
51 mu thermo:mu;
52 }
53
54 // Mandatory/Optional (inherited) entries
55 ...
56 }
57 \endverbatim
58
59 where the entries mean:
60 \table
61 Property | Description | Type | Reqd | Dflt
62 type | Type name: interRegionExplicitPorositySource | word | yes | -
63 type | Name of porosity model | word | yes | -
64 U | Name of operand velocity field | word | no | U
65 mu | Name of operand dynamic viscosity field | word | no | thermo:mu
66 \endtable
67
68 The inherited entries are elaborated in:
69 - \link interRegionOption.H \endlink
70
71 Sources described by, for example using the DarcyForchheimer model:
72
73 \verbatim
74 interRegionExplicitPorositySourceCoeffs
75 {
76 type DarcyForchheimer;
77 DarcyForchheimerCoeffs
78 {
79 d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
80 f f [0 -1 0 0 0 0 0] (0 0 0);
81
82 coordinateSystem
83 {
84 origin (0 0 0);
85 e1 (0.70710678 0.70710678 0);
86 e2 (0 0 1);
87 }
88 }
89 }
90 \endverbatim
91
92Note
93 - The porous region must be selected as a cellZone.
94
95SourceFiles
96 interRegionExplicitPorositySource.C
97
98\*---------------------------------------------------------------------------*/
99
100#ifndef interRegionExplicitPorositySource_H
101#define interRegionExplicitPorositySource_H
102
103#include "interRegionOption.H"
104
105// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106
107namespace Foam
108{
109
110// Forward declarations
111class porosityModel;
112
113namespace fv
114{
115
116/*---------------------------------------------------------------------------*\
117 Class interRegionExplicitPorositySource Declaration
118\*---------------------------------------------------------------------------*/
119
120class interRegionExplicitPorositySource
121:
122 public interRegionOption
123{
124protected:
125
126 // Protected Data
127
128 //- Run-time selectable porosity model
129 autoPtr<porosityModel> porosityPtr_;
130
131 //- First iteration
132 bool firstIter_;
133
134 //- Name of operand velocity field
135 word UName_;
136
137 //- Name of operand dynamic viscosity field (compressible case only)
138 word muName_;
139
140
141 // Protected Member Functions
142
143 //- Initialise
144 void initialise();
145
146
147public:
148
149 //- Runtime type information
150 TypeName("interRegionExplicitPorositySource");
151
152
153 // Constructors
154
155 //- Construct from components
157 (
158 const word& name,
159 const word& modelType,
160 const dictionary& dict,
162 );
163
164 //- No copy construct
166 (
168 ) = delete;
169
170 //- No copy assignment
171 void operator=(const interRegionExplicitPorositySource&) = delete;
172
173
174 //- Destructor
175 virtual ~interRegionExplicitPorositySource() = default;
176
177
178 // Member Functions
180 // Add explicit and implicit contributions
181
182 //- Vector
183 virtual void addSup
184 (
185 fvMatrix<vector>& eqn,
186 const label fieldi
187 );
188
189
190 // Add explicit and implicit contributions to compressible equation
191
192 //- Vector
193 virtual void addSup
195 const volScalarField& rho,
196 fvMatrix<vector>& eqn,
197 const label fieldi
198 );
199
201 // IO
202
203 //- Read dictionary
204 virtual bool read(const dictionary& dict);
205};
206
207
208// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209
210} // End namespace fv
211} // End namespace Foam
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215#endif
216
217// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:121
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Applies inter-region explicit porosity source.
interRegionExplicitPorositySource(const interRegionExplicitPorositySource &)=delete
No copy construct.
void operator=(const interRegionExplicitPorositySource &)=delete
No copy assignment.
virtual bool read(const dictionary &dict)
Read dictionary.
word muName_
Name of operand dynamic viscosity field (compressible case only)
autoPtr< porosityModel > porosityPtr_
Run-time selectable porosity model.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Vector.
virtual ~interRegionExplicitPorositySource()=default
Destructor.
TypeName("interRegionExplicitPorositySource")
Runtime type information.
Intermediate class for handling inter-region exchanges.
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73