diff --git a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCodeContext.C b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCodeContext.C index 48691501ee..a35de05c8c 100644 --- a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCodeContext.C +++ b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCodeContext.C @@ -85,6 +85,14 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict) stringOps::inplaceExpand(libs_, dict); } + // optional + const entry* localPtr = dict.lookupEntryPtr("localCode", false, false); + if (localPtr) + { + localCode_ = stringOps::trim(localPtr->stream()); + stringOps::inplaceExpand(localCode_, dict); + } + // calculate SHA1 digest from include, options, localCode, code OSHA1stream os; os << include_ << options_ << libs_ << localCode_ << code_; @@ -103,14 +111,18 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict) { addLineDirective(include_, includePtr->startLineNumber(), dict.name()); } - if (optionsPtr) - { - addLineDirective(options_, optionsPtr->startLineNumber(), dict.name()); - } + + // Do not add line directive to options_ (Make/options) since at it is a + // single line at this point. Can be fixed. + if (libsPtr) { addLineDirective(libs_, libsPtr->startLineNumber(), dict.name()); } + if (localPtr) + { + addLineDirective(localCode_, localPtr->startLineNumber(), dict.name()); + } } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C index f89258586c..5b56ba374e 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,6 +46,12 @@ namespace Foam gasThermoPhysics ); makeChemistryModel + ( + ODEChemistryModel, + psiChemistryModel, + constGasThermoPhysics + ); + makeChemistryModel ( ODEChemistryModel, psiChemistryModel, diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C index 5b2edfb004..2f5e3dd193 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,6 +46,12 @@ namespace Foam gasThermoPhysics ); makeChemistryModel + ( + ODEChemistryModel, + rhoChemistryModel, + constGasThermoPhysics + ); + makeChemistryModel ( ODEChemistryModel, rhoChemistryModel, diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C index 82b29fb37b..a4c9a2aad0 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C @@ -34,8 +34,10 @@ License namespace Foam { makeChemistrySolverTypes(psiChemistryModel, gasThermoPhysics); + makeChemistrySolverTypes(psiChemistryModel, constGasThermoPhysics); makeChemistrySolverTypes(psiChemistryModel, icoPoly8ThermoPhysics); makeChemistrySolverTypes(rhoChemistryModel, gasThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, constGasThermoPhysics); makeChemistrySolverTypes(rhoChemistryModel, icoPoly8ThermoPhysics); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index bc2d7d0e01..94648757fd 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -889,12 +889,12 @@ Foam::chemkinReader::chemkinReader(const dictionary& thermoDict) fileName relPath = thermoDict.name().path(); if (relPath.size()) { - if (chemkinFile.size() && chemkinFile[0] != '/') + if (!chemkinFile.isAbsolute()) { chemkinFile = relPath/chemkinFile; } - if (thermoFile.size() && thermoFile[0] != '/') + if (!thermoFile.isAbsolute()) { thermoFile = relPath/thermoFile; } diff --git a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C index 5ac41aa0e6..839ef42ba2 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C @@ -108,6 +108,8 @@ void Foam::singleStepReactingMixture::calculateMaxProducts() Yprod0_[specieI] = this->speciesData()[specieI].W()/Wm*Xi[i]; } + Info << "Maximum products mass concentrations :" << Yprod0_<< endl; + // Normalize the stoichiometric coeff to mass forAll(specieStoichCoeffs_, i) { diff --git a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H index 5f31f225ea..9e1270de05 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.H @@ -152,6 +152,9 @@ public: //- Return the list to indicate if specie is produced/consumed inline const List& specieProd() const; + //- Return the list of products mass concentrations + inline const scalarList& Yprod0() const; + // I-O diff --git a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixtureI.H b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixtureI.H index f8cfe1d9f1..9fab9b30a0 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixtureI.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixtureI.H @@ -94,4 +94,12 @@ Foam::singleStepReactingMixture::specieProd() const } +template +inline const Foam::scalarList& +Foam::singleStepReactingMixture::Yprod0() const +{ + return Yprod0_; +} + + // ************************************************************************* //