Skip to content
Snippets Groups Projects
Commit 9e7f8b26 authored by Lars Bilke's avatar Lars Bilke Committed by Dmitri Naumov
Browse files

Removed ThirdParty/ogs6py.

ogs6py is a dependency of OGSTools which depends on OGS.
parent 6e24f050
No related branches found
No related tags found
No related merge requests found
[submodule "ThirdParty/ogs6py"]
path = ThirdParty/ogs6py
url = https://github.com/joergbuchwald/ogs6py.git
......@@ -357,12 +357,10 @@ AddTest(
ThermalConvection_ts_1_t_0.000000_expected.vtu ThermalConvection_ts_1_t_0.000000.vtu darcy_velocity darcy_velocity 1e-8 1e-13
)
if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND Python_FOUND)
add_custom_target(generate_invalid_project_files_ht
${Python_EXECUTABLE}
${PROJECT_SOURCE_DIR}/ThirdParty/ogs6py/generateInvalidMediaForHT.py
generateInvalidMediaForHT.py
WORKING_DIRECTORY ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/)
if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND OGS_USE_PIP)
execute_process(COMMAND ${Python_EXECUTABLE}
${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/generateInvalidMediaForHT.py
WORKING_DIRECTORY ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles)
file(GLOB HT_INVALID_PRJ_FILES ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/*.prj)
foreach(ht_invalid_prj_file ${HT_INVALID_PRJ_FILES})
string(REPLACE ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/HT "invalid" ht_invalid_prj_file_short ${ht_invalid_prj_file})
......@@ -372,7 +370,6 @@ if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND Python_FOUND)
EXECUTABLE ogs
EXECUTABLE_ARGS ${ht_invalid_prj_file}
RUNTIME 1
DEPENDS generate_invalid_project_files_ht
)
set_tests_properties(ogs-HT_${ht_invalid_prj_file_short} PROPERTIES WILL_FAIL TRUE)
endforeach()
......
from ogs6py import ogs
def addSolidPropertiesForHT(omit=""):
if omit != "storage":
model.media.add_property(
medium_id="0",
phase_type="Solid",
name="storage",
type="Constant",
value="0.0",
)
if omit != "density":
model.media.add_property(
medium_id="0",
phase_type="Solid",
name="density",
type="Constant",
value="0.0",
)
if omit != "thermal_conductivity":
model.media.add_property(
medium_id="0",
phase_type="Solid",
name="thermal_conductivity",
type="Constant",
value="3.0",
)
if omit != "specific_heat_capacity":
model.media.add_property(
medium_id="0",
phase_type="Solid",
name="specific_heat_capacity",
type="Constant",
value="0.0",
)
def addAqueousLiquidPropertiesForHT(omit=""):
if omit != "specific_heat_capacity":
model.media.add_property(
medium_id="0",
phase_type="AqueousLiquid",
name="specific_heat_capacity",
type="Constant",
value="0.0",
)
if omit != "thermal_conductivity":
model.media.add_property(
medium_id="0",
phase_type="AqueousLiquid",
name="thermal_conductivity",
type="Constant",
value="0.65",
)
if omit != "density":
model.media.add_property(
medium_id="0",
phase_type="AqueousLiquid",
name="density",
type="Constant",
value="1e-3",
)
if omit != "viscosity":
model.media.add_property(
medium_id="0",
phase_type="AqueousLiquid",
name="viscosity",
type="Constant",
value="1e-3",
)
def addMediumPropertiesForHT(omit=""):
if omit != "thermal_longitudinal_dispersivity":
model.media.add_property(
medium_id="0",
name="thermal_longitudinal_dispersivity",
type="Constant",
value="0.0",
)
if omit != "thermal_transversal_dispersivity":
model.media.add_property(
medium_id="0",
name="thermal_transversal_dispersivity",
type="Constant",
value="0.0",
)
if omit != "permeability":
model.media.add_property(
medium_id="0", name="permeability", type="Constant", value="1e-14 0 0 1e-14"
)
if omit != "porosity":
model.media.add_property(
medium_id="0", name="porosity", type="Constant", value="1e-3"
)
solid_properties = [
"",
"storage",
"density",
"thermal_conductivity",
"specific_heat_capacity",
]
aqueousfluid_properties = [
"",
"specific_heat_capacity",
"thermal_conductivity",
"density",
"viscosity",
]
medium_properties = [
"",
"thermal_longitudinal_dispersivity",
"thermal_transversal_dispersivity",
"permeability",
"porosity",
]
for solid_property in solid_properties:
for aqueousfluid_property in aqueousfluid_properties:
for medium_property in medium_properties:
if (
solid_property == ""
and aqueousfluid_property == ""
and medium_property == ""
):
continue
model = ogs.OGS(
PROJECT_FILE="HT_"
+ solid_property
+ "_"
+ aqueousfluid_property
+ "_"
+ medium_property
+ ".prj"
)
model.mesh.add_mesh(filename="square_1x1_quad_1e3.vtu")
model.geo.add_geom(filename="square_1x1.gml")
model.processes.set_process(
name="HT", type="HT", integration_order="2", specific_body_force="0 0"
)
model.processes.add_process_variable(
process_variable="temperature", process_variable_name="temperature"
)
model.processes.add_process_variable(
process_variable="pressure", process_variable_name="pressure"
)
model.processes.add_process_variable(
secondary_variable="darcy_velocity", output_name="darcy_velocity"
)
addAqueousLiquidPropertiesForHT(aqueousfluid_property)
addSolidPropertiesForHT(solid_property)
addMediumPropertiesForHT(medium_property)
model.timeloop.add_process(
process="HT",
nonlinear_solver_name="basic_picard",
convergence_type="DeltaX",
norm_type="NORM2",
abstol="1e-15",
time_discretization="BackwardEuler",
)
model.timeloop.set_stepping(
process="HT",
type="FixedTimeStepping",
t_initial="0",
t_end="1",
repeat="4",
delta_t="0.25",
)
model.timeloop.add_output(
type="VTK",
prefix="HT_test_",
repeat="1",
each_steps="10",
variables=["temperature", "pressure"],
)
model.parameters.add_parameter(name="T0", type="Constant", value="0")
model.parameters.add_parameter(name="P0", type="Constant", value="0")
model.parameters.add_parameter(
name="p_Dirichlet_left", type="Constant", value="1"
)
# model.parameters.add_parameter(name="p_Dirichlet_right", type="Constant", value="-1")
model.parameters.add_parameter(
name="t_Dirichlet_bottom", type="Constant", value="2"
)
# model.parameters.add_parameter(name="t_Dirichlet_top", type="Constant", value="1")
model.processvars.set_ic(
process_variable_name="temperature",
components="1",
order="1",
initial_condition="T0",
)
model.processvars.add_bc(
process_variable_name="temperature",
geometrical_set="square_1x1_geometry",
geometry="bottom",
type="Dirichlet",
component="0",
parameter="t_Dirichlet_bottom",
)
# model.processvars.add_bc(process_variable_name="temperature",
# geometrical_set="square_1x1_geometry",
# geometry="top",
# type="Dirichlet",
# component="1",
# parameter="t_Dirichlet_top")
model.processvars.set_ic(
process_variable_name="pressure",
components="1",
order="1",
initial_condition="P0",
)
model.processvars.add_bc(
process_variable_name="pressure",
geometrical_set="square_1x1_geometry",
geometry="left",
type="Dirichlet",
component="1",
parameter="p_Dirichlet_left",
)
# model.processvars.addadd_bcBC(process_variable_name="pressure",
# geometrical_set="square_1x1_geometry",
# geometry="right",
# type="Dirichlet",
# component="1",
# parameter="p_Dirichlet_right")
model.nonlinsolvers.add_non_lin_solver(
name="basic_picard",
type="Picard",
max_iter="4",
linear_solver="general_linear_solver",
)
model.linsolvers.add_lin_solver(
name="general_linear_solver",
kind="lis",
solver_type="cg",
precon_type="jacobi",
max_iteration_step="10000",
error_tolerance="1e-16",
)
model.linsolvers.add_lin_solver(
name="general_linear_solver",
kind="eigen",
solver_type="CG",
precon_type="DIAGONAL",
max_iteration_step="10000",
error_tolerance="1e-16",
)
model.linsolvers.add_lin_solver(
name="general_linear_solver",
kind="petsc",
solver_type="cg",
precon_type="bjacobi",
max_iteration_step="10000",
error_tolerance="1e-16",
prefix="foo",
)
model.write_input()
Subproject commit a909ed65ad9ec99fbe752dd7000f07005ee912ff
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