From ce5266694f2f9b0df05d64ac4db0e9fd0df30bed Mon Sep 17 00:00:00 2001
From: sergio <s.ferraris@opencfd.co.uk>
Date: Thu, 14 Jul 2011 10:00:01 +0100
Subject: [PATCH] BUG: Fixed fixedTemperature on thermal porous zone.

---
 .../thermalModel/fixedTemperature/fixedTemperature.C         | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
index 4f75d3ee135..9564b56c663 100644
--- a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
+++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
@@ -82,6 +82,8 @@ void Foam::porousMedia::fixedTemperature::addEnthalpySource
     scalarField& hDiag = hEqn.diag();
     scalarField& hSource = hEqn.source();
 
+    tmp<volScalarField> Cp = thermo.Cp();
+
     // TODO: generalize for non-fixedTemperature methods
     const scalar rate = 1e6;
 
@@ -92,7 +94,8 @@ void Foam::porousMedia::fixedTemperature::addEnthalpySource
         forAll(cells, i)
         {
             hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
-            hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*T_;
+            hSource[cells[i]] +=
+                rate*V[cells[i]]*rho[cells[i]]*Cp()[cells[i]]*T_;
         }
     }
 }
-- 
GitLab