Skip to content
Permalink
Browse files

Merge pull request #2487 from TomFischer/HT-UseMPLForSolidPhase

[HT] Use MPL for solid phase properties.
  • Loading branch information...
TomFischer committed May 13, 2019
2 parents a1b9f4d + 19eaf15 commit 13858dd6ff6bb734e3b7349b93d7995ca88a7435
Showing with 334 additions and 391 deletions.
  1. +0 −27 ProcessLib/HT/CreateHTProcess.cpp
  2. +25 −12 ProcessLib/HT/HTFEM.h
  3. +1 −10 ProcessLib/HT/HTMaterialProperties.h
  4. +3 −3 ProcessLib/HT/MonolithicHTFEM.h
  5. +2 −2 ProcessLib/HT/StaggeredHTFEM-impl.h
  6. +29 −27 ProcessLib/HT/Tests.cmake
  7. +15 −18 Tests/Data/Parabolic/HT/ConstViscosity/square_5500x5500.prj
  8. +34 −22 Tests/Data/Parabolic/HT/FaultedCube/Ra_795_fault_bcgs_jacobi.prj
  9. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/CoupledPressureParabolicTemperatureParabolic.prj
  10. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/CoupledPressureParabolicTemperatureParabolicStaggered.prj
  11. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/IsothermalFluidFlow.prj
  12. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/IsothermalFluidFlowStaggered.prj
  13. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/IsothermalFluidFlowWithGravity.prj
  14. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/IsothermalFluidFlowWithGravityStaggered.prj
  15. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/PressureDiffusionTemperatureDiffusion.prj
  16. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/PressureDiffusionTemperatureDiffusionStaggered.prj
  17. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/PressureParabolicTemperatureParabolic.prj
  18. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/PressureParabolicTemperatureParabolicStaggered.prj
  19. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/calculatesurfaceflux_ht_cube_1e3.prj
  20. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/calculatesurfaceflux_ht_cube_1e4.prj
  21. +15 −18 Tests/Data/Parabolic/HT/SimpleSynthetics/constraint_bc_1e3.prj
  22. +15 −18 Tests/Data/Parabolic/HT/StaggeredCoupling/ConstViscosity/square_5500x5500_staggered_scheme.prj
  23. +15 −18 ...a/Parabolic/HT/StaggeredCoupling/ConstViscosity/square_5500x5500_staggered_scheme_adaptive_dt.prj
@@ -79,30 +79,6 @@ std::unique_ptr<Process> createHTProcess(
const int _heat_transport_process_id = 0;
const int _hydraulic_process_id = 1;

// Parameter for the density of the solid.
auto& density_solid = ParameterLib::findParameter<double>(
config,
//! \ogs_file_param_special{prj__processes__process__HT__density_solid}
"density_solid", parameters, 1);
DBUG("Use '%s' as density_solid parameter.", density_solid.name.c_str());

// Parameter for the specific heat capacity of the solid.
auto& specific_heat_capacity_solid = ParameterLib::findParameter<double>(
config,
//! \ogs_file_param_special{prj__processes__process__HT__specific_heat_capacity_solid}
"specific_heat_capacity_solid", parameters, 1);
DBUG("Use '%s' as specific_heat_capacity_solid parameter.",
specific_heat_capacity_solid.name.c_str());

// Parameter for the thermal conductivity of the solid (only one scalar per
// element, i.e., the isotropic case is handled at the moment)
auto& thermal_conductivity_solid = ParameterLib::findParameter<double>(
config,
//! \ogs_file_param_special{prj__processes__process__HT__thermal_conductivity_solid}
"thermal_conductivity_solid", parameters, 1);
DBUG("Use '%s' as thermal_conductivity_solid parameter.",
thermal_conductivity_solid.name.c_str());

// Specific body force parameter.
Eigen::VectorXd specific_body_force;
std::vector<double> const b =
@@ -164,10 +140,7 @@ std::unique_ptr<Process> createHTProcess(

std::unique_ptr<HTMaterialProperties> material_properties =
std::make_unique<HTMaterialProperties>(
density_solid,
std::move(media_map),
specific_heat_capacity_solid,
thermal_conductivity_solid,
has_fluid_thermal_expansion,
*solid_thermal_expansion,
*biot_constant,
@@ -209,39 +209,52 @@ class HTFEM : public HTLocalAssemblerInterface
IntegrationPointData<NodalRowVectorType, GlobalDimNodalMatrixType>>>
_ip_data;

double getHeatEnergyCoefficient(const double t,
const ParameterLib::SpatialPosition& pos,
const double porosity,
const double fluid_density,
const double specific_heat_capacity_fluid)
double getHeatEnergyCoefficient(
MaterialPropertyLib::VariableArray const& vars,
const double porosity,
const double fluid_density,
const double specific_heat_capacity_fluid)
{
auto const& medium =
*_material_properties.media_map->getMedium(this->_element.getID());
auto const& solid_phase = medium.phase("Solid");

auto const specific_heat_capacity_solid =
_material_properties.specific_heat_capacity_solid(t, pos)[0];
solid_phase
.property(
MaterialPropertyLib::PropertyType::specific_heat_capacity)
.template value<double>(vars);

auto const solid_density =
_material_properties.density_solid(t, pos)[0];
solid_phase.property(MaterialPropertyLib::PropertyType::density)
.template value<double>(vars);

return solid_density * specific_heat_capacity_solid * (1 - porosity) +
fluid_density * specific_heat_capacity_fluid * porosity;
}

GlobalDimMatrixType getThermalConductivityDispersivity(
const double t, const ParameterLib::SpatialPosition& pos,
MaterialPropertyLib::VariableArray const& vars,
const double porosity, const double fluid_density,
const double specific_heat_capacity_fluid,
const GlobalDimVectorType& velocity, const GlobalDimMatrixType& I)
{
auto const thermal_conductivity_solid =
_material_properties.thermal_conductivity_solid(t, pos)[0];

auto const& medium =
*_material_properties.media_map->getMedium(_element.getID());
auto const& solid_phase = medium.phase("Solid");
auto const& liquid_phase = medium.phase("AqueousLiquid");

auto const thermal_conductivity_solid =
solid_phase
.property(
MaterialPropertyLib::PropertyType::thermal_conductivity)
.template value<double>(vars);

auto const thermal_conductivity_fluid =
liquid_phase
.property(
MaterialPropertyLib::PropertyType::thermal_conductivity)
.template value<double>();
.template value<double>(vars);

double const thermal_conductivity =
thermal_conductivity_solid * (1 - porosity) +
@@ -24,20 +24,14 @@ namespace HT
struct HTMaterialProperties final
{
HTMaterialProperties(
ParameterLib::Parameter<double> const& density_solid_,
std::unique_ptr<MaterialPropertyLib::MaterialSpatialDistributionMap>&&
media_map_,
ParameterLib::Parameter<double> const& specific_heat_capacity_solid_,
ParameterLib::Parameter<double> const& thermal_conductivity_solid_,
bool const has_fluid_thermal_expansion_,
ParameterLib::Parameter<double> const& solid_thermal_expansion_,
ParameterLib::Parameter<double> const& biot_constant_,
Eigen::VectorXd specific_body_force_,
bool const has_gravity_)
: density_solid(density_solid_),
media_map(std::move(media_map_)),
specific_heat_capacity_solid(specific_heat_capacity_solid_),
thermal_conductivity_solid(thermal_conductivity_solid_),
: media_map(std::move(media_map_)),
has_fluid_thermal_expansion(has_fluid_thermal_expansion_),
solid_thermal_expansion(solid_thermal_expansion_),
biot_constant(biot_constant_),
@@ -51,11 +45,8 @@ struct HTMaterialProperties final
void operator=(HTMaterialProperties&&) = delete;
void operator=(HTMaterialProperties const&) = delete;

ParameterLib::Parameter<double> const& density_solid;
std::unique_ptr<MaterialPropertyLib::MaterialSpatialDistributionMap>
media_map;
ParameterLib::Parameter<double> const& specific_heat_capacity_solid;
ParameterLib::Parameter<double> const& thermal_conductivity_solid;

bool const has_fluid_thermal_expansion;
ParameterLib::Parameter<double> const& solid_thermal_expansion;
@@ -176,8 +176,8 @@ class MonolithicHTFEM
// matrix assembly
GlobalDimMatrixType const thermal_conductivity_dispersivity =
this->getThermalConductivityDispersivity(
t, pos, porosity, fluid_density,
specific_heat_capacity_fluid, velocity, I);
vars, porosity, fluid_density, specific_heat_capacity_fluid,
velocity, I);
Ktt.noalias() +=
(dNdx.transpose() * thermal_conductivity_dispersivity * dNdx +
N.transpose() * velocity.transpose() * dNdx * fluid_density *
@@ -186,7 +186,7 @@ class MonolithicHTFEM
Kpp.noalias() += w * dNdx.transpose() * K_over_mu * dNdx;
Mtt.noalias() +=
w *
this->getHeatEnergyCoefficient(t, pos, porosity, fluid_density,
this->getHeatEnergyCoefficient(vars, porosity, fluid_density,
specific_heat_capacity_fluid) *
N.transpose() * N;
Mpp.noalias() += w * N.transpose() * specific_storage * N;
@@ -252,7 +252,7 @@ void StaggeredHTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::
// Assemble mass matrix
local_M.noalias() +=
w *
this->getHeatEnergyCoefficient(t, pos, porosity, fluid_density,
this->getHeatEnergyCoefficient(vars, porosity, fluid_density,
specific_heat_capacity_fluid) *
N.transpose() * N;

@@ -276,7 +276,7 @@ void StaggeredHTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::

GlobalDimMatrixType const thermal_conductivity_dispersivity =
this->getThermalConductivityDispersivity(
t, pos, porosity, fluid_density, specific_heat_capacity_fluid,
vars, porosity, fluid_density, specific_heat_capacity_fluid,
velocity, I);

local_K.noalias() +=
@@ -209,19 +209,20 @@ AddTest(
VIS ConstViscosityThermalConvectionStaggeredAdaptive_dt_pcs_1_ts_141_t_50000000000.000000.vtu
)

AddTest(
NAME HT_a_DECOVALEX_THMC_based_Example
PATH Parabolic/HT/StaggeredCoupling/ADecovalexTHMCBasedHTExample
EXECUTABLE ogs
EXECUTABLE_ARGS th_decovalex.prj
WRAPPER time
TESTER vtkdiff
REQUIREMENTS NOT (OGS_USE_LIS OR OGS_USE_MPI)
DIFF_DATA
th_decovalex.vtu th_decovalex_pcs_1_ts_40_t_18.000000.vtu T_ref T 6e-12 1.e-14
th_decovalex.vtu th_decovalex_pcs_1_ts_40_t_18.000000.vtu p_ref p 1e-7 1.e-14
VIS th_decovalex_pcs_1_ts_78_t_1000.000000.vtu
)
# 2019-05-09 TF disable the test until the MPL can deal with parameters as properties
#AddTest(
# NAME HT_a_DECOVALEX_THMC_based_Example
# PATH Parabolic/HT/StaggeredCoupling/ADecovalexTHMCBasedHTExample
# EXECUTABLE ogs
# EXECUTABLE_ARGS th_decovalex.prj
# WRAPPER time
# TESTER vtkdiff
# REQUIREMENTS NOT (OGS_USE_LIS OR OGS_USE_MPI)
# DIFF_DATA
# th_decovalex.vtu th_decovalex_pcs_1_ts_40_t_18.000000.vtu T_ref T 6e-12 1.e-14
# th_decovalex.vtu th_decovalex_pcs_1_ts_40_t_18.000000.vtu p_ref p 1e-7 1.e-14
# VIS th_decovalex_pcs_1_ts_78_t_1000.000000.vtu
#)

AddTest(
NAME HT_SimpleSynthetics_IsothermalFluidFlowStaggered
@@ -412,20 +413,21 @@ AddTest(
VIS ConstViscosityThermalConvectionStaggeredAdaptive_dt_pcs_1_ts_141_t_50000000000_000000_0.vtu
)

AddTest(
NAME HT_a_DECOVALEX_THMC_based_Example
PATH Parabolic/HT/StaggeredCoupling/ADecovalexTHMCBasedHTExample
EXECUTABLE_ARGS th_decovalex.prj
WRAPPER mpirun
WRAPPER_ARGS -np 1
TESTER vtkdiff
REQUIREMENTS OGS_USE_MPI
RUNTIME 186
DIFF_DATA
th_decovalex.vtu th_decovalex_pcs_1_ts_40_t_18_000000_0.vtu T_ref T 1e-10 1.e-10
th_decovalex.vtu th_decovalex_pcs_1_ts_40_t_18_000000_0.vtu p_ref p 1e-10 1.e-10
VIS th_decovalex_pcs_1_ts_78_t_1000_000000_0.vtu
)
# 2019-05-09 TF disable the test until the MPL can deal with parameters as properties
# AddTest(
# NAME HT_a_DECOVALEX_THMC_based_Example
# PATH Parabolic/HT/StaggeredCoupling/ADecovalexTHMCBasedHTExample
# EXECUTABLE_ARGS th_decovalex.prj
# WRAPPER mpirun
# WRAPPER_ARGS -np 1
# TESTER vtkdiff
# REQUIREMENTS OGS_USE_MPI
# RUNTIME 186
# DIFF_DATA
# th_decovalex.vtu th_decovalex_pcs_1_ts_40_t_18_000000_0.vtu T_ref T 1e-10 1.e-10
# th_decovalex.vtu th_decovalex_pcs_1_ts_40_t_18_000000_0.vtu p_ref p 1e-10 1.e-10
# VIS th_decovalex_pcs_1_ts_78_t_1000_000000_0.vtu
# )

AddTest(
NAME HT_FaultedCube_rev0
@@ -11,9 +11,6 @@
<temperature>T</temperature>
<pressure>p</pressure>
</process_variables>
<density_solid>rho_solid</density_solid>
<specific_heat_capacity_solid>c_solid</specific_heat_capacity_solid>
<thermal_conductivity_solid>lambda_solid</thermal_conductivity_solid>
<specific_body_force>0 -9.81</specific_body_force>
<secondary_variables>
<secondary_variable type="static" internal_name="darcy_velocity" output_name="darcy_velocity"/>
@@ -71,6 +68,21 @@
<type>Constant</type>
<value>0.0</value>
</property>
<property>
<name>density</name>
<type>Constant</type>
<value>0.0</value>
</property>
<property>
<name>thermal_conductivity</name>
<type>Constant</type>
<value>3.0</value>
</property>
<property>
<name>specific_heat_capacity</name>
<type>Constant</type>
<value>0</value>
</property>
</properties>
</phase>
</phases>
@@ -226,21 +238,11 @@
</output>
</time_loop>
<parameters>
<parameter>
<name>rho_solid</name>
<type>Constant</type>
<value>0.0</value>
</parameter>
<parameter>
<name>rho_fluid</name>
<type>Constant</type>
<value>1000</value>
</parameter>
<parameter>
<name>lambda_solid</name>
<type>Constant</type>
<value>3.0</value>
</parameter>
<parameter>
<name>alpha_l</name>
<type>Constant</type>
@@ -251,11 +253,6 @@
<type>Constant</type>
<value>0.0</value>
</parameter>
<parameter>
<name>c_solid</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>T0</name>
<type>MeshNode</type>

0 comments on commit 13858dd

Please sign in to comment.
You can’t perform that action at this time.