From 5d0d4b4b78d062e0bca1297cd496c62294226a30 Mon Sep 17 00:00:00 2001
From: sergio <sergio>
Date: Mon, 28 May 2012 15:16:44 +0100
Subject: [PATCH] BUG:Using fvMatrix function to set value in h Eq

---
 .../fixedTemperature/fixedTemperature.C          | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
index 509c7d70cc6..d92194d66f1 100644
--- a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
+++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C
@@ -78,25 +78,13 @@ void Foam::porousMedia::fixedTemperature::addEnthalpySource
     }
 
     const fvMesh& mesh = pZone_.mesh();
-    const scalarField& V = mesh.V();
-    scalarField& hDiag = hEqn.diag();
-    scalarField& hSource = hEqn.source();
-
-    const scalarField T(hDiag.size(), T_);
-
-    const scalar rate = 1e6;
+    const scalarField T(hEqn.diag().size(), T_);
 
     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]]*h()[cells[i]];
-        }
+        hEqn.setValues(cells, h());
     }
 }
 
-- 
GitLab