From 04e92966793499ca35048d23e0aac635989ca0e0 Mon Sep 17 00:00:00 2001
From: sergio <sergio>
Date: Wed, 8 Feb 2012 09:59:58 +0000
Subject: [PATCH] BUG: Fix of temperatureThermoBaffle for multi prperties case

---
 .../temperatureThermoBaffleFvPatchScalarField.C        | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.C b/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.C
index cf339acd54d..082f6ae5d10 100644
--- a/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.C
+++ b/src/regionModels/thermoBaffleModels/derivedFvPatchFields/temperatureThermoBaffle/temperatureThermoBaffleFvPatchScalarField.C
@@ -107,6 +107,11 @@ temperatureThermoBaffleFvPatchScalarField
             << exit(FatalError);
     }
 
+    const directMappedPatchBase& mpp =
+        refCast<const directMappedPatchBase>(patch().patch());
+
+    const word nbrMesh = mpp.sampleRegion();
+
     const fvMesh& thisMesh = patch().boundaryMesh().mesh();
 
     typedef regionModels::thermoBaffleModels::thermoBaffleModel baffle;
@@ -114,14 +119,15 @@ temperatureThermoBaffleFvPatchScalarField
     if
     (
         thisMesh.name() == polyMesh::defaultRegion
-     && !thisMesh.foundObject<baffle>("thermoBaffle")
+     && !thisMesh.foundObject<baffle>(nbrMesh)
      && !owner_
     )
     {
-        Info << "Creating thermal baffle..." << endl;
+        Info << "Creating thermal baffle..." <<  nbrMesh << endl;
         baffle_.reset(baffle::New(thisMesh, dict).ptr());
         owner_ = true;
         dict.lookup("thermoType") >> solidThermoType_;
+        baffle_->rename(nbrMesh);
     }
 }
 
-- 
GitLab