phaseLimitStabilisation.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) 2017-2024 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::phaseLimitStabilisation
26 
27 Description
28  Stabilisation source for phase transport equations
29 
30  Applies an implicit source to the phase transport equation for the specified
31  \c field when the phase volume fraction is below \c residualAlpha. The
32  stabilisation rate is provided by the registered
33  uniformDimensionedScalarField \c rate, which could be extended to also
34  support volScalarField and volScalarField::Internal field types. The \c
35  field is currently stabilised towards zero in the limit of the phase volume
36  fraction approaching zero but this could be extended to support a
37  specified value or a value or field looked-up from the database.
38 
39 Usage
40  Example usage:
41  \verbatim
42  stabilisation
43  {
44  type phaseLimitStabilisation;
45 
46  field sigma.liquid;
47 
48  rate rLambda.liquid;
49  residualAlpha 1e-3;
50  }
51  \endverbatim
52 
53 SourceFiles
54  phaseLimitStabilisation.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef phaseLimitStabilisation_H
59 #define phaseLimitStabilisation_H
60 
61 #include "fvModel.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace fv
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class phaseLimitStabilisation Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public fvModel
77 {
78  // Private Data
79 
80  //- Field name
81  word fieldName_;
82 
83  //- Rate field name
84  word rateName_;
85 
86  //- Residual alpha value below which stabilisation is applied
87  scalar residualAlpha_;
88 
89 
90  // Private Member Functions
91 
92  //- Non-virtual read
93  void readCoeffs();
94 
95  //- Add source terms to an incompressible phase equation
96  template<class Type>
97  void addSupType
98  (
99  const volScalarField& alpha,
100  const VolField<Type>& field,
101  fvMatrix<Type>& eqn
102  ) const;
103 
104  //- Add source terms to a phase equation
105  template<class Type>
106  void addSupType
107  (
108  const volScalarField& alpha,
109  const volScalarField& rho,
110  const VolField<Type>& field,
111  fvMatrix<Type>& eqn
112  ) const;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("phaseLimitStabilisation");
119 
120 
121  // Constructors
122 
123  //- Construct from components
125  (
126  const word& name,
127  const word& modelType,
128  const fvMesh& mesh,
129  const dictionary& dict
130  );
131 
132  //- Disallow default bitwise copy construction
134 
135 
136  //- Destructor
137  virtual ~phaseLimitStabilisation()
138  {}
139 
140 
141  // Member Functions
142 
143  // Checks
144 
145  //- Return the list of fields for which the fvModel adds source term
146  // to the transport equation
147  virtual wordList addSupFields() const;
148 
149 
150  // Sources
151 
152  //- Add a source term to an incompressible phase equation
154 
155  //- Add a source term to a phase equation
157 
158 
159  // Mesh changes
160 
161  //- Update for mesh motion
162  virtual bool movePoints();
163 
164  //- Update topology using the given map
165  virtual void topoChange(const polyTopoChangeMap&);
166 
167  //- Update from another mesh using the given map
168  virtual void mapMesh(const polyMeshMap&);
169 
170  //- Redistribute or update using the given distribution map
171  virtual void distribute(const polyDistributionMap&);
172 
173 
174  //- Read dictionary
175  virtual bool read(const dictionary& dict);
176 
177 
178  // Member Operators
179 
180  //- Disallow default bitwise assignment
181  void operator=(const phaseLimitStabilisation&) = delete;
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace fv
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Generic GeometricField class.
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
Finite volume model abstract base class.
Definition: fvModel.H:59
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
Stabilisation source for phase transport equations.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
TypeName("phaseLimitStabilisation")
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 movePoints()
Add a source term to an incompressible phase equation.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
phaseLimitStabilisation(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
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
#define DEFINE_FV_MODEL_ADD_ALPHA_RHO_FIELD_SUP(Type, nullArg)
Definition: fvModelM.H:62
#define DEFINE_FV_MODEL_ADD_RHO_FIELD_SUP(Type, nullArg)
Definition: fvModelM.H:43
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
labelList fv(nPoints)
dictionary dict