diff --git a/include/teqp/models/cubics.hpp b/include/teqp/models/cubics.hpp index 88d9e75f7c5c042f9a9709a8bfd68223ad6506ae..887bb6b40a3bf4f8cd34cbe91f4447437cfd1479 100644 --- a/include/teqp/models/cubics.hpp +++ b/include/teqp/models/cubics.hpp @@ -96,6 +96,9 @@ public: const RhoType& rho, const MoleFracType& molefrac) const { + if (molefrac.size() != alphas.size()) { + throw std::invalid_argument("Sizes do not match"); + } auto b = get_b(T, molefrac); auto Psiminus = -log(1.0 - b * rho); auto Psiplus = log((Delta1 * b * rho + 1) / (Delta2 * b * rho + 1)) / (b * (Delta1 - Delta2));