incompressibleInterPhaseTransportModel.C
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) 2021 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 \*---------------------------------------------------------------------------*/
25 
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
32 (
33  const volVectorField& U,
34  const surfaceScalarField& phi,
35  const surfaceScalarField& alphaPhi10,
36  const incompressibleTwoPhaseMixture& mixture
37 )
38 :
39  twoPhaseTransport_(false),
40  mixture_(mixture),
41  phi_(phi),
42  alphaPhi10_(alphaPhi10)
43 {
44  {
45  IOdictionary momentumTransport
46  (
47  IOobject
48  (
49  momentumTransportModel::typeName,
50  U.time().constant(),
51  U.db(),
54  )
55  );
56 
57  word simulationType
58  (
59  momentumTransport.lookup("simulationType")
60  );
61 
62  if (simulationType == "twoPhaseTransport")
63  {
64  twoPhaseTransport_ = true;
65  }
66  }
67 
68  if (twoPhaseTransport_)
69  {
72 
73  alphaPhi2_ =
74  (
76  (
77  IOobject::groupName("alphaPhi", alpha2.group()),
78  (phi_ - alphaPhi10_)
79  )
80  );
81 
82  turbulence1_ =
83  (
85  (
86  alpha1,
87  U,
88  alphaPhi10_,
89  phi,
90  mixture.nuModel1()
91  )
92  );
93 
94  turbulence2_ =
95  (
97  (
98  alpha2,
99  U,
100  alphaPhi2_(),
101  phi,
102  mixture.nuModel2()
103  )
104  );
105  }
106  else
107  {
109  (
110  U,
111  phi,
112  mixture
113  );
114 
115  turbulence_->validate();
116  }
117 }
118 
119 
120 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
121 
124 (
125  const volScalarField& rho,
126  volVectorField& U
127 ) const
128 {
129  if (twoPhaseTransport_)
130  {
131  return
132  mixture_.rho1()*turbulence1_->divDevSigma(U)
133  + mixture_.rho2()*turbulence2_->divDevSigma(U);
134  }
135  else
136  {
137  return turbulence_->divDevTau(rho, U);
138  }
139 }
140 
141 
143 {
144  if (twoPhaseTransport_)
145  {
146  alphaPhi2_.ref() = (phi_ - alphaPhi10_);
147  }
148 }
149 
150 
152 {
153  if (twoPhaseTransport_)
154  {
155  turbulence1_->correct();
156  turbulence2_->correct();
157  }
158  else
159  {
160  turbulence_->correct();
161  }
162 }
163 
164 
165 // ************************************************************************* //
void correctPhasePhi()
Correct the phase mass-fluxes.
tmp< fvVectorMatrix > divDevTau(const volScalarField &rho, volVectorField &U) const
Return the effective momentum stress divergence.
const volScalarField & alpha2() const
Return the phase-fraction of phase 2.
const incompressibleTwoPhaseInteractingMixture & mixture_
Mixture properties.
volScalarField & alpha1(mixture.alpha1())
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:59
alpha2
Definition: alphaEqn.H:115
const volScalarField & alpha1() const
Return the phase-fraction of phase 1.
static autoPtr< incompressibleMomentumTransportModel > New(const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
Return a reference to the selected turbulence model.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:58
static word groupName(Name name, const word &group)
incompressibleInterPhaseTransportModel(const volVectorField &U, const surfaceScalarField &phi, const surfaceScalarField &alphaPhi10, const incompressibleTwoPhaseMixture &mixture)
Construct from components.
A class for managing temporary objects.
Definition: PtrList.H:53
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static autoPtr< phaseIncompressibleMomentumTransportModel > New(const alphaField &alpha, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Return a reference to the selected turbulence model.
void correct()
Correct the phase or mixture transport models.