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-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::interRegionExplicitPorositySource
26 
27 Description
28  Inter-region explicit porosity source.
29 
30 Usage
31  Example usage, here employing the Darcy-Forchheimer model:
32  \verbatim
33  interRegionExplicitPorositySourceCoeffs
34  {
35  type DarcyForchheimer;
36 
37  DarcyForchheimerCoeffs
38  {
39  d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
40  f f [0 -1 0 0 0 0 0] (0 0 0);
41 
42  coordinateSystem
43  {
44  type cartesian;
45  origin (0 0 0);
46  coordinateRotation
47  {
48  type axesRotation;
49  e1 (0.70710678 0.70710678 0);
50  e2 (0 0 1);
51  }
52  }
53  }
54  }
55  \endverbatim
56 
57 SourceFiles
58  interRegionExplicitPorositySource.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef interRegionExplicitPorositySource_H
63 #define interRegionExplicitPorositySource_H
64 
65 #include "interRegionModel.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 class porosityModel;
73 
74 namespace fv
75 {
76 
77 
78 /*---------------------------------------------------------------------------*\
79  Class interRegionExplicitPorositySource Declaration
80 \*---------------------------------------------------------------------------*/
81 
83 :
84  public interRegionModel
85 {
86  // Private data
87 
88  //- Velocity field name, default = U
89  word UName_;
90 
91  //- Porosity mapping filter
93 
94  //- Run-time selectable porosity model
95  mutable autoPtr<porosityModel> porosityPtr_;
96 
97 
98  // Protected Member Functions
99 
100  //- Non-virtual read
101  void readCoeffs();
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("interRegionExplicitPorositySource");
108 
109 
110  // Constructors
111 
112  //- Construct from components
114  (
115  const word& name,
116  const word& modelType,
117  const fvMesh& mesh,
118  const dictionary& dict
119  );
120 
121  //- Disallow default bitwise copy construction
123  (
125  );
126 
127 
128  //- Destructor
130  {}
131 
132 
133  // Member Functions
134 
135  // Checks
136 
137  //- Return the list of fields for which the fvModel adds source term
138  // to the transport equation
139  virtual wordList addSupFields() const;
140 
141 
142  // Add explicit and implicit contributions to compressible equation
143 
144  virtual void addSup
145  (
146  const volScalarField& rho,
147  fvMatrix<vector>& eqn,
148  const word& fieldName
149  ) const;
150 
151 
152  // Mesh changes
153 
154  //- Update for mesh motion
155  virtual bool movePoints();
156 
157  //- Update topology using the given map
158  virtual void topoChange(const polyTopoChangeMap&);
159 
160  //- Update from another mesh using the given map
161  virtual void mapMesh(const polyMeshMap&);
162 
163  //- Redistribute or update using the given distribution map
164  virtual void distribute(const polyDistributionMap&);
165 
166 
167  // IO
168 
169  //- Read dictionary
170  virtual bool read(const dictionary& dict);
171 
172 
173  // Member Operators
174 
175  //- Disallow default bitwise assignment
176  void operator=(const interRegionExplicitPorositySource&) = delete;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace fv
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
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:160
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:101
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
interRegionExplicitPorositySource(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
void operator=(const interRegionExplicitPorositySource &)=delete
Disallow default bitwise assignment.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void addSup(const volScalarField &rho, fvMatrix< vector > &eqn, const word &fieldName) const
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
TypeName("interRegionExplicitPorositySource")
Runtime type information.
Base class for inter-region exchange.
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
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict