diff --git a/src/thermophysicalModels/solidSpecie/reaction/Reactions/solidReaction/solidReaction.C b/src/thermophysicalModels/solidSpecie/reaction/Reactions/solidReaction/solidReaction.C index bffd5f8d2f2ed5737f37063e81d72951755c5ac5..18d2a9367c88b7156f00416475d4142de400cacb 100644 --- a/src/thermophysicalModels/solidSpecie/reaction/Reactions/solidReaction/solidReaction.C +++ b/src/thermophysicalModels/solidSpecie/reaction/Reactions/solidReaction/solidReaction.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,7 +67,7 @@ Foam::solidReaction<ReactionThermo>::solidReaction const dictionary& dict ) : - Reaction<ReactionThermo>(species, thermoDatabase, dict), + Reaction<ReactionThermo>(species, thermoDatabase, dict, false), pyrolisisGases_(dict.parent().parent().lookup("gaseousSpecies")), glhs_(), grhs_() diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C index e994ff1dce0825a8625875b4e5ffec744fd1559b..645cc4fc806b2b11734b0690ab481863da23bf31 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -111,19 +111,20 @@ void Foam::Reaction<ReactionThermo>::setThermo const HashPtrTable<ReactionThermo>& thermoDatabase ) { + typename ReactionThermo::thermoType rhsThermo ( rhs_[0].stoichCoeff - *(*thermoDatabase[species_[rhs_[0].index]]).W() - *(*thermoDatabase[species_[rhs_[0].index]]) + *(*thermoDatabase[species_[rhs_[0].index]]).W() + *(*thermoDatabase[species_[rhs_[0].index]]) ); for (label i=1; i<rhs_.size(); ++i) { rhsThermo += rhs_[i].stoichCoeff - *(*thermoDatabase[species_[rhs_[i].index]]).W() - *(*thermoDatabase[species_[rhs_[i].index]]); + *(*thermoDatabase[species_[rhs_[i].index]]).W() + *(*thermoDatabase[species_[rhs_[i].index]]); } typename ReactionThermo::thermoType lhsThermo @@ -154,7 +155,8 @@ Foam::Reaction<ReactionThermo>::Reaction const speciesTable& species, const List<specieCoeffs>& lhs, const List<specieCoeffs>& rhs, - const HashPtrTable<ReactionThermo>& thermoDatabase + const HashPtrTable<ReactionThermo>& thermoDatabase, + bool initReactionThermo ) : ReactionThermo::thermoType(*thermoDatabase[species[0]]), @@ -163,7 +165,10 @@ Foam::Reaction<ReactionThermo>::Reaction lhs_(lhs), rhs_(rhs) { - setThermo(thermoDatabase); + if (initReactionThermo) + { + setThermo(thermoDatabase); + } } @@ -325,7 +330,8 @@ Foam::Reaction<ReactionThermo>::Reaction ( const speciesTable& species, const HashPtrTable<ReactionThermo>& thermoDatabase, - const dictionary& dict + const dictionary& dict, + bool initReactionThermo ) : ReactionThermo::thermoType(*thermoDatabase[species[0]]), @@ -339,7 +345,11 @@ Foam::Reaction<ReactionThermo>::Reaction lhs_, rhs_ ); - setThermo(thermoDatabase); + + if (initReactionThermo) + { + setThermo(thermoDatabase); + } } diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H index d96134aac9523d59d4b0fdb77db2663123026eab..7b3b8ea571e823e22ecb26e69770ef9ae0c5694f 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -186,18 +186,27 @@ public: const speciesTable& species, const List<specieCoeffs>& lhs, const List<specieCoeffs>& rhs, - const HashPtrTable<ReactionThermo>& thermoDatabase + const HashPtrTable<ReactionThermo>& thermoDatabase, + bool initReactionThermo = true ); //- Construct as copy given new speciesTable - Reaction(const Reaction<ReactionThermo>&, const speciesTable& species); + Reaction + ( + const Reaction<ReactionThermo>&, + const speciesTable& species + ); //- Construct from dictionary + // NOTE: initReactionThermo is used by solidReaction where there is no + // need of setting a lhs - rhs thermo type for each reaction. This is + // needed for mechanism with reversible reactions Reaction ( const speciesTable& species, const HashPtrTable<ReactionThermo>& thermoDatabase, - const dictionary& dict + const dictionary& dict, + bool initReactionThermo = true ); //- Construct and return a clone diff --git a/tutorials/combustion/fireFoam/LES/simplePMMApanel/0/panelRegion/Qr b/tutorials/combustion/fireFoam/LES/simplePMMApanel/0/panelRegion/qr similarity index 98% rename from tutorials/combustion/fireFoam/LES/simplePMMApanel/0/panelRegion/Qr rename to tutorials/combustion/fireFoam/LES/simplePMMApanel/0/panelRegion/qr index 654cb3ae748ca6c766c59281d32618d2c859c3c7..ba9e5916fb1ec647ae13cf9a0881323c73dad3b2 100644 --- a/tutorials/combustion/fireFoam/LES/simplePMMApanel/0/panelRegion/Qr +++ b/tutorials/combustion/fireFoam/LES/simplePMMApanel/0/panelRegion/qr @@ -11,7 +11,7 @@ FoamFile format ascii; class volScalarField; location "0"; - object Qr; + object qr; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/combustion/fireFoam/LES/simplePMMApanel/constant/pyrolysisZones b/tutorials/combustion/fireFoam/LES/simplePMMApanel/constant/pyrolysisZones index a099495670d023da0a3f793e0de0533b8203f3a4..f5fd1efacc503a9dee9d6980ecc49005c85c105d 100644 --- a/tutorials/combustion/fireFoam/LES/simplePMMApanel/constant/pyrolysisZones +++ b/tutorials/combustion/fireFoam/LES/simplePMMApanel/constant/pyrolysisZones @@ -29,7 +29,7 @@ FoamFile filmCoupled false; - radFluxName Qr; + qrHSource on; minimumDelta 1e-6; diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/chemistryProperties b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/chemistryProperties index 22ec9ceabe4afb249989673cd7072899f7f3fc78..c22fa78d78a3c02875c27e37baa127e08b3853a1 100644 --- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/chemistryProperties +++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/chemistryProperties @@ -33,7 +33,7 @@ EulerImplicitCoeffs odeCoeffs { - solver Rosenbrock43; + solver Rosenbrock34; absTol 1e-12; relTol 0.01; } diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/reactions b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/reactions index e548bae90ffdb1e3d0822d8af80a19f9e2552636..842baa512bed455cba2fafa959164501aa546b47 100644 --- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/reactions +++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/reactions @@ -1,3 +1,12 @@ +elements +( +O +C +H +N +); + + species ( O2 diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/thermo.compressibleGas b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/thermo.compressibleGas index 371a3bb6c87f57d6bde8d7e4b6d585c89893168b..4bbb98aa34305e8df8340d9820a4d8ebe928602e 100644 --- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/thermo.compressibleGas +++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/thermo.compressibleGas @@ -21,6 +21,10 @@ O2 { molWeight 31.9988; } + elements + { + O 2; + } thermodynamics { Tlow 200; @@ -42,6 +46,11 @@ H2O { molWeight 18.0153; } + elements + { + O 1; + H 2; + } thermodynamics { Tlow 200; @@ -63,6 +72,11 @@ CH4 { molWeight 16.0428; } + elements + { + C 1; + H 4; + } thermodynamics { Tlow 200; @@ -84,6 +98,11 @@ CO2 { molWeight 44.01; } + elements + { + C 1; + O 2; + } thermodynamics { Tlow 200; @@ -105,6 +124,10 @@ N2 { molWeight 28.0134; } + elements + { + N 2; + } thermodynamics { Tlow 200;