mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-02-12 06:44:59 -05:00
Update the ECS solver, all transport tests pass
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user