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 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  Inter-region explicit porosity source.
35 
36  Sources described by, for example using the DarcyForchheimer model:
37 
38  \verbatim
39  interRegionExplicitPorositySourceCoeffs
40  {
41  type DarcyForchheimer;
42  DarcyForchheimerCoeffs
43  {
44  d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
45  f f [0 -1 0 0 0 0 0] (0 0 0);
46 
47  coordinateSystem
48  {
49  origin (0 0 0);
50  e1 (0.70710678 0.70710678 0);
51  e2 (0 0 1);
52  }
53  }
54  }
55  \endverbatim
56 
57 Note
58  The porous region must be selected as a cellZone.
59 
60 SourceFiles
61  interRegionExplicitPorositySource.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef interRegionExplicitPorositySource_H
66 #define interRegionExplicitPorositySource_H
67 
68 #include "interRegionOption.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 // Forward declarations
76 class porosityModel;
77 
78 namespace fv
79 {
80 
81 
82 /*---------------------------------------------------------------------------*\
83  Class interRegionExplicitPorositySource Declaration
84 \*---------------------------------------------------------------------------*/
85 
87 :
88  public interRegionOption
89 {
90 protected:
91 
92  // Protected data
93 
94  //- Run-time selectable porosity model
96 
97  //- First iteration
98  bool firstIter_;
99 
100  //- Velocity field name, default = U
101  word UName_;
102 
103  //- Dynamic viscosity field name (compressible case only)
104  // default = thermo:mu
105  word muName_;
106 
107 
108  // Protected Member Functions
109 
110  //- Initialise
111  void initialise();
112 
113 
114 private:
115 
116  // Private Member Functions
117 
118  //- No copy construct
120  (
122  ) = delete;
123 
124  //- No copy assignment
125  void operator=(const interRegionExplicitPorositySource&) = delete;
126 
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("interRegionExplicitPorositySource");
132 
133 
134  // Constructors
135 
136  //- Construct from components
138  (
139  const word& name,
140  const word& modelType,
141  const dictionary& dict,
142  const fvMesh& mesh
143  );
144 
145 
146  //- Destructor
147  virtual ~interRegionExplicitPorositySource() = default;
148 
149 
150  // Member Functions
151 
152  // Add explicit and implicit contributions
153 
154  //- Vector
155  virtual void addSup
156  (
157  fvMatrix<vector>& eqn,
158  const label fieldi
159  );
160 
161 
162  // Add explicit and implicit contributions to compressible equation
163 
164  //- Vector
165  virtual void addSup
166  (
167  const volScalarField& rho,
168  fvMatrix<vector>& eqn,
169  const label fieldi
170  );
171 
172 
173  // IO
174 
175  //- Read dictionary
176  virtual bool read(const dictionary& dict);
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace fv
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
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:97
rho
rho
Definition: readInitialConditions.H:88
Foam::fv::interRegionExplicitPorositySource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: interRegionExplicitPorositySource.C:291
Foam::fv::interRegionExplicitPorositySource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Vector.
Definition: interRegionExplicitPorositySource.C:138
Foam::fv::interRegionOption
Base class for inter-region exchange.
Definition: interRegionOption.H:53
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:94
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:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fv::interRegionExplicitPorositySource::UName_
word UName_
Velocity field name, default = U.
Definition: interRegionExplicitPorositySource.H:100
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::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_
Dynamic viscosity field name (compressible case only)
Definition: interRegionExplicitPorositySource.H:104
Foam::fv::interRegionExplicitPorositySource::initialise
void initialise()
Initialise.
Definition: interRegionExplicitPorositySource.C:53
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::fv::interRegionExplicitPorositySource
Inter-region explicit porosity source.
Definition: interRegionExplicitPorositySource.H:85