The log only contains the validation step, no calculation step. So I cannot see too much from there.
Can you send me the implementations of
GetTemperatureFromPHFlash
and
SetFromFlowTPX
I am not sure which is the failing flash, as I do not have a log on that; are these also copies from the CO-LaN example? The CO-LaN example does not give this error though... The first one is
Code: Select all
//generate flash specifications
CVariant flashSpec1,flashSpec2;
CBSTR overall(L"overall");
//flash specification 1: overall enthalpy
flashSpec1.MakeArray(3,VT_BSTR);
flashSpec1.AllocStringAt(0,L"enthalpy");
flashSpec1.SetStringAt(1,NULL);
flashSpec1.SetStringAt(2,overall);
//flash specification 2: overall pressure
flashSpec2.MakeArray(3,VT_BSTR);
flashSpec2.AllocStringAt(0,L"pressure");
flashSpec2.SetStringAt(1,NULL);
flashSpec2.SetStringAt(2,overall);
//perform PH flash
hr=iEqRoutine->CalcEquilibrium(flashSpec1,flashSpec2,CBSTR(L"unspecified"));
for which the flash specifications look ok. The second one reads
Code: Select all
//generate flash specifications
CVariant flashSpec1,flashSpec2;
CBSTR overall(L"overall");
//flash specification 1: overall temperature
flashSpec1.MakeArray(3,VT_BSTR);
flashSpec1.AllocStringAt(0,L"temperature");
flashSpec1.SetStringAt(1,NULL);
flashSpec1.SetStringAt(2,overall);
//flash specification 2: overall pressure
flashSpec2.MakeArray(3,VT_BSTR);
flashSpec2.AllocStringAt(0,L"pressure");
flashSpec2.SetStringAt(1,NULL);
flashSpec2.SetStringAt(2,overall);
//perform TP flash
hr=iEqRoutine->CalcEquilibrium(flashSpec1,flashSpec2,CBSTR(L"unspecified"));
which also looks ok. Alternatively, send me your entire code (perhaps removing the pieces that are IP sensitive) and I can have a look.
Thanks.