Simscape Fluid Simulation with chemical reaction
Show older comments
Hello everyone,
I would simulate ammonia dissociation behavior with simscape. How can I convert two phase fluid system (NH3) to mixed gas system (H2 + N2) in simscape? Thank you.
Answers (1)
Yifeng Tang
on 14 Jun 2023
Moved: Sabin
on 5 Aug 2025
0 votes
If it's sufficient for you to only model the overall process from NH3 (g) + energy -> N2(g) + H2(g), you may be able to use the moist air domain, and write a custom block for the reaction.
but you mentioned "two phase fluid system", if by that you mean some gas can change phase between liquid and gas, it is going to be a much much more difficult problem to do in Simscape.
2 Comments
인하
on 10 Feb 2026
Hello, thank you very much for your helpful answer.
I am currently working on implementing an ammonia cracking process using MATLAB/Simulink. In my process design, liquid ammonia is first sent to a vaporizer to be converted into gaseous ammonia, and then the gas-phase ammonia is fed into a reactor where the decomposition reaction occurs. Therefore, my system needs to handle both liquid and gas phases, which is why I have been using the Two-Phase Fluid (2P) domain so far.
However, based on your answer, I understood that implementing chemical reactions with varying species compositions can be quite difficult within the 2P domain. Am I understanding your point correctly?
In that case, if the main goal is to model the ammonia decomposition reaction, would you recommend abandoning the 2P domain and instead using a different approach or domain?
Yifeng Tang
on 10 Feb 2026
Yes, it's difficult to model multiple species in the 2P domain.
But, don't abandon on the 2P domain just yet. It sounds like the two-phase is only needed for ammonia evaporation, meaning the only fluid during this process is pure ammonia. I suggest you keep this part in 2P.
You can then use the Interface (2P-MA) block to pass the temperature, pressure, and mass flow information to the moist air domain, where you can try to do the decomposition reactions. You need to make sure the properties on both the 2P and MA networks are consistent for the NH3 part.
If the 3 species from MA domain isn't sufficient for your reaction, you can also consider using this custom gas mixture domain: https://www.mathworks.com/matlabcentral/fileexchange/180844-gas-mixture-domain. It contains basic blocks like a foundation library, so you may need to write some custom blocks (which I guess you have to do with MA domain anyway). You'll need to write a interface block to go from 2P to this mixture domain. The code from the interface (2P-MA) block is visible, you can use it as reference.
Hope this helps.
Yifeng
Categories
Find more on Foundation and Custom Domains in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!