diff --git a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp index 374242ad6f8d3c38a3b50399264960df69877286..89200fc08600343c48e4564517525a827b1885ec 100644 --- a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp +++ b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp @@ -134,6 +134,8 @@ std::unique_ptr<Process> createHydroMechanicsProcess( auto media_map = MaterialPropertyLib::createMaterialSpatialDistributionMap(media, mesh); + std::array const requiredMediumProperties = { + MaterialPropertyLib::reference_temperature}; std::array const requiredGasProperties = { MaterialPropertyLib::viscosity, MaterialPropertyLib::density}; std::array const requiredSolidProperties = { @@ -142,6 +144,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( for (auto const& m : media) { + checkRequiredProperties(*m.second, requiredMediumProperties); checkRequiredProperties(m.second->phase("Gas"), requiredGasProperties); checkRequiredProperties(m.second->phase("Solid"), requiredSolidProperties); @@ -155,18 +158,10 @@ std::unique_ptr<Process> createHydroMechanicsProcess( MathLib::KelvinVector::KelvinVectorDimensions<DisplacementDim>::value, &mesh); - // Reference temperature - double const reference_temperature = - //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS__reference_temperature} - config.getConfigParameter<double>( - "reference_temperature", std::numeric_limits<double>::quiet_NaN()); - DBUG("Use 'reference_temperature' as reference temperature."); - HydroMechanicsProcessData<DisplacementDim> process_data{ materialIDs(mesh), std::move(media_map), std::move(solid_constitutive_relations), - initial_stress, specific_body_force, - reference_temperature}; + initial_stress, specific_body_force}; SecondaryVariableCollection secondary_variables; diff --git a/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h b/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h index 0d345bd8310bb2420b60586a620b877c326fc8db..b3434a3625096c54b17c0e7834901ed083110db1 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h +++ b/ProcessLib/HydroMechanics/HydroMechanicsFEM-impl.h @@ -182,12 +182,15 @@ void HydroMechanicsLocalAssembler<ShapeFunctionDisplacement, unsigned const n_integration_points = _integration_method.getNumberOfPoints(); - auto const T_ref = _process_data.reference_temperature; auto const& b = _process_data.specific_body_force; auto const& medium = _process_data.media_map->getMedium(_element.getID()); auto const& solid = medium->phase("Solid"); auto const& gas = medium->phase("Gas"); MPL::VariableArray vars; + + auto const T_ref = + medium->property(MPL::PropertyType::reference_temperature) + .template value<double>(vars, x_position, t); vars[static_cast<int>(MPL::Variable::temperature)] = T_ref; for (unsigned ip = 0; ip < n_integration_points; ip++) @@ -351,8 +354,10 @@ HydroMechanicsLocalAssembler<ShapeFunctionDisplacement, ShapeFunctionPressure, auto const& solid = medium->phase("Solid"); auto const& gas = medium->phase("Gas"); MPL::VariableArray vars; + vars[static_cast<int>(MPL::Variable::temperature)] = - _process_data.reference_temperature; + medium->property(MPL::PropertyType::reference_temperature) + .template value<double>(vars, x_position, t); for (unsigned ip = 0; ip < n_integration_points; ip++) { @@ -432,8 +437,10 @@ void HydroMechanicsLocalAssembler<ShapeFunctionDisplacement, auto const& solid = medium->phase("Solid"); auto const& gas = medium->phase("Gas"); MPL::VariableArray vars; + vars[static_cast<int>(MPL::Variable::temperature)] = - _process_data.reference_temperature; + medium->property(MPL::PropertyType::reference_temperature) + .template value<double>(vars, x_position, t); int const n_integration_points = _integration_method.getNumberOfPoints(); for (int ip = 0; ip < n_integration_points; ip++) @@ -528,11 +535,14 @@ void HydroMechanicsLocalAssembler<ShapeFunctionDisplacement, ParameterLib::SpatialPosition x_position; x_position.setElementID(_element.getID()); - auto const T_ref = _process_data.reference_temperature; auto const& medium = _process_data.media_map->getMedium(_element.getID()); auto const& solid = medium->phase("Solid"); auto const& gas = medium->phase("Gas"); MPL::VariableArray vars; + + auto const T_ref = + medium->property(MPL::PropertyType::reference_temperature) + .template value<double>(vars, x_position, t); vars[static_cast<int>(MPL::Variable::temperature)] = T_ref; int const n_integration_points = _integration_method.getNumberOfPoints(); @@ -643,6 +653,12 @@ void HydroMechanicsLocalAssembler<ShapeFunctionDisplacement, ParameterLib::SpatialPosition x_position; x_position.setElementID(_element.getID()); + auto const& medium = _process_data.media_map->getMedium(_element.getID()); + + auto const T_ref = + medium->property(MPL::PropertyType::reference_temperature) + .template value<double>(MPL::VariableArray(), x_position, t); + int const n_integration_points = _integration_method.getNumberOfPoints(); for (int ip = 0; ip < n_integration_points; ip++) { @@ -663,8 +679,7 @@ void HydroMechanicsLocalAssembler<ShapeFunctionDisplacement, auto& eps = _ip_data[ip].eps; eps.noalias() = B * u; - _ip_data[ip].updateConstitutiveRelation( - t, x_position, dt, u, _process_data.reference_temperature); + _ip_data[ip].updateConstitutiveRelation(t, x_position, dt, u, T_ref); } } diff --git a/ProcessLib/HydroMechanics/HydroMechanicsProcessData.h b/ProcessLib/HydroMechanics/HydroMechanicsProcessData.h index e49489986e2926429543eb02127d5fc877855a2f..362f502ebd10abda8e3ac86d0d84b818449658cc 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsProcessData.h +++ b/ProcessLib/HydroMechanics/HydroMechanicsProcessData.h @@ -55,10 +55,6 @@ struct HydroMechanicsProcessData /// A vector of displacement dimension's length. Eigen::Matrix<double, DisplacementDim, 1> const specific_body_force; - /// Reference Temperature. A scalar quantity. - double const reference_temperature = - std::numeric_limits<double>::quiet_NaN(); - MeshLib::PropertyVector<double>* pressure_interpolated = nullptr; std::array<MeshLib::PropertyVector<double>*, 3> principal_stress_vector = { nullptr, nullptr, nullptr};