Skip to content
Snippets Groups Projects
Commit c12fc858 authored by Ian Bell's avatar Ian Bell
Browse files

Add check on length of mole fractions in vdW model

parent 7f8bbc19
No related branches found
No related tags found
No related merge requests found
...@@ -115,6 +115,9 @@ public: ...@@ -115,6 +115,9 @@ public:
const RhoType& rho, const RhoType& rho,
const MoleFracType &molefrac) const const MoleFracType &molefrac) const
{ {
if (molefrac.size() != ai.size()) {
throw teqp::InvalidArgument("mole fractions must be of size " + std::to_string(ai.size()) + " but are of size " + std::to_string(molefrac.size()));
}
auto Psiminus = -log(1.0 - b(molefrac) * rho); auto Psiminus = -log(1.0 - b(molefrac) * rho);
auto Psiplus = rho; auto Psiplus = rho;
auto val = Psiminus - a(T, molefrac) / (Ru * T) * Psiplus; auto val = Psiminus - a(T, molefrac) / (Ru * T) * Psiplus;
......
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