phaseChangeTwoPhaseMixture.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) 2011-2017 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 \*---------------------------------------------------------------------------*/
27 
29 #include "surfaceMesh.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(phaseChangeTwoPhaseMixture, 0);
36  defineRunTimeSelectionTable(phaseChangeTwoPhaseMixture, components);
37 }
38 
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
42 (
43  const word& type,
44  const volVectorField& U,
45  const surfaceScalarField& phi
46 )
47 :
48  incompressibleTwoPhaseMixture(U, phi),
49  phaseChangeTwoPhaseMixtureCoeffs_(optionalSubDict(type + "Coeffs")),
50  pSat_("pSat", dimPressure, *this)
51 {}
52 
53 
54 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
55 
58 {
59  volScalarField alphalCoeff(1.0/rho1() - alpha1_*(1.0/rho1() - 1.0/rho2()));
60  Pair<tmp<volScalarField>> mDotAlphal = this->mDotAlphal();
61 
62  return Pair<tmp<volScalarField>>
63  (
64  alphalCoeff*mDotAlphal[0],
65  alphalCoeff*mDotAlphal[1]
66  );
67 }
68 
71 {
72  dimensionedScalar pCoeff(1.0/rho1() - 1.0/rho2());
73  Pair<tmp<volScalarField>> mDotP = this->mDotP();
74 
75  return Pair<tmp<volScalarField>>(pCoeff*mDotP[0], pCoeff*mDotP[1]);
76 }
77 
78 
80 {
82  {
83  phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs");
84  readEntry("pSat", pSat_);
85 
86  return true;
87  }
88 
89  return false;
90 }
91 
92 
93 // ************************************************************************* //
type
Types of root.
Definition: Roots.H:52
virtual bool read()=0
Read the transportProperties dictionary and update.
volScalarField & rho1
Pair< tmp< volScalarField > > vDotAlphal() const
Return the volumetric condensation and vaporisation rates as a.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:85
phaseChangeTwoPhaseMixture(const phaseChangeTwoPhaseMixture &)=delete
No copy construct.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:84
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:752
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: instant.H:46
const dimensionSet dimPressure
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
volScalarField & rho2
U
Definition: pEqn.H:72
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Pair< tmp< volScalarField > > vDotP() const
Return the volumetric condensation and vaporisation rates as.
virtual bool read()
Read base transportProperties dictionary.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Namespace for OpenFOAM.