Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / combustionModels / combustionModel / combustionModelNew.C
blob23e07f76e13014350cc80c0edea2b53091f5cd44
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2009-2011 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
10     OpenFOAM is free software: you can redistribute it and/or modify it
11     under the terms of the GNU General Public License as published by
12     the Free Software Foundation, either version 3 of the License, or
13     (at your option) any later version.
15     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
16     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18     for more details.
20     You should have received a copy of the GNU General Public License
21     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
23 \*---------------------------------------------------------------------------*/
25 #include "combustionModel.H"
27 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 Foam::autoPtr<Foam::combustionModel> Foam::combustionModel::New
31     const dictionary& combustionProperties,
32     hsCombustionThermo& thermo,
33     const compressible::turbulenceModel& turbulence,
34     const surfaceScalarField& phi,
35     const volScalarField& rho
38     word combustionModelTypeName = combustionProperties.lookup
39     (
40         "combustionModel"
41     );
43     Info<< "Selecting combustion model " << combustionModelTypeName << endl;
45     dictionaryConstructorTable::iterator cstrIter =
46         dictionaryConstructorTablePtr_->find(combustionModelTypeName);
48     if (cstrIter == dictionaryConstructorTablePtr_->end())
49     {
50         FatalErrorIn
51         (
52             "combustionModel::New"
53         )   << "Unknown combustionModel type "
54             << combustionModelTypeName << endl << endl
55             << "Valid  combustionModels are : " << endl
56             << dictionaryConstructorTablePtr_->toc()
57             << exit(FatalError);
58     }
60     return autoPtr<combustionModel>
61         (cstrIter()(combustionProperties, thermo, turbulence, phi, rho));
65 // ************************************************************************* //