Skip to content
Snippets Groups Projects
Unverified Commit 11eaad52 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #2415 from TomFischer/MPLLinearProperty

[MPL] Change implementation of LinearProperty
parents 7205dbd7 59ddbcd4
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,8 @@
- Add MFront/TFEL solid constitutive relation support via.
MFrontGenericInterfaceSupport library. CMake option `OGS_USE_MFRONT`. [#2259](https://github.com/ufz/ogs/pull/2259)
- Infrastructure for multi-phase, multi-component material properties library.
[#2303](https://github.com/ufz/ogs/pull/2303)
[#2303](https://github.com/ufz/ogs/pull/2303),
[#2415](https://github.com/ufz/ogs/pull/2415)
- Anisotropic tensors may now be given in given local coordinate system. [#2370](https://github.com/ufz/ogs/pull/2370)
- Non-constant density model implementation in HC process. [#2200](https://github.com/ufz/ogs/pull/2200)
- Add second derivatives of permeability functions in Richards flow. [#2188](https://github.com/ufz/ogs/pull/2188)
......
Definition of a linear property:
\f$y(x) = y_{\textrm{ref}} + m (x - x_{\textrm{ref}})\f$
\f$y(x) = y_{\textrm{ref}} (1 + m (x - x_{\textrm{ref}})\f$
where
- \f$y_{\textrm{ref}}\f$ is a reference value, for instance reference density
- \f$m\f$ is the slope of the linear relationship
- \f$m\f$ is a value influencing the slope of the linear relationship
- \f$x_{\textrm{ref}}\f$ is a reference condition, for instance reference
temperatue
temperature
The slope \f$m\f$ of the linear relation.
\f$m\f$ is a value influencing the slope of the linear relation. The slope is
\f$y_{\mathrm{ref}} m.\f$
......@@ -23,18 +23,20 @@ LinearProperty::LinearProperty(PropertyDataType const& property_reference_value,
PropertyDataType LinearProperty::value(
VariableArray const& variable_array) const
{
return boost::get<double>(_value) +
boost::get<double>(_independent_variable.slope) *
(boost::get<double>(variable_array[static_cast<int>(
_independent_variable.type)]) -
boost::get<double>(_independent_variable.reference_condition));
return boost::get<double>(_value) *
(1 + boost::get<double>(_independent_variable.slope) *
(boost::get<double>(variable_array[static_cast<int>(
_independent_variable.type)]) -
boost::get<double>(
_independent_variable.reference_condition)));
}
PropertyDataType LinearProperty::dValue(VariableArray const& /*variable_array*/,
Variable const primary_variable) const
{
return _independent_variable.type == primary_variable
? _independent_variable.slope
? boost::get<double>(_value) *
boost::get<double>(_independent_variable.slope)
: decltype(_value){};
}
......
......@@ -24,18 +24,20 @@ TEST(MaterialPropertyLib, LinearProperty)
MaterialPropertyLib::VariableArray variable_array;
variable_array[static_cast<int>(
MaterialPropertyLib::Variable::temperature)] = 303.15;
ASSERT_NEAR(boost::get<double>(linear_property.value(variable_array)),
y_ref + m * (boost::get<double>(variable_array[static_cast<int>(
MaterialPropertyLib::Variable::temperature)]) -
x_ref),
1.e-10);
ASSERT_NEAR(
boost::get<double>(linear_property.value(variable_array)),
y_ref * (1 + m * (boost::get<double>(variable_array[static_cast<int>(
MaterialPropertyLib::Variable::temperature)]) -
x_ref)),
1.e-10);
ASSERT_EQ(
boost::get<double>(linear_property.dValue(
variable_array, MaterialPropertyLib::Variable::phase_pressure)),
0.0);
ASSERT_EQ(boost::get<double>(linear_property.dValue(
variable_array, MaterialPropertyLib::Variable::temperature)),
m);
ASSERT_NEAR(
boost::get<double>(linear_property.dValue(
variable_array, MaterialPropertyLib::Variable::temperature)),
y_ref * m, 1.e-16);
ASSERT_EQ(boost::get<double>(linear_property.d2Value(
variable_array,
MaterialPropertyLib::Variable::temperature,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment