All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
phaseChange.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 | Copyright (C) 2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "phaseChange.H"
27 #include "twoPhaseSystem.H"
28 #include "phaseSystem.H"
31 #include "fvmSup.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace diameterModels
39 {
40 namespace IATEsources
41 {
42  defineTypeNameAndDebug(phaseChange, 0);
43  addToRunTimeSelectionTable(IATEsource, phaseChange, dictionary);
44 }
45 }
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
53  const IATE& iate,
54  const dictionary& dict
55 )
56 :
57  IATEsource(iate)
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62 
65 (
66  const volScalarField& alphai,
67  volScalarField& kappai
68 ) const
69 {
70  const ThermalPhaseChangePhaseSystem
71  <
72  MomentumTransferPhaseSystem
73  <
74  twoPhaseSystem
75  >
76  >& phaseChangeFluid = refCast
77  <
78  const ThermalPhaseChangePhaseSystem
79  <
80  MomentumTransferPhaseSystem<twoPhaseSystem>
81  >
82  >(fluid());
83 
84  return -fvm::SuSp
85  (
86  (1.0/3.0)
87  *phaseChangeFluid.iDmdt(phase())()()
88  /(alphai()*phase().rho()()),
89  kappai
90  );
91 }
92 
93 
94 // ************************************************************************* //
dictionary dict
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
const twoPhaseSystem & fluid() const
Definition: IATEsource.H:143
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
const phaseModel & phase() const
Definition: IATEsource.H:138
phaseChange(const IATE &iate, const dictionary &dict)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
const dimensionedScalar & rho() const
Definition: phaseModel.H:165
A class for managing temporary objects.
Definition: PtrList.H:53
Calculate the matrix for implicit and explicit sources.
virtual tmp< volScalarField > R() const =0
Namespace for OpenFOAM.