Solved using "float" in the Set function: oms1.SetOverallCompoundMassFlow('Methane',float(outWFCH4))
Hi again, I have tried with creating a project from scratch without involving Cantera and the function i.e. oms1.SetOverallCompoundMassFlow('Methane',outCH4) works as expected. Is there a way to print outputs from a Python script for debugging? thanks a lot
Thanks, Daniel. I got another error saying "an integer is required". I can go around the issue by rounding the number but that would not be numerically correct. Something I should do to troubleshoot the code? Set the properties on the Outlet Material Stream connected to Port 1(oms1) oms1.Clear() Set operative conditions oms1.SetTemperature(T) oms1.SetPressure(P) oms1.SetMassFlow(WF) Read mass fractions from cantera mixture. See the original 'gri30.yaml' file to inspect compound indexes in the array...
Thanks, Daniel. I will correct the calculations above to make sure mass and molar balances are respected. About the compound index, I guess it is the one defined in DWSIM: how can I get to know compound indexes? is there any function I could call? Anyhow, the note on the function says "String". see attached screenshot Thanks a lot
Thanks, Daniel. I have corrected the typo "mass" with "molar" above for reference for future readers. About the compound index, I guess it is the one defined in DWSIM: how can I get to know compound indexes? is there any function I could call? Anyhow, the note on the function says "String". see attached screenshot Thanks a lot
Thanks, Daniel. I have corrected the typo "mass" with "molar" above for reference for future readers. About the compound index, I guess it is the one defined in DWSIM: how can I get to know compound indexes? is there any function I could call?
Thanks, Daniel. I got another error saying "an integer is required". I can go around the issue by rounding the number but that would not be numerically correct. Something I should do to troubleshoot the code? Read variables: MF = ims1.Phases[0].Properties.molarflow set macro variables: oms1.SetTemperature(T) oms1.SetPressure(P) oms1.SetMassFlow(WF) calculate molar fractions: outxCH4 = MFoutCH4 outxH2O = MFoutH2O outxCO = MFoutCO outxCO2 = MFoutCO2 outxH2 = MFoutH2 outxO2 = MFoutO2 set molar fractions:...
Thanks, Daniel. I got another error saying "an integer is required". I can go around the issue by rounding the number but that would not be numerically correct. Something I should do to troubleshoot the code? set macro variables: oms1.SetTemperature(T) oms1.SetPressure(P) oms1.SetMassFlow(WF) calculate mass fractions: outxCH4 = MFoutCH4 outxH2O = MFoutH2O outxCO = MFoutCO outxCO2 = MFoutCO2 outxH2 = MFoutH2 outxO2 = MFoutO2 set mass fractions: oms1.SetOverallCompoundMolarFlow('Methane', outxCH4)...