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-2023 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 {
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 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
const Mesh & mesh() const
Return mesh.
Generic GeometricField class.
static word groupName(Name name, const word &group)
IATE (Interfacial Area Transport Equation) bubble diameter model.
Definition: IATE.H:69
IATE (Interfacial Area Transport Equation) bubble diameter model run-time selectable sources.
Definition: IATEsource.H:54
phaseChange(const IATE &iate, const dictionary &dict)
virtual tmp< fvScalarMatrix > R(const volScalarField &alphai, volScalarField &kappai) const
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Class to represent an interface between phases. Derivations can further specify the configuration of ...
virtual word name() const
Name.
label index(const phaseModel &phase) const
Return the index of the given phase. Generates a FatalError if.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Calculate the matrix for implicit and explicit sources.
addToRunTimeSelectionTable(IATEsource, dummy, word)
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const VolField< Type > &)
Namespace for OpenFOAM.
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
dictionary dict