usnistgov / REFPROP-wrappers

Wrappers around NIST REFPROP for languages such as Python, MATLAB, etc.
195 stars 127 forks source link

Add derived quantity functions to Mathcad wrapper #475

Closed henningjp closed 2 years ago

henningjp commented 2 years ago

Description of the Change

Add derived quantity functions to Mathcad wrapper for speed improvement

New functions (general and saturation (f/g) as function of either t, p, or both) follow naming convention of all other thermodynamic functions in the Mathcad wrapper:

  1. Prandtl Number (rp_prtp, rp_prft, rp_prgt, rp_prfp, rp_prgp)
  2. Cp/Cv ratio, gamma (rp_gammatp, rp_gammaft, rp_gammagt, rp_gammafp, rp_gammagp)
  3. Thermal Expansion Coefficient, Beta (rp_betatp, rp_betaft, rp_betagt, rp_betafp, rp_betagp)
  4. Compressibility, Z (rp_ztp, rp_zft, rp_zgt, rp_zfp, rp_zgp, & rp_zcrit)

Additional Items:

Benefits

  1. Calling these derived quantity functions from the compiled add-in DLL should be slightly faster than performing the underlying calculations natively within Mathcad, especially when called repeatedly.
  2. Transport functions now provide correct error handling of codes returned by REFPROP 10.

Possible Drawbacks

Because the Mathcad unit handling include file (REFPROP_units.mcdx) is a binary file, it has not been updated in this PR, but will be updated to include the above derived quantity functions once the planned REFPROP 10 high-level API functions are added to the Mathcad wrapper.

Verification Process

Applicable Issues (none)

henningjp commented 2 years ago

@ianhbell - This should be ready to go.

ianhbell commented 2 years ago

Wow this is a huge amount of work, thank you for your contribution.