Skip to content
Snippets Groups Projects
Commit fc01738c authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[T/THM] Added a test case for 0D Python STs

parent 64f87d59
No related branches found
No related tags found
No related merge requests found
Showing
with 53 additions and 0 deletions
......@@ -142,6 +142,23 @@ AddTest(
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 poroelastic, point heat source consolidation, variation with a Python source term
AddTest(
NAME ThermoHydroMechanics_point_heat_injection_py_st
PATH ThermoHydroMechanics/Linear/Point_injection/with-python-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
......
../expected_pointheatsource_quadratic-mesh_ts_10_t_50000.000000.vtu
\ No newline at end of file
<?xml version='1.0' encoding='ISO-8859-1'?>
<OpenGeoSysProjectDiff base_file="../pointheatsource_quadratic-mesh.prj">
<replace sel="//source_term/type/text()">
Python
</replace>
<add sel="//source_term">
<source_term_object>source_term</source_term_object>
</add>
<add sel="/*">
<python_script>source_term.py</python_script>
</add>
<!-- 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>
../quarter_002_2nd.vtu
\ No newline at end of file
../quarter_circle_geometry_bottom.vtu
\ No newline at end of file
../quarter_circle_geometry_center.vtu
\ No newline at end of file
../quarter_circle_geometry_left.vtu
\ No newline at end of file
../quarter_circle_geometry_out.vtu
\ No newline at end of file
try:
import ogs.callbacks as OpenGeoSys
except ModuleNotFoundError:
import OpenGeoSys
class SourceTerm(OpenGeoSys.SourceTerm):
def getFlux(self, _t, coords, _primary_vars):
x, y, z = coords
value = 150
Jac = [0.0] * 4
return (value, Jac)
source_term = SourceTerm()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment