18 #if defined(__powerpc__)
20 #define RAPIDJSON_NO_INT64DEFINE
78 std::vector< std::vector<double> >
hmat,
rhomat,
cpmat,
cp0mat,
smat,
cvmat,
umat,
viscmat,
kmat,
pmat,
dpdTmat;
252 virtual double phir(
double tau,
double delta);
255 virtual double dphir_dTau(
double tau,
double delta);
266 virtual double phi0(
double tau,
double delta);
268 virtual double dphi0_dTau(
double tau,
double delta);
297 virtual double density_Tp(
double T,
double p);
298 virtual double density_Tp(
double T,
double p,
double rho_guess);
307 virtual void density_Ts(
double T,
double s,
double &rhoout,
double &pout,
double &rhoLout,
double &rhoVout,
double &psatLout,
double &psatVout);
316 virtual void temperature_hs(
double h,
double s,
double &Tout,
double &rhoout,
double &rhoL,
double &rhoV,
double &TsatLout,
double &TsatVout);
325 virtual void temperature_ps(
double p,
double s,
double &Tout,
double &rhoout,
double &rhoL,
double &rhoV,
double &TsatLout,
double &TsatVout);
336 virtual void temperature_ph(
double p,
double h,
double &Tout,
double &rhoout,
double &rhoL,
double &rhoV,
double &TsatLout,
double &TsatVout,
double T0 = -1,
double rho0 = -1);
344 std::string
phase_Tp(
double T,
double p,
double &pL,
double &pV,
double &rhoL,
double &rhoV);
347 long phase_Tp_indices(
double T,
double p,
double &pL,
double &pV,
double &rhoL,
double &rhoV);
350 std::string
phase_Trho(
double T,
double rho,
double &pL,
double &pV,
double &rhoL,
double &rhoV);
353 long phase_Trho_indices(
double T,
double rho,
double &pL,
double &pV,
double &rhoL,
double &rhoV);
355 long phase_prho_indices(
double p,
double rho,
double &T,
double &TL,
double &TV,
double &rhoL,
double &rhoV);
399 double Tsat_anc(
double p,
double Q);
403 std::vector<double>
ConformalTemperature(
Fluid *InterestFluid,
Fluid *ReferenceFluid,
double T,
double rho,
double T0,
double rho0, std::string *errstring);
406 virtual void ECSParams(
double *e_k,
double *sigma);
444 throw NotImplementedError(std::string(
"conductivity_background not implemented for this fluid"));
453 double conductivity_critical(
double T,
double rho,
double qd = 2e9,
double GAMMA = 0.0496,
double zeta0 = 1.94e-10);
469 throw NotImplementedError(std::string(
"viscosity_residual not implemented for this fluid"));
478 throw NotImplementedError(std::string(
"viscosity_background not implemented for this fluid"));
483 void saturation_VdW(
double T,
double &rhoL,
double &rhoV,
double &p,
double s0=-1);
492 virtual void saturation_T(
double T,
bool UseLUT,
double &psatLout,
double &psatVout,
double &rhoLout,
double &rhoVout);
501 virtual void saturation_p(
double p,
bool UseLUT,
double &TsatLout,
double &TsatVout,
double &rhoLout,
double &rhoVout);
514 virtual void saturation_h(
double h,
double Tmin,
double Tmax,
int Q,
double &Tsatout,
double &rhoout,
double &TsatLout,
double &TsatVout,
double &rhoLout,
double &rhoVout);
525 virtual void saturation_s(
double s,
int Q,
double &Tsatout,
double &rhoout,
double &TsatLout,
double &TsatVout,
double &rhoLout,
double &rhoVout);
534 void rhosatPure(
double T,
double &rhoLout,
double &rhoVout,
double &pout,
double omega,
bool use_guesses);
544 void rhosatPure_Akasaka(
double T,
double &rhoLout,
double &rhoVout,
double &pout,
double omega,
bool use_guesses =
false);
551 void rhosatPure_Brent(
double T,
double &rhoLout,
double &rhoVout,
double &pout);
566 double Tsat(
double p,
double Q,
double T_guess);
577 double Tsat(
double p,
double Q,
double T_guess,
bool UseLUT,
double &rhoLout,
double &rhoVout);
struct HSContainer HS
The point that is used to reduce the T and rho for EOS.
void rhosatPure(double T, double &rhoLout, double &rhoVout, double &pout, double omega, bool use_guesses)
std::vector< double > a_hs_satL
char * get_namec()
Returns a char* with the name of the fluid.
double drhoVdT_sat
Derivative of density w.r.t. temperature along the saturated vapor curve.
virtual double d3phir_dDelta_dTau2(double tau, double delta)
std::vector< phi_BC * > phirlist
double R()
Returns the mass-specific gas constant for the fluid in the desired units.
virtual double d2phi0_dTau2(double tau, double delta)
FluidCacheElement dphir_dDelta
double interpolateV(double T)
AncillaryCurveClass * h_ancillary
True if it is a pure fluid, false otherwise.
std::vector< std::vector< double > > hmat
virtual double d2phir_dDelta_dTau(double tau, double delta)
virtual void temperature_ph(double p, double h, double &Tout, double &rhoout, double &rhoL, double &rhoV, double &TsatLout, double &TsatVout, double T0=-1, double rho0=-1)
double reverseinterpolateL(double y)
bool build_TTSE_LUT(bool force=false)
Build of the TTSE LUT.
virtual void temperature_ps(double p, double s, double &Tout, double &rhoout, double &rhoL, double &rhoV, double &TsatLout, double &TsatVout)
struct FluidLimits limits
virtual double d3phir_dDelta3(double tau, double delta)
virtual double density_Tp(double T, double p)
double reverseinterpolateV(double y)
double rhoendV
Saturated vapor density at the last temperature for which the conventional methods can be used...
virtual void temperature_hs(double h, double s, double &Tout, double &rhoout, double &rhoL, double &rhoV, double &TsatLout, double &TsatVout)
void enable_TTSE_LUT_writing(void)
Enable the writing of TTSE tables to file.
virtual void saturation_s(double s, int Q, double &Tsatout, double &rhoout, double &TsatLout, double &TsatVout, double &rhoLout, double &rhoVout)
double Tsat_anc(double p, double Q)
bool isenabled_TTSE_LUT_writing(void)
Check if the writing of TTSE tables to file is enabled.
virtual double d3phi0_dTau3(double tau, double delta)
double psatV_anc(double T)
virtual void saturation_h(double h, double Tmin, double Tmax, int Q, double &Tsatout, double &rhoout, double &TsatLout, double &TsatVout, double &rhoLout, double &rhoVout)
virtual double viscosity_residual(double T, double rho)
std::vector< std::vector< double > > viscmat
double interpolateL(double T)
std::vector< std::string > get_aliases()
double specific_heat_p_ideal_Trho(double T)
virtual double viscosity_background(double T, double rho)
virtual double d3phir_dTau3(double tau, double delta)
std::string ECSReferenceFluid
A list of aliases of names for the Fluid, each element is a std::string instance. ...
std::vector< std::vector< double > > pmat
FluidCacheElement d2phir_dDelta2
std::string name
A container to hold the cache for residual Helmholtz derivatives.
AncillaryCurveClass * s_ancillary
virtual double phi0(double tau, double delta)
FluidCacheElement d2phir_dTau2
std::string TransportReference
A std::string that contains a reference for thermo properties for the fluid.
void set_TTSESinglePhase_LUT_range(double hmin, double hmax, double pmin, double pmax)
Over-ride the default range of the single-phase LUT.
virtual double ECS_psi_viscosity(double rhor)
std::string to_json()
Export this fluid as a JSON file;.
double viscosity_ECS_Trho(double T, double rho, Fluid *ReferenceFluid)
double gibbs_Trho(double T, double rho)
virtual double psat(double T)
double cpsatV_anc(double T)
double rhoendL
Saturated liquid density at the last temperature for which the conventional methods can be used...
double pressure_Trho(double T, double rho)
void disable_EXTTP(void)
Disable the TTSE.
virtual double d3phi0_dDelta3(double tau, double delta)
double drhodT_pL_anc(double T)
AncillaryCurveClass(Fluid *pFluid, std::string Output)
std::vector< double > pvec
long phase_prho_indices(double p, double rho, double &T, double &TL, double &TV, double &rhoL, double &rhoV)
double conductivity_critical(double T, double rho, double qd=2e9, double GAMMA=0.0496, double zeta0=1.94e-10)
double psatL_anc(double T)
std::vector< std::string > aliases
The REFPROP-compliant name if REFPROP-"name" is not a compatible fluid name. If not included...
virtual double dphi0_dTau(double tau, double delta)
double entropy_Trho(double T, double rho)
double _get_rho_guess(double T, double p)
double density_Tp_Soave(double T, double p, int iValue=0)
Get the density using the Soave EOS.
struct CriticalStruct reduce
A pointer to the point that is used to reduce the T and rho for EOS.
double internal_energy_Trho(double T, double rho)
long phase_Trho_indices(double T, double rho, double &pL, double &pV, double &rhoL, double &rhoV)
Return the phase using the phase flags from phase enum in CoolProp.h.
std::string get_REFPROPname()
void set_TTSESinglePhase_LUT_size(int Np, int Nh)
Over-ride the default size of the single-phase LUT.
void update(Fluid *pFluid, std::string Output)
std::string get_name()
Returns a std::string with the name of the fluid.
void rebuild_CriticalSplineConstants_T()
Rebuild the constants.
void rhosatPure_BrentrhoV(double T, double &rhoLout, double &rhoVout, double &pout)
virtual double surface_tension_T(double T)
virtual void ECSParams(double *e_k, double *sigma)
virtual double rhosatV(double T)
double speed_sound_Trho(double T, double rho)
double cpsatL_anc(double T)
std::string get_TransportReference()
virtual double viscosity_dilute(double T, double e_k, double sigma)
TTSETwoPhaseTableClass TTSESatV
Fluid is the abstract base class that is employed by all the other fluids.
FluidCacheElement dphir_dTau
virtual double dphir_dTau(double tau, double delta)
virtual double dphi0_dDelta(double tau, double delta)
EnvironmentalFactorsStruct environment
struct CriticalStruct * preduce
std::string EOSReference
The critical qd parameter for the Olchowy-Sengers cross-over term.
long phase_Tp_indices(double T, double p, double &pL, double &pV, double &rhoL, double &rhoV)
Return the phase using the phase flags from phase enum in CoolProp.h.
void enable_TTSE_LUT(void)
Fluid()
A vector of instances of the phi_BC classes for the ideal-gas Helmholtz energy contribution.
void set_TTSESat_LUT_size(int Nsat)
Over-ride the default size of both of the saturation LUT.
double hsatV_anc(double T)
CriticalSplineStruct_T(double Tend, double rhoendL, double rhoendV, double drhoLdT_sat, double drhoVdT_sat)
std::vector< std::vector< double > > cvmat
TTSESinglePhaseTableClass TTSESinglePhase
std::string REFPROPname
The name of the fluid.
std::string ECS_LENNARD_JONES
bool isenabled_EXTTP(void)
Check if TTSE is enabled.
FluidCacheElement d2phir_dDelta_dTau
std::string get_EOSReference()
std::vector< std::vector< double > > smat
bool isPure
A std::string that contains a reference for the transport properties of the fluid.
std::string SURFACE_TENSION
double hsatL_anc(double T)
std::vector< int > n_hs_satL
double interpolate_in_TTSE_LUT(long iParam, long iInput1, double Input1, long iInput2, double Input2)
Interpolate within the TTSE LUT.
double specific_heat_v_Trho(double T, double rho)
double drhodT_pV_anc(double T)
void rhosatPure_Brent(double T, double &rhoLout, double &rhoVout, double &pout)
A document for parsing JSON text as DOM.
CriticalSplineStruct_T CriticalSpline_T
double Tsat(double p, double Q, double T_guess)
virtual double psatV(double T)
void rhosatPure_Akasaka(double T, double &rhoLout, double &rhoVout, double &pout, double omega, bool use_guesses=false)
virtual double d3phi0_dDelta2_dTau(double tau, double delta)
void disable_TTSE_LUT_writing(void)
Disable the writing of TTSE tables to file.
double density_Tp_PengRobinson(double T, double p, int solution)
virtual double d2phir_dDelta2(double tau, double delta)
double drhodT_p_Trho(double T, double rho)
struct CriticalStruct crit
std::vector< double > ConformalTemperature(Fluid *InterestFluid, Fluid *ReferenceFluid, double T, double rho, double T0, double rho0, std::string *errstring)
std::vector< std::vector< double > > umat
BibTeXKeysStruct BibTeXKeys
double dpdrho_Trho(double T, double rho)
virtual double phir(double tau, double delta)
bool enabled_TTSE_LUT
Parameters for the Tabular Taylor Series Expansion (TTSE) Method.
double temperature_prho(double p, double rho, double T0)
virtual double ECS_f_int(double T)
virtual double conductivity_background(double T, double rho)
virtual double d2phi0_dDelta2(double tau, double delta)
std::string phase_Tp(double T, double p, double &pL, double &pV, double &rhoL, double &rhoV)
Return the phase given the temperature and pressure.
void get_TTSESinglePhase_LUT_range(double *hmin, double *hmax, double *pmin, double *pmax)
Get the current range of the single-phase LUT.
std::vector< phi_BC * > phi0list
A vector of instances of the phi_BC classes for the residual Helmholtz energy contribution.
double dpdT_Trho(double T, double rho)
double specific_heat_p_Trho(double T, double rho)
void post_load(rapidjson::Document &JSON, rapidjson::Document &JSON_CAS)
bool enable_writing_tables_to_files
bool isAlias(std::string name)
virtual double viscosity_Trho(double T, double rho)
virtual double ECS_chi_conductivity(double rhor)
virtual double d3phi0_dDelta_dTau2(double tau, double delta)
virtual double d2phi0_dDelta_dTau(double tau, double delta)
bool isenabled_TTSE_LUT(void)
Check if TTSE is enabled.
double conductivity_ECS_Trho(double T, double rho, Fluid *ReferenceFluid)
std::vector< std::vector< double > > cp0mat
void saturation_VdW(double T, double &rhoL, double &rhoV, double &p, double s0=-1)
bool pure()
Returns true if the fluid is pure, false if pseudo-pure or a mixture.
virtual double d2phir_dTau2(double tau, double delta)
virtual double psatL(double T)
double temperature_prho_PengRobinson(double p, double rho)
TTSETwoPhaseTableClass TTSESatL
double interpolate_rho(Fluid *pFluid, int phase, double T)
virtual double dphir_dDelta(double tau, double delta)
std::vector< std::vector< double > > kmat
virtual double rhosatL(double T)
virtual void saturation_p(double p, bool UseLUT, double &TsatLout, double &TsatVout, double &rhoLout, double &rhoVout)
void add_alias(std::string alias)
double ssatL_anc(double T)
std::vector< double > Tvec
virtual double d3phir_dDelta2_dTau(double tau, double delta)
double ECS_qd
A string that gives the name of the fluids that should be used for the ECS method for transport prope...
std::vector< std::vector< double > > rhomat
virtual double conductivity_Trho(double T, double rho)
double enthalpy_Trho(double T, double rho)
void disable_TTSE_LUT(void)
Disable the TTSE.
double temperature_prho_VanDerWaals(double p, double rho)
virtual void density_Ts(double T, double s, double &rhoout, double &pout, double &rhoLout, double &rhoVout, double &psatLout, double &psatVout)
virtual void saturation_T(double T, bool UseLUT, double &psatLout, double &psatVout, double &rhoLout, double &rhoVout)
std::string HSReferenceState
std::vector< std::vector< double > > cpmat
double drhoLdT_sat
Derivative of density w.r.t. temperature along the saturated liquid curve.
std::vector< std::vector< double > > dpdTmat
double Tend
The last temperature for which the conventional methods can be used.
double ssatV_anc(double T)
std::string phase_Trho(double T, double rho, double &pL, double &pV, double &rhoL, double &rhoV)
Return the phase given the temperature and the density.