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-2018 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  // Private Member Functions
91 
92  //- Disallow default bitwise copy construct
94 
95  //- Disallow default bitwise assignment
96  void operator=(const PhaseLimitStabilization&);
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("PhaseLimitStabilization");
103 
104 
105  // Constructors
106 
107  //- Construct from components
109  (
110  const word& name,
111  const word& modelType,
112  const dictionary& dict,
113  const fvMesh& mesh
114  );
115 
116 
117  //- Destructor
118  virtual ~PhaseLimitStabilization()
119  {}
120 
121 
122  // Member Functions
123 
124  //- Source term to compressible phase equation
125  virtual void addSup
126  (
127  const volScalarField& alpha,
128  const volScalarField& rho,
129  fvMatrix<Type>& eqn,
130  const label fieldi
131  );
132 
133  //- Read dictionary
134  virtual bool read(const dictionary& dict);
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 // ************************************************************************* //
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:137
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)
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
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Namespace for OpenFOAM.
Finite volume options abstract base class. Provides a base set of controls, e.g.: ...
Definition: fvOption.H:66