Update the ECS solver, all transport tests pass

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-12-10 23:00:28 -05:00
parent 4a76cb1d4b
commit bf3cd4a614
2 changed files with 15 additions and 12 deletions

View File

@@ -942,7 +942,7 @@ void TransportRoutines::conformal_state_solver(HelmholtzEOSMixtureBackend &HEOS,
Eigen::Vector2d r;
Eigen::Matrix2d J;
// Update the reference fluid with the conformal state
HEOS_Reference.update(DmolarT_INPUTS, rhomolar0, T0);
HEOS_Reference.update_DmolarT_direct(rhomolar0, T0);
do{
long double dtau_dT = -HEOS_Reference.T_critical()/(T0*T0);
long double ddelta_drho = 1/HEOS_Reference.rhomolar_critical();
@@ -969,7 +969,7 @@ void TransportRoutines::conformal_state_solver(HelmholtzEOSMixtureBackend &HEOS,
double T_new = T0_init + frac*v(0);
double rhomolar_new = rhomolar0_init + frac*v(1);
// Update state with step
HEOS_Reference.update(DmolarT_INPUTS, rhomolar_new, T_new);
HEOS_Reference.update_DmolarT_direct(rhomolar_new, T_new);
resid = sqrt(POW2(HEOS_Reference.alphar() - alphar) + POW2(HEOS_Reference.keyed_output(iZ) - Z));
if (resid > resid_old){
continue;
@@ -1033,10 +1033,13 @@ long double TransportRoutines::viscosity_ECS(HelmholtzEOSMixtureBackend &HEOS, H
// Solver for conformal state
// **************************
//
HEOS_Reference.specify_phase(iphase_gas); // something homogeneous
conformal_state_solver(HEOS, HEOS_Reference, T0, rhomolar0);
// Update the reference fluid with the updated conformal state
HEOS_Reference.update(DmolarT_INPUTS, rhomolar0*psi, T0);
HEOS_Reference.update_DmolarT_direct(rhomolar0*psi, T0);
// Recalculate ESRR
f = HEOS.T()/T0;