incompressibleTwoPhaseInteractingMixture.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) 2014-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 
28 #include "surfaceFields.H"
29 #include "fvc.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(incompressibleTwoPhaseInteractingMixture, 0);
36 }
37 
38 
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
43 (
44  const volVectorField& U,
45  const surfaceScalarField& phi
46 )
47 :
48  IOdictionary
49  (
50  IOobject
51  (
52  "transportProperties",
53  U.time().constant(),
54  U.db(),
55  IOobject::MUST_READ_IF_MODIFIED,
56  IOobject::NO_WRITE
57  )
58  ),
59  twoPhaseMixture(U.mesh(), *this),
60  dynamicTransportModel(),
61 
62  muModel_
63  (
64  mixtureViscosityModel::New
65  (
66  "mu",
67  subDict(phase1Name_),
68  U,
69  phi
70  )
71  ),
72 
73  nucModel_
74  (
75  viscosityModel::New
76  (
77  "nuc",
78  subDict(phase2Name_),
79  U,
80  phi
81  )
82  ),
83 
84  rhod_("rho", dimDensity, muModel_->viscosityProperties()),
85  rhoc_("rho", dimDensity, nucModel_->viscosityProperties()),
86  dd_
87  (
88  "d",
89  dimLength,
90  muModel_->viscosityProperties().lookupOrDefault("d", 0.0)
91  ),
92  alphaMax_(muModel_->viscosityProperties().lookupOrDefault("alphaMax", 1.0)),
93 
94  U_(U),
95  phi_(phi),
96 
97  mu_
98  (
99  IOobject
100  (
101  "mu",
102  U_.time().timeName(),
103  U_.db()
104  ),
105  U_.mesh(),
106  dimensionedScalar(dimensionSet(1, -1, -1, 0, 0), 0),
107  calculatedFvPatchScalarField::typeName
108  )
109 {
110  correct();
111 }
112 
113 
114 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
115 
117 {
118  if (regIOobject::read())
119  {
120  if
121  (
122  muModel_().read(subDict(phase1Name_))
123  && nucModel_().read(subDict(phase2Name_))
124  )
125  {
126  muModel_->viscosityProperties().lookup("rho") >> rhod_;
127  nucModel_->viscosityProperties().lookup("rho") >> rhoc_;
128 
129  dd_ = dimensionedScalar
130  (
131  "d",
132  dimLength,
133  muModel_->viscosityProperties().lookupOrDefault("d", 0)
134  );
135 
136  alphaMax_ =
137  muModel_->viscosityProperties().lookupOrDefault
138  (
139  "alphaMax",
140  1.0
141  );
142 
143  return true;
144  }
145  else
146  {
147  return false;
148  }
149  }
150  else
151  {
152  return false;
153  }
154 }
155 
156 
157 // ************************************************************************* //
Foam::surfaceFields.
virtual bool read()
Read base transportProperties dictionary.
virtual bool read()
Read object.
static dimensioned< Type > lookupOrDefault(const word &, const dictionary &, const dimensionSet &dims=dimless, const Type &defaultValue=pTraits< Type >::zero)
Construct from dictionary, with default dimensions and value.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
Macros for easy insertion into run-time selection tables.
const dimensionSet dimLength
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
dynamicFvMesh & mesh
virtual bool read()
Read phase properties dictionary.
const dimensionSet dimDensity
phi
Definition: correctPhi.H:3
word timeName
Definition: getTimeIndex.H:3
incompressibleTwoPhaseInteractingMixture(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
defineTypeNameAndDebug(combustionModel, 0)
U
Definition: pEqn.H:72
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Namespace for OpenFOAM.