PhaseLimitStabilization.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) 2017 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::PhaseLimitStabilization
28 
29 Description
30  Stabilization source for phase transport equations
31 
32  Applies an implicit source to the phase transport equation for the specified
33  \c field when the phase volume fraction is below \c residualAlpha. The
34  stabilization rate is provided by the registered
35  uniformDimensionedScalarField \c rate, which could be extended to also
36  support volScalarField and volScalarField::Internal field types. The \c
37  field is currently stabilized towards zero in the limit of the phase volume
38  fraction approaching zero but this could be extended to support a
39  specified value or a value or field looked-up from the database.
40 
41 Usage
42  Example usage:
43  \verbatim
44  stabilization
45  {
46  type symmTensorPhaseLimitStabilization;
47 
48  field sigma.liquid;
49  rate rLambda.liquid;
50  residualAlpha 1e-3;
51  }
52  \endverbatim
53 
54 SourceFiles
55  PhaseLimitStabilization.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef PhaseLimitStabilization_H
60 #define PhaseLimitStabilization_H
61 
62 #include "fvOption.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 namespace fv
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class PhaseLimitStabilization Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 template<class Type>
77 :
78  public option
79 {
80  // Private data
81 
82  //- Field name
83  word fieldName_;
84 
85  //- Rate field name
86  word rateName_;
87 
88  //- Residual alpha value below which stabilization is applied
89  scalar residualAlpha_;
90 
91 
92  // Private Member Functions
93 
94  //- No copy construct
96 
97  //- No copy assignment
98  void operator=(const PhaseLimitStabilization&) = delete;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("PhaseLimitStabilization");
105 
106 
107  // Constructors
108 
109  //- Construct from components
111  (
112  const word& name,
113  const word& modelType,
114  const dictionary& dict,
115  const fvMesh& mesh
116  );
117 
118 
119  //- Destructor
120  virtual ~PhaseLimitStabilization() = default;
121 
122 
123  // Member Functions
124 
125  //- Source term to compressible phase equation
126  virtual void addSup
127  (
128  const volScalarField& alpha,
129  const volScalarField& rho,
130  fvMatrix<Type>& eqn,
131  const label fieldi
132  );
133 
134  //- Read dictionary
135  virtual bool read(const dictionary& dict);
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace fv
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #ifdef NoRepository
147  #include "PhaseLimitStabilization.C"
148 #endif
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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::PhaseLimitStabilization::~PhaseLimitStabilization
virtual ~PhaseLimitStabilization()=default
Destructor.
rho
rho
Definition: readInitialConditions.H:88
Foam::fv::PhaseLimitStabilization
Stabilization source for phase transport equations.
Definition: PhaseLimitStabilization.H:75
Foam::fv::option
Finite volume options abstract base class. Provides a base set of controls, e.g.:
Definition: fvOption.H:69
dict
dictionary dict
Definition: searchingEngine.H:14
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::fv::PhaseLimitStabilization::addSup
virtual void addSup(const volScalarField &alpha, const volScalarField &rho, fvMatrix< Type > &eqn, const label fieldi)
Source term to compressible phase equation.
Definition: PhaseLimitStabilization.C:58
Foam::fv::PhaseLimitStabilization::TypeName
TypeName("PhaseLimitStabilization")
Runtime type information.
fvOption.H
Foam::fv::PhaseLimitStabilization::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: PhaseLimitStabilization.C:75
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::GeometricField< scalar, fvPatchField, volMesh >
PhaseLimitStabilization.C