phaseChange.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-2018 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  pairName_(dict.lookup("pairName")),
59  iDmdtPtr_(nullptr)
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64 
67 (
68  const volScalarField& alphai,
69  volScalarField& kappai
70 ) const
71 {
72  if (!iDmdtPtr_)
73  {
74  iDmdtPtr_ = &alphai.mesh().lookupObject<volScalarField>
75  (
76  IOobject::groupName("iDmdt", pairName_)
77  );
78  }
79 
80  const volScalarField& iDmdt = *iDmdtPtr_;
81 
82  return -fvm::SuSp
83  (
84  (1.0/3.0)
85  *iDmdt()
86  /(alphai()*phase().rho()()),
87  kappai
88  );
89 }
90 
91 
92 // ************************************************************************* //
dictionary dict
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
stressControl lookup("compactNormalStress") >> compactNormalStress
static word groupName(Name name, const word &group)
phaseChange(const IATE &iate, const dictionary &dict)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
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.