PhaseLimitStabilization.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-2019 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::PhaseLimitStabilization
26 
27 Description
28  Stabilization 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  stabilization 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 stabilized 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  stabilization
43  {
44  type symmTensorPhaseLimitStabilization;
45 
46  field sigma.liquid;
47  rate rLambda.liquid;
48  residualAlpha 1e-3;
49  }
50  \endverbatim
51 
52 SourceFiles
53  PhaseLimitStabilization.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef PhaseLimitStabilization_H
58 #define PhaseLimitStabilization_H
59 
60 #include "fvOption.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 namespace fv
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class PhaseLimitStabilization Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 template<class Type>
75 :
76  public option
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 stabilization is applied
87  scalar residualAlpha_;
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("PhaseLimitStabilization");
94 
95 
96  // Constructors
97 
98  //- Construct from components
100  (
101  const word& name,
102  const word& modelType,
103  const dictionary& dict,
104  const fvMesh& mesh
105  );
106 
107  //- Disallow default bitwise copy construction
109 
110 
111  //- Destructor
112  virtual ~PhaseLimitStabilization()
113  {}
114 
115 
116  // Member Functions
117 
118  //- Source term to compressible phase equation
119  virtual void addSup
120  (
121  const volScalarField& alpha,
122  const volScalarField& rho,
123  fvMatrix<Type>& eqn,
124  const label fieldi
125  );
126 
127  //- Read dictionary
128  virtual bool read(const dictionary& dict);
129 
130 
131  // Member Operators
132 
133  //- Disallow default bitwise assignment
134  void operator=(const PhaseLimitStabilization&) = delete;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace fv
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #ifdef NoRepository
146  #include "PhaseLimitStabilization.C"
147 #endif
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
void operator=(const PhaseLimitStabilization &)=delete
Disallow default bitwise assignment.
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual void addSup(const volScalarField &alpha, const volScalarField &rho, fvMatrix< Type > &eqn, const label fieldi)
Source term to compressible phase equation.
TypeName("PhaseLimitStabilization")
Runtime type information.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
PhaseLimitStabilization(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
Stabilization source for phase transport equations.
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
virtual bool read(const dictionary &dict)
Read dictionary.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
Finite volume options abstract base class. Provides a base set of controls, e.g.: ...
Definition: fvOption.H:66