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