VirtualFCS.Chemical.AmmoniaCracker.AmmoniaCrackerDyn

Dynamic (lumped-volume per segment) ammonia cracker. Same kinetics as AmmoniaCracker, but each of the N computational segments is a Modelica.Fluid.Interfaces.PartialLumpedVolume-style control volume so that transient pressure build-up is captured.

1. Parameters and inputs

Parameters define the reactor geometry, initial inventories, thermal response, and regularization of transport and reaction rates. Types abbreviated as SI refer to Modelica.Units.SI. The medium must support the species order {NH3, H2, N2}, with NH3 and H2 as the two independent mass fractions.

Geometry and catalyst

NameTypeUnitDefaultDescription
NInteger150Number of computational segments and heat ports; inherited from AmmoniaCrackerInterface
HSI.Lengthm12.0Reactor height
LSI.Lengthm1.0Reactor length used for tube layout and external surface area
WSI.Lengthm1.2Reactor width
pitchSI.Lengthm10e-2Separation between tubes
z_headReal10.166Fraction of reactor height reserved for headers
D_tubesSI.Lengthm10e-2Tube diameter used in flow area and friction calculations
t_tubesSI.Lengthm5e-3Tube wall thickness used in catalyst area and wall heat capacity
W_catRealg/m24Catalyst mass per unit reaction area

Thermal conditions and initialization

NameTypeUnitDefaultDescription
T_out_targetSI.TemperatureK550 + 273.15Reference temperature for the equilibrium constant; does not impose the outlet temperature
T_startSI.TemperatureK550 + 273.15Temperature start guess and reference for initial density; temperature states have fixed = false
p_startSI.PressurePa30e5Reference pressure used to calculate the fixed initial species inventories
X_start[3]SI.MassFraction1{0.998, 0.001, 0.001}Initial mass fractions {NH3, H2, N2}
deltaH_rxnSI.MolarEnergyJ/mol46.0e3Endothermic heat demand per mole of NH3 converted
T_aSI.TemperatureK293.15Ambient temperature in the segment heat-loss expression
U_totSI.CoefficientOfHeatTransferW/(m2.K)1External heat-transfer coefficient
rho_wallSI.Densitykg/m37850Tube wall material density
cp_wallSI.SpecificHeatCapacityJ/(kg.K)500Tube wall material specific heat capacity

Flow and numerical regularization

NameTypeUnitDefaultDescription
dp_smallSI.PressurePa1e3Pressure range for regularizing the square-root flow law at the inlet and outlet faces
dp_small_internalSI.PressurePa1e8Pressure range for regularizing the square-root flow law at the internal faces. Below this range the flow law is approximately linear, adding a numerical resistance of about sqrt(k_face*dp_small_internal) between segments. This keeps internal pressure differences resolvable by the solver at low flow; the resulting bed pressure drop is of the order of kPa.
tau_rxn_minSI.Times0.05Minimum inventory-consumption time used to limit reaction rate
dp_inlet_nominalSI.PressurePa0Additional inlet header pressure drop at nominal flow
dp_outlet_nominalSI.PressurePa0Additional outlet header pressure drop at nominal flow
m_flow_nominalSI.MassFlowRatekg/s0.3Reference flow for header losses and nominal friction factor
m_flow_smallSI.MassFlowRatekg/s1e-3Range for smooth switching of donor-side face compositions
mu_nominalSI.DynamicViscosityPa.s3.5e-5Viscosity used to calculate the nominal Reynolds number

Calculated parameters

The following parameters are final and are calculated from the settings above.

NameTypeUnitDefaultDescription
k0Real-3.33/3.6*1e10Kinetic pre-exponential factor used by rate; see the rate-unit convention below
z_tubeSI.LengthmH*(1 - z_head)Active tube length
dzSI.Lengthmz_tube/NSegment length
N_tubes_xInteger1integer(floor((L + pitch)/(D_tubes + pitch)))Number of tubes along the reactor length
N_tubes_yInteger1integer(floor((W + pitch)/(D_tubes + pitch)))Number of tubes along the reactor width
N_tubesInteger1N_tubes_x*N_tubes_yTotal number of tubes
A_rSI.Aream2N_tubes*pi*(D_tubes - t_tubes)*z_tubeCatalyst-covered reaction area
A_cSI.Aream2pi*(D_tubes/2)^2Cross-sectional area of one tube
A_flowSI.Aream2N_tubes*A_cTotal flow area of all tubes
A_sSI.Aream22*(H*L + W*L + H*W)External heat-loss surface area
z[N]SI.Lengthm{dz*i - dz/2 for i in 1:N}Segment centre positions measured from the inlet
V_segSI.Volumem3A_flow*dzGas volume per segment
m_cat_segRealgW_cat*A_r/NCatalyst mass per segment
C_solid_segSI.HeatCapacityJ/KN_tubes*pi*(D_tubes - t_tubes)*t_tubes*dz*rho_wall*cp_wallTube wall heat capacity per segment
deltaG_0RealJ/mol95517 - 193.67*T_out_target - 0.035293*T_out_target^2 + 9.22*10e-6*T_out_target^3Reference Gibbs-energy expression used for equilibrium
k_eqReal1exp(-deltaG_0/R/T_out_target)Equilibrium constant evaluated at the reference temperature
rho_startSI.Densitykg/m3p_start/(R*T_start*(X_start[2]/MM_H2 + X_start[3]/MM_N2 + X_start[1]/MM_NH3))Ideal-gas density used for initial inventories
Re_nominalReal1m_flow_nominal*D_tubes/(A_flow*mu_nominal)Nominal Reynolds number
f_nominalReal1frictionFactor(Re_nominal)Friction factor applied at all segment faces

Inputs and input-side interfaces

NameDirectionInterfaceUnitDescription
port_aNominal inlet; bidirectionalFluidPort_aPa; kg/s; J/kgFeed pressure, mass flow, stream enthalpy, and composition; medium is AmmoniaMedium
heatPorts[N]Bidirectional thermal interfaceHeatPorts_aK; WOne heat port per segment, at the segment temperature; positive Q_flow supplies heat to the reactor

No signal input connectors are declared. Heating and thermal boundary conditions are provided by connected thermal components.

2. Model description

AmmoniaCrackerDyn is a segmented catalytic ammonia-decomposition reactor for system-level transient studies. It represents the conversion of ammonia into hydrogen and nitrogen, gas accumulation, pressure-driven transport, and thermal response of the gas and tube walls. Applications include studying feed changes, outlet throttling, and coupling to distributed heaters, gas separation, and hydrogen-consuming equipment.

Each of the N segments contains separate NH3, H2, and N2 mass inventories. Ideal-gas partial pressures determine segment pressure. Adjacent segments exchange mass through regularized quadratic pressure-loss laws, with half-segment friction at the inlet and outlet and optional additional header losses. Face compositions use a smoothed donor-cell formulation for forward and reverse flow. The friction factor is fixed at its nominal-flow value; the locally calculated Reynolds number is a diagnostic, not a friction feedback.

A dynamic temperature balance is solved in every segment. Gas and tube wall share one temperature and a combined heat capacity. Heat supplied through heatPorts balances inflow thermal transport, endothermic reaction demand, and heat exchange with ambient. The forward inlet term uses the incoming stream enthalpy and the enthalpy of the feed composition at segment conditions. Internal transport uses a specific-heat approximation; at the outlet, reverse thermal inflow is approximated at the last segment temperature rather than using the external outlet stream enthalpy.

Species inventories have fixed initial values calculated from p_start, T_start, and X_start. Temperature start values are not fixed, so the surrounding model must provide suitable initialization conditions. T_out_target is used to evaluate k_eq and is not a temperature constraint or an internal controller set-point.

3. Governing equations and references

The reaction stoichiometry per mole of ammonia consumed is NH3 -> 1.5 H2 + 0.5 N2. Representative segment equations are:

m_tot[i] = m_NH3[i] + m_H2[i] + m_N2[i]

P_tot[i] = (n_NH3[i] + n_H2[i] + n_N2[i])*R*T[i]/V_seg

der(m_species[i]) = inlet species flow - outlet species flow

                    + nu_species*R_NH3[i]*MM_species

r_rxn[i] = max(0, min(rate(...), n_NH3[i]/(tau_rxn_min*m_cat_seg)))

R_NH3[i] = r_rxn[i]*m_cat_seg

Q_rxn[i] = deltaH_rxn*R_NH3[i]

Q_loss[i] = U_tot*A_s/N*(T[i] - T_a)

(m_tot[i]*cp_mix[i] + C_solid_seg)*der(T[i])

  = inflow thermal transport - Q_loss[i] - Q_rxn[i] + heatPorts[i].Q_flow

m_flow_face[j] = regRoot(upstream pressure - downstream pressure, dp_reg)

                 /sqrt(k_face[j])

dp_reg = dp_small at the inlet and outlet faces, dp_small_internal at the internal faces

The quadratic friction between neighbouring segments is very small, so the physical internal pressure drops are much smaller than the absolute tolerance of the segment pressures. Without additional regularization, the internal face flows become dominated by solver noise at low feed flow, causing very small step sizes. The default dp_small_internal = 1e8 Pa makes these faces effectively linear. This has a negligible effect on the overall pressure profile and outlet conditions.

The kinetic expression follows Realpe et al. (2023), doi:10.1039/d2re00408a, with activation energy Ea = 1.54e5 J/mol and exponents a = 0.37 and b = -1.04 for the Co-Ba/CeO2 catalyst. Partial pressures are divided by 1e5 in the rate expression; NH3 and H2 pressure ratios are floored at 1e-6. Negative net kinetic rates are clipped to zero, so the model does not implement reverse ammonia synthesis. The inventory-based upper limit restricts ammonia consumption on the timescale tau_rxn_min.

As implemented, r_rxn is interpreted as mol/(s.g_cat) and multiplied by m_cat_seg in grams. The k0 declaration describes its units as mol/(kg.s); this convention should be checked when changing or calibrating catalyst data. Species balances use SI molar masses MM_NH3 = 0.017, MM_H2 = 0.002, and MM_N2 = 0.028 kg/mol.

The nominal friction factor uses 64/Re for laminar flow, a linear blend between Re = 2300 and 4000, and 0.3163*Re^(-0.25) above 4000. The function floors Re at 1e-3. Positive segment volumes, flow areas, nominal flow, regularization scales, and physically consistent initial compositions are required.

The model follows a lumped-inventory approach similar to Modelica.Fluid.Interfaces.PartialLumpedVolume, but implements its own species and approximate temperature balances rather than extending that class. Medium properties are supplied by CrackedAmmonia by default.

4. Outputs

No signal output connectors are declared. The nominal outlet and selected internal variables are available below. Array indices 1 and N identify the inlet-side and outlet-side segments.

NameDirectionInterfaceUnitDescription
port_bNominal outlet; bidirectionalFluidPort_bPa; kg/s; J/kgOutlet connection; outflow enthalpy and composition are calculated from segment N
T[N]Monitored state arraySI.TemperatureKSegment temperatures
P_tot[N]Monitored arraySI.PressurePaTotal segment pressures
m_NH3[N], m_H2[N], m_N2[N]Monitored state arraysSI.MasskgSpecies inventories per segment
w_NH3[N], w_H2[N], w_N2[N]Monitored arraysSI.MassFraction1Segment species mass fractions
mol_frac_NH3[N], mol_frac_H2[N], mol_frac_N2[N]Monitored arraysReal1Segment species mole fractions
NH3_conversion[N]Monitored arrayReal1Defined as 1 - mol_frac_NH3[i]; a composition indicator, not a feed-referenced conversion
R_NH3[N]Monitored arraySI.MolarFlowRatemol/sAmmonia consumption rate per segment
Q_rxn[N], Q_loss[N]Monitored arraysSI.HeatFlowRateWReaction heat demand and ambient heat loss per segment
m_flow_face[N + 1]Monitored arraySI.MassFlowRatekg/sMass flows at segment faces; positive in the nominal inlet-to-outlet direction
m_flow_balanceMonitored variableSI.MassFlowRatekg/sport_a.m_flow + port_b.m_flow - der(sum(m_tot)); total mass-balance residual
T_inMonitored variableSI.TemperatureKTemperature inferred from the incoming port_a stream

Contents