bool loadFieldFunction( fvMesh &mesh, const word &fName, SLPtrList<FieldType> &fieldList ) { const Time &runTime=mesh.time(); IOobject f ( fName, runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ); f.headerOk(); word className=f.headerClassName(); if(className==FieldType::typeName) { Info << "Reading field " << fName << " of type " << FieldType::typeName << endl; fieldList.append( new FieldType ( IOobject ( fName, runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ) ); return true; } else { return false; } }
int main(int argc, char *argv[]) { # include "setRootCase.H" # include "createTime.H" Info<< nl << "Reading Burcat data IOdictionary" << endl; IOdictionary CpData ( IOobject ( "BurcatCpData", runTime.constant(), runTime, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) ); scalar T = 3000.0; SLPtrList<thermo> EQreactions; EQreactions.append ( new thermo ( thermo(CpData.lookup("CO2")) == thermo(CpData.lookup("CO")) + 0.5*thermo(CpData.lookup("O2")) ) ); EQreactions.append ( new thermo ( thermo(CpData.lookup("O2")) == 2.0*thermo(CpData.lookup("O")) ) ); EQreactions.append ( new thermo ( thermo(CpData.lookup("H2O")) == thermo(CpData.lookup("H2")) + 0.5*thermo(CpData.lookup("O2")) ) ); EQreactions.append ( new thermo ( thermo(CpData.lookup("H2O")) == thermo(CpData.lookup("H")) + thermo(CpData.lookup("OH")) ) ); forAllConstIter(SLPtrList<thermo>, EQreactions, iter) { Info<< "Kc(EQreactions) = " << iter().Kc(T) << endl; }