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-2022 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"
28 #include "fvmSup.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace diameterModels
36 {
37 namespace IATEsources
38 {
40  addToRunTimeSelectionTable(IATEsource, phaseChange, dictionary);
41 }
42 }
43 }
44 
45 
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 
49 (
50  const IATE& iate,
51  const dictionary& dict
52 )
53 :
54  IATEsource(iate),
55  otherPhaseName_(dict.lookup("otherPhase")),
56  dmdtfName_(dict.lookup("dmdtf")),
57  specieName_(dict.lookupOrDefault<word>("specie", word::null))
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62 
65 (
66  const volScalarField& alphai,
67  volScalarField& kappai
68 ) const
69 {
70  const phaseInterface interface
71  (
72  phase(),
73  phase().fluid().phases()[otherPhaseName_]
74  );
75 
76  const volScalarField& dmdtf =
77  alphai.mesh().lookupObject<volScalarField>
78  (
80  (
81  IOobject::groupName(dmdtfName_, specieName_),
82  interface.name()
83  )
84  );
85 
86  const label dmdtfSign = interface.index(phase()) == 0 ? +1 : -1;
87 
88  return -fvm::SuSp(dmdtfSign*dmdtf/(3*alphai*phase().rho()), kappai);
89 }
90 
91 
92 // ************************************************************************* //
dictionary dict
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual tmp< fvScalarMatrix > R(const volScalarField &alphai, volScalarField &kappai) const
twoPhaseChangeModel & phaseChange
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:58
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)
phaseSystem::phaseModelList & phases
Definition: createFields.H:12
A class for managing temporary objects.
Definition: PtrList.H:53
const phaseSystem & fluid() const
Definition: IATEsource.H:143
Calculate the matrix for implicit and explicit sources.
Namespace for OpenFOAM.