newhReactionThermo.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "hReactionThermo.H"
00028 #include "fvMesh.H"
00029
00030
00031
00032 Foam::autoPtr<Foam::hReactionThermo> Foam::hReactionThermo::New
00033 (
00034 const fvMesh& mesh
00035 )
00036 {
00037 word hReactionThermoTypeName;
00038
00039
00040
00041
00042 {
00043 IOdictionary thermoDict
00044 (
00045 IOobject
00046 (
00047 "thermophysicalProperties",
00048 mesh.time().constant(),
00049 mesh,
00050 IOobject::MUST_READ,
00051 IOobject::NO_WRITE
00052 )
00053 );
00054
00055 thermoDict.lookup("thermoType") >> hReactionThermoTypeName;
00056 }
00057
00058 Info<< "Selecting thermodynamics package " << hReactionThermoTypeName
00059 << endl;
00060
00061 fvMeshConstructorTable::iterator cstrIter =
00062 fvMeshConstructorTablePtr_->find(hReactionThermoTypeName);
00063
00064 if (cstrIter == fvMeshConstructorTablePtr_->end())
00065 {
00066 FatalErrorIn("hReactionThermo::New(const fvMesh&)")
00067 << "Unknown hReactionThermo type "
00068 << hReactionThermoTypeName << nl << nl
00069 << "Valid hReactionThermo types are:" << nl
00070 << fvMeshConstructorTablePtr_->toc() << nl
00071 << exit(FatalError);
00072 }
00073
00074 return autoPtr<hReactionThermo>(cstrIter()(mesh));
00075 }
00076
00077
00078 Foam::autoPtr<Foam::hReactionThermo> Foam::hReactionThermo::NewType
00079 (
00080 const fvMesh& mesh,
00081 const word& thermoType
00082 )
00083 {
00084 word hReactionThermoTypeName;
00085
00086
00087
00088
00089 {
00090 IOdictionary thermoDict
00091 (
00092 IOobject
00093 (
00094 "thermophysicalProperties",
00095 mesh.time().constant(),
00096 mesh,
00097 IOobject::MUST_READ,
00098 IOobject::NO_WRITE
00099 )
00100 );
00101
00102 thermoDict.lookup("thermoType") >> hReactionThermoTypeName;
00103
00104 if (hReactionThermoTypeName.find(thermoType) == string::npos)
00105 {
00106 wordList allModels = fvMeshConstructorTablePtr_->toc();
00107 DynamicList<word> validModels;
00108 forAll(allModels, i)
00109 {
00110 if (allModels[i].find(thermoType) != string::npos)
00111 {
00112 validModels.append(allModels[i]);
00113 }
00114 }
00115
00116 FatalErrorIn
00117 (
00118 "autoPtr<hReactionThermo> hReactionThermo::NewType"
00119 "("
00120 "const fvMesh&, "
00121 "const word&"
00122 ")"
00123 ) << "Inconsistent thermo package selected:" << nl << nl
00124 << hReactionThermoTypeName << nl << nl << "Please select a "
00125 << "thermo package based on " << thermoType
00126 << ". Valid options include:" << nl << validModels << nl
00127 << exit(FatalError);
00128 }
00129 }
00130
00131 Info<< "Selecting thermodynamics package " << hReactionThermoTypeName
00132 << endl;
00133
00134 fvMeshConstructorTable::iterator cstrIter =
00135 fvMeshConstructorTablePtr_->find(hReactionThermoTypeName);
00136
00137 if (cstrIter == fvMeshConstructorTablePtr_->end())
00138 {
00139 FatalErrorIn("hReactionThermo::New(const fvMesh&)")
00140 << "Unknown hReactionThermo type "
00141 << hReactionThermoTypeName << nl << nl
00142 << "Valid hReactionThermo types are:" << nl
00143 << fvMeshConstructorTablePtr_->toc() << nl
00144 << exit(FatalError);
00145 }
00146
00147 return autoPtr<hReactionThermo>(cstrIter()(mesh));
00148 }
00149
00150
00151
Copyright © 2000-2009 OpenCFD Ltd