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) 2015-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
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 
34 namespace Foam
35 {
36  defineTypeNameAndDebug(interfaceCompositionModel, 0);
37  defineRunTimeSelectionTable(interfaceCompositionModel, dictionary);
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 (
45  const dictionary& dict,
46  const phasePair& pair
47 )
48 :
49  pair_(pair),
50  speciesNames_(dict.lookup("species"))
51 {}
52 
53 
54 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
55 
58 (
59  const dictionary& dict,
60  const phasePair& pair
61 )
62 {
63  const word modelType
64  (
65  dict.get<word>("type")
66  + "<"
67  + pair.phase1().thermo().type()
68  + ","
69  + pair.phase2().thermo().type()
70  + ">"
71  );
72 
73  Info<< "Selecting interfaceCompositionModel for "
74  << pair << ": " << modelType << endl;
75 
76  auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
77 
78  if (!cstrIter.found())
79  {
81  (
82  dict,
83  "interfaceCompositionModel",
84  modelType,
85  *dictionaryConstructorTablePtr_
86  ) << abort(FatalIOError);
87  }
88 
89  return cstrIter()(dict, pair);
90 }
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
96 {
97  return this->speciesNames_.found(speciesName);
98 }
99 
100 
101 // ************************************************************************* //
Foam::interfaceCompositionModel::New
static autoPtr< interfaceCompositionModel > New(const dictionary &dict, const phasePair &pair)
Definition: interfaceCompositionModel.C:79
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:81
FatalIOErrorInLookup
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:406
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
interfaceCompositionModel.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
Foam::interfaceCompositionModel::transports
bool transports(word &speciesName) const
Definition: interfaceCompositionModel.C:95
Foam::autoPtr< Foam::interfaceCompositionModel >
Foam::interfaceCompositionModel::interfaceCompositionModel
interfaceCompositionModel(const dictionary &dict, const phasePair &pair)
Construct from a dictionary and a phase pair.
Definition: interfaceCompositionModel.C:54
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)