From 2a3953577388f8790c2985c8a6f51a84dd04f8f0 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Tue, 1 Oct 2019 11:30:30 +0200
Subject: [PATCH] [T] 1D line source term with analytical sol.

---
 ProcessLib/HeatConduction/Tests.cmake         |  12 ++
 .../line_1_entire_line.vtu                    |   3 +
 .../1D_line_source_term_tests/line_1_left.vtu |   3 +
 .../line_1_right.vtu                          |   3 +
 .../line_source_term.prj                      | 143 ++++++++++++++++++
 .../mesh_1_line_100.vtu                       |   3 +
 6 files changed, 167 insertions(+)
 create mode 100644 Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_entire_line.vtu
 create mode 100644 Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_left.vtu
 create mode 100644 Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_right.vtu
 create mode 100644 Tests/Data/Parabolic/T/1D_line_source_term_tests/line_source_term.prj
 create mode 100644 Tests/Data/Parabolic/T/1D_line_source_term_tests/mesh_1_line_100.vtu

diff --git a/ProcessLib/HeatConduction/Tests.cmake b/ProcessLib/HeatConduction/Tests.cmake
index a8a47d5200a..d5a2d589be0 100644
--- a/ProcessLib/HeatConduction/Tests.cmake
+++ b/ProcessLib/HeatConduction/Tests.cmake
@@ -128,6 +128,18 @@ AddTest(
         REQUIREMENTS NOT OGS_USE_MPI
 )
 
+AddTest(
+        NAME HeatConduction_1D_LineSourceTerm
+        PATH
+        Parabolic/T/1D_line_source_term_tests/
+        EXECUTABLE ogs
+        EXECUTABLE_ARGS line_source_term.prj
+        TESTER vtkdiff
+        DIFF_DATA
+        mesh_1_line_100.vtu source_term_at_entire_line_pcs_0_ts_1_t_1.000000.vtu analytical_temperature temperature 1e-13 1e-13
+        REQUIREMENTS NOT OGS_USE_MPI
+)
+
 AddTest(
         NAME HeatConduction_2D_LineSourceTermLeft
         PATH Parabolic/T/2D_source_term_tests/line_source_term_left
diff --git a/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_entire_line.vtu b/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_entire_line.vtu
new file mode 100644
index 00000000000..14f9ca11b58
--- /dev/null
+++ b/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_entire_line.vtu
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c197d46a63137501c0e1ccf79f5987d7d6b67d72476b1933f258bdcd6077f162
+size 10219
diff --git a/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_left.vtu b/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_left.vtu
new file mode 100644
index 00000000000..8dc593a449a
--- /dev/null
+++ b/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_left.vtu
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2d23249bbbe0d9791d5b1a1981a7a8a106d7f9c132eb5be22f25266c0495177
+size 1583
diff --git a/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_right.vtu b/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_right.vtu
new file mode 100644
index 00000000000..5ee0416abb1
--- /dev/null
+++ b/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_1_right.vtu
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ac9fc2cb59e32818b32449d271119a833b9bebcac15ed979ee540ffebf571922
+size 1583
diff --git a/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_source_term.prj b/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_source_term.prj
new file mode 100644
index 00000000000..87ed0bf495c
--- /dev/null
+++ b/Tests/Data/Parabolic/T/1D_line_source_term_tests/line_source_term.prj
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<OpenGeoSysProject>
+    <meshes>
+        <mesh>mesh_1_line_100.vtu</mesh>
+        <mesh>line_1_entire_line.vtu</mesh>
+        <mesh>line_1_left.vtu</mesh>
+        <mesh>line_1_right.vtu</mesh>
+    </meshes>
+    <processes>
+        <process>
+            <name>HeatConduction</name>
+            <type>HEAT_CONDUCTION</type>
+            <integration_order>2</integration_order>
+            <thermal_conductivity>lambda</thermal_conductivity>
+            <heat_capacity>c_p</heat_capacity>
+            <density>rho</density>
+            <process_variables>
+                <process_variable>temperature</process_variable>
+            </process_variables>
+            <secondary_variables>
+                <secondary_variable type="static" internal_name="heat_flux_x" output_name="heat_flux_x"/>
+            </secondary_variables>
+        </process>
+    </processes>
+    <time_loop>
+        <processes>
+            <process ref="HeatConduction">
+                <nonlinear_solver>basic_picard</nonlinear_solver>
+                <convergence_criterion>
+                    <type>DeltaX</type>
+                    <norm_type>NORM2</norm_type>
+                    <abstol>1.e-6</abstol>
+                </convergence_criterion>
+                <time_discretization>
+                    <type>BackwardEuler</type>
+                </time_discretization>
+                <time_stepping>
+                    <type>FixedTimeStepping</type>
+                    <t_initial> 0.0 </t_initial>
+                    <t_end> 1 </t_end>
+                    <timesteps>
+                        <pair>
+                            <repeat>1</repeat>
+                            <delta_t>1</delta_t>
+                        </pair>
+                    </timesteps>
+                </time_stepping>
+            </process>
+        </processes>
+        <output>
+            <type>VTK</type>
+            <prefix>source_term_at_entire_line</prefix>
+            <timesteps>
+                <pair>
+                    <repeat> 10000 </repeat>
+                    <each_steps> 1 </each_steps>
+                </pair>
+            </timesteps>
+            <variables>
+                <variable> temperature </variable>
+                <variable> heat_flux_x </variable>
+            </variables>
+        </output>
+    </time_loop>
+    <parameters>
+        <parameter>
+            <name>lambda</name>
+            <type>Constant</type>
+            <value>1</value>
+        </parameter>
+        <parameter>
+            <name>c_p</name>
+            <type>Constant</type>
+            <value>0</value>
+        </parameter>
+        <parameter>
+            <name>rho</name>
+            <type>Constant</type>
+            <value>0</value>
+        </parameter>
+        <parameter>
+            <name>T0</name>
+            <type>Constant</type>
+            <value>0</value>
+        </parameter>
+        <parameter>
+            <name>HeatSource</name>
+            <type>Constant</type>
+            <value>1</value>
+        </parameter>
+    </parameters>
+    <process_variables>
+        <process_variable>
+            <name>temperature</name>
+            <components>1</components>
+            <order>1</order>
+            <initial_condition>T0</initial_condition>
+            <boundary_conditions>
+                <boundary_condition>
+                    <mesh>line_1_left</mesh>
+                    <type>Dirichlet</type>
+                    <parameter>T0</parameter>
+                </boundary_condition>
+                <boundary_condition>
+                    <mesh>line_1_right</mesh>
+                    <type>Dirichlet</type>
+                    <parameter>T0</parameter>
+                </boundary_condition>
+            </boundary_conditions>
+            <source_terms>
+                <source_term>
+                    <mesh>line_1_entire_line</mesh>
+                    <type>Line</type>
+                    <parameter>HeatSource</parameter>
+                </source_term>
+            </source_terms>
+        </process_variable>
+    </process_variables>
+    <nonlinear_solvers>
+        <nonlinear_solver>
+            <name>basic_picard</name>
+            <type>Picard</type>
+            <max_iter>10</max_iter>
+            <linear_solver>general_linear_solver</linear_solver>
+        </nonlinear_solver>
+    </nonlinear_solvers>
+    <linear_solvers>
+        <linear_solver>
+            <name>general_linear_solver</name>
+            <lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis>
+            <eigen>
+                <solver_type>CG</solver_type>
+                <precon_type>DIAGONAL</precon_type>
+                <max_iteration_step>10000</max_iteration_step>
+                <error_tolerance>1e-16</error_tolerance>
+            </eigen>
+            <petsc>
+                <prefix>gw</prefix>
+                <parameters>-gw_ksp_type cg -gw_pc_type bjacobi -gw_ksp_rtol 1e-16 -gw_ksp_max_it 10000</parameters>
+            </petsc>
+        </linear_solver>
+    </linear_solvers>
+</OpenGeoSysProject>
diff --git a/Tests/Data/Parabolic/T/1D_line_source_term_tests/mesh_1_line_100.vtu b/Tests/Data/Parabolic/T/1D_line_source_term_tests/mesh_1_line_100.vtu
new file mode 100644
index 00000000000..9b276984bca
--- /dev/null
+++ b/Tests/Data/Parabolic/T/1D_line_source_term_tests/mesh_1_line_100.vtu
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:47eef401df08330a83c5e63445a2f09dd622c3501945d16d326056866c8f9427
+size 7627
-- 
GitLab