IATEphaseChange.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2020 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 "IATEphaseChange.H"
27 #include "phaseSystem.H"
30 #include "fvmSup.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace diameterModels
38 {
39 namespace IATEsources
40 {
41  defineTypeNameAndDebug(phaseChange, 0);
42  addToRunTimeSelectionTable(IATEsource, phaseChange, dictionary);
43 }
44 }
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
51 (
52  const IATE& iate,
53  const dictionary& dict
54 )
55 :
56  IATEsource(iate),
57  otherPhaseName_(dict.lookup("otherPhase")),
58  dmdtfName_(dict.lookup("dmdtf")),
59  specieName_(dict.lookupOrDefault<word>("specie", word::null))
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64 
67 (
68  const volScalarField& alphai,
69  volScalarField& kappai
70 ) const
71 {
72  const phasePair& pair =
73  phase().fluid().phasePairs()
74  [
75  phasePairKey(phase().name(), otherPhaseName_)
76  ];
77 
78  const volScalarField& dmdtf =
79  alphai.mesh().lookupObject<volScalarField>
80  (
82  (
83  IOobject::groupName(dmdtfName_, specieName_),
84  pair.name()
85  )
86  );
87 
88  const label dmdtfSign =
89  phase().name() == pair.first() ? +1 : -1;
90 
91  return -fvm::SuSp(dmdtfSign*dmdtf/(3*alphai*phase().rho()), kappai);
92 }
93 
94 
95 // ************************************************************************* //
dictionary dict
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual tmp< fvScalarMatrix > R(const volScalarField &alphai, volScalarField &kappai) const
const word & name() const
Definition: phaseModel.H:109
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
const phasePairTable & phasePairs() const
Return the phase pairs.
Definition: phaseSystemI.H:105
stressControl lookup("compactNormalStress") >> compactNormalStress
static word groupName(Name name, const word &group)
const phaseModel & phase() const
Definition: IATEsource.H:138
phaseChange(const IATE &iate, const dictionary &dict)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const Mesh & mesh() const
Return mesh.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
const phaseSystem & fluid() const
Return the system to which this phase belongs.
A class for managing temporary objects.
Definition: PtrList.H:53
Calculate the matrix for implicit and explicit sources.
Namespace for OpenFOAM.