I'm trying to simulate the Haber-Bosch process which operates at high temperature and pressure. Since DWSIM does not have the Boston-Mathias SRK typically recommended to account for the non-ideality of ammonia at high pressure, I am trying using the Mathias-Copeman SRK package found in ChemSep, incorporating it into DWSIM as a CAPE-OPEN package. The CAPE-OPEN implementation seems to work just fine when performing flash calculations, i.e. through a gas-liquid separator.
However, when I try to perform the ammonia synthesis reaction, I get a solver error. The kinetic model used is from Froment and Bischoff (taken from 10.1016/j.compchemeng.2008.03.001), and it works just fine when using DWSIM property packages like SRK or PR. It does not work when I switch to any CAPE-OPEN property package (whether MC-SRK or just regular SRK), giving me the message: System.Exception: PFR ODE solver failed to find a solution. at DWSIM.UnitOperations.Reactors.Reactor_PFR.ODEFunc(Double x, Double[] y) in C:\Users\danie\source\repos\DanWBR\dwsim\DWSIM.UnitOperations\Reactors\PFR.vb:line 492.
I tried toying around with the length of the integration steps or changing the solver type without any success.
To Reproduce
MC-SRK.zip
- Open the Thermodynamics tab of the Settings menu.
- Configure the MC-SRK CAPE-OPEN Property Package.
- Using the Thermo Interface 1.1, select ChemSep as manager.
- Load MC-SRK (file attached), save in the ChemSep interface.
- Make sure that the compound and phase mapping are all OK.
- Confirm that the package works well by solving stream 1 with the MC-SRK package. (If it doesn't turn blue, the package isn't properly configured.)
- Run the whole simulation. It should result in an error.
- Confirm that this is limited to the MC-SRK package by switching the PP of all units to SRK or PR.
Desktop:
- OS: Windows
- Version v9.0.5
I'm trying to simulate the Haber-Bosch process which operates at high temperature and pressure. Since DWSIM does not have the Boston-Mathias SRK typically recommended to account for the non-ideality of ammonia at high pressure, I am trying using the Mathias-Copeman SRK package found in ChemSep, incorporating it into DWSIM as a CAPE-OPEN package. The CAPE-OPEN implementation seems to work just fine when performing flash calculations, i.e. through a gas-liquid separator.
However, when I try to perform the ammonia synthesis reaction, I get a solver error. The kinetic model used is from Froment and Bischoff (taken from 10.1016/j.compchemeng.2008.03.001), and it works just fine when using DWSIM property packages like SRK or PR. It does not work when I switch to any CAPE-OPEN property package (whether MC-SRK or just regular SRK), giving me the message: System.Exception: PFR ODE solver failed to find a solution. at DWSIM.UnitOperations.Reactors.Reactor_PFR.ODEFunc(Double x, Double[] y) in C:\Users\danie\source\repos\DanWBR\dwsim\DWSIM.UnitOperations\Reactors\PFR.vb:line 492.
I tried toying around with the length of the integration steps or changing the solver type without any success.
To Reproduce
MC-SRK.zip
Desktop: