basicSolidChemistryModelNew.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) 2013-2017 OpenFOAM Foundation
9 Copyright (C) 2019-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
30
31// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
32
35{
36 const IOdictionary chemistryDict
37 (
39 (
40 thermo.phasePropertyName("chemistryProperties"),
41 thermo.db().time().constant(),
42 thermo.db(),
45 false
46 )
47 );
48
49 const dictionary& chemistryTypeDict =
50 chemistryDict.subDict("chemistryType");
51
52 Info<< "Selecting chemistry type " << chemistryTypeDict << endl;
53
55 (
57 (
59 thermo.db().time().constant(),
60 thermo.db(),
63 false
64 )
65 );
66
67 const dictionary& solidThermoTypeDict = thermoDict.subDict("thermoType");
68 const word solidThermoTypeName
69 (
70 solidThermoTypeDict.get<word>("transport") + '<'
71 + solidThermoTypeDict.get<word>("thermo") + '<'
72 + solidThermoTypeDict.get<word>("equationOfState") + '<'
73 + solidThermoTypeDict.get<word>("specie") + ">>,"
74 + solidThermoTypeDict.get<word>("energy") + ">"
75 );
76
77 const dictionary& gasThermoTypeDict = thermoDict.subDict("gasThermoType");
78 const word gasThermoTypeName
79 (
80 gasThermoTypeDict.get<word>("transport") + '<'
81 + gasThermoTypeDict.get<word>("thermo") + '<'
82 + gasThermoTypeDict.get<word>("equationOfState") + '<'
83 + gasThermoTypeDict.get<word>("specie") + ">>,"
84 + gasThermoTypeDict.get<word>("energy") + ">"
85 );
86
87 // Construct the name of the chemistry type from the components
88 const word chemistryTypeName
89 (
90 chemistryTypeDict.get<word>("chemistrySolver") + '<'
91 + chemistryTypeDict.get<word>("chemistryThermo") + '<'
92 + typeName + ','
93 + solidThermoTypeName + ',' + gasThermoTypeName + ">>"
94 );
95
96 Info<< "chemistryTypeName " << chemistryTypeName << endl;
97
98 const auto& cnstrTable = *(thermoConstructorTablePtr_);
99
100 auto* ctorPtr = cnstrTable.lookup(chemistryTypeName, nullptr);
101
102 if (!ctorPtr)
103 {
105 (
106 chemistryTypeDict,
107 typeName,
108 word::null, // Suppress long name? Just output dictionary (above)
109 cnstrTable
110 );
111
112 // Table of available packages (as constituent parts)
114 (
117 ({
118 "chemistrySolver",
119 "chemistryThermo",
120 "baseChemistry",
121 "transport",
122 "thermo", // solid
123 "equationOfState",
124 "specie",
125 "energy",
126 "transport",
127 "thermo", // gas
128 "equationOfState",
129 "specie",
130 "energy"
131 }),
132 cnstrTable.sortedToc()
133 );
134
136 << exit(FatalIOError);
137 }
138
140}
141
142
143// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
@ MUST_READ_IF_MODIFIED
Definition: IOobject.H:180
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
static Ostream & printThermoNames(Ostream &os, const wordList &cmptNames, const wordList &thermoNames)
Print (filtered) table of thermo names, splits on " ,<>".
Definition: basicThermo.C:75
static const word dictName
Definition: basicThermo.H:256
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
Foam::solidReactionThermo.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for handling words, derived from Foam::string.
Definition: word.H:68
const dictionary & thermoDict
Definition: EEqn.H:16
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
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
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130