Commit 01d37348 authored by Dmitry Yu. Naumov's avatar Dmitry Yu. Naumov Committed by Dmitry Yu. Naumov
Browse files

[MPL] Update porosity from mass balance.

Use the new variables array values from previous time step.
parent 10778cee
......@@ -34,10 +34,21 @@ void PorosityFromMassBalance::checkScale() const
}
}
PropertyDataType PorosityFromMassBalance::value(
VariableArray const& /*variable_array*/,
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
OGS_FATAL(
"PorosityFromMassBalance value call requires previous time step "
"values.");
}
PropertyDataType PorosityFromMassBalance::value(
VariableArray const& variable_array,
ParameterLib::SpatialPosition const& pos,
double const t, double const dt) const
VariableArray const& variable_array_prev,
ParameterLib::SpatialPosition const& pos, double const t,
double const dt) const
{
double const beta_SR = std::get<double>(
variable_array[static_cast<int>(Variable::grain_compressibility)]);
......@@ -52,11 +63,11 @@ PropertyDataType PorosityFromMassBalance::value(
double const p_eff_dot = std::get<double>(variable_array[static_cast<int>(
Variable::effective_pore_pressure_rate)]);
double const phi = std::get<double>(
variable_array[static_cast<int>(Variable::porosity)]);
double const phi_prev = std::get<double>(
variable_array_prev[static_cast<int>(Variable::porosity)]);
double const w = dt * (e_dot + p_eff_dot * beta_SR);
return std::clamp((phi + alpha_b * w) / (1 + w), phi_min_, phi_max_);
return std::clamp((phi_prev + alpha_b * w) / (1 + w), phi_min_, phi_max_);
}
PropertyDataType PorosityFromMassBalance::dValue(
......
......@@ -51,6 +51,10 @@ public:
PropertyDataType value(VariableArray const& variable_array,
ParameterLib::SpatialPosition const& pos,
double const t, double const dt) const override;
PropertyDataType value(VariableArray const& variable_array,
VariableArray const& variable_array_prev,
ParameterLib::SpatialPosition const& pos,
double const t, double const dt) const override;
PropertyDataType dValue(VariableArray const& variable_array,
Variable const variable,
ParameterLib::SpatialPosition const& pos,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment