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-2021 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 dictionary& dict,
118  const fvMesh& mesh
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  // IO
153 
154  //- Read dictionary
155  virtual bool read(const dictionary& dict);
156 
157 
158  // Member Operators
159 
160  //- Disallow default bitwise assignment
161  void operator=(const interRegionExplicitPorositySource&) = delete;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace fv
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
dictionary dict
virtual bool read(const dictionary &dict)
Read dictionary.
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
void operator=(const interRegionExplicitPorositySource &)=delete
Disallow default bitwise assignment.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
Base class for inter-region exchange.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
interRegionExplicitPorositySource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
TypeName("interRegionExplicitPorositySource")
Runtime type information.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Namespace for OpenFOAM.
virtual void addSup(const volScalarField &rho, fvMatrix< vector > &eqn, const word &fieldName) const