38 double const dt)
const
40 auto phase = std::get<Phase*>(
scale_);
41 auto const numberOfComponents = phase->numberOfComponents();
42 if (numberOfComponents < 1)
46 .template value<double>(variable_array, pos, t, dt);
48 else if (numberOfComponents > 2)
51 "AverageMolarMass::value only allows for phases consisting of up "
52 "to two components.");
68 .template value<Eigen::Vector2d>(variable_array, pos, t, dt);
71 for (
size_t c = 0;
c < numberOfComponents;
c++)
76 .template value<double>(variable_array, pos, t, dt);
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.");
116 .template dValue<Eigen::Vector2d>(
117 variable_array, variable, pos, t, dt)[0];
119 auto const M_0 = phase->component(0)
121 .template value<double>(variable_array, pos, t, dt);
122 auto const M_1 = phase->component(1)
124 .template value<double>(variable_array, pos, t, dt);
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