Skip to content

Commit

Permalink
Merge branch 'THM_MultimaterialRestart_MCC' into 'master'
Browse files Browse the repository at this point in the history
THM/RM Multi-material restart for MCC-type models

See merge request ogs/ogs!4971
  • Loading branch information
endJunction committed May 6, 2024
2 parents 9186f19 + 7cc5c39 commit 3d39bb2
Show file tree
Hide file tree
Showing 89 changed files with 2,001 additions and 184 deletions.
10 changes: 3 additions & 7 deletions ProcessLib/RichardsMechanics/IntegrationPointData.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ struct IntegrationPointData final
MPL::VariableArray variable_array;
MPL::VariableArray variable_array_prev;

auto const null_state = solid_material.createMaterialStateVariables();
solid_material.initializeInternalStateVariables(t, x_position,
*null_state);

using KV = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>;

variable_array.stress.emplace<KV>(KV::Zero());
Expand All @@ -118,9 +114,9 @@ struct IntegrationPointData final
variable_array_prev.mechanical_strain.emplace<KV>(KV::Zero());
variable_array_prev.temperature = temperature;

auto&& solution =
solid_material.integrateStress(variable_array_prev, variable_array,
t, x_position, dt, *null_state);
auto&& solution = solid_material.integrateStress(
variable_array_prev, variable_array, t, x_position, dt,
*material_state_variables);

if (!solution)
{
Expand Down
2 changes: 1 addition & 1 deletion ProcessLib/RichardsMechanics/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif()

if (NOT OGS_USE_MPI AND OGS_USE_MFRONT)
OgsTest(PROJECTFILE RichardsMechanics/mfront_restart_part1.prj RUNTIME 1)
OgsTest(PROJECTFILE RichardsMechanics/mfront_restart_part2.prj RUNTIME 1)
OgsTest(PROJECTFILE RichardsMechanics/mfront_restart_part2.xml RUNTIME 1)
endif()

AddTest(
Expand Down
10 changes: 3 additions & 7 deletions ProcessLib/ThermoHydroMechanics/IntegrationPointData.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ struct IntegrationPointData final
MPL::VariableArray variable_array;
MPL::VariableArray variable_array_prev;

auto const null_state = solid_material.createMaterialStateVariables();
solid_material.initializeInternalStateVariables(t, x_position,
*null_state);

using KV = MathLib::KelvinVector::KelvinVectorType<DisplacementDim>;

variable_array.stress.emplace<KV>(KV::Zero());
Expand All @@ -112,9 +108,9 @@ struct IntegrationPointData final
variable_array_prev.mechanical_strain.emplace<KV>(KV::Zero());
variable_array_prev.temperature = temperature;

auto&& solution =
solid_material.integrateStress(variable_array_prev, variable_array,
t, x_position, dt, *null_state);
auto&& solution = solid_material.integrateStress(
variable_array_prev, variable_array, t, x_position, dt,
*material_state_variables);

if (!solution)
{
Expand Down
12 changes: 8 additions & 4 deletions ProcessLib/ThermoHydroMechanics/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ if (NOT OGS_USE_MPI)
OgsTest(PROJECTFILE ThermoHydroMechanics/Linear/HeatTransportInStationaryFlow/WithFreezingPhase.prj RUNTIME 1)

if (OGS_USE_MFRONT)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterialEhlers/M/square_1e1_2_matIDs.prj RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterialEhlers/M/square_1e1_2_matIDs_restart.xml RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterialEhlers/TM/square_1e1_2_matIDs.prj RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterialEhlers/TM/square_1e1_2_matIDs_restart.xml RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterial/DP_Ehlers/M/square_1e1_2_matIDs.prj RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterial/DP_Ehlers/M/square_1e1_2_matIDs_restart.xml RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterial/DP_Ehlers/TM/square_1e1_2_matIDs.prj RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterial/DP_Ehlers/TM/square_1e1_2_matIDs_restart.xml RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterial/DP_MCC/TM/square_1e1_2_matIDs.prj RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/MultiMaterial/DP_MCC/TM/square_1e1_2_matIDs_restart.xml RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/RestartMCC/mfront_restart_part1.prj RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/RestartMCC/mfront_restart_part2.xml RUNTIME 1)
endif()
endif()

Expand Down
25 changes: 4 additions & 21 deletions Tests/Data/RichardsMechanics/mfront_restart_part1.prj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<secondary_variables>
<secondary_variable internal_name="ElasticStrain" output_name="ElasticStrain"/>
<secondary_variable internal_name="EquivalentPlasticStrain" output_name="EquivalentPlasticStrain"/>
<secondary_variable internal_name="PreConsolidationPressure" output_name="PreConsolidationPressure"/>
<secondary_variable internal_name="PlasticVolumetricStrain" output_name="PlasticVolumetricStrain"/>
<secondary_variable internal_name="sigma" output_name="sigma"/>
<secondary_variable internal_name="swelling_stress" output_name="swelling_stress"/>
<secondary_variable internal_name="epsilon" output_name="epsilon"/>
Expand Down Expand Up @@ -147,7 +149,7 @@
<t_end>1000</t_end>
<initial_dt>1000</initial_dt>
<minimum_dt>100</minimum_dt>
<maximum_dt>1e5</maximum_dt>
<maximum_dt>1000</maximum_dt>
<number_iterations>1 5 10 15</number_iterations>
<multiplier>1.2 1.0 0.8 0.6</multiplier>
</time_stepping>
Expand All @@ -164,15 +166,6 @@
</pair>
</timesteps>
<variables>
<variable>displacement</variable>
<variable>pressure</variable>
<variable>sigma</variable>
<variable>epsilon</variable>
<variable>velocity</variable>
<variable>saturation</variable>
<variable>porosity</variable>
<variable>MassFlowRate</variable>
<variable>NodalForces</variable>
</variables>
</output>
</time_loop>
Expand Down Expand Up @@ -216,22 +209,12 @@
<type>Constant</type>
<value>2e5</value>
</parameter>
<parameter>
<name>InitialPorosity</name>
<type>Constant</type>
<value>0.44</value>
</parameter>
<parameter>
<name>InitialVolumeRatio</name>
<type>Constant</type>
<value>1.78571428571428571429</value>
</parameter>
<!-- Initial and boundary values -->
<parameter>
<name>rho_sr</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>displacement0</name>
<type>Constant</type>
Expand All @@ -245,7 +228,7 @@
<parameter>
<name>phi0</name>
<type>Constant</type>
<value>0.432</value>
<value>0.432</value> <!-- TODO 0.44-->
</parameter>
<parameter>
<name>top_pressure</name>
Expand Down
97 changes: 97 additions & 0 deletions Tests/Data/RichardsMechanics/mfront_restart_part2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProjectDiff base_file="mfront_restart_part1.prj">
<replace sel="/*/meshes/mesh[1]/text()">mfront_restart_part1_ts_1_t_1000.000000.vtu</replace>
<replace sel="/*/time_loop/processes/process/time_stepping/t_initial/text()">1000</replace>
<replace sel="/*/time_loop/processes/process/time_stepping/t_end/text()">2000</replace>
<replace sel="/*/time_loop/output/prefix/text()">mfront_restart_part2</replace>

<remove sel="/*/processes/process/constitutive_relation/initial_values"/>
<remove sel="/*/processes/process/initial_stress"/>

<remove sel="/*/parameters/parameter[name='displacement0']"/>
<add sel="/*/parameters">
<parameter>
<name>displacement0</name>
<type>MeshNode</type>
<field_name>displacement</field_name>
</parameter>
</add>

<remove sel="/*/parameters/parameter[name='pressure_ic']"/>
<add sel="/*/parameters">
<parameter>
<name>pressure_ic</name>
<type>MeshNode</type>
<field_name>pressure</field_name>
</parameter>
<parameter>
<name>pressure_bc</name>
<type>Constant</type>
<value>-5e3</value>
</parameter>
</add>

<remove sel="/*/process_variables/process_variable[name='pressure']/boundary_conditions"/>
<add sel="/*/process_variables/process_variable[name='pressure']">
<boundary_conditions>
<boundary_condition>
<mesh>square_1x1_quad_1e0_top</mesh>
<type>Dirichlet</type>
<parameter>pressure_bc</parameter>
</boundary_condition>
<boundary_condition>
<mesh>square_1x1_quad_1e0_bottom</mesh>
<type>Dirichlet</type>
<parameter>pressure_bc</parameter>
</boundary_condition>
</boundary_conditions>
</add>

<remove sel="/*/test_definition"/>
<add sel="/*">
<test_definition>
<vtkdiff>
<regex>mfront_restart_part2_ts_.*_t_.*.vtu</regex>
<field>displacement</field>
<absolute_tolerance>2e-14</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>mfront_restart_part2_ts_.*_t_.*.vtu</regex>
<field>sigma</field>
<absolute_tolerance>1e-9</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>mfront_restart_part2_ts_.*_t_.*.vtu</regex>
<field>epsilon</field>
<absolute_tolerance>1e-15</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>mfront_restart_part2_ts_.*_t_.*.vtu</regex>
<field>pressure</field>
<absolute_tolerance>1e-15</absolute_tolerance>
<relative_tolerance>1e-15</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>mfront_restart_part2_ts_.*_t_.*.vtu</regex>
<field>velocity</field>
<absolute_tolerance>1e-15</absolute_tolerance>
<relative_tolerance>1e-15</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>mfront_restart_part2_ts_.*_t_.*.vtu</regex>
<field>MassFlowRate</field>
<absolute_tolerance>1e-15</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>mfront_restart_part2_ts_.*_t_.*.vtu</regex>
<field>NodalForces</field>
<absolute_tolerance>1e-10</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
</test_definition>
</add>
</OpenGeoSysProjectDiff>
Loading

0 comments on commit 3d39bb2

Please sign in to comment.