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

Pressure two ways works (alpha and Psi)

parent 185a85ee
No related branches found
Tags v0.0.13
No related merge requests found
...@@ -60,7 +60,15 @@ void test_vdwMix() { ...@@ -60,7 +60,15 @@ void test_vdwMix() {
auto Psir = vdW.Psir(T, rhovec); auto Psir = vdW.Psir(T, rhovec);
auto dPsirdrho0 = rhovec[0] * deriv2([&vdW, rhotot](const auto& T, const auto& rhovec) { return vdW.Psir(T, rhovec); }, T, rhovec); auto dPsirdrho0 = rhovec[0] * deriv2([&vdW, rhotot](const auto& T, const auto& rhovec) { return vdW.Psir(T, rhovec); }, T, rhovec);
auto dPsirdrho1 = rhovec[1] * deriv3([&vdW, rhotot](const auto& T, const auto& rhovec) { return vdW.Psir(T, rhovec); }, T, rhovec); auto dPsirdrho1 = rhovec[1] * deriv3([&vdW, rhotot](const auto& T, const auto& rhovec) { return vdW.Psir(T, rhovec); }, T, rhovec);
auto pfromderiv = rho * R * T - Psir + dPsirdrho0 + dPsirdrho1; auto pfromderiv = rho*R*T - Psir + dPsirdrho0 + dPsirdrho1;
{
auto term0 = rhovec[0] * deriv2([&vdW, rhotot](const auto& T, const auto& rhovec) { return vdW.alphar(T, rhovec); }, T, rhovec);
auto term1 = rhovec[1] * deriv3([&vdW, rhotot](const auto& T, const auto& rhovec) { return vdW.alphar(T, rhovec); }, T, rhovec);
auto pr = (term0 + term1)*rhotot*R*T;
auto pfromderiv2 = rho*R*T + pr;
auto err2 = pfromderiv / pfromderiv2 - 1;
int err = 0;
}
auto t3 = std::chrono::steady_clock::now(); auto t3 = std::chrono::steady_clock::now();
std::cout << std::chrono::duration<double>(t3 - t2).count() << " from isochoric (mix) " << std::endl; std::cout << std::chrono::duration<double>(t3 - t2).count() << " from isochoric (mix) " << std::endl;
......
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