Compressor modeling with ExtensibleReactor

83 views
Skip to first unread message

james jery

unread,
Sep 29, 2024, 10:52:42 PM9/29/24
to Cantera Users' Group
I figured out how to use extensibleReactor module and successfully built a compressor model with output. However, the output is incorrect compared to aspen. I have some problems with my balance equations design.

I have tried 2 design, but both fail.

One is was to treat the dynamic problem as a static one which means the RHS[2] = p2 - p1, it would return the right value at t = 1 as I expected. But it would cause significant deviations compared to the results from Aspen when p2/p1 is large.

I'm not sure how to design a differential balance equation for dp/dt, so another attempt was to use the full differential method to differentiate the GPSA equation. But it would fall into an infinite loop.

I think it's my mistake in balance equation design, both approaches will collpase using sim.advance_to_steady_state() methods.

The relevant information is in the attachment.Could anyone give me help, any advice would be appreciated.

Regards,
James
FT.yaml
MyCompressor.py

Ray Speth

unread,
Oct 13, 2024, 12:06:23 PM10/13/24
to Cantera Users' Group

Hi James,

This is an interesting topic. I think working through this particular case may help clear up some areas where some additional flexibility in the extensible reactor model could be useful.

One thing is that in the reactor network, a compressor is more analogous to a flow device, like a MassFlowController, than it is to a reactor itself, as it doesn’t have a single thermodynamic state. Instead, I’d think of the inlet and outlet being the Reactor objects. However, since we don’t yet have an ExtensibleFlowDevice to build on, the only way to do this is to add the custom behavior to one of the reactors, similar to what you’ve done here, or this example that implements an equation for wall inertia.

Do you have a brief writeup of the equations that you’re trying to implement? It might help to see them in their mathematical form rather than the translation to code where its easy to get lost in the details. It’s not quite clear to me whether you all of your equations are differential equations, or whether you have some algebraic constraints. Currently, the ExtensibleReactor model doesn’t support these algebraic equations, though the underlying ReactorNet integrator can handle them and this is an enhancement that could be made at some point.

Regards,
Ray

james jery

unread,
Oct 28, 2024, 4:25:45 AM10/28/24
to Cantera Users' Group
Thanks for reply, Ray.
After posting my problem, and I revise the RHS[2] equation which could return result implementing sim.advance_to_steady_state().But still failing to converge,  I'm stuck on this issue.RelatedEquation.png
MyCompressor.py
Reply all
Reply to author
Forward
0 new messages