State of water in a reactor

558 views
Skip to first unread message

Raphael R

unread,
Jul 8, 2021, 12:58:49 PM7/8/21
to Cantera Users' Group

Hi everyone,

i´ve been using Cantera with Matlab for a while, my actual environment is a reactor, that gets compressed and due to the compression there is a increase in pressure and temperature.

During the compression, I inject a amount of water.

Now my question is, if there is a way to get the state of this water dose?

I want to know, how much water is in a gas state and in a liquid state?

I hope there is anyone, who can give me a hint.

Please tell me, if my question is not precise enough.

Thanks in advance

Regards,
Raphael




Steven DeCaluwe

unread,
Jul 12, 2021, 9:24:28 AM7/12/21
to canter...@googlegroups.com
Hi Raphael,

I don’t know the answer to this off the top of my head, and would need to play around with code to answer it.

Would it be possible to share the details of your script, either by copy-paste or by attaching the .m file? That way I’ll know that I am “playing around” in a relevant way :)

Best,
Steven

——————————————————
Steven C. DeCaluwe, Ph.D | Associate Professor of Mechanical Engineering
COLORADOSCHOOLOFMINES
Brown Building W410B
Golden, CO 80401

Twitter: @CORESresearch
He / Him / His





--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cantera-users/1edbac6d-a907-4fcf-8c73-94c10d1be2c8n%40googlegroups.com.

Raphael R

unread,
Jul 12, 2021, 11:09:48 AM7/12/21
to Cantera Users' Group
Hi,

thanks for your fast response, I attached the *.m file. There is also a function needed which I attach in the next post.

The main reason for my question is that I want to know is, how is Cantera handling the vaporization of liquid water in a reactor and  is in the end of the cycle the whole amount of liquid disappeared.

Regards,
Raphael
CanteraReaktorH2O_DI.m

Raphael R

unread,
Jul 12, 2021, 11:12:28 AM7/12/21
to Cantera Users' Group
This function is also needed for the *.m file. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [KW]=crank_angle(t,f)
KW=mod((2*pi*f*t)+pi,4*pi);

end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I was not able to upload it.

Thanks in advance!

Best regards,
Raphael
S. DeCaluwe schrieb am Montag, 12. Juli 2021 um 15:24:28 UTC+2:

Ingmar Schoegl

unread,
Jul 15, 2021, 6:11:13 PM7/15/21
to Cantera Users' Group
Hallo Raphael,

... while I haven't run your script, I noticed that you're using GRI30 (for H2 combustion), where you're injecting Water (which is a Cantera object handling a pure substance). For GRI, you would pretty much assume ideal gas for all constituents (i.e. phase is by definition gas). I am not aware of a good way to handle phase change for this context (although others may). My recommendation would be to inject water in the gas phase (using the same thermo object as for the reactor content), and handle latent heat of vaporization by a heat transfer term.

Not sure that this helps,
-ingmar-

Steven DeCaluwe

unread,
Jul 26, 2021, 10:51:41 AM7/26/21
to canter...@googlegroups.com
Hi Raphael,

Similarly, I looked over the script (I do not have Matlab, so this is the best I can do, for now).  There are of course some language barriers, but I think I understand the big idea of what you are doing.

Along the lines of what Ingmar has suggested, I think any suggestion here will likely have you adding more functionality to track the state of your water.  For example, I’m not quite certain: is water injected at a different state (T and P) than the reactor contents?  If so, you would need to model the heat transfer between the reactor contents and injected water (would you assume that pressure equilibrates immediately?).  In my “mind’s eye” picture, you would have the water’s internal energy as a state variable, and so you can implement an equation to predict the evolution, du/dt.  If you do this, then yes, you can set the water state using `setState_UP`, and then print out the quality for any given state via `vaporFraction(gas)`.

I will note, of course, that you are assuming no reactions between any water vapor produced and the other contents of your reactor. 



Now, for implementation.  Cantera’s current reactors seem like they cannot handle injecting one phase of matter into a reactor whose contents are an entirely other phase.  My two initial thoughts:
1. Define a custom reactor.  We give an example of how to do this in Python, here: https://cantera.org/examples/python/reactors/custom.py.html
2. Define two reactors—one for gas, one for water—with a wall between them to transfer heat between the two phases.  I am not adept as using Cantera’s reactor models, but this seems the fasted and most straight-forward approach (again, assuming you do not want to enable chemical reactions between the two phases).


Best,
Steven






Reply all
Reply to author
Forward
Message has been deleted
0 new messages