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) 2013-2018 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::multiphaseSystem
28 
29 Description
30  Class which solves the volume fraction equations for two phases.
31 
32 SourceFiles
33  multiphaseSystem.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef multiphaseSystem_H
38 #define multiphaseSystem_H
39 
40 #include "phaseSystem.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class dragModel;
48 class virtualMassModel;
49 
50 /*---------------------------------------------------------------------------*\
51  Class multiphaseSystem Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class multiphaseSystem
55 :
56  public phaseSystem
57 {
58 private:
59 
60  // Private typedefs
61 
64 
65 
66  // Private data
67 
68  //- The indexed phase-fraction field; e.g., 1 for water, 2 for air, 3
69  // for oil, etc...
70  volScalarField alphas_;
71 
72  //-
73  cAlphaTable cAlphas_;
74 
75  //- Stabilisation for normalisation of the interface normal
76  const dimensionedScalar deltaN_;
77 
78  //- Conversion factor for degrees into radians
79  static const scalar convertToRad;
80 
81 
82  // Private member functions
83 
84  void calcAlphas();
85 
86  void solveAlphas();
87 
89  (
90  const volScalarField& alpha1,
91  const volScalarField& alpha2
92  ) const;
93 
95  (
96  const volScalarField& alpha1,
97  const volScalarField& alpha2
98  ) const;
99 
100  void correctContactAngle
101  (
102  const phaseModel& alpha1,
103  const phaseModel& alpha2,
104  surfaceVectorField::Boundary& nHatb
105  ) const;
106 
108  (
109  const phaseModel& alpha1,
110  const phaseModel& alpha2
111  ) const;
112 
113  //- Return the drag coefficient for phase pair
114  virtual tmp<volScalarField> Kd(const phasePairKey& key) const = 0;
115 
116  //- Return the virtual mass coefficient for phase pair
117  virtual tmp<volScalarField> Vm(const phasePairKey& key) const = 0;
118 
119 
120 protected:
121 
122  // Protected data
123 
124  //- Flag to indicate that returned lists of fields are "complete"; i.e.,
125  // that an absence of force is returned as a constructed list of zeros,
126  // rather than a null pointer
127  static const bool fillFields_ = false;
128 
129 
130 public:
131 
132  //- Runtime type information
133  TypeName("multiphaseSystem");
134 
135  // Declare runtime construction
136 
138  (
139  autoPtr,
141  dictionary,
142  (
143  const fvMesh& mesh
144  ),
145  (mesh)
146  );
147 
148 
149  // Constructors
150 
151  //- Construct from fvMesh
152  multiphaseSystem(const fvMesh& mesh);
153 
154 
155  //- Destructor
156  virtual ~multiphaseSystem();
157 
158 
159  // Selectors
160 
162  (
163  const fvMesh& mesh
164  );
165 
166 
167  // Member Functions
168 
169  using phaseSystem::sigma;
170  using phaseSystem::dmdts;
171 
172  //- Return the surface tension force
174 
175  //- Indicator of the proximity of the interface
176  // Field values are 1 near and 0 away for the interface.
178 
179  //- Solve for the phase fractions
180  virtual void solve();
181 };
182 
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:57
Foam::multiphaseSystem::nearInterface
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
Definition: multiphaseSystem.C:597
Foam::multiphaseSystem::~multiphaseSystem
virtual ~multiphaseSystem()
Destructor.
Definition: multiphaseSystem.C:545
Foam::multiphaseSystem::solve
virtual void solve()
Solve for the phase fractions.
Definition: multiphaseSystem.C:622
Foam::phase
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:54
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::phaseSystem::sigma
tmp< volScalarField > sigma(const phasePairKey &key) const
Return the surface tension coefficient for a pair.
Definition: phaseSystem.C:319
alpha2
const volScalarField & alpha2
Definition: setRegionFluidFields.H:9
Foam::multiphaseSystem::multiphaseSystem
multiphaseSystem(const fvMesh &mesh)
Construct from fvMesh.
Definition: multiphaseSystem.C:507
Foam::multiphaseSystem
Class which solves the volume fraction equations for two phases.
Definition: multiphaseSystem.H:53
alpha1
const volScalarField & alpha1
Definition: setRegionFluidFields.H:8
Foam::multiphaseSystem::surfaceTension
tmp< surfaceScalarField > surfaceTension(const phaseModel &phase) const
Return the surface tension force.
Definition: multiphaseSystem.C:552
Foam::phaseSystem::dmdts
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
Definition: phaseSystem.C:351
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
Foam::phasePairKey
Definition: phasePairKey.H:59
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::multiphaseSystem::fillFields_
static const bool fillFields_
Flag to indicate that returned lists of fields are "complete"; i.e.,.
Definition: multiphaseSystem.H:126
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::multiphaseSystem::New
static autoPtr< multiphaseSystem > New(const fvMesh &mesh)
Definition: newMultiphaseSystem.C:34
Foam::phaseSystem::mesh
const fvMesh & mesh() const
Return the mesh.
Definition: phaseSystemI.H:30
Foam::HashTable< scalar, phasePairKey, phasePairKey::hash >
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::multiphaseSystem::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, multiphaseSystem, dictionary,(const fvMesh &mesh),(mesh))
Foam::phaseSystem
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:69
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::multiphaseSystem::TypeName
TypeName("multiphaseSystem")
Runtime type information.