multiphaseSystem.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-2020 OpenCFD Ltd.
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::multiphaseSystem
28 
29 Description
30  Class which solves the volume fraction equations for multiple phases
31 
32 SourceFiles
33  multiphaseSystem.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef multiphaseSystem_H
38 #define multiphaseSystem_H
39 
40 #include "phaseSystem.H"
41 #include "UPtrList.H"
42 #include "phasePairKey.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class multiphaseSystem Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class multiphaseSystem
54 :
55  public phaseSystem
56 {
57 protected:
58 
60 
63 
65 
66 
67  // Protected data
68 
69  //- Unallocated phase list
70  UPtrList<phaseModel> phases_;
71 
72  //- Table for compression factors between phases
73  scalarTable cAlphas_;
74 
75  //- Maximum volumen rate change
77 
78  //- Compression fluxed for phases
80 
81  //- Su phase source terms
82  SuSpTable Su_;
83 
84  //- Sp phase source terms
85  SuSpTable Sp_;
86 
87 
88  // Protected members
89 
90  //- Calculate Sp and Su
91  void calculateSuSp();
92 
93  //- Solve alphas
94  void solveAlphas();
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("multiphaseSystem");
101 
102  // Declare runtime construction
103 
105  (
106  autoPtr,
108  dictionary,
109  (
110  const fvMesh& mesh
111  ),
112  (mesh)
113  );
114 
115 
116  // Constructors
117 
118  //- Construct from fvMesh
119  multiphaseSystem(const fvMesh&);
120 
121 
122  //- Destructor
123  virtual ~multiphaseSystem() = default;
124 
125 
126  // Selectors
127 
128  static autoPtr<multiphaseSystem> New(const fvMesh& mesh);
129 
130 
131  // Member Functions
132 
133  //- Solve for the phase fractions
134  virtual void solve();
135 
136 
137  // Access
138 
139  //- Return phases
140  const UPtrList<phaseModel>& phases() const;
141 
142  //- Return phases
144 
145  //- Constant access phase model i
146  const phaseModel& phase(const label i) const;
147 
148  //- Access phase model i
149  phaseModel& phase(const label i);
150 
151  //- Access to ddtAlphaMax
153 
154  //- Maximum diffusion number
155  scalar maxDiffNo() const;
156 
157  //- Access to compression fluxes for phaes
158  const compressionFluxTable& limitedPhiAlphas() const;
159 
160  //- Access Su
161  SuSpTable& Su();
162 
163  //- Access Sp
164  SuSpTable& Sp();
165 
166  //- Read thermophysical properties dictionary
167  virtual bool read();
168 };
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
Foam::multiphaseSystem::limitedPhiAlphas
const compressionFluxTable & limitedPhiAlphas() const
Access to compression fluxes for phaes.
Definition: multiphaseSystem.C:480
UPtrList.H
Foam::multiphaseSystem::~multiphaseSystem
virtual ~multiphaseSystem()=default
Destructor.
Foam::multiphaseSystem::calculateSuSp
void calculateSuSp()
Calculate Sp and Su.
Definition: multiphaseSystem.C:122
Foam::multiphaseSystem::solve
void solve()
Solve for the mixture phase-fractions.
Definition: multiphaseSystem.C:821
Foam::multiphaseSystem::phases_
UPtrList< phaseModel > phases_
Unallocated phase list.
Definition: multiphaseSystem.H:69
Foam::multiphaseSystem
Incompressible multi-phase mixture with built in solution for the phase fractions with interface comp...
Definition: multiphaseSystem.H:65
Foam::multiphaseSystem::scalarTable
HashTable< scalar, phasePairKey, phasePairKey::hash > scalarTable
Definition: multiphaseSystem.H:61
Foam::multiphaseSystem::phase
const phaseModel & phase(const label i) const
Constant access phase model i.
Definition: multiphaseSystem.C:446
Foam::multiphaseSystem::Su_
SuSpTable Su_
Su phase source terms.
Definition: multiphaseSystem.H:81
Foam::multiphaseSystem::maxDiffNo
scalar maxDiffNo() const
Maximum diffusion number.
Definition: multiphaseSystem.C:464
Foam::UPtrList< phaseModel >
Foam::multiphaseSystem::ddtAlphaMax
dimensionedScalar ddtAlphaMax() const
Access to ddtAlphaMax.
Definition: multiphaseSystem.C:458
Foam::multiphaseSystem::Sp
SuSpTable & Sp()
Access Sp.
Definition: multiphaseSystem.C:492
Foam::multiphaseSystem::Sp_
SuSpTable Sp_
Sp phase source terms.
Definition: multiphaseSystem.H:84
Foam::multiphaseSystem::read
bool read()
Read base transportProperties dictionary.
Definition: multiphaseSystem.C:916
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned< scalar >
Foam::multiphaseSystem::limitedPhiAlphas_
compressionFluxTable limitedPhiAlphas_
Compression fluxed for phases.
Definition: multiphaseSystem.H:78
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::multiphaseSystem::phases
const PtrDictionary< phaseModel > & phases() const
Return the phases.
Definition: multiphaseSystem.H:215
Foam::multiphaseSystem::New
static autoPtr< multiphaseSystem > New(const fvMesh &mesh)
Definition: multiphaseSystemNew.C:33
Foam::multiphaseSystem::SuSpTable
HashTable< volScalarField::Internal > SuSpTable
Definition: multiphaseSystem.H:58
Foam::HashTable< volScalarField::Internal >
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::multiphaseSystem::ddtAlphaMax_
dimensionedScalar ddtAlphaMax_
Maximum volumen rate change.
Definition: multiphaseSystem.H:75
Foam::multiphaseSystem::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, multiphaseSystem, dictionary,(const fvMesh &mesh),(mesh))
Foam::multiphaseSystem::cAlphas_
scalarTable cAlphas_
Table for compression factors between phases.
Definition: multiphaseSystem.H:72
Foam::multiphaseSystem::Su
SuSpTable & Su()
Access Su.
Definition: multiphaseSystem.C:486
Foam::multiphaseSystem::TypeName
TypeName("multiphaseSystem")
Runtime type information.
Foam::multiphaseSystem::multiphaseSystem
multiphaseSystem(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Definition: multiphaseSystem.C:361
Foam::multiphaseSystem::compressionFluxTable
HashTable< surfaceScalarField > compressionFluxTable
Definition: multiphaseSystem.H:63