incompressibleTwoPhaseInteractingMixture.C
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) 2014-2015 OpenFOAM Foundation
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
31 #include "surfaceFields.H"
32 #include "fvc.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38  defineTypeNameAndDebug(incompressibleTwoPhaseInteractingMixture, 0);
39 }
40 
41 
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43 
46 (
47  const volVectorField& U,
48  const surfaceScalarField& phi
49 )
50 :
51  IOdictionary
52  (
53  IOobject
54  (
55  "transportProperties",
56  U.time().constant(),
57  U.db(),
58  IOobject::MUST_READ_IF_MODIFIED,
59  IOobject::NO_WRITE
60  )
61  ),
62  twoPhaseMixture(U.mesh(), *this),
63 
64  muModel_
65  (
66  mixtureViscosityModel::New
67  (
68  "mu",
69  subDict(phase1Name_),
70  U,
71  phi
72  )
73  ),
74 
75  nucModel_
76  (
77  viscosityModel::New
78  (
79  "nuc",
80  subDict(phase2Name_),
81  U,
82  phi
83  )
84  ),
85 
86  rhod_("rho", dimDensity, muModel_->viscosityProperties()),
87  rhoc_("rho", dimDensity, nucModel_->viscosityProperties()),
88  dd_
89  (
90  "d",
91  dimLength,
92  muModel_->viscosityProperties().getOrDefault("d", 0.0)
93  ),
94  alphaMax_(muModel_->viscosityProperties().getOrDefault("alphaMax", 1.0)),
95 
96  U_(U),
97  phi_(phi),
98 
99  mu_
100  (
101  IOobject
102  (
103  "mu",
104  U_.time().timeName(),
105  U_.db()
106  ),
107  U_.mesh(),
108  dimensionedScalar(dimensionSet(1, -1, -1, 0, 0), Zero),
109  calculatedFvPatchScalarField::typeName
110  )
111 {
112  correct();
113 }
114 
115 
116 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
117 
119 {
120  if (regIOobject::read())
121  {
122  if
123  (
126  )
127  {
128  muModel_->viscosityProperties().readEntry("rho", rhod_);
129  nucModel_->viscosityProperties().readEntry("rho", rhoc_);
130 
132  (
133  "d",
134  dimLength,
135  muModel_->viscosityProperties().getOrDefault("d", 0)
136  );
137 
138  alphaMax_ =
139  muModel_->viscosityProperties().getOrDefault
140  (
141  "alphaMax",
142  1.0
143  );
144 
145  return true;
146  }
147  }
148 
149  return false;
150 }
151 
152 
153 // ************************************************************************* //
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::incompressibleTwoPhaseInteractingMixture::rhoc_
dimensionedScalar rhoc_
Definition: incompressibleTwoPhaseInteractingMixture.H:72
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::dimDensity
const dimensionSet dimDensity
Foam::twoPhaseMixture::phase1Name_
word phase1Name_
Definition: twoPhaseMixture.H:56
Foam::regIOobject::read
virtual bool read()
Read object.
Definition: regIOobjectRead.C:191
surfaceFields.H
Foam::surfaceFields.
Foam::incompressibleTwoPhaseInteractingMixture::incompressibleTwoPhaseInteractingMixture
incompressibleTwoPhaseInteractingMixture(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Foam::incompressibleTwoPhaseInteractingMixture::read
virtual bool read()
Read base transportProperties dictionary.
Foam::incompressibleTwoPhaseInteractingMixture::muModel_
autoPtr< mixtureViscosityModel > muModel_
Definition: incompressibleTwoPhaseInteractingMixture.H:68
incompressibleTwoPhaseInteractingMixture.H
correct
fvOptions correct(rho)
Foam::incompressibleTwoPhaseInteractingMixture::alphaMax_
scalar alphaMax_
Optional maximum dispersed phase-fraction (e.g. packing limit)
Definition: incompressibleTwoPhaseInteractingMixture.H:78
Foam::dictionary::subDict
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::incompressibleTwoPhaseInteractingMixture::dd_
dimensionedScalar dd_
Optional diameter of the dispersed phase particles.
Definition: incompressibleTwoPhaseInteractingMixture.H:75
timeName
word timeName
Definition: getTimeIndex.H:3
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::incompressibleTwoPhaseInteractingMixture::nucModel_
autoPtr< viscosityModel > nucModel_
Definition: incompressibleTwoPhaseInteractingMixture.H:69
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::incompressibleTwoPhaseInteractingMixture::rhod_
dimensionedScalar rhod_
Definition: incompressibleTwoPhaseInteractingMixture.H:71
Foam::twoPhaseMixture::phase2Name_
word phase2Name_
Definition: twoPhaseMixture.H:57
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
U
U
Definition: pEqn.H:72
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
fvc.H
constant
constant condensation/saturation model.
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)