Commit 9e4fedb5 authored by Dmitry Yu. Naumov's avatar Dmitry Yu. Naumov
Browse files

Merge branch 'anisotropic_thermal_expansivity' into 'master'

allow solid thermal expansion to be anisotropic in THM process

See merge request !3107
parents f3135891 ac130440
Pipeline #1408 failed with stages
in 112 minutes and 6 seconds
......@@ -100,14 +100,10 @@ struct IntegrationPointData final
double const dt,
DisplacementVectorType const& /*u*/,
double const T,
double const thermal_strain)
MathLib::KelvinVector::KelvinVectorType<DisplacementDim> const& thermal_strain)
{
auto const& identity2 = MathLib::KelvinVector::Invariants<
MathLib::KelvinVector::KelvinVectorDimensions<
DisplacementDim>::value>::identity2;
// assume isotropic thermal expansion
eps_m.noalias() = eps - thermal_strain * identity2;
eps_m.noalias() = eps - thermal_strain;
auto&& solution = solid_material.integrateStress(
t, x_position, dt, eps_m_prev, eps_m, sigma_eff_prev,
*material_state_variables, T);
......
......@@ -85,3 +85,69 @@ AddTest(
expected_square_1e0_lin_pcs_0_ts_10_t_50000.000000.vtu square_1e0_lin_pcs_0_ts_10_t_50000.000000.vtu epsilon epsilon 1e-5 1e-5
expected_square_1e0_lin_pcs_0_ts_10_t_50000.000000.vtu square_1e0_lin_pcs_0_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
PATH ThermoHydroMechanics/Linear/anisotropic_thermal_expansivity
RUNTIME 5
EXECUTABLE ogs
EXECUTABLE_ARGS cube_ortho_phi0.0.prj
WRAPPER time
TESTER vtkdiff
REQUIREMENTS NOT OGS_USE_MPI
DIFF_DATA
expected_cube_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu displacement displacement 1e-8 1e-8
expected_cube_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu pressure pressure 1e-5 1e-5
expected_cube_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu temperature temperature 1e-8 1e-8
expected_cube_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu sigma sigma 1e-5 1e-5
expected_cube_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu epsilon epsilon 1e-8 1e-8
)
# ThermoHydroMechanics; Small deformation, linear elastic, porosity!=0, anisotropic thermal expansion
AddTest(
NAME ThermoHydroMechanics_cube_ortho-thermal-expansion
PATH ThermoHydroMechanics/Linear/anisotropic_thermal_expansivity
RUNTIME 5
EXECUTABLE ogs
EXECUTABLE_ARGS cube_ortho_phi0.183.prj
WRAPPER time
TESTER vtkdiff
REQUIREMENTS NOT OGS_USE_MPI
DIFF_DATA
expected_cube_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu displacement displacement 1e-8 1e-8
expected_cube_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu pressure pressure 1e-5 1e-5
expected_cube_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu temperature temperature 1e-8 1e-8
expected_cube_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu sigma sigma 1e-5 1e-5
expected_cube_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu epsilon epsilon 1e-8 1e-8
)
AddTest(
NAME ThermoHydroMechanics_square_ortho-thermal-expansion-phi0
PATH ThermoHydroMechanics/Linear/anisotropic_thermal_expansivity
RUNTIME 5
EXECUTABLE ogs
EXECUTABLE_ARGS square_ortho_phi0.0.prj
WRAPPER time
TESTER vtkdiff
REQUIREMENTS NOT OGS_USE_MPI
DIFF_DATA
expected_square_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu displacement displacement 1e-8 1e-8
expected_square_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu pressure pressure 1e-5 1e-5
expected_square_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu temperature temperature 1e-8 1e-8
expected_square_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu sigma sigma 1e-5 1e-5
expected_square_ortho-thermal-expansion_phi0ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0ts_10_t_1.000000.vtu epsilon epsilon 1e-8 1e-8
)
AddTest(
NAME ThermoHydroMechanics_square_ortho-thermal-expansion
PATH ThermoHydroMechanics/Linear/anisotropic_thermal_expansivity
RUNTIME 5
EXECUTABLE ogs
EXECUTABLE_ARGS square_ortho_phi0.183.prj
WRAPPER time
TESTER vtkdiff
REQUIREMENTS NOT OGS_USE_MPI
DIFF_DATA
expected_square_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu displacement displacement 1e-8 1e-8
expected_square_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu pressure pressure 1e-5 1e-5
expected_square_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu temperature temperature 1e-8 1e-8
expected_square_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu sigma sigma 1e-5 1e-5
expected_square_ortho-thermal-expansion_phi0.183ts_10_t_1.000000.vtu THM_square_ortho-thermal-expansion-phi0.183ts_10_t_1.000000.vtu epsilon epsilon 1e-8 1e-8
)
......@@ -236,11 +236,16 @@ void ThermoHydroMechanicsLocalAssembler<ShapeFunctionDisplacement,
auto const specific_storage =
solid_phase.property(MaterialPropertyLib::PropertyType::storage)
.template value<double>(vars, x_position, t, dt);
auto const solid_linear_thermal_expansion_coefficient =
solid_phase
.property(
MaterialPropertyLib::PropertyType::thermal_expansivity)
.template value<double>(vars, x_position, t, dt);
// Consider anisotropic thermal expansion.
// Read in 3x3 tensor. 2D case also requires expansion coeff. for z-
// component.
Eigen::Matrix<double, 3,
3> const solid_linear_thermal_expansion_coefficient =
MaterialPropertyLib::formEigenTensor<3>(
solid_phase
.property(
MaterialPropertyLib::PropertyType::thermal_expansivity)
.value(vars, x_position, t, dt));
auto const porosity =
solid_phase.property(MaterialPropertyLib::PropertyType::porosity)
......@@ -283,10 +288,14 @@ void ThermoHydroMechanicsLocalAssembler<ShapeFunctionDisplacement,
// TODO (Wenqing) : Change dT to time step wise increment
double const delta_T(T_int_pt - T0);
double const thermal_strain =
solid_linear_thermal_expansion_coefficient * delta_T;
MathLib::KelvinVector::KelvinVectorType<DisplacementDim> const
thermal_strain =
MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
solid_linear_thermal_expansion_coefficient) *
delta_T;
double const rho_s = solid_density * (1 - 3 * thermal_strain);
double const rho_s = solid_density * (1 -
solid_linear_thermal_expansion_coefficient.trace() * delta_T);
auto velocity = (-K_over_mu * dNdx_p * p).eval();
velocity += K_over_mu * fluid_density * b;
......@@ -332,7 +341,7 @@ void ThermoHydroMechanicsLocalAssembler<ShapeFunctionDisplacement,
//
auto const beta =
porosity * fluid_volumetric_thermal_expansion_coefficient +
(1 - porosity) * 3 * solid_linear_thermal_expansion_coefficient;
(1 - porosity) * solid_linear_thermal_expansion_coefficient.trace();
storage_T.noalias() += N_T.transpose() * beta * N_T * w;
//
......@@ -588,15 +597,22 @@ void ThermoHydroMechanicsLocalAssembler<ShapeFunctionDisplacement,
vars[static_cast<int>(MaterialPropertyLib::Variable::phase_pressure)] =
N_T.dot(p); // N_T = N_p
auto const solid_linear_thermal_expansion_coefficient =
solid_phase
.property(
MaterialPropertyLib::PropertyType::thermal_expansivity)
.template value<double>(vars, x_position, t, dt);
// Read in 3x3 tensor. 2D case also requires expansion coeff. for z-
// component.
Eigen::Matrix<double, 3,
3> const solid_linear_thermal_expansion_coefficient =
MaterialPropertyLib::formEigenTensor<3>(
solid_phase
.property(
MaterialPropertyLib::PropertyType::thermal_expansivity)
.value(vars, x_position, t, dt));
double const delta_T(T_int_pt - T0);
double const thermal_strain =
solid_linear_thermal_expansion_coefficient * delta_T;
MathLib::KelvinVector::KelvinVectorType<DisplacementDim> const
thermal_strain =
MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
solid_linear_thermal_expansion_coefficient) *
delta_T;
auto& eps = _ip_data[ip].eps;
eps.noalias() = B * u;
......
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<meshes>
<mesh>single_cube_bulk.vtu</mesh>
<mesh>single_cube_x0_surface.vtu</mesh>
<mesh>single_cube_x10_surface.vtu</mesh>
<mesh>single_cube_y0_surface.vtu</mesh>
<mesh>single_cube_y10_surface.vtu</mesh>
<mesh>single_cube_z0_surface.vtu</mesh>
<mesh>single_cube_z10_surface.vtu</mesh>
</meshes>
<processes>
<process>
<name>THERMO_HYDRO_MECHANICS</name>
<type>THERMO_HYDRO_MECHANICS</type>
<integration_order>4</integration_order>
<dimension>3</dimension>
<constitutive_relation>
<type>LinearElasticIsotropic</type>
<youngs_modulus>E</youngs_modulus>
<poissons_ratio>nu</poissons_ratio>
</constitutive_relation>
<reference_temperature>temperature0</reference_temperature>
<process_variables>
<displacement>displacement</displacement>
<pressure>pressure</pressure>
<temperature>temperature</temperature>
</process_variables>
<secondary_variables>
<secondary_variable internal_name="sigma" output_name="sigma"/>
<secondary_variable internal_name="epsilon" output_name="epsilon"/>
</secondary_variables>
<specific_body_force>0 0 0</specific_body_force>
</process>
</processes>
<media>
<medium id="0">
<phases>
<phase>
<type>AqueousLiquid</type>
<properties>
<property>
<name>specific_heat_capacity</name>
<type>Constant</type>
<value>4065.12</value>
</property>
<property>
<name>thermal_conductivity</name>
<type>Constant</type>
<value>0.63</value>
</property>
<property>
<name>density</name>
<type>Linear</type>
<reference_value>999.1</reference_value>
<independent_variable>
<variable_name>temperature</variable_name>
<reference_condition>293.15</reference_condition>
<slope>-3.98e-4</slope>
</independent_variable>
</property>
<property>
<name>thermal_expansivity</name>
<type>Constant</type>
<value>3.98e-4</value>
</property>
<property>
<name>viscosity</name>
<type>Constant</type>
<value>1.e-3</value>
</property>
</properties>
</phase>
<phase>
<type>Solid</type>
<properties>
<property>
<name>permeability</name>
<type>Constant</type>
<value>3e-20 0 0 0 3e-20 0 0 0 3e-20</value>
</property>
<property>
<name>porosity</name>
<type>Constant</type>
<value>0.0</value>
</property>
<property>
<name>storage</name>
<type>Constant</type>
<value>1e-10</value>
</property>
<property>
<name>density</name>
<type>Constant</type>
<value>2768.5</value>
</property>
<property>
<name>thermal_conductivity</name>
<type>Constant</type>
<value>1.7</value>
</property>
<property>
<name>specific_heat_capacity</name>
<type>Constant</type>
<value>860.0</value>
</property>
<property>
<name>biot_coefficient</name>
<type>Constant</type>
<value>1.0</value>
</property>
<property>
<name>thermal_expansivity</name>
<type>Constant</type>
<!-- eps_i = (thermal_expansivity)_i * DeltaT -->
<value>1.5e-5 2.5e-5 3.5e-5</value>
</property>
</properties>
</phase>
</phases>
</medium>
</media>
<time_loop>
<processes>
<process ref="THERMO_HYDRO_MECHANICS">
<nonlinear_solver>basic_newton</nonlinear_solver>
<convergence_criterion>
<type>PerComponentDeltaX</type>
<norm_type>NORM2</norm_type>
<abstols>1e-5 1e-2 1e-5 1e-5 1e-5</abstols>
</convergence_criterion>
<time_discretization>
<type>BackwardEuler</type>
</time_discretization>
<time_stepping>
<type>FixedTimeStepping</type>
<t_initial>0</t_initial>
<t_end>1</t_end>
<timesteps>
<pair>
<repeat>10</repeat>
<delta_t>0.1</delta_t>
</pair>
</timesteps>
</time_stepping>
</process>
</processes>
<output>
<type>VTK</type>
<prefix>THM_ortho-thermal-expansion-phi0</prefix>
<timesteps>
<pair>
<repeat>100</repeat>
<each_steps>1</each_steps>
</pair>
</timesteps>
<variables>
<variable>displacement</variable>
<variable>pressure</variable>
<variable>temperature</variable>
<variable>sigma</variable>
<variable>epsilon</variable>
</variables>
</output>
</time_loop>
<parameters>
<parameter>
<name>E</name>
<type>Constant</type>
<value>2.7e9</value>
</parameter>
<parameter>
<name>nu</name>
<type>Constant</type>
<value>0.33</value>
</parameter>
<parameter>
<name>displacement0</name>
<type>Constant</type>
<values>0 0 0</values>
</parameter>
<parameter>
<name>pressure_ic</name>
<type>Constant</type>
<values>0</values>
</parameter>
<parameter>
<name>dirichlet0</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>neumann0</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>pressure_bc_left</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>temperature0</name>
<type>Constant</type>
<value>293.15</value>
</parameter>
<parameter>
<name>Tvalue</name>
<type>Constant</type>
<value>293.15</value>
</parameter>
<parameter>
<name>temperature1</name>
<type>CurveScaled</type>
<parameter>Tvalue</parameter>
<curve>Tcurve</curve>
</parameter>
</parameters>
<curves>
<curve>
<name>Tcurve</name>
<coords>0 1</coords>
<values>1 1.5</values>
</curve>
</curves>
<process_variables>
<process_variable>
<name>displacement</name>
<components>3</components>
<order>1</order>
<initial_condition>displacement0</initial_condition>
<boundary_conditions>
<boundary_condition>
<mesh>single_cube_x0_surface</mesh>
<type>Dirichlet</type>
<component>0</component>
<parameter>dirichlet0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_y0_surface</mesh>
<type>Dirichlet</type>
<component>1</component>
<parameter>dirichlet0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_z0_surface</mesh>
<type>Dirichlet</type>
<component>2</component>
<parameter>dirichlet0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_x10_surface</mesh>
<type>Neumann</type>
<component>0</component>
<parameter>neumann0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_y10_surface</mesh>
<type>Neumann</type>
<component>1</component>
<parameter>neumann0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_z10_surface</mesh>
<type>Neumann</type>
<component>2</component>
<parameter>neumann0</parameter>
</boundary_condition>
</boundary_conditions>
</process_variable>
<process_variable>
<name>pressure</name>
<components>1</components>
<order>1</order>
<initial_condition>pressure_ic</initial_condition>
<boundary_conditions>
</boundary_conditions>
</process_variable>
<process_variable>
<name>temperature</name>
<components>1</components>
<order>1</order>
<initial_condition>temperature0</initial_condition>
<boundary_conditions>
<boundary_condition>
<mesh>single_cube_x10_surface</mesh>
<type>Dirichlet</type>
<component>0</component>
<parameter>temperature1</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_y10_surface</mesh>
<type>Dirichlet</type>
<component>0</component>
<parameter>temperature1</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_z10_surface</mesh>
<type>Dirichlet</type>
<component>0</component>
<parameter>temperature1</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_x0_surface</mesh>
<type>Dirichlet</type>
<component>0</component>
<parameter>temperature1</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_y0_surface</mesh>
<type>Dirichlet</type>
<component>0</component>
<parameter>temperature1</parameter>
</boundary_condition>
<boundary_condition>
<mesh>single_cube_z0_surface</mesh>
<type>Dirichlet</type>
<component>0</component>
<parameter>temperature1</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>
<eigen>
<solver_type>SparseLU</solver_type>
<scaling>1</scaling>
</eigen>
</linear_solver>
</linear_solvers>
</OpenGeoSysProject>
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<meshes>
<mesh>single_cube_bulk.vtu</mesh>
<mesh>single_cube_x0_surface.vtu</mesh>
<mesh>single_cube_x10_surface.vtu</mesh>
<mesh>single_cube_y0_surface.vtu</mesh>
<mesh>single_cube_y10_surface.vtu</mesh>
<mesh>single_cube_z0_surface.vtu</mesh>
<mesh>single_cube_z10_surface.vtu</mesh>
</meshes>
<processes>
<process>
<name>THERMO_HYDRO_MECHANICS</name>
<type>THERMO_HYDRO_MECHANICS</type>
<integration_order>4</integration_order>
<dimension>3</dimension>
<constitutive_relation>
<type>LinearElasticIsotropic</type>
<youngs_modulus>E</youngs_modulus>
<poissons_ratio>nu</poissons_ratio>
</constitutive_relation>
<reference_temperature>temperature0</reference_temperature>
<process_variables>
<displacement>displacement</displacement>
<pressure>pressure</pressure>
<temperature>temperature</temperature>
</process_variables>
<secondary_variables>
<secondary_variable internal_name="sigma" output_name="sigma"/>
<secondary_variable internal_name="epsilon" output_name="epsilon"/>
</secondary_variables>
<specific_body_force>0 0 0</specific_body_force>
</process>
</processes>
<media>
<medium id="0">
<phases>
<phase>
<type>AqueousLiquid</type>
<properties>
<property>
<name>specific_heat_capacity</name>
<type>Constant</type>
<value>4065.12</value>
</property>
<property>
<name>thermal_conductivity</name>
<type>Constant</type>
<value>0.63</value>
</property>
<property>
<name>density</name>
<type>Linear</type>
<reference_value>999.1</reference_value>
<independent_variable>
<variable_name>temperature</variable_name>
<reference_condition>293.15</reference_condition>
<slope>-3.98e-4</slope>