From 25751cf413845f730d06660eb46c345f051d33f8 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Fri, 27 Sep 2013 12:42:17 +0100
Subject: [PATCH] combustionModels/PaSR/PaSR: Changed useReactionRate to
 !integrateReactionRate

---
 src/combustionModels/PaSR/PaSR.C | 22 +++++++++++++++-------
 src/combustionModels/PaSR/PaSR.H |  5 +++--
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C
index 7bf26a18cba..14ae46a1121 100644
--- a/src/combustionModels/PaSR/PaSR.C
+++ b/src/combustionModels/PaSR/PaSR.C
@@ -51,11 +51,18 @@ Foam::combustionModels::PaSR<Type>::PaSR
         mesh,
         dimensionedScalar("kappa", dimless, 0.0)
     ),
-    useReactionRate_(this->coeffs().lookupOrDefault("useReactionRate", false))
+    integrateReactionRate_
+    (
+        this->coeffs().lookupOrDefault("integrateReactionRate", true)
+    )
 {
-    if (useReactionRate_)
+    if (integrateReactionRate_)
+    {
+        Info<< "    using integrated reaction rate" << endl;
+    }
+    else
     {
-        Info<< "    using reaction rate" << endl;
+        Info<< "    using instantaneous reaction rate" << endl;
     }
 }
 
@@ -83,13 +90,13 @@ void Foam::combustionModels::PaSR<Type>::correct()
     {
         const scalar dt = this->mesh().time().deltaTValue();
 
-        if (useReactionRate_)
+        if (integrateReactionRate_)
         {
-            this->chemistryPtr_->calculate();
+            this->chemistryPtr_->solve(dt);
         }
         else
         {
-            this->chemistryPtr_->solve(dt);
+            this->chemistryPtr_->calculate();
         }
 
         if (turbulentReaction_)
@@ -219,7 +226,8 @@ bool Foam::combustionModels::PaSR<Type>::read()
     {
         this->coeffs().lookup("Cmix") >> Cmix_;
         this->coeffs().lookup("turbulentReaction") >> turbulentReaction_;
-        this->coeffs().lookup("useReactionRate") >> useReactionRate_;
+        this->coeffs().lookup("integrateReactionRate")
+            >> integrateReactionRate_;
         return true;
     }
     else
diff --git a/src/combustionModels/PaSR/PaSR.H b/src/combustionModels/PaSR/PaSR.H
index fa6c73eb955..5b4c8d60819 100644
--- a/src/combustionModels/PaSR/PaSR.H
+++ b/src/combustionModels/PaSR/PaSR.H
@@ -65,8 +65,9 @@ class PaSR
         //- Mixing parameter
         volScalarField kappa_;
 
-        //- Use reaction rate
-        bool useReactionRate_;
+        //- Integrate reaction rate over the time-step
+        //  using the selected ODE solver
+        bool integrateReactionRate_;
 
 
     // Private Member Functions
-- 
GitLab