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-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::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 a phase equation
96  template<class Type>
97  void addSupType
98  (
99  const volScalarField& alpha,
100  const volScalarField& rho,
101  fvMatrix<Type>& eqn,
102  const word& fieldName
103  ) const;
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("phaseLimitStabilisation");
110 
111 
112  // Constructors
113 
114  //- Construct from components
116  (
117  const word& name,
118  const word& modelType,
119  const dictionary& dict,
120  const fvMesh& mesh
121  );
122 
123  //- Disallow default bitwise copy construction
125 
126 
127  //- Destructor
128  virtual ~phaseLimitStabilisation()
129  {}
130 
131 
132  // Member Functions
133 
134  // Checks
135 
136  //- Return the list of fields for which the fvModel adds source term
137  // to the transport equation
138  virtual wordList addSupFields() const;
139 
140 
141  // Sources
142 
143  //- Add a source term to a phase equation
145 
146 
147  //- Read dictionary
148  virtual bool read(const dictionary& dict);
149 
150 
151  // Member Operators
152 
153  //- Disallow default bitwise assignment
154  void operator=(const phaseLimitStabilisation&) = delete;
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace fv
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
dictionary dict
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
virtual bool read(const dictionary &dict)
Read dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
FOR_ALL_FIELD_TYPES(DEFINE_FV_MODEL_ADD_ALPHA_RHO_SUP)
Add a source term to a phase equation.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
#define DEFINE_FV_MODEL_ADD_ALPHA_RHO_SUP(Type, nullArg)
Definition: fvModelM.H:62
Finite volume model abstract base class.
Definition: fvModel.H:55
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
phaseLimitStabilisation(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
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("phaseLimitStabilisation")
Runtime type information.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Stabilisation source for phase transport equations.
void operator=(const phaseLimitStabilisation &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.