mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Fix Coverity CID 38573
This commit is contained in:
@@ -1797,20 +1797,17 @@ CoolPropDbl HelmholtzEOSMixtureBackend::solver_rho_Tp(CoolPropDbl T, CoolPropDbl
|
||||
class solver_TP_resid : public FuncWrapper1D
|
||||
{
|
||||
public:
|
||||
CoolPropDbl T, p, r, peos, rhomolar, rhor, tau, R_u, delta, dalphar_dDelta;
|
||||
CoolPropDbl T, p, rhor, tau, R_u, delta;
|
||||
HelmholtzEOSMixtureBackend *HEOS;
|
||||
|
||||
solver_TP_resid(HelmholtzEOSMixtureBackend *HEOS, CoolPropDbl T, CoolPropDbl p){
|
||||
this->HEOS = HEOS; this->T = T; this->p = p; this->rhor = HEOS->get_reducing_state().rhomolar;
|
||||
this->tau = HEOS->get_reducing_state().T/T; this->R_u = HEOS->gas_constant();
|
||||
};
|
||||
solver_TP_resid(HelmholtzEOSMixtureBackend *HEOS, CoolPropDbl T, CoolPropDbl p)
|
||||
: HEOS(HEOS),T(T),p(p),delta(_HUGE),rhor(HEOS->get_reducing_state().rhomolar),
|
||||
tau(HEOS->get_reducing_state().T/T),R_u(HEOS->gas_constant()){}
|
||||
double call(double rhomolar){
|
||||
this->rhomolar = rhomolar;
|
||||
delta = rhomolar/rhor; // needed for derivative
|
||||
HEOS->update_DmolarT_direct(rhomolar, T);
|
||||
peos = HEOS->p();
|
||||
r = (peos-p)/p;
|
||||
return r;
|
||||
CoolPropDbl peos = HEOS->p();
|
||||
return (peos-p)/p;
|
||||
};
|
||||
double deriv(double rhomolar){
|
||||
// dp/drho|T / pspecified
|
||||
|
||||
Reference in New Issue
Block a user