Closed Jonshagen closed 3 years ago
Can you please post a runnable (copy-pastable) example? Also, are you aware of these headers: https://github.com/CoolProp/REFPROP-headers ?
Hmm, maybe my headers are outdated?
using namespace std; //OK as long as no other namespaces are used
Yes, please switch over to the REFPROP_headers ones and try again. No more function pointer management!
There's a bug in the heat of formation routine that may return incorrect values under some circumstances. If you would like a patch, please send me a personal email (eric.lemmon@nist.gov).
I am trying to set up a simple but flexible combustion process using heat of formation. The input substances will be defined by the user.
the HeatFrmDll returns "662 Not all heating values available" for very common substances. I get it for pure H2O and for a air like mixture of N2, O2 mixture (of course I expect 0 HFRM). Are those substances not available?
code: // get pointers into the dll to the actual functions. SETUPdll = (fp_SETUPdllTYPE)GetProcAddress(RefpropdllInstance, "SETUPdll"); SETREFdll = (fp_SETREFdllTYPE)GetProcAddress(RefpropdllInstance, "SETREFdll"); HEATFRMdll = (fp_HEATFRMdllTYPE)GetProcAddress(RefpropdllInstance, "HEATFRMdll");
// SETREFdll(hrf, &ixflag, x, &h0, &s0, &t0, &p0, &ierr, herr, lengthofreference, errormessagelength); I have tested with this on and off but I dont think it should be needed for the heat of formation SETUPdll(&i, hf, hfmix, hrf, &ierr, herr, refpropcharlength*ncmax, refpropcharlength, lengthofreference, errormessagelength);
// Reference temperature t = T + 273.15;
// Calculate enthalpy HEATFRMdll(&t, &d, x, &hFrm, &ierr, herr, errormessagelength);