mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-02-13 07:15:14 -05:00
Added cp0 and dpdT|rho for REFPROP backend for use in PDSim
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -770,6 +770,26 @@ void REFPROPMixtureBackend::calc_phase_envelope(const std::string &type)
|
||||
&ierr, herr, errormessagelength); // Error message
|
||||
if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); }
|
||||
}
|
||||
long double REFPROPMixtureBackend::calc_cpmolar_idealgas(void)
|
||||
{
|
||||
double rho_mol_L = 0.001*_rhomolar;
|
||||
double p0, e0, h0, s0, cv0, cp0, w0, A0, G0;
|
||||
THERM0dll(&_T,&rho_mol_L,&(mole_fractions[0]),&p0,&e0,&h0,&s0,&cv0,&cp0,&w0,&A0,&G0);
|
||||
return static_cast<long double>(cp0);
|
||||
}
|
||||
long double REFPROPMixtureBackend::calc_first_partial_deriv(parameters Of, parameters Wrt, parameters Constant)
|
||||
{
|
||||
if (Of == iP && Wrt == iT && (Constant == iDmolar || Constant == iDmass))
|
||||
{
|
||||
double rho_mol_L = 0.001*_rhomolar;
|
||||
double dpt;
|
||||
DPDTdll(&_T, &rho_mol_L, &(mole_fractions[0]), &dpt);
|
||||
return static_cast<long double>(dpt*1000);
|
||||
}
|
||||
else{
|
||||
throw ValueError(format("These derivative terms are not supported"));
|
||||
}
|
||||
}
|
||||
|
||||
void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double value1, double value2)
|
||||
{
|
||||
|
||||
@@ -55,6 +55,10 @@ public:
|
||||
|
||||
/// Returns true if REFPROP is supported on this platform
|
||||
bool REFPROP_supported(void);
|
||||
|
||||
long double calc_cpmolar_idealgas(void);
|
||||
|
||||
long double calc_first_partial_deriv(parameters Of, parameters Wrt, parameters Constant);
|
||||
|
||||
/// Set the fluids in REFPROP DLL by calling the SETUPdll function
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user