Troubleshooting stability of PFR model with enthalpy balances enabled and reactions proceeding to completion #1634
-
|
System specs: I am modeling a complex reaction network (>100 reactions) using the PFR reactor model and starting to have problems with the solver not finding feasible solutions and/or taking a very long time to solve. I initially had it working isothermally (energy_balance_type = none) in what seemed to be a stable manner and reasonable initialization and solve times of a few seconds. Then I have recently turned on the enthalpy balance (energy_balance_type = enthalpyTotal, default for FTPx state definition) to incorporate heats of reaction and now I am having serious problems getting this to initialize or solve. After a lot of troubleshooting, I've narrowed things down somewhat to where I suspect the infeasibility issues are related to some species being reacted to extinction. Some of the reactions happen very quickly, and as a result the reaction rates are attempting to drive the mole fraction of those reactants below the 1e-20 lower bound for mole_frac_comp variables. I think this is at least part of the problem because trying some workarounds like removing the reaction from the model or changing the lower bound on the mole_frac_comp variable have allowed the model to solve in some cases. Question 1: Is there a recommended or preferred way in IDAES to handle reactions that run to completion, that is, one of the reactants is completely consumed? Solve time and reliability were not as much of a problem until I introduced the energy balance to the reactor. For example, it was not having any issues solving, even with the very small concentrations of reactant, for the isothermal case with energy_balance_type = none. What is more, even if I deactivate the enthalpy_balances constraint and fix the reactor temperatures to be exactly the same as the isothermal case, there is still a 10-fold slow-down in solve times, if the reactor solves at all. Question 2: What happens when the enthalpy balance equations are added to make the model so much slower and less stable in solving what should otherwise be the exact same problem? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Hello, I recommend using the diagnostics toolbox to confirm the numerics of your model are reasonable. You may find there is a modeling mistake or the equations are poorly scaled. https://idaes-examples.readthedocs.io/en/2.4.0/docs/diagnostics/diagnostics_toolbox_doc.html Cheers, |
Beta Was this translation helpful? Give feedback.
Here the devil is in the implementation details. What equation of state and equilibrium form are you using? We've found that equating log_fugacity is better conditioned than equating fugacity directly. If you're using the cubic equation of state, that naturally leads to use of log mole fraction variables, but the ideal equation of state takes the log function of the normal mole fraction variables. We real…