explicitPorositySource.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-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fv::explicitPorositySource
28 
29 Group
30  grpFvOptionsSources
31 
32 Description
33  Explicit porosity source
34 
35 Usage
36  Example usage, here employing the Darcy-Forchheimer model:
37  \verbatim
38  explicitPorositySourceCoeffs
39  {
40  type DarcyForchheimer;
41 
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  explicitPorositySource.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef explicitPorositySource_H
66 #define explicitPorositySource_H
67 
68 #include "cellSetOption.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 class porosityModel;
76 
77 namespace fv
78 {
79 
80 
81 /*---------------------------------------------------------------------------*\
82  Class explicitPorositySource Declaration
83 \*---------------------------------------------------------------------------*/
84 
86 :
87  public cellSetOption
88 {
89 protected:
90 
91  // Protected data
92 
93  //- Run-time selectable porosity model
95 
96 
97 private:
98 
99  // Private Member Functions
100 
101  //- No copy construct
103 
104  //- No copy assignment
105  void operator=(const explicitPorositySource&) = delete;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("explicitPorositySource");
112 
113 
114  // Constructors
115 
116  //- Construct from components
118  (
119  const word& name,
120  const word& modelType,
121  const dictionary& dict,
122  const fvMesh& mesh
123  );
124 
125 
126  //- Destructor
127  virtual ~explicitPorositySource() = default;
128 
129 
130  // Member Functions
131 
132  //- Access to the porosityModel
133  const porosityModel& model() const
134  {
135  return *porosityPtr_;
136  }
137 
138 
139  //- Add implicit contribution to momentum equation
140  virtual void addSup
141  (
142  fvMatrix<vector>& eqn,
143  const label fieldi
144  );
145 
146  //- Add implicit contribution to compressible momentum equation
147  virtual void addSup
148  (
149  const volScalarField& rho,
150  fvMatrix<vector>& eqn,
151  const label fieldi
152  );
153 
154  //- Add implicit contribution to phase momentum equation
155  virtual void addSup
156  (
157  const volScalarField& alpha,
158  const volScalarField& rho,
159  fvMatrix<vector>& eqn,
160  const label fieldi
161  );
162 
163 
164  //- Read dictionary
165  virtual bool read(const dictionary& dict);
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace fv
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::cellSetOption
Cell-set options abstract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:72
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:30
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::fv::explicitPorositySource::TypeName
TypeName("explicitPorositySource")
Runtime type information.
rho
rho
Definition: readInitialConditions.H:88
cellSetOption.H
Foam::fv::explicitPorositySource::~explicitPorositySource
virtual ~explicitPorositySource()=default
Destructor.
Foam::fv::explicitPorositySource
Explicit porosity source.
Definition: explicitPorositySource.H:84
Foam::fv::explicitPorositySource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Add implicit contribution to momentum equation.
Definition: explicitPorositySource.C:83
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::fv::explicitPorositySource::model
const porosityModel & model() const
Access to the porosityModel.
Definition: explicitPorositySource.H:132
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
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::porosityModel
Top level model for porosity models.
Definition: porosityModel.H:57
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::explicitPorositySource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: explicitPorositySource.C:121
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::fv::explicitPorositySource::porosityPtr_
autoPtr< porosityModel > porosityPtr_
Run-time selectable porosity model.
Definition: explicitPorositySource.H:93