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-------------------------------------------------------------------------------
10License
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
33namespace 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// ************************************************************************* //
surfaceScalarField & phi
volScalarField & rho2
volScalarField & rho1
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:69
const dimensionedScalar & rho1() const
Return const-access to phase1 density.
const dimensionedScalar & rho2() const
Return const-access to phase2 density.
virtual bool read()
Read base transportProperties dictionary.
virtual bool read()=0
Read the transportProperties dictionary and update.
Pair< tmp< volScalarField > > vDotP() const
Return the volumetric condensation and vaporisation rates as.
Pair< tmp< volScalarField > > vDotAlphal() const
Return the volumetric condensation and vaporisation rates as a.
virtual Pair< tmp< volScalarField > > mDotAlphal() const =0
Return the mass condensation and vaporisation rates as a.
volScalarField alpha1_
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
U
Definition: pEqn.H:72
type
Types of root.
Definition: Roots.H:55
Namespace for OpenFOAM.
const dimensionSet dimPressure
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.