Skip to content
Snippets Groups Projects
Commit b8e243ae authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Merge branch 'THM_FixPrevIceVolumeFraction' into 'master'

[PL/THM] Explicitly set phi_fr_prev

See merge request ogs/ogs!4744
parents d846de4d 69ca768c
No related branches found
No related tags found
No related merge requests found
Showing
with 673 additions and 4 deletions
......@@ -71,15 +71,14 @@ struct IntegrationPointData final
DisplacementDim>::MaterialStateVariables>
material_state_variables;
double phi_fr = 0;
double phi_fr_prev;
double phi_fr = std::numeric_limits<double>::quiet_NaN();
double phi_fr_prev = std::numeric_limits<double>::quiet_NaN();
double integration_weight;
double porosity;
void pushBackState()
{
phi_fr_prev = phi_fr;
eps0_prev = eps0;
eps_prev = eps;
eps_m_prev = eps_m;
......
......@@ -7,6 +7,7 @@ if (NOT OGS_USE_MPI)
OgsTest(PROJECTFILE ThermoHydroMechanics/ColumnDeformationFreezing/TM.prj RUNTIME 13)
OgsTest(PROJECTFILE ThermoHydroMechanics/HeatingHomogeneousDomain/hex_THM.prj RUNTIME 30)
OgsTest(PROJECTFILE ThermoHydroMechanics/9percentWaterFreezingExpansion/UnitSquare.prj RUNTIME 1)
OgsTest(PROJECTFILE ThermoHydroMechanics/Linear/HeatTransportInStationaryFlow/WithFreezingPhase.prj RUNTIME 1)
endif()
AddTest(
......
......@@ -389,7 +389,15 @@ ConstitutiveRelationsValues<DisplacementDim> ThermoHydroMechanicsLocalAssembler<
vars, MaterialPropertyLib::Variable::temperature,
x_position, t, dt);
double const& phi_fr_prev = ip_data.phi_fr_prev;
double const phi_fr_prev = [&]()
{
MaterialPropertyLib::VariableArray vars_prev;
vars_prev.temperature = T_prev_int_pt;
return (*medium)[MaterialPropertyLib::PropertyType::volume_fraction]
.template value<double>(vars_prev, x_position, t, dt);
}();
ip_data.phi_fr_prev = phi_fr_prev;
// alpha_T^I
MathLib::KelvinVector::KelvinVectorType<
DisplacementDim> const ice_linear_thermal_expansion_coefficient =
......
<?xml version='1.0' encoding='ISO-8859-1'?>
<OpenGeoSysProject>
<meshes>
<mesh>WithFreezingPhase.vtu</mesh>
<mesh>geometry_left.vtu</mesh>
<mesh>geometry_right.vtu</mesh>
<mesh>geometry_top.vtu</mesh>
<mesh>geometry_bottom.vtu</mesh>
</meshes>
<processes>
<process>
<name>HeatTransportInStationaryFlow</name>
<type>THERMO_HYDRO_MECHANICS</type>
<integration_order>2</integration_order>
<dimension>2</dimension>
<constitutive_relation>
<type>LinearElasticIsotropic</type>
<youngs_modulus>E</youngs_modulus>
<poissons_ratio>nu</poissons_ratio>
</constitutive_relation>
<ice_constitutive_relation>
<type>LinearElasticIsotropic</type>
<youngs_modulus>E_ice</youngs_modulus>
<poissons_ratio>nu_ice</poissons_ratio>
</ice_constitutive_relation>
<process_variables>
<temperature>temperature</temperature>
<pressure>pressure</pressure>
<displacement>displacement</displacement>
</process_variables>
<specific_body_force>0 0</specific_body_force>
<secondary_variables>
<secondary_variable internal_name="sigma" output_name="sigma"/>
<secondary_variable internal_name="sigma_ice" output_name="sigma_ice"/>
<secondary_variable internal_name="epsilon" output_name="epsilon"/>
<secondary_variable internal_name="velocity" output_name="velocity"/>
<secondary_variable internal_name="ice_volume_fraction" output_name="ice_volume_fraction"/>
</secondary_variables>
</process>
</processes>
<media>
<medium id="0">
<phases>
<phase>
<type>AqueousLiquid</type>
<properties>
<property>
<name>specific_heat_capacity</name>
<type>Constant</type>
<value>4182</value>
</property>
<property>
<name>thermal_conductivity</name>
<type>Constant</type>
<value>0.6</value>
</property>
<property>
<name>density</name>
<type>Constant</type>
<value>1000</value>
</property>
<property>
<name>viscosity</name>
<type>Constant</type>
<value>1.0e-3</value>
</property>
</properties>
</phase>
<phase>
<type>FrozenLiquid</type>
<properties>
<property>
<name>thermal_conductivity</name>
<type>Constant</type>
<value>2.2</value>
</property>
<property>
<name>specific_heat_capacity</name>
<type>Constant</type>
<value>2090</value>
</property>
<property>
<name>density</name>
<type>Constant</type>
<value>920</value>
</property>
<property>
<name>specific_latent_heat</name>
<type>Constant</type>
<value>334000</value>
</property>
<property>
<name>thermal_expansivity</name>
<type>Constant</type>
<value>5.5e-5</value>
</property>
<property>
<name>phase_change_expansivity</name>
<type>Constant</type>
<value>0.03</value>
</property>
</properties>
</phase>
<phase>
<type>Solid</type>
<properties>
<property>
<name>bulk_modulus</name>
<type>Constant</type>
<value>1.0e10</value>
</property>
<property>
<name>density</name>
<type>Constant</type>
<value>2850</value>
</property>
<property>
<name>thermal_conductivity</name>
<type>Constant</type>
<value>5.0</value>
</property>
<property>
<name>specific_heat_capacity</name>
<type>Constant</type>
<value>1e6</value>
</property>
<property>
<name>thermal_expansivity</name>
<type>Constant</type>
<value>0.0</value>
</property>
</properties>
</phase>
</phases>
<properties>
<property>
<name>biot_coefficient</name>
<type>Constant</type>
<value>1.0</value>
</property>
<property>
<name>permeability</name>
<type>Constant</type>
<value>1.e-11</value>
</property>
<property>
<name>porosity</name>
<type>Constant</type>
<value>0.5</value>
</property>
<property>
<name>volume_fraction</name>
<type>TemperatureDependentFraction</type>
<steepness>0.5</steepness>
<characteristic_temperature>273.15</characteristic_temperature>
</property>
<property>
<name>density</name>
<type>VolumeFractionAverage</type>
</property>
<property>
<name>thermal_conductivity</name>
<type>VolumeFractionAverage</type>
</property>
</properties>
</medium>
</media>
<time_loop>
<processes>
<process ref="HeatTransportInStationaryFlow">
<nonlinear_solver>basic_newton</nonlinear_solver>
<convergence_criterion>
<type>PerComponentDeltaX</type>
<norm_type>NORM2</norm_type>
<abstols>1e-11 1e-8 1e-14 1e-14</abstols>
</convergence_criterion>
<time_discretization>
<type>BackwardEuler</type>
</time_discretization>
<time_stepping>
<type>FixedTimeStepping</type>
<t_initial>0</t_initial>
<t_end>5e+4</t_end>
<timesteps>
<pair>
<repeat>250</repeat>
<delta_t>1000</delta_t>
</pair>
</timesteps>
</time_stepping>
</process>
</processes>
<output>
<type>VTK</type>
<prefix>WithFreezingPhase</prefix>
<suffix>_ts_{:timestep}_t_{:time}</suffix>
<variables>
</variables>
<fixed_output_times>0 1000 10000 20000 50000</fixed_output_times>
</output>
</time_loop>
<parameters>
<parameter>
<name>E</name>
<type>Constant</type>
<value>1e10</value>
</parameter>
<parameter>
<name>nu</name>
<type>Constant</type>
<value>0.2</value>
</parameter>
<parameter>
<name>E_ice</name>
<type>Constant</type>
<value>1e10</value>
</parameter>
<parameter>
<name>nu_ice</name>
<type>Constant</type>
<value>0.2</value>
</parameter>
<parameter>
<name>T0</name>
<type>Constant</type>
<value>278.15</value>
</parameter>
<parameter>
<name>T_left</name>
<type>CurveScaled</type>
<parameter>T0</parameter>
<curve>temperature_load</curve>
</parameter>
<parameter>
<name>P0</name>
<type>Function</type>
<expression>1e5 + 1e5*(1-x)</expression>
</parameter>
<parameter>
<name>displacement0</name>
<type>MeshNode</type>
<field_name>displacement</field_name>
</parameter>
<parameter>
<name>u0</name>
<type>Constant</type>
<values>0</values>
</parameter>
</parameters>
<curves>
<curve>
<name>temperature_load</name>
<coords>0 10000 20000 50000</coords>
<values>1 1 1.15 1.15 </values>
</curve>
</curves>
<process_variables>
<process_variable>
<name>temperature</name>
<components>1</components>
<order>1</order>
<initial_condition>T0</initial_condition>
<boundary_conditions>
<boundary_condition>
<mesh>geometry_left</mesh>
<type>Dirichlet</type>
<parameter>T_left</parameter>
</boundary_condition>
</boundary_conditions>
</process_variable>
<process_variable>
<name>pressure</name>
<components>1</components>
<order>1</order>
<initial_condition>P0</initial_condition>
<boundary_conditions>
<boundary_condition>
<mesh>geometry_left</mesh>
<type>Dirichlet</type>
<parameter>P0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>geometry_right</mesh>
<type>Dirichlet</type>
<parameter>P0</parameter>
</boundary_condition>
</boundary_conditions>
</process_variable>
<process_variable>
<name>displacement</name>
<components>2</components>
<order>1</order>
<initial_condition>displacement0</initial_condition>
<boundary_conditions>
<boundary_condition>
<mesh>geometry_left</mesh>
<type>Dirichlet</type>
<component>0</component>
<parameter>u0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>geometry_bottom</mesh>
<type>Dirichlet</type>
<component>1</component>
<parameter>u0</parameter>
</boundary_condition>
<!--
<boundary_condition>
<mesh>geometry_right</mesh>
<type>Dirichlet</type>
<component>0</component>
<parameter>u0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>geometry_top</mesh>
<type>Dirichlet</type>
<component>1</component>
<parameter>u0</parameter>
</boundary_condition>
-->
</boundary_conditions>
</process_variable>
</process_variables>
<nonlinear_solvers>
<nonlinear_solver>
<name>basic_newton</name>
<type>Newton</type>
<max_iter>50</max_iter>
<linear_solver>general_linear_solver</linear_solver>
</nonlinear_solver>
</nonlinear_solvers>
<linear_solvers>
<linear_solver>
<name>general_linear_solver</name>
<lis>-i bicgstab -p jacobi -tol 1e-12 -maxiter 10000</lis>
<eigen>
<solver_type>SparseLU</solver_type>
<scaling>1</scaling>
</eigen>
</linear_solver>
</linear_solvers>
<test_definition>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>displacement</field>
<absolute_tolerance>1e-16</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>epsilon</field>
<absolute_tolerance>1e-16</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>sigma</field>
<absolute_tolerance>2e-7</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>sigma_ice</field>
<absolute_tolerance>7e-6</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>ice_volume_fraction</field>
<absolute_tolerance>8e-15</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>pressure</field>
<absolute_tolerance>2e-9</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>temperature</field>
<absolute_tolerance>1e-12</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>MassFlowRate</field>
<absolute_tolerance>1e-16</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>HeatFlowRate</field>
<absolute_tolerance>5e-11</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>WithFreezingPhase_ts_.*.vtu</regex>
<field>NodalForces</field>
<absolute_tolerance>2e-9</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
</test_definition>
</OpenGeoSysProject>
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