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