Fixes two issues that were occurring in the Mathcad wrapper interface:
Previous patch exposed a bug in the wrapper when calling CRITPdll for mixtures. Two changes made to correct this issue:
Calls to CRITPdll checked for (ierr != 0), which failed when REFPROP returned warnings. Changed this to check for (ierr > 0) when throwing an error to ignore REFPROP warnings (negative ierr return values). Changed this behavior for ALL instances of (ierr != 0) in the wrapper code as a best practice.
Modified passing of mole fraction array variable, x, to be consistent with other pass-by-reference instances using &x[0] for consistency.
Mathcad wrapper now checks for .MIX files in the default MIXTURES directory. If not found, tries to locate the .MIX file in the user's Virtual Store where the REFPROP GUI stores it when it can't write to the C: drive.
Additional Items:
When loading new fluids, if number of components is greater than 1 (mixture), SATSPLN is called by default, consistent with the behavior of the REFPROP GUI.
Converted tab characters to spaces (untabify) in many files changed for this patch for clearer viewing on Github
Created additional project configurations in the VS script to simplify building for Mathcad Prime versions 5, 6, 7, and 8.
Updated wrapper version to patch version 2.0.2.
Benefits
Mixture property calls now behave as expected.
SATSPLN now called by default when new mixtures are loaded for better saturation curve behavior
Custom mixtures created by the REFPROP GUI are now found in the user's Virtual Store if REFPROP can't save the custom mixture to the user's C: drive.
Possible Drawbacks
SATSPLNdll is now called by default on the legacy function calls whenever a new mixture fluid is loaded (ncomp > 1). This is the default behavior for the REFPROP GUI. However, there may be fluid mixtures that do not benefit from the spline calls or there may be situations where the splines are not desired. Potentially, a Mathcad wrapper function could be created that would set a flag to disable this default behavior if needed.
Lots of files changed in this PR due to "untabify" operation on files being worked on. Will untabify the remaining files in a separate PR to keep future code mod PR's cleaner.
Verification Process
Tested new functionality and proper mixture calculations with SATSPLN called by default.
Ran extended regression testing that now includes mixture behavior.
Test proper retrieval of standard pre-defined mixtures as well as custom mixture files stored in user's Virtual Store.
Description of the Change
Fixes two issues that were occurring in the Mathcad wrapper interface:
x
, to be consistent with other pass-by-reference instances using&x[0]
for consistency.Additional Items:
Benefits
Possible Drawbacks
SATSPLNdll is now called by default on the legacy function calls whenever a new mixture fluid is loaded (ncomp > 1). This is the default behavior for the REFPROP GUI. However, there may be fluid mixtures that do not benefit from the spline calls or there may be situations where the splines are not desired. Potentially, a Mathcad wrapper function could be created that would set a flag to disable this default behavior if needed.
Lots of files changed in this PR due to "untabify" operation on files being worked on. Will untabify the remaining files in a separate PR to keep future code mod PR's cleaner.
Verification Process
Applicable Issues (none)
Closes #464 Closes #465