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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::fv::interRegionExplicitPorositySource
29 
30 Group
31  grpFvOptionsSources
32 
33 Description
34  Applies inter-region explicit porosity source.
35 
36 Usage
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 
92 Note
93  - The porous region must be selected as a cellZone.
94 
95 SourceFiles
96  interRegionExplicitPorositySource.C
97 
98 \*---------------------------------------------------------------------------*/
99 
100 #ifndef interRegionExplicitPorositySource_H
101 #define interRegionExplicitPorositySource_H
102 
103 #include "interRegionOption.H"
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 namespace Foam
108 {
109 
110 // Forward declarations
111 class porosityModel;
112 
113 namespace fv
114 {
115 
116 /*---------------------------------------------------------------------------*\
117  Class interRegionExplicitPorositySource Declaration
118 \*---------------------------------------------------------------------------*/
119 
120 class interRegionExplicitPorositySource
121 :
122  public interRegionOption
123 {
124 protected:
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 
147 public:
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,
161  const fvMesh& mesh
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
179 
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
194  (
195  const volScalarField& rho,
196  fvMatrix<vector>& eqn,
197  const label fieldi
198  );
199 
200 
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 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:30
Foam::fv::interRegionExplicitPorositySource::~interRegionExplicitPorositySource
virtual ~interRegionExplicitPorositySource()=default
Destructor.
Foam::fv::interRegionExplicitPorositySource::firstIter_
bool firstIter_
First iteration.
Definition: interRegionExplicitPorositySource.H:161
rho
rho
Definition: readInitialConditions.H:88
Foam::fv::interRegionExplicitPorositySource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: interRegionExplicitPorositySource.C:290
Foam::fv::interRegionExplicitPorositySource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Vector.
Definition: interRegionExplicitPorositySource.C:138
Foam::fv::interRegionOption
Intermediate class for handling inter-region exchanges.
Definition: interRegionOption.H:107
interRegionOption.H
Foam::fv::interRegionExplicitPorositySource::TypeName
TypeName("interRegionExplicitPorositySource")
Runtime type information.
Foam::fv::interRegionExplicitPorositySource::porosityPtr_
autoPtr< porosityModel > porosityPtr_
Run-time selectable porosity model.
Definition: interRegionExplicitPorositySource.H:158
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fv::interRegionExplicitPorositySource::UName_
word UName_
Name of operand velocity field.
Definition: interRegionExplicitPorositySource.H:164
fv
labelList fv(nPoints)
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::fv::interRegionExplicitPorositySource::interRegionExplicitPorositySource
interRegionExplicitPorositySource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: interRegionExplicitPorositySource.C:114
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:36
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76
Foam::fv::interRegionExplicitPorositySource::muName_
word muName_
Name of operand dynamic viscosity field (compressible case only)
Definition: interRegionExplicitPorositySource.H:167
Foam::fv::interRegionExplicitPorositySource::initialise
void initialise()
Initialise.
Definition: interRegionExplicitPorositySource.C:53
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::fv::interRegionExplicitPorositySource
Applies inter-region explicit porosity source.
Definition: interRegionExplicitPorositySource.H:149
Foam::fv::interRegionExplicitPorositySource::operator=
void operator=(const interRegionExplicitPorositySource &)=delete
No copy assignment.