diff --git a/MaterialLib/MPL/Components/GetThermalExpansivity.cpp b/MaterialLib/MPL/Utils/GetLiquidThermalExpansivity.cpp similarity index 63% rename from MaterialLib/MPL/Components/GetThermalExpansivity.cpp rename to MaterialLib/MPL/Utils/GetLiquidThermalExpansivity.cpp index a506ede693572788a9c6574a0517d47ea33b932c..1faa1ffc59e215176379c8ef4b81b4dd9eef4e9a 100644 --- a/MaterialLib/MPL/Components/GetThermalExpansivity.cpp +++ b/MaterialLib/MPL/Utils/GetLiquidThermalExpansivity.cpp @@ -10,7 +10,7 @@ * Created on August 16, 2019, 3:40 PM */ -#include "GetThermalExpansivity.h" +#include "GetLiquidThermalExpansivity.h" #include "MaterialLib/MPL/Phase.h" @@ -18,18 +18,18 @@ namespace MaterialPropertyLib { class Phase; -double getThermalExpansivity(Phase const& phase, VariableArray const& vars, - const double density, - ParameterLib::SpatialPosition const& pos, - double const t, double const dt) +double getLiquidThermalExpansivity(Phase const& phase, + VariableArray const& vars, + const double density, + ParameterLib::SpatialPosition const& pos, + double const t, double const dt) { - auto const thermal_expansivity_ptr = - &phase.property(MaterialPropertyLib::PropertyType::thermal_expansivity); - // The thermal expansivity is explicitly given in the project file. - if (thermal_expansivity_ptr) + if (phase.hasProperty( + MaterialPropertyLib::PropertyType::thermal_expansivity)) { - return (*thermal_expansivity_ptr) + return phase + .property(MaterialPropertyLib::PropertyType::thermal_expansivity) .template value<double>(vars, pos, t, dt); } diff --git a/MaterialLib/MPL/Components/GetThermalExpansivity.h b/MaterialLib/MPL/Utils/GetLiquidThermalExpansivity.h similarity index 78% rename from MaterialLib/MPL/Components/GetThermalExpansivity.h rename to MaterialLib/MPL/Utils/GetLiquidThermalExpansivity.h index 229521d032217a60861fde2e2f0f3f4ef3627cfe..a32857dd5bf1f991c036d803d2dbb9856097ec1c 100644 --- a/MaterialLib/MPL/Components/GetThermalExpansivity.h +++ b/MaterialLib/MPL/Utils/GetLiquidThermalExpansivity.h @@ -38,8 +38,9 @@ class Phase; * \f] * where \f$\rho\f$ is the density, \f$T\f$ is the temperature. */ -double getThermalExpansivity(Phase const& phase, VariableArray const& vars, - const double density, - ParameterLib::SpatialPosition const& pos, - double const t, double const dt); +double getLiquidThermalExpansivity(Phase const& phase, + VariableArray const& vars, + const double density, + ParameterLib::SpatialPosition const& pos, + double const t, double const dt); } // namespace MaterialPropertyLib diff --git a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h index ebd8d14c1538f3e7b6845710b2f820a4a6f084b1..3568452f1ed9fc2c5e838d5c94c6a06aef784617 100644 --- a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h +++ b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h @@ -14,7 +14,7 @@ #include "MaterialLib/SolidModels/SelectSolidConstitutiveRelation.h" -#include "MaterialLib/MPL/Components/GetThermalExpansivity.h" +#include "MaterialLib/MPL/Utils/GetLiquidThermalExpansivity.h" #include "MaterialLib/MPL/Medium.h" #include "MaterialLib/MPL/Property.h" #include "MaterialLib/MPL/Utils/FormEffectiveThermalConductivity.h" @@ -273,7 +273,7 @@ void ThermoHydroMechanicsLocalAssembler<ShapeFunctionDisplacement, .template value<double>(vars, x_position, t, dt); double const fluid_volumetric_thermal_expansion_coefficient = - MaterialPropertyLib::getThermalExpansivity( + MaterialPropertyLib::getLiquidThermalExpansivity( liquid_phase, vars, fluid_density, x_position, t, dt); // Use the viscosity model to compute the viscosity