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 #include "psiChemistryModel.H"
00027
00028
00029
00030 Foam::autoPtr<Foam::psiChemistryModel> Foam::psiChemistryModel::New
00031 (
00032 const fvMesh& mesh
00033 )
00034 {
00035 word psiChemistryModelType;
00036 word thermoTypeName;
00037 word userModel;
00038
00039
00040
00041
00042 {
00043 IOdictionary chemistryPropertiesDict
00044 (
00045 IOobject
00046 (
00047 "chemistryProperties",
00048 mesh.time().constant(),
00049 mesh,
00050 IOobject::MUST_READ,
00051 IOobject::NO_WRITE
00052 )
00053 );
00054
00055 chemistryPropertiesDict.lookup("psiChemistryModel") >> userModel;
00056
00057
00058
00059 label tempOpen = userModel.find('<');
00060 label tempClose = userModel.find('>');
00061
00062 word className = userModel(0, tempOpen);
00063 thermoTypeName = userModel(tempOpen + 1, tempClose - tempOpen - 1);
00064
00065 psiChemistryModelType =
00066 className + '<' + typeName + ',' + thermoTypeName + '>';
00067 }
00068
00069 if (debug)
00070 {
00071 Info<< "Selecting psiChemistryModel " << psiChemistryModelType << endl;
00072 }
00073 else
00074 {
00075 Info<< "Selecting psiChemistryModel " << userModel << endl;
00076 }
00077
00078 fvMeshConstructorTable::iterator cstrIter =
00079 fvMeshConstructorTablePtr_->find(psiChemistryModelType);
00080
00081 if (cstrIter == fvMeshConstructorTablePtr_->end())
00082 {
00083 if (debug)
00084 {
00085 FatalErrorIn("psiChemistryModelBase::New(const mesh&)")
00086 << "Unknown psiChemistryModel type " << psiChemistryModelType
00087 << nl << nl << "Valid psiChemistryModel types are:" << nl
00088 << fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError);
00089 }
00090 else
00091 {
00092 wordList models = fvMeshConstructorTablePtr_->sortedToc();
00093 forAll(models, i)
00094 {
00095 models[i] = models[i].replace(typeName + ',', "");
00096 }
00097
00098 FatalErrorIn("psiChemistryModelBase::New(const mesh&)")
00099 << "Unknown psiChemistryModel type " << userModel
00100 << nl << nl << "Valid psiChemistryModel types are:" << nl
00101 << models << nl << exit(FatalError);
00102 }
00103 }
00104
00105 return autoPtr<psiChemistryModel>
00106 (cstrIter()(mesh, typeName, thermoTypeName));
00107 }
00108
00109
00110