1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "hsCombustionThermo.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 Foam::autoPtr<Foam::hsCombustionThermo> Foam::hsCombustionThermo::New
36 // get model name, but do not register the dictionary
37 // otherwise it is registered in the database twice
44 "thermophysicalProperties",
45 mesh.time().constant(),
47 IOobject::MUST_READ_IF_MODIFIED,
51 ).lookup("thermoType")
54 Info<< "Selecting thermodynamics package " << modelType << endl;
56 fvMeshConstructorTable::iterator cstrIter =
57 fvMeshConstructorTablePtr_->find(modelType);
59 if (cstrIter == fvMeshConstructorTablePtr_->end())
61 FatalErrorIn("hsCombustionThermo::New(const fvMesh&)")
62 << "Unknown hsCombustionThermo type "
63 << modelType << nl << nl
64 << "Valid hsCombustionThermo types:" << nl
65 << fvMeshConstructorTablePtr_->toc() << nl
69 return autoPtr<hsCombustionThermo>(cstrIter()(mesh));
73 Foam::autoPtr<Foam::hsCombustionThermo> Foam::hsCombustionThermo::NewType
76 const word& thermoType
79 // get model name, but do not register the dictionary
80 // otherwise it is registered in the database twice
87 "thermophysicalProperties",
88 mesh.time().constant(),
90 IOobject::MUST_READ_IF_MODIFIED,
94 ).lookup("thermoType")
97 if (modelType.find(thermoType) == string::npos)
99 wordList allModels = fvMeshConstructorTablePtr_->toc();
100 DynamicList<word> validModels;
103 if (allModels[i].find(thermoType) != string::npos)
105 validModels.append(allModels[i]);
111 "autoPtr<hsCombustionThermo> hsCombustionThermo::NewType"
116 ) << "Inconsistent thermo package selected:" << nl << nl
117 << modelType << nl << nl << "Please select a "
118 << "thermo package based on " << thermoType
119 << ". Valid options include:" << nl << validModels << nl
123 Info<< "Selecting thermodynamics package " << modelType << endl;
125 fvMeshConstructorTable::iterator cstrIter =
126 fvMeshConstructorTablePtr_->find(modelType);
128 if (cstrIter == fvMeshConstructorTablePtr_->end())
132 "autoPtr<hsCombustionThermo> hsCombustionThermo::NewType"
137 ) << "Unknown hsCombustionThermo type "
138 << modelType << nl << nl
139 << "Valid hsCombustionThermo types are:" << nl
140 << fvMeshConstructorTablePtr_->toc() << nl
144 return autoPtr<hsCombustionThermo>(cstrIter()(mesh));
148 // ************************************************************************* //