diff --git a/ProcessLib/ThermoRichardsMechanics/CreateThermoRichardsMechanicsProcess.cpp b/ProcessLib/ThermoRichardsMechanics/CreateThermoRichardsMechanicsProcess.cpp index 8bff9076ec946ce37040f1101cd0c3f30985b9ee..33d25675af644f72a8c49b85fc48fdc4cf0dd1d4 100644 --- a/ProcessLib/ThermoRichardsMechanics/CreateThermoRichardsMechanicsProcess.cpp +++ b/ProcessLib/ThermoRichardsMechanics/CreateThermoRichardsMechanicsProcess.cpp @@ -40,8 +40,7 @@ void checkMPLProperties( std::array const required_medium_properties = { MaterialPropertyLib::porosity, MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, - MaterialPropertyLib::relative_permeability, - MaterialPropertyLib::saturation}; + MaterialPropertyLib::relative_permeability}; std::array const required_liquid_properties = { MaterialPropertyLib::viscosity, MaterialPropertyLib::density}; std::array const required_solid_properties = {MaterialPropertyLib::density}; diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h index 421998d8795b94167409a673f0dc9a3a6ed2c2bd..0e6788e5019858560da45e8e9af407dd5cc6edcc 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM-impl.h @@ -127,17 +127,24 @@ void ThermoRichardsMechanicsLocalAssembler< NumLib::shapeFunctionInterpolate(-p_L, N, p_cap_ip); MPL::VariableArray variables; - variables.capillary_pressure = p_cap_ip; - variables.liquid_phase_pressure = -p_cap_ip; - // setting pG to 1 atm - // TODO : rewrite equations s.t. p_L = pG-p_cap - variables.gas_phase_pressure = 1.0e5; - variables.temperature = T_ip; - - double const S_L = - medium.property(MPL::PropertyType::saturation) - .template value<double>(variables, x_position, t, dt); - std::get<PrevState<SaturationData>>(this->prev_states_[ip])->S_L = S_L; + + if (medium.hasProperty(MPL::PropertyType::saturation)) + { + variables.capillary_pressure = p_cap_ip; + variables.liquid_phase_pressure = -p_cap_ip; + // setting pG to 1 atm + // TODO : rewrite equations s.t. p_L = pG-p_cap + variables.gas_phase_pressure = 1.0e5; + variables.temperature = T_ip; + + double const S_L = + medium.property(MPL::PropertyType::saturation) + .template value<double>(variables, x_position, t, dt); + std::get<PrevState<SaturationData>>(this->prev_states_[ip])->S_L = + S_L; + + variables.liquid_saturation = S_L; + } constitutive_setting.init(models, t, dt, x_position, media_data, {T_ip, 0, {}}, this->current_states_[ip], @@ -145,7 +152,12 @@ void ThermoRichardsMechanicsLocalAssembler< if (this->process_data_.initial_stress.value) { - variables.liquid_saturation = S_L; + if (!medium.hasProperty(MPL::PropertyType::saturation)) + { + OGS_FATAL( + "The medium has no saturation property required to compute " + "initial stress."); + } convertInitialStressType(ip, t, x_position, medium, variables, -p_cap_ip); }