From 08191ee82894002a975491f5c818f1b9dbe5fa9c Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Mon, 15 Jun 2015 17:40:48 +0100
Subject: [PATCH] ReactingMultiphaseParcel,ReactingParcel: Use T0 for
 consistent radiation transfer Resolves bug-report
 http://www.openfoam.org/mantisbt/view.php?id=1636

---
 .../ReactingMultiphaseParcel.C                     | 14 +++++++++-----
 .../Templates/ReactingParcel/ReactingParcel.C      |  7 ++-----
 .../parcels/Templates/ThermoParcel/ThermoParcel.C  |  6 +++---
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C
index a635b89fdc1..289127b18bd 100644
--- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C
+++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C
@@ -360,14 +360,16 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
                 label gid = composition.localToCarrierId(LIQ, i);
                 td.cloud().rhoTrans(gid)[cellI] += dm*YMix[LIQ]*YLiquid_[i];
             }
-/*
+
             // No mapping between solid components and carrier phase
+            /*
             forAll(YSolid_, i)
             {
                 label gid = composition.localToCarrierId(SLD, i);
                 td.cloud().rhoTrans(gid)[cellI] += dm*YMix[SLD]*YSolid_[i];
             }
-*/
+            */
+
             td.cloud().UTrans()[cellI] += dm*U0;
 
             td.cloud().hsTrans()[cellI] += dm*HsEff(td, pc, T0, idG, idL, idS);
@@ -441,8 +443,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
             td.cloud().UTrans()[cellI] += dm*U0;
             td.cloud().hsTrans()[cellI] += dm*hs;
         }
-/*
+
         // No mapping between solid components and carrier phase
+        /*
         forAll(YSolid_, i)
         {
             scalar dm = np0*dMassSolid[i];
@@ -452,7 +455,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
             td.cloud().UTrans()[cellI] += dm*U0;
             td.cloud().hsTrans()[cellI] += dm*hs;
         }
-*/
+        */
+
         forAll(dMassSRCarrier, i)
         {
             scalar dm = np0*dMassSRCarrier[i];
@@ -474,7 +478,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
         if (td.cloud().radiation())
         {
             const scalar ap = this->areaP();
-            const scalar T4 = pow4(this->T_);
+            const scalar T4 = pow4(T0);
             td.cloud().radAreaP()[cellI] += dt*np0*ap;
             td.cloud().radT4()[cellI] += dt*np0*T4;
             td.cloud().radAreaPT4()[cellI] += dt*np0*ap*T4;
diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C
index 6e3ce506f85..efbee0018e6 100644
--- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C
+++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C
@@ -304,9 +304,6 @@ void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection
 
         this->Tc_ = td.cloud().constProps().TMin();
     }
-
-//  constant pressure
-//  this->pc_ = this->pc_;
 }
 
 
@@ -433,7 +430,7 @@ void Foam::ReactingParcel<ParcelType>::calc
 
 
     // Sources
-    //~~~~~~~~
+    // ~~~~~~~
 
     // Explicit momentum source for particle
     vector Su = vector::zero;
@@ -608,7 +605,7 @@ void Foam::ReactingParcel<ParcelType>::calc
         if (td.cloud().radiation())
         {
             const scalar ap = this->areaP();
-            const scalar T4 = pow4(this->T_);
+            const scalar T4 = pow4(T0);
             td.cloud().radAreaP()[cellI] += dt*np0*ap;
             td.cloud().radT4()[cellI] += dt*np0*T4;
             td.cloud().radAreaPT4()[cellI] += dt*np0*ap*T4;
diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C
index e5b469d4e35..4198420d38d 100644
--- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C
+++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C
@@ -172,6 +172,9 @@ void Foam::ThermoParcel<ParcelType>::calc
     const scalar np0 = this->nParticle_;
     const scalar mass0 = this->mass();
 
+    // Store T for consistent radiation source
+    const scalar T0 = this->T_;
+
 
     // Calc surface values
     // ~~~~~~~~~~~~~~~~~~~
@@ -210,9 +213,6 @@ void Foam::ThermoParcel<ParcelType>::calc
     // Sum Ni*Cpi*Wi of emission species
     scalar NCpW = 0.0;
 
-    // Store T for consistent radiation source
-    const scalar T0 = this->T_;
-
     // Calculate new particle temperature
     this->T_ =
         this->calcHeatTransfer
-- 
GitLab