From 64f87d592ece735dd7b6ac8fda7148137d754369 Mon Sep 17 00:00:00 2001
From: Christoph Lehmann <christoph.lehmann@ufz.de>
Date: Thu, 30 May 2024 09:45:45 +0200
Subject: [PATCH] [T/THM] Added a test case for 0D volumetric source terms

---
 ProcessLib/ThermoHydroMechanics/Tests.cmake     | 17 +++++++++++++++++
 ...urce_quadratic-mesh_ts_10_t_50000.000000.vtu |  1 +
 .../pointheatsource_quadratic-mesh.xml          |  9 +++++++++
 .../quarter_002_2nd.vtu                         |  1 +
 .../quarter_circle_geometry_bottom.vtu          |  1 +
 .../quarter_circle_geometry_center.vtu          |  1 +
 .../quarter_circle_geometry_left.vtu            |  1 +
 .../quarter_circle_geometry_out.vtu             |  1 +
 8 files changed, 32 insertions(+)
 create mode 120000 Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu
 create mode 100644 Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/pointheatsource_quadratic-mesh.xml
 create mode 120000 Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_002_2nd.vtu
 create mode 120000 Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_bottom.vtu
 create mode 120000 Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_center.vtu
 create mode 120000 Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_left.vtu
 create mode 120000 Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_out.vtu

diff --git a/ProcessLib/ThermoHydroMechanics/Tests.cmake b/ProcessLib/ThermoHydroMechanics/Tests.cmake
index e8632084e92..bfe2d133d55 100644
--- a/ProcessLib/ThermoHydroMechanics/Tests.cmake
+++ b/ProcessLib/ThermoHydroMechanics/Tests.cmake
@@ -125,6 +125,23 @@ AddTest(
     expected_pointheatsource_linear-mesh_ts_10_t_50000.000000.vtu pointheatsource_linear-mesh_ts_10_t_50000.000000.vtu epsilon epsilon 1e-5 1e-5
     expected_pointheatsource_linear-mesh_ts_10_t_50000.000000.vtu pointheatsource_linear-mesh_ts_10_t_50000.000000.vtu sigma sigma 1e-5 1e-5
 )
+# ThermoHydroMechanics; Small deformation, linear poroelastic, point heat source consolidation, variation with a volumetric source term
+AddTest(
+    NAME ThermoHydroMechanics_point_heat_injection_vol_st
+    PATH ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term
+    RUNTIME 45
+    EXECUTABLE ogs
+    EXECUTABLE_ARGS pointheatsource_quadratic-mesh.xml
+    WRAPPER time
+    TESTER vtkdiff
+    REQUIREMENTS NOT OGS_USE_MPI
+    DIFF_DATA
+    expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu displacement displacement 1e-5 1e-5
+    expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu pressure pressure 1e-5 1e-5
+    expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu temperature temperature 1e-5 1e-5
+    expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu epsilon epsilon 1e-5 1e-5
+    expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu sigma sigma 1e-5 1e-5
+)
 # ThermoHydroMechanics; Small deformation, linear elastic, porosity=0, anisotropic thermal expansion
 AddTest(
     NAME ThermoHydroMechanics_cube_ortho-thermal-expansion-phi0
diff --git a/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu
new file mode 120000
index 00000000000..91d0a2ec11a
--- /dev/null
+++ b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu
@@ -0,0 +1 @@
+../expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu
\ No newline at end of file
diff --git a/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/pointheatsource_quadratic-mesh.xml b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/pointheatsource_quadratic-mesh.xml
new file mode 100644
index 00000000000..085ce9217c9
--- /dev/null
+++ b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/pointheatsource_quadratic-mesh.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<OpenGeoSysProjectDiff base_file="../pointheatsource_quadratic-mesh.prj">
+    <replace sel="//source_term/type/text()">
+        Volumetric
+    </replace>
+
+    <!-- axial symmetry would multiply with an integral measure of 0 at the center point, thereby disabling the heat source -->
+    <remove sel="/*/meshes/mesh[text()='quarter_circle_geometry_center.vtu']/@axially_symmetric" />
+</OpenGeoSysProjectDiff>
diff --git a/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_002_2nd.vtu b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_002_2nd.vtu
new file mode 120000
index 00000000000..571461b87fa
--- /dev/null
+++ b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_002_2nd.vtu
@@ -0,0 +1 @@
+../quarter_002_2nd.vtu
\ No newline at end of file
diff --git a/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_bottom.vtu b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_bottom.vtu
new file mode 120000
index 00000000000..2befae203d9
--- /dev/null
+++ b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_bottom.vtu
@@ -0,0 +1 @@
+../quarter_circle_geometry_bottom.vtu
\ No newline at end of file
diff --git a/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_center.vtu b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_center.vtu
new file mode 120000
index 00000000000..7e3e61a8e92
--- /dev/null
+++ b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_center.vtu
@@ -0,0 +1 @@
+../quarter_circle_geometry_center.vtu
\ No newline at end of file
diff --git a/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_left.vtu b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_left.vtu
new file mode 120000
index 00000000000..1619e5104c1
--- /dev/null
+++ b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_left.vtu
@@ -0,0 +1 @@
+../quarter_circle_geometry_left.vtu
\ No newline at end of file
diff --git a/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_out.vtu b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_out.vtu
new file mode 120000
index 00000000000..09740266319
--- /dev/null
+++ b/Tests/Data/ThermoHydroMechanics/Linear/Point_injection/with-volumetric-source-term/quarter_circle_geometry_out.vtu
@@ -0,0 +1 @@
+../quarter_circle_geometry_out.vtu
\ No newline at end of file
-- 
GitLab