interfaceCompositionModel.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2017-2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
29#include "phaseModel.H"
30#include "phasePair.H"
31
32// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33
34namespace Foam
35{
36namespace multiphaseInter
37{
40}
41}
42
43const Foam::Enum
44<
46>
48{
49 { modelVariable::T, "temperature" },
50 { modelVariable::P, "pressure" },
51 { modelVariable::Y, "massFraction" },
52 { modelVariable::alpha, "alphaVolumeFraction" },
53};
54
55
56// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
57
59(
60 const dictionary& dict,
61 const phasePair& pair
62)
63:
64 modelVariable_
65 (
66 modelVariableNames_.getOrDefault
67 (
68 "variable",
69 dict,
71 )
72 ),
73 includeVolChange_(dict.getOrDefault("includeVolChange", true)),
74 pair_(pair),
75 speciesName_(dict.getOrDefault<word>("species", "none")),
76 mesh_(pair_.from().mesh())
77{}
78
79
80// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
81
84(
85 const dictionary& dict,
86 const phasePair& pair
87)
88{
89 const word modelType
90 (
91 dict.get<word>("type")
92 + "<"
93 + pair.phase1().thermo().type()
94 + ","
95 + pair.phase2().thermo().type()
96 + ">"
97 );
98
99 Info<< "Selecting interfaceCompositionModel for "
100 << pair << ": " << modelType << endl;
101
102 auto* ctorPtr = dictionaryConstructorTable(modelType);
103
104 if (!ctorPtr)
105 {
107 (
108 dict,
109 "interfaceCompositionModel",
110 modelType,
111 *dictionaryConstructorTablePtr_
112 ) << exit(FatalIOError);
113 }
114
115 return ctorPtr(dict, pair);
116}
117
118
119// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
120
121const Foam::word Foam::multiphaseInter::interfaceCompositionModel
122::transferSpecie() const
123{
124 return speciesName_;
125}
126
127
128const Foam::phasePair& Foam::multiphaseInter::interfaceCompositionModel
129::pair() const
130{
131 return pair_;
132}
133
134
135const Foam::multiphaseInterSystem& Foam::multiphaseInter
136::interfaceCompositionModel::fluid() const
137{
138 return pair().to().fluid();
139}
140
141
142const Foam::word& Foam::multiphaseInter::interfaceCompositionModel
143::variable() const
144{
145 return modelVariableNames_[modelVariable_];
146}
147
148
150const noexcept
151{
152 return true;
153}
154
155
157{
158 return includeVolChange_;
159}
160
161
162// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
static const Enum< modelVariable > modelVariableNames_
Selection names for the modelVariable.
modelVariable
Enumeration for variable based mass transfer models.
virtual const rhoThermo & thermo() const =0
Access const to phase thermo.
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:56
const multiphaseInter::phaseModel & phase1() const
Definition: phasePairI.H:30
const multiphaseInter::phaseModel & phase2() const
Definition: phasePairI.H:36
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
const volScalarField & T
dynamicFvMesh & mesh
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
Namespace for OpenFOAM.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
IOerror FatalIOError
const direction noexcept
Definition: Scalar.H:223
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
dictionary dict