Doubt in connecting two PSRs to a plug-flow-reactor via valves and MFC

164 views
Skip to first unread message

Francisco M. Guimarães

unread,
Oct 5, 2021, 7:53:47 AM10/5/21
to Cantera Users' Group
Dear all,

I am having some questions about implementing certain interactions (valves and mfc) in a 0-dimensional reactor network. 

I intend to connect two psr reactors (ORZ and CRZ) to a plug-flow-reactor (PFZ), which I model as a linear chain of psr reactors. Ideally I would like the ORZ-PFZ connection to be staged, i.e. that ORZ could "send" a different (decreasing) amount of mass flux to each psr component of PFZ. I tried and failed to do this due to not being able to update in each iteration the mass flow in the mfc going from ORZ to PFZ (this according to the modeling I have, with reference to pfr.py from Cantera's site).

On the other hand I noticed that having an open valve between ORZ and PFZ (see code below) the results seem to follow the experimental trends well. From here several questions came to me about the use of valves and how to use them correctly in modeling a plug-flow-reactor.

According to the modeling I implemented for the plug-flow-reactor, the ORZ and CRZ mass flows enter through a mfc into the reservoir upstream of the PFZ, and in addition, there are valves that also connect ORZ and CRZ to this reservoir and ORZ to the PFZ, as shown in the lines of code below.

Specific questions:

1/ Can someone check the interactions I modeled and tell me if they look correct or not? (For example, in terms of mass conservation in each reactor) I just ask for those in ///CHECK THESE CONNECTIONS///. 

2/ Can anyone explain to me what is the difference between the mfr_ORZ_upstream_v interaction and the mfr_ORZ_PFZ_v interaction? Although the results with one or the other are different, I don't understand the reason, because both are valve connections from ORZ to PFZ, although one has a reservoir through it and the other does not. 

The attatched lines of code (some of them) and charts may be relevant (the charts show the results for the current model shown here).

Many thanks!
Francisco

#---------------------

# gaseous fuel
fuel = ct.Solution('mechanismsRQL\\{}'.format(mech))
fuel.TPX = T0_fuel, P, 'NH3:{:.2f}, H2:{:.2f}'.format(xNH3, xH2)

# gaseous oxidizer
air = ct.Solution('mechanismsRQL\\{}'.format(mech))
air.TPX = T0_air, P, 'O2:{:.2f}, N2:{:.2f}'.format(xO2, xN2)

gas_FZ = ct.Solution('mechanismsRQL\\{}'.format(mech))
gas_FZ.TPX = 1800, P, 'O2:{:.2f}, N2:{:.2f}'.format(xO2, xN2)  # high temperature to assure ignition

gas_IRZ = ct.Solution('mechanismsRQL\\{}'.format(mech))
gas_IRZ.TPX = 1800, P, 'O2:{:.2f}, N2:{:.2f}'.format(xO2, xN2)

gas_CRZ = ct.Solution('mechanismsRQL\\{}'.format(mech))
gas_CRZ.TPX = 1800, P, 'O2:{:.2f}, N2:{:.2f}'.format(xO2, xN2)

gas_ORZ = ct.Solution('mechanismsRQL\\{}'.format(mech))
gas_ORZ.TPX = 1800, P, 'O2:{:.2f}, N2:{:.2f}'.format(xO2, xN2)

gas_PFZ = ct.Solution('mechanismsRQL\\{}'.format(mech))
gas_PFZ.TPX = 1800, P, 'O2:{:.2f}, N2:{:.2f}'.format(xO2, xN2)

# ----------------------------------
# Reactors initialization
# ----------------------------------

# Create reservoirs
resAir = ct.Reservoir(air)
resFuel = ct.Reservoir(fuel)
upstream_PFZ = ct.Reservoir(gas_PFZ)
flueGas = ct.Reservoir(air)

# fuel.equilibrate('HP')  # to assure ignition
FZ = ct.IdealGasReactor(gas_FZ, energy='on')
FZ.volume = vol_FZ

IRZ = ct.IdealGasReactor(gas_IRZ, energy='on')
IRZ.volume = vol_IRZ

ORZ = ct.IdealGasReactor(gas_ORZ, energy='on')
ORZ.volume = vol_ORZ
# ORZ.chemistry_enabled = False

CRZ = ct.IdealGasReactor(gas_CRZ, energy='on')
CRZ.volume = vol_CRZ

PFZ = ct.IdealGasReactor(gas_PFZ, energy='on')
PFZ.volume = dVol_PFZ

# ----------------------------------
# Connections between reactors (MFC and valves) 
# ----------------------------------

mfr_resAir_FZ = ct.MassFlowController(resAir, FZ, mdot=mdotAir_FZ)
mfr_resFuel_FZ = ct.MassFlowController(resFuel, FZ, mdot=mdotFuel_FZ)
mfr_resAir_ORZ = ct.MassFlowController(resAir, ORZ, mdot=mdotAir_ORZ)

mfr_FZ_IRZ = ct.MassFlowController(FZ, IRZ, mdot=mdotGas_FZ_IRZ)
mfr_FZ_IRZ_v = ct.Valve(FZ, IRZ, K=PVC)

mfr_FZ_ORZ = ct.MassFlowController(FZ, ORZ, mdot=mdotGas_FZ_ORZ)
mfr_FZ_ORZ_v = ct.Valve(FZ, ORZ, K=PVC)

mfr_FZ_CRZ = ct.MassFlowController(FZ, CRZ, mdot=mdotGas_FZ_CRZ)
mfr_FZ_CRZ_v = ct.Valve(FZ, CRZ, K=PVC)

mfr_IRZ_FZ = ct.MassFlowController(IRZ, FZ, mdot=mdotGas_IRZ_FZ)
mfr_IRZ_FZ_v = ct.Valve(IRZ, FZ, K=PVC)

mfr_IRZ_CRZ = ct.MassFlowController(IRZ, CRZ, mdot=mdotGas_IRZ_CRZ)
mfr_IRZ_CRZ_v = ct.Valve(IRZ, CRZ, K=PVC)
mfr_CRZ_IRZ_v = ct.Valve(CRZ, IRZ, K=PVC)

mfr_ORZ_CRZ = ct.MassFlowController(ORZ, CRZ, mdot=mdotGas_ORZ_CRZ)
mfr_ORZ_CRZ_v = ct.Valve(ORZ, CRZ, K=PVC)

mfr_ORZ_FZ_v = ct.Valve(ORZ, FZ, K=PVC)
# mfr_CRZ_FZ_v = ct.Valve(CRZ, FZ, K=PVC)
mfr_CRZ_ORZ_v = ct.Valve(CRZ, ORZ, K=PVC)

# ///CHECK THESE CONNECTIONS 1///
mfr_ORZ_upstream = ct.MassFlowController(ORZ, upstream_PFZ, mdot=mdotGas_ORZ_upstream[n])   # [n] would mean a staged mass flow inlet.However, currently only the first value (that is the total mass flow) of the vector is used.
mfr_ORZ_PFZ = ct.MassFlowController(ORZ, PFZ, mdot=mdotGas_ORZ_PFZ)  # check this line
mfr_ORZ_upstream_v = ct.Valve(ORZ, upstream_PFZ, K=PVC)    # check this line
mfr_ORZ_PFZ_v = ct.Valve(ORZ, PFZ, K=PVC)   # check this line

# ///CHECK THESE CONNECTIONS 2///
mfr_CRZ_upstream = ct.MassFlowController(CRZ, upstream_PFZ, mdot=mdotGas_CRZ_upstream[n])
mfr_CRZ_PFZ = ct.MassFlowController(CRZ, PFZ, mdot=mdotGas_CRZ_PFZ)
mfr_CRZ_upstream_v = ct.Valve(CRZ, upstream_PFZ, K=PVC)  # MANDATORY
# mfr_CRZ_PFZ = ct.Valve(CRZ, PFZ, K=1e-8)   # check this line

mfr_upstream_PFZ = ct.MassFlowController(upstream_PFZ, PFZ, mdot=mdotGas_upstream_PFZ) # mdotGas_upstream_PFZ = mdotGas_ORZ_upstream + mdotGas_CRZ_upstream
# mfr_upstream_PFZ_v = ct.Valve(upstream_PFZ, PFZ, K=PVC)

# mfr_PFZ_flue = ct.PressureController(PFZ, flueGas, master=mfr_upstream_PFZ, K=PVC)
# mfr_PFZ_flue = ct.MassFlowController(PFZ, flueGas, mdot=mdotGas_PFZ_flue) # mdotGas_PFZ_flue = mdotAir + mdotFuel
mfr_PFZ_flue_v = ct.Valve(PFZ, flueGas, K=PVC)

# ----------------------------------
# Heat transfer modeling
# ----------------------------------

ovrU_FZ = U_FZ
ovrU_CRZ = U_CRZ
ovrU_ORZ = U_ORZ
ovrU_PFZ = U_PFZ
emiss_int = em_int
# emiss_ext = em_ext

wall_FZ_ORZ = ct.Wall(left=ORZ, right=FZ, A=surfArea_FZ_ext)
wall_FZ_ORZ.emissivity = emiss_int

wall_IRZ_FZ = ct.Wall(left=IRZ, right=FZ, A=surfArea_IRZ)
wall_IRZ_FZ.emissivity = emiss_int

wall_CRZ_FZ = ct.Wall(left=CRZ, right=FZ, A=surfArea_CRZ_FZ)
wall_CRZ_FZ.emissivity = emiss_int

wall_CRZ_ORZ = ct.Wall(left=ORZ, right=CRZ, A=surfArea_CRZ_ORZ)
wall_CRZ_ORZ.emissivity = emiss_int

wall_ORZ_ext = ct.Wall(left=resAir, right=ORZ, A=surfArea_ORZ, U=ovrU_ORZ)
# wall_ORZ_ext.emissivity = emiss_ext ~ 0

wall_PFZ_ext = ct.Wall(left=resAir, right=PFZ, A=dSurfArea_PFZ, U=ovrU_PFZ)
# wall_PFZ_ext.emissivity = emiss_ext ~ 0

# ----------------------------------
# Plug-flow-reactor (PFZ) iteration
# ----------------------------------

# iterate through the cells
for n in range(nReactors):

# Set the state of the reservoir to match that of the previous reactor
if n == 0:
gas_PFZ.TPX = CRZ.thermo.TPX
else:
gas_PFZ.TPX = PFZ.thermo.TPX

# gas_PFZ.TPX = PFZ.thermo.TPX
upstream_PFZ.syncState()
sim.set_initial_time(0.0)
sim.advance_to_steady_state()

T.jpeg
NOx.jpeg
O2.jpeg
NH3.jpeg
H2.jpeg
Reply all
Reply to author
Forward
0 new messages