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