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.
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.
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
N | Integer | 1 | 50 | Number of computational segments and heat ports; inherited from AmmoniaCrackerInterface |
H | SI.Length | m | 12.0 | Reactor height |
L | SI.Length | m | 1.0 | Reactor length used for tube layout and external surface area |
W | SI.Length | m | 1.2 | Reactor width |
pitch | SI.Length | m | 10e-2 | Separation between tubes |
z_head | Real | 1 | 0.166 | Fraction of reactor height reserved for headers |
D_tubes | SI.Length | m | 10e-2 | Tube diameter used in flow area and friction calculations |
t_tubes | SI.Length | m | 5e-3 | Tube wall thickness used in catalyst area and wall heat capacity |
W_cat | Real | g/m2 | 4 | Catalyst mass per unit reaction area |
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
T_out_target | SI.Temperature | K | 550 + 273.15 | Reference temperature for the equilibrium constant; does not impose the outlet temperature |
T_start | SI.Temperature | K | 550 + 273.15 | Temperature start guess and reference for initial density; temperature states have fixed = false |
p_start | SI.Pressure | Pa | 30e5 | Reference pressure used to calculate the fixed initial species inventories |
X_start[3] | SI.MassFraction | 1 | {0.998, 0.001, 0.001} | Initial mass fractions {NH3, H2, N2} |
deltaH_rxn | SI.MolarEnergy | J/mol | 46.0e3 | Endothermic heat demand per mole of NH3 converted |
T_a | SI.Temperature | K | 293.15 | Ambient temperature in the segment heat-loss expression |
U_tot | SI.CoefficientOfHeatTransfer | W/(m2.K) | 1 | External heat-transfer coefficient |
rho_wall | SI.Density | kg/m3 | 7850 | Tube wall material density |
cp_wall | SI.SpecificHeatCapacity | J/(kg.K) | 500 | Tube wall material specific heat capacity |
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
dp_small | SI.Pressure | Pa | 1e3 | Pressure range for regularizing the square-root flow law at the inlet and outlet faces |
dp_small_internal | SI.Pressure | Pa | 1e8 | Pressure 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_min | SI.Time | s | 0.05 | Minimum inventory-consumption time used to limit reaction rate |
dp_inlet_nominal | SI.Pressure | Pa | 0 | Additional inlet header pressure drop at nominal flow |
dp_outlet_nominal | SI.Pressure | Pa | 0 | Additional outlet header pressure drop at nominal flow |
m_flow_nominal | SI.MassFlowRate | kg/s | 0.3 | Reference flow for header losses and nominal friction factor |
m_flow_small | SI.MassFlowRate | kg/s | 1e-3 | Range for smooth switching of donor-side face compositions |
mu_nominal | SI.DynamicViscosity | Pa.s | 3.5e-5 | Viscosity used to calculate the nominal Reynolds number |
The following parameters are final and are calculated from the settings above.
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
k0 | Real | - | 3.33/3.6*1e10 | Kinetic pre-exponential factor used by rate; see the rate-unit convention below |
z_tube | SI.Length | m | H*(1 - z_head) | Active tube length |
dz | SI.Length | m | z_tube/N | Segment length |
N_tubes_x | Integer | 1 | integer(floor((L + pitch)/(D_tubes + pitch))) | Number of tubes along the reactor length |
N_tubes_y | Integer | 1 | integer(floor((W + pitch)/(D_tubes + pitch))) | Number of tubes along the reactor width |
N_tubes | Integer | 1 | N_tubes_x*N_tubes_y | Total number of tubes |
A_r | SI.Area | m2 | N_tubes*pi*(D_tubes - t_tubes)*z_tube | Catalyst-covered reaction area |
A_c | SI.Area | m2 | pi*(D_tubes/2)^2 | Cross-sectional area of one tube |
A_flow | SI.Area | m2 | N_tubes*A_c | Total flow area of all tubes |
A_s | SI.Area | m2 | 2*(H*L + W*L + H*W) | External heat-loss surface area |
z[N] | SI.Length | m | {dz*i - dz/2 for i in 1:N} | Segment centre positions measured from the inlet |
V_seg | SI.Volume | m3 | A_flow*dz | Gas volume per segment |
m_cat_seg | Real | g | W_cat*A_r/N | Catalyst mass per segment |
C_solid_seg | SI.HeatCapacity | J/K | N_tubes*pi*(D_tubes - t_tubes)*t_tubes*dz*rho_wall*cp_wall | Tube wall heat capacity per segment |
deltaG_0 | Real | J/mol | 95517 - 193.67*T_out_target - 0.035293*T_out_target^2 + 9.22*10e-6*T_out_target^3 | Reference Gibbs-energy expression used for equilibrium |
k_eq | Real | 1 | exp(-deltaG_0/R/T_out_target) | Equilibrium constant evaluated at the reference temperature |
rho_start | SI.Density | kg/m3 | p_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_nominal | Real | 1 | m_flow_nominal*D_tubes/(A_flow*mu_nominal) | Nominal Reynolds number |
f_nominal | Real | 1 | frictionFactor(Re_nominal) | Friction factor applied at all segment faces |
| Name | Direction | Interface | Unit | Description |
|---|---|---|---|---|
port_a | Nominal inlet; bidirectional | FluidPort_a | Pa; kg/s; J/kg | Feed pressure, mass flow, stream enthalpy, and composition; medium is AmmoniaMedium |
heatPorts[N] | Bidirectional thermal interface | HeatPorts_a | K; W | One 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.
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.
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.
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.
| Name | Direction | Interface | Unit | Description |
|---|---|---|---|---|
port_b | Nominal outlet; bidirectional | FluidPort_b | Pa; kg/s; J/kg | Outlet connection; outflow enthalpy and composition are calculated from segment N |
T[N] | Monitored state array | SI.Temperature | K | Segment temperatures |
P_tot[N] | Monitored array | SI.Pressure | Pa | Total segment pressures |
m_NH3[N], m_H2[N], m_N2[N] | Monitored state arrays | SI.Mass | kg | Species inventories per segment |
w_NH3[N], w_H2[N], w_N2[N] | Monitored arrays | SI.MassFraction | 1 | Segment species mass fractions |
mol_frac_NH3[N], mol_frac_H2[N], mol_frac_N2[N] | Monitored arrays | Real | 1 | Segment species mole fractions |
NH3_conversion[N] | Monitored array | Real | 1 | Defined as 1 - mol_frac_NH3[i]; a composition indicator, not a feed-referenced conversion |
R_NH3[N] | Monitored array | SI.MolarFlowRate | mol/s | Ammonia consumption rate per segment |
Q_rxn[N], Q_loss[N] | Monitored arrays | SI.HeatFlowRate | W | Reaction heat demand and ambient heat loss per segment |
m_flow_face[N + 1] | Monitored array | SI.MassFlowRate | kg/s | Mass flows at segment faces; positive in the nominal inlet-to-outlet direction |
m_flow_balance | Monitored variable | SI.MassFlowRate | kg/s | port_a.m_flow + port_b.m_flow - der(sum(m_tot)); total mass-balance residual |
T_in | Monitored variable | SI.Temperature | K | Temperature inferred from the incoming port_a stream |