| 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) 2011-2015 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::incompressibleThreePhaseMixture |
| 28 |
|
| 29 |
Description |
| 30 |
|
| 31 |
SourceFiles |
| 32 |
incompressibleThreePhaseMixture.C |
| 33 |
|
| 34 |
\*---------------------------------------------------------------------------*/ |
| 35 |
|
| 36 |
#ifndef incompressibleThreePhaseMixture_H |
| 37 |
#define incompressibleThreePhaseMixture_H |
| 38 |
|
| 39 |
#include "incompressible/transportModel/transportModel.H" |
| 40 |
#include "IOdictionary.H" |
| 41 |
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H" |
| 42 |
#include "dimensionedScalar.H" |
| 43 |
#include "volFields.H" |
| 44 |
|
| 45 |
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // |
| 46 |
|
| 47 |
namespace Foam |
| 48 |
{ |
| 49 |
|
| 50 |
/*---------------------------------------------------------------------------*\ |
| 51 |
Class incompressibleThreePhaseMixture Declaration |
| 52 |
\*---------------------------------------------------------------------------*/ |
| 53 |
|
| 54 |
class incompressibleThreePhaseMixture |
| 55 |
: |
| 56 |
public IOdictionary, |
| 57 |
public transportModel |
| 58 |
{ |
| 59 |
// Private data |
| 60 |
|
| 61 |
word phase1Name_; |
| 62 |
word phase2Name_; |
| 63 |
word phase3Name_; |
| 64 |
|
| 65 |
volScalarField alpha1_; |
| 66 |
volScalarField alpha2_; |
| 67 |
volScalarField alpha3_; |
| 68 |
|
| 69 |
const volVectorField& U_; |
| 70 |
const surfaceScalarField& phi_; |
| 71 |
|
| 72 |
volScalarField nu_; |
| 73 |
|
| 74 |
autoPtr<viscosityModel> nuModel1_; |
| 75 |
autoPtr<viscosityModel> nuModel2_; |
| 76 |
autoPtr<viscosityModel> nuModel3_; |
| 77 |
|
| 78 |
dimensionedScalar rho1_; |
| 79 |
dimensionedScalar rho2_; |
| 80 |
dimensionedScalar rho3_; |
| 81 |
|
| 82 |
|
| 83 |
// Private Member Functions |
| 84 |
|
| 85 |
//- Calculate and return the laminar viscosity |
| 86 |
void calcNu(); |
| 87 |
|
| 88 |
|
| 89 |
public: |
| 90 |
|
| 91 |
// Constructors |
| 92 |
|
| 93 |
//- Construct from components |
| 94 |
incompressibleThreePhaseMixture |
| 95 |
( |
| 96 |
const volVectorField& U, |
| 97 |
const surfaceScalarField& phi |
| 98 |
); |
| 99 |
|
| 100 |
|
| 101 |
//- Destructor |
| 102 |
~incompressibleThreePhaseMixture() |
| 103 |
{} |
| 104 |
|
| 105 |
|
| 106 |
// Member Functions |
| 107 |
|
| 108 |
const word phase1Name() const |
| 109 |
{ |
| 110 |
return phase1Name_; |
| 111 |
} |
| 112 |
|
| 113 |
const word phase2Name() const |
| 114 |
{ |
| 115 |
return phase2Name_; |
| 116 |
} |
| 117 |
|
| 118 |
const word phase3Name() const |
| 119 |
{ |
| 120 |
return phase3Name_; |
| 121 |
} |
| 122 |
|
| 123 |
const volScalarField& alpha1() const |
| 124 |
{ |
| 125 |
return alpha1_; |
| 126 |
} |
| 127 |
|
| 128 |
volScalarField& alpha1() |
| 129 |
{ |
| 130 |
return alpha1_; |
| 131 |
} |
| 132 |
|
| 133 |
const volScalarField& alpha2() const |
| 134 |
{ |
| 135 |
return alpha2_; |
| 136 |
} |
| 137 |
|
| 138 |
volScalarField& alpha2() |
| 139 |
{ |
| 140 |
return alpha2_; |
| 141 |
} |
| 142 |
|
| 143 |
const volScalarField& alpha3() const |
| 144 |
{ |
| 145 |
return alpha3_; |
| 146 |
} |
| 147 |
|
| 148 |
volScalarField& alpha3() |
| 149 |
{ |
| 150 |
return alpha3_; |
| 151 |
} |
| 152 |
|
| 153 |
//- Return const-access to phase1 density |
| 154 |
const dimensionedScalar& rho1() const |
| 155 |
{ |
| 156 |
return rho1_; |
| 157 |
} |
| 158 |
|
| 159 |
//- Return const-access to phase2 density |
| 160 |
const dimensionedScalar& rho2() const |
| 161 |
{ |
| 162 |
return rho2_; |
| 163 |
}; |
| 164 |
|
| 165 |
//- Return const-access to phase3 density |
| 166 |
const dimensionedScalar& rho3() const |
| 167 |
{ |
| 168 |
return rho3_; |
| 169 |
}; |
| 170 |
|
| 171 |
//- Return the velocity |
| 172 |
const volVectorField& U() const |
| 173 |
{ |
| 174 |
return U_; |
| 175 |
} |
| 176 |
|
| 177 |
//- Return the flux |
| 178 |
const surfaceScalarField& phi() const |
| 179 |
{ |
| 180 |
return phi_; |
| 181 |
} |
| 182 |
|
| 183 |
//- Return const-access to phase1 viscosityModel |
| 184 |
const viscosityModel& nuModel1() const |
| 185 |
{ |
| 186 |
return *nuModel1_; |
| 187 |
} |
| 188 |
|
| 189 |
//- Return const-access to phase2 viscosityModel |
| 190 |
const viscosityModel& nuModel2() const |
| 191 |
{ |
| 192 |
return *nuModel2_; |
| 193 |
} |
| 194 |
|
| 195 |
//- Return const-access to phase3 viscosityModel |
| 196 |
const viscosityModel& nuModel3() const |
| 197 |
{ |
| 198 |
return *nuModel3_; |
| 199 |
} |
| 200 |
|
| 201 |
//- Return the dynamic laminar viscosity |
| 202 |
tmp<volScalarField> mu() const; |
| 203 |
|
| 204 |
//- Return the face-interpolated dynamic laminar viscosity |
| 205 |
tmp<surfaceScalarField> muf() const; |
| 206 |
|
| 207 |
//- Return the kinematic laminar viscosity |
| 208 |
tmp<volScalarField> nu() const |
| 209 |
{ |
| 210 |
return nu_; |
| 211 |
} |
| 212 |
|
| 213 |
//- Return the laminar viscosity for patch |
| 214 |
tmp<scalarField> nu(const label patchi) const |
| 215 |
{ |
| 216 |
return nu_.boundaryField()[patchi]; |
| 217 |
} |
| 218 |
|
| 219 |
//- Return the face-interpolated dynamic laminar viscosity |
| 220 |
tmp<surfaceScalarField> nuf() const; |
| 221 |
|
| 222 |
//- Correct the laminar viscosity |
| 223 |
void correct() |
| 224 |
{ |
| 225 |
calcNu(); |
| 226 |
} |
| 227 |
|
| 228 |
//- Read base transportProperties dictionary |
| 229 |
bool read(); |
| 230 |
}; |
| 231 |
|
| 232 |
|
| 233 |
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // |
| 234 |
|
| 235 |
} // End namespace Foam |
| 236 |
|
| 237 |
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // |
| 238 |
|
| 239 |
#endif |
| 240 |
|
| 241 |
// ************************************************************************* // |