interRegionPorosityForce.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-2023 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::interRegionPorosityForce
26 
27 Description
28  This model applies the force exerted on the fluid by a porous media, the
29  extent of which is defined by an overlapping region
30 
31 Usage
32  Example usage, here employing the Darcy-Forchheimer model:
33  \verbatim
34  interRegionPorosityForceCoeffs
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 SourceFiles
59  interRegionPorosityForce.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef interRegionPorosityForce_H
64 #define interRegionPorosityForce_H
65 
66 #include "interRegionModel.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 
73 class porosityModel;
74 
75 namespace fv
76 {
77 
78 
79 /*---------------------------------------------------------------------------*\
80  Class interRegionPorosityForce Declaration
81 \*---------------------------------------------------------------------------*/
82 
84 :
85  public interRegionModel
86 {
87  // Private data
88 
89  //- Velocity field name, default = U
90  word UName_;
91 
92  //- Porosity mapping filter
94 
95  //- Run-time selectable porosity model
96  mutable autoPtr<porosityModel> porosityPtr_;
97 
98 
99  // Protected Member Functions
100 
101  //- Non-virtual read
102  void readCoeffs();
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("interRegionPorosityForce");
109 
110 
111  // Constructors
112 
113  //- Construct from components
115  (
116  const word& name,
117  const word& modelType,
118  const fvMesh& mesh,
119  const dictionary& dict
120  );
121 
122  //- Disallow default bitwise copy construction
124  (
126  ) = delete;
127 
128 
129  //- Destructor
130  virtual ~interRegionPorosityForce()
131  {}
132 
133 
134  // Member Functions
135 
136  // Checks
137 
138  //- Return the list of fields for which the fvModel adds source term
139  // to the transport equation
140  virtual wordList addSupFields() const;
141 
142 
143  // Evaluation
144 
145  //- Add source to momentum equation
146  virtual void addSup
147  (
148  const volVectorField& U,
149  fvMatrix<vector>& eqn
150  ) const;
151 
152  //- Add source to compressible momentum equation
153  virtual void addSup
154  (
155  const volScalarField& rho,
156  const volVectorField& U,
157  fvMatrix<vector>& eqn
158  ) const;
159 
160  //- Add source to phase momentum equation
161  virtual void addSup
162  (
163  const volScalarField& alpha,
164  const volScalarField& rho,
165  const volVectorField& U,
166  fvMatrix<vector>& eqn
167  ) const;
168 
169 
170  // Mesh changes
171 
172  //- Update for mesh motion
173  virtual bool movePoints();
174 
175  //- Update topology using the given map
176  virtual void topoChange(const polyTopoChangeMap&);
177 
178  //- Update from another mesh using the given map
179  virtual void mapMesh(const polyMeshMap&);
180 
181  //- Redistribute or update using the given distribution map
182  virtual void distribute(const polyDistributionMap&);
183 
184 
185  // IO
186 
187  //- Read dictionary
188  virtual bool read(const dictionary& dict);
189 
190 
191  // Member Operators
192 
193  //- Disallow default bitwise assignment
194  void operator=(const interRegionPorosityForce&) = delete;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace fv
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:53
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:47
Base class for inter-region exchange.
This model applies the force exerted on the fluid by a porous media, the extent of which is defined b...
virtual bool movePoints()
Update for mesh motion.
virtual void addSup(const volVectorField &U, fvMatrix< vector > &eqn) const
Add source to momentum equation.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
TypeName("interRegionPorosityForce")
Runtime type information.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
interRegionPorosityForce(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
void operator=(const interRegionPorosityForce &)=delete
Disallow default bitwise assignment.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict