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

Slightly more concise implementation for simple vdW, should avoid a few copies

(but maybe the compiler elides all the copies anyhow)
parent 0c43a16b
No related branches found
No related tags found
No related merge requests found
......@@ -23,10 +23,7 @@ public:
template<typename TType, typename RhoType, typename VecType>
auto alphar(const TType &T, const RhoType& rhotot, const VecType &molefrac) const {
auto Psiminus = -log(1.0 - b * rhotot);
auto Psiplus = rhotot;
auto val = Psiminus - a / (R(molefrac) * T) * Psiplus;
return forceeval(val);
return forceeval(-log(1.0 - b * rhotot) - (a / (R(molefrac) * T)) * rhotot);
}
double p(double T, double v) {
......
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