38 double const dt)
const
40 auto phase = std::get<Phase*>(
scale_);
41 auto const numberOfComponents = phase->numberOfComponents();
42 if (numberOfComponents < 1)
48 else if (numberOfComponents > 2)
51 "AverageMolarMass::value only allows for phases consisting of up "
52 "to two components.");
71 for (
size_t c = 0;
c < numberOfComponents;
c++)
79 M += xn_zeta * M_zeta;
88 double const dt)
const
94 "AverageMolarMass::dValue is implemented for derivatives with "
95 "respect to phase_pressure or temperature only.");
98 auto phase = std::get<Phase*>(
scale_);
100 auto const numberOfComponents = phase->numberOfComponents();
101 if (numberOfComponents <= 1)
105 else if (numberOfComponents > 2)
108 "AverageMolarMass::dValue is currently implemented two or less "
109 "phase components only.");
117 variable_array, variable, pos, t, dt)[0];
119 auto const M_0 = phase->component(0)
122 auto const M_1 = phase->component(1)
126 return dxnC * (M_0 - M_1);
PropertyDataType d2Value(VariableArray const &variable_array, Variable const variable1, Variable const variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
Default implementation: 2nd derivative of any constant property is zero.
std::variant< double, Eigen::Matrix< double, 2, 1 >, Eigen::Matrix< double, 3, 1 >, Eigen::Matrix< double, 2, 2 >, Eigen::Matrix< double, 3, 3 >, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 >, Eigen::MatrixXd > PropertyDataType