temperaturePhaseChangeTwoPhaseMixture.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) 2016-2020 OpenCFD Ltd.
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
30// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31
32namespace Foam
33{
34 defineTypeNameAndDebug(temperaturePhaseChangeTwoPhaseMixture, 0);
36 (
37 temperaturePhaseChangeTwoPhaseMixture,
38 components
39 );
40}
41
42// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43
44Foam::temperaturePhaseChangeTwoPhaseMixture::
45temperaturePhaseChangeTwoPhaseMixture
46(
47 const thermoIncompressibleTwoPhaseMixture& mixture,
48 const fvMesh& mesh
49)
50:
51 IOdictionary
52 (
53 IOobject
54 (
55 "phaseChangeProperties",
56 mesh.time().constant(),
57 mesh,
58 IOobject::MUST_READ_IF_MODIFIED,
59 IOobject::NO_WRITE
60 )
61 ),
62 mixture_(mixture),
63 mesh_(mesh)
64{}
65
66
67// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
68
71{
72 volScalarField alphalCoeff
73 (
75 *(1.0/mixture_.rho1() - 1.0/mixture_.rho2())
76 );
77
78 Pair<tmp<volScalarField>> mDotAlphal = this->mDotAlphal();
79
80 return Pair<tmp<volScalarField>>
81 (
82 alphalCoeff*mDotAlphal[0],
83 alphalCoeff*mDotAlphal[1]
84 );
85}
86
87
90{
91 dimensionedScalar pCoeff(1.0/mixture_.rho1() - 1.0/mixture_.rho2());
92 Pair<tmp<volScalarField>> mDot = this->mDot();
93
94 return Pair<tmp<volScalarField>>(pCoeff*mDot[0], pCoeff*mDot[1]);
95}
96
97
99{
100 if (regIOobject::read())
101 {
102 return true;
103 }
104
105 return false;
106}
107
108
109// ************************************************************************* //
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.
constant condensation/saturation model.
virtual bool read()
Read object.
virtual Pair< tmp< volScalarField > > vDot() const
Return the volumetric condensation and vaporisation rates as.
const thermoIncompressibleTwoPhaseMixture & mixture_
Reference to the thermoIncompressibleTwoPhaseMixture.
virtual Pair< tmp< volScalarField > > vDotAlphal() const
Return the volumetric condensation and vaporisation rates as a.
virtual bool read()
Read the transportProperties dictionary and update.
virtual Pair< tmp< volScalarField > > mDotAlphal() const =0
Return the mass condensation and vaporisation rates as a.
const volScalarField & alpha1() const
Return the phase-fraction of phase 1.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39