From 856923151dc6d8d08916f6dd8c9f977911cd08b9 Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Wed, 18 Jul 2018 16:56:53 +0200
Subject: [PATCH] [SD] Added a reference temperature to SmallDeformation

---
 .../SmallDeformation/CreateSmallDeformationProcess.cpp |  8 +++++++-
 ProcessLib/SmallDeformation/SmallDeformationFEM.h      |  2 +-
 .../SmallDeformation/SmallDeformationProcessData.h     | 10 +++++++---
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp
index ca1ee9024ab..44af30c5410 100644
--- a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp
+++ b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp
@@ -93,8 +93,14 @@ createSmallDeformationProcess(
         std::copy_n(b.data(), b.size(), specific_body_force.data());
     }
 
+    // Reference temperature
+    const auto& reference_temperature =
+        //! \ogs_file_param{prj__processes__process__SMALL_DEFORMATION__reference_temperature}
+        config.getConfigParameterOptional<double>("reference_temperature");
+
     SmallDeformationProcessData<DisplacementDim> process_data{
-        std::move(material), solid_density, specific_body_force};
+        std::move(material), solid_density, specific_body_force,
+        *reference_temperature};
 
     SecondaryVariableCollection secondary_variables;
 
diff --git a/ProcessLib/SmallDeformation/SmallDeformationFEM.h b/ProcessLib/SmallDeformation/SmallDeformationFEM.h
index 04be9b795b1..d304a54cfbc 100644
--- a/ProcessLib/SmallDeformation/SmallDeformationFEM.h
+++ b/ProcessLib/SmallDeformation/SmallDeformationFEM.h
@@ -249,7 +249,7 @@ public:
 
             auto&& solution = _ip_data[ip].solid_material.integrateStress(
                 t, x_position, _process_data.dt, eps_prev, eps, sigma_prev,
-                *state, MaterialLib::PhysicalConstant::RoomTemperature);
+                *state, _process_data.reference_temperature);
 
             if (!solution)
                 OGS_FATAL("Computation of local constitutive relation failed.");
diff --git a/ProcessLib/SmallDeformation/SmallDeformationProcessData.h b/ProcessLib/SmallDeformation/SmallDeformationProcessData.h
index 6d3545a7949..29a24c8e426 100644
--- a/ProcessLib/SmallDeformation/SmallDeformationProcessData.h
+++ b/ProcessLib/SmallDeformation/SmallDeformationProcessData.h
@@ -36,10 +36,12 @@ struct SmallDeformationProcessData
             material,
         Parameter<double> const& solid_density_,
         Eigen::Matrix<double, DisplacementDim, 1>
-            specific_body_force_)
+            specific_body_force_,
+        double const reference_temperature_)
         : material{std::move(material)},
           solid_density(solid_density_),
-          specific_body_force(std::move(specific_body_force_))
+          specific_body_force(std::move(specific_body_force_)),
+          reference_temperature(reference_temperature_)
     {
     }
 
@@ -48,7 +50,8 @@ struct SmallDeformationProcessData
           solid_density(other.solid_density),
           specific_body_force(other.specific_body_force),
           dt{other.dt},
-          t{other.t}
+          t{other.t},
+          reference_temperature(other.reference_temperature)
     {
     }
 
@@ -71,6 +74,7 @@ struct SmallDeformationProcessData
     Eigen::Matrix<double, DisplacementDim, 1> const specific_body_force;
     double dt = 0;
     double t = 0;
+    double const reference_temperature;
 };
 
 }  // namespace SmallDeformation
-- 
GitLab