From 060a2b0f425c8e3fb9aa9748f8a4199a2de50d41 Mon Sep 17 00:00:00 2001
From: sergio <sergio>
Date: Fri, 4 May 2012 16:17:43 +0100
Subject: [PATCH] BUG: Making fixeTemperature general for variable Cp thermos

---
 .../thermalModel/fixedTemperature/fixedTemperature.C        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
index a6f6b3ca889..509c7d70cc6 100644
--- a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
+++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
@@ -82,20 +82,20 @@ void Foam::porousMedia::fixedTemperature::addEnthalpySource
     scalarField& hDiag = hEqn.diag();
     scalarField& hSource = hEqn.source();
 
-    tmp<volScalarField> Cp = thermo.Cp();
+    const scalarField T(hDiag.size(), T_);
 
-    // TODO: generalize for non-fixedTemperature methods
     const scalar rate = 1e6;
 
     forAll(zones, zoneI)
     {
         const labelList& cells = mesh.cellZones()[zones[zoneI]];
+        tmp<scalarField> h = thermo.h(T, cells);
 
         forAll(cells, i)
         {
             hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
             hSource[cells[i]] +=
-                rate*V[cells[i]]*rho[cells[i]]*Cp()[cells[i]]*T_;
+                rate*V[cells[i]]*rho[cells[i]]*h()[cells[i]];
         }
     }
 }
-- 
GitLab