Using water in liquid state

435 views
Skip to first unread message

Abdul Rahman Dastagir

unread,
Aug 20, 2018, 1:32:56 PM8/20/18
to Cantera Users' Group
Hello everyone,

I'm using cantera in python to model a combustion. I wanted to see the results by applying water injection. Is there a way to define in cantera H2O in it's liquid state and then applying latent heat of vapourization for water.

Thank you so much for your help.

With best wishes,

Abdul Dastagir

Ray Speth

unread,
Aug 27, 2018, 11:04:44 AM8/27/18
to Cantera Users' Group
Hi,

What have you tried already? There may be a few options, depending on how you are modeling things. If you share your code so far, perhaps we can provide some suggestions.

Regards,
Ray

Abdul Rahman Dastagir

unread,
Aug 28, 2018, 2:24:04 AM8/28/18
to Cantera Users' Group
This is what I've done so far,

# For liquid saturated water at 300 Kelvin
water = ct.Water()
water.TX = 300, 0.0

Ray Speth

unread,
Aug 28, 2018, 10:54:09 AM8/28/18
to Cantera Users' Group
And what would you do if you weren't concerned with the water entering in the liquid state? That's what you need to show -- right now, we have no idea what kind of combustion system it is you are trying to model.

Regards,
Ray

Abdul Rahman Dastagir

unread,
Aug 29, 2018, 2:41:08 AM8/29/18
to Cantera Users' Group
Hi Ray,

I'm trying to model a non-premixed combustion system in a gas turbine which can also accommodate steam/water injection. This is to understand the NOx emissions. This is how I thought to model the code. If water isn't entering in liquid state, I was using steam injection instead. But, I wanted to incorporate both steam or water injection. Please, have a look and let me know.

air = ct.Solution('gri30.cti')
oxidizer_comp = 'N2:0.7729, O2:0.2074, CO2:0.0003, H2O:0.01009, Ar:0.009310'
air.TPX = Tin_o,p, oxidizer_comp
air_in = ct.Reservoir(air)

fuel = ct.Solution('gri30.xml')
fuel_comp = 'CH4:0.90, C2H6:0.0564, C3H8:0.0234, CO2:0.0144, N2:0.0053'
fuel.TPX = Tin_f, p, fuel_comp
fuel_in = ct.Reservoir(fuel)

"""To toggle between steam and water """
steam = ct.Water()
steam.TX = 300, 0.0
#steam = ct.Solution('gri30.xml')
#steam_comp = 'H2O:1.0'
#steam.TPX = 300, p, steam_comp
steam_in = ct.Reservoir(steam)

## Create the Flame Sheet reactor, and fill it in initially with N2
gas1 = ct.Solution('gri30.xml')
gas1.TPX = Tin_f, p, 'N2:1.0'
FSR = ct.IdealGasReactor(gas1)
FSR.volume = V_FSR

psr1=ct.Solution('gri30.xml')
psr1.set_equivalence_ratio (phi_PSR_1,fuel_comp,oxidizer_comp)  # Setting the equivalence ratio equal to that of FSR
psr1.equilibrate('HP')
PSR_1 = ct.IdealGasReactor(psr1,energy='on')              # PSR-1
PSR_1.volume = V_PSRn

psr_recirculation=ct.Solution('gri30.xml')
psr_recirculation.set_equivalence_ratio (phi_PSR_recirculation,fuel_comp,oxidizer_comp)  # Setting the equivalence ratio equal to that of FSR
psr_recirculation.equilibrate('HP')
PSR_recirculation = ct.IdealGasReactor(psr_recirculation,energy='on')              # PSR-2
PSR_recirculation.volume = V_PSRn

fuel_steam = ct.IdealGasReactor(gas1, energy = 'on')
mfc_fuel = ct.MassFlowController(fuel_in, fuel_steam ,mdot = fuel_mdot)
mfc_steam = ct.MassFlowController(steam_in, fuel_steam, mdot= amount_of_steam_flow_to_FSR*steam_mdot)
mfc_f = ct.MassFlowController(fuel_in, FSR, mdot=fuel_mdot)
mfc_st = ct.MassFlowController(steam_in, FSR, mdot=amount_of_steam_flow_to_FSR*steam_mdot)
mfc_o = ct.MassFlowController(air_in, FSR, mdot=air_mdot_FSR)


""" The igniter will use a Gaussian time-dependent mass flow rate. """
fwhm = 0.2
amplitude = 0.01
t0 = 1.0
igniter_mdot = lambda t: amplitude * math.exp(-(t-t0)**2 * 4 * math.log(2) / fwhm**2)
mfc_igniter = ct.MassFlowController(igniter, FSR, mdot=igniter_mdot)

""" Defining the mass flow controllers from the oxidizer Reservoir to the PSRs """
mfc_o1 = ct.MassFlowController(air_in,PSR_1,mdot = mdot_o1) # Mass flow controller to PSR_1
mfc_st1 = ct.MassFlowController(steam_in, PSR_1, mdot=amount_of_steam_flow_to_each_PSR*steam_mdot)

""" Setting the mass flow controllers from FSR to PSR_1 to....PSR_5 """
total_flow = air_mdot_FSR+fuel_mdot+(amount_of_steam_flow_to_FSR*steam_mdot)                        # Defining the flows to the PSR from FSR

##Bypassing the amount of gases across the PSRs

bypass_PSR_1_to_PSR_recirculation = 1


##Defining the mass flow rates through each PSRs
mdot_PSR_1_to_PSR_recirculation = (fuel_flow_to_PSR_1+air_flow_to_PSR_1)*bypass_PSR_1_to_PSR_recirculation

FSR_to_PSR_1 = ct.MassFlowController(FSR,PSR_1, mdot = total_flow)

mfc_o2 = ct.MassFlowController(air_in,PSR_recirculation,mdot = mdot_o_recirc) # Mass flow controller to PSR_2
mfc_st2 = ct.MassFlowController(steam_in, PSR_recirculation, mdot=amount_of_steam_flow_to_each_PSR*steam_mdot)
PSR_1_to_PSR_recirculation = ct.MassFlowController(PSR_1,PSR_recirculation,mdot = mdot_PSR_1_to_PSR_recirculation)

"""Recirculating the flows through the PSRs"""
#Bypassing the amount of gases to recirculate across the PSRs
bypass_PSR_recirculation_to_PSR_1 = 1

##Defining the mass flow rates to each PSRs
mdot_PSR_recirculation_to_PSR_1 =  (mdot_PSR_1_to_PSR_recirculation+mdot_o_recirc+(amount_of_steam_flow_to_each_PSR*steam_mdot))*bypass_PSR_recirculation_to_PSR_1

PSR_recirculation_to_PSR_1 = ct.MassFlowController(PSR_recirculation,PSR_1,mdot = mdot_PSR_recirculation_to_PSR_1)

""" Create a reservoir for the exhaust """
exhaust = ct.Reservoir(gas)

""" Put a valve on the exhaust line to regulate the pressure """
v = ct.Valve(PSR_1, exhaust, K=1e-5)

""" Creating a reactor network """
net = ct.ReactorNet([FSR,PSR_1,PSR_recirculation])#,PSR_3,PSR_4,PSR_5])

# take single steps to 6 s, writing the results to a CSV file for later
# plotting.
tfinal = 6.0
tnow = 0.0
Tprev = FSR.T
tprev = tnow

while tnow < tfinal:
    tnow = net.step()
    tres = FSR.mass/total_flow
    Tnow = FSR.T
    if abs(Tnow - Tprev) > 1.0 or tnow-tprev > 2e-2:
        tprev = tnow
        Tprev = Tnow


Thank you for your help

Regards,
Abdul

Ray Speth

unread,
Aug 29, 2018, 9:48:36 AM8/29/18
to Cantera Users' Group
Abdul,

Defining a reservoir containing liquid water should work fine. In the IdealGasReactor, it will of course be treated as an ideal gas, but the energy balance will be computed correctly, using the enthalpy of the liquid water for what's entering the reactor. You should be able to verify this by seeing a difference in the results if you set the state of the reservoir to be saturated liquid versus saturated vapor. Is there something about this that isn't working? You've chosen to remove some details that are needed to actually run your code, so we have no idea what happens when you run it.

Regards,
Ray

Abdul Rahman Dastagir

unread,
Aug 30, 2018, 5:15:05 AM8/30/18
to Cantera Users' Group
Hi Ray,

It is running, but the thing is that the flame temperature when I use water or steam should decrease by a few 100 Kelvins, but it reduces by like only 20 to 30 Kelvin. I wanted to know if I should define the latent heat of vapourization, if so will that help, and how do I do it?

Anil Kunwar

unread,
Aug 31, 2018, 5:55:21 PM8/31/18
to Cantera Users' Group
Ray,
It sounds interesting to know that practically , special cases of solid phases and liquid phases can be modeled alongside gaseous phases within Cantera.


Yours Sincerely,
Anil Kunwar

Ray Speth

unread,
Sep 1, 2018, 11:01:59 AM9/1/18
to Cantera Users' Group

Abdul,

The pure fluid equation of state for water (the model you are using when you call ct.Water()) includes the enthalpy of vaporization where necessary. You can easily see this by setting the state to the saturated liquid or vapor conditions and observing the change in enthalpy. For example:

>>> w = ct.Water()
>>> w.TX = 300, 1
>>> hg = w.enthalpy_mass
>>> w.TX = 300, 0
>>> hf = w.enthalpy_mass
>>> hg-hf
2437937.8152761906

You should also be able to observe a difference in your reactor model if you set the input to liquid water versus steam. Another thing you can do to confirm that your model is working as intended is to just examine the overall enthalpy balance of the system, looking at all of the inlets and outlets to your reactor.

Regards,
Ray

Satyendra Rana

unread,
Dec 20, 2024, 4:23:29 PM12/20/24
to Cantera Users' Group
Hello Ray,

In this discussion, you mentioned that ct.Water() handles the enthalpy of vaporization. I wonder if I can use this method to simulate the addition of micron-sized liquid water droplets to a fuel-air mixture in order to estimate the adiabatic flame temperature of the flame? I understand that Cantera combustion calculations only handle gas-phase reactants. Is there a way I can simulate the use of water in the liquid phase, at least to determine the adiabatic temperature, similar to how it's done in the NASA CEA calculator?

Thanks for your time,
Rana
Reply all
Reply to author
Forward
0 new messages