Top-level parameters define the process initial conditions, cracker discretization, and feed and cooling controls. Types abbreviated as SI refer to Modelica.Units.SI. Mass-fraction vectors use the order {NH3, H2, N2}.
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
P_H2_tank_set | SI.Pressure | Pa | 20e5 | Hydrogen buffer-tank pressure target |
P_H2_tank_start | SI.Pressure | Pa | P_H2_tank_set*0.99 | Initial hydrogen tank pressure and reference for downstream process initialization |
dpdt_set | Real | Pa/s | 1e4 | Rate of change of the hydrogen tank pressure target |
P_NH3_tank_start | SI.Pressure | Pa | 15e5 | Initial ammonia storage-tank pressure |
P_out_PSA | SI.Pressure | Pa | P_H2_tank_start | PSA tail-boundary pressure and reference for cracker and cooler initialization |
T_out_target | SI.Temperature | K | 550 + 273.15 | Cracker outlet temperature target; also sets vaporizer initial temperature to T_out_target - 50 |
T_start | SI.Temperature | K | 550 + 273.15 | Initial temperature of the cracker and cooler |
T_NH3_tank | SI.Temperature | K | 20 + 273.15 | Declared ammonia tank temperature parameter; currently not connected to a component modifier. The tank uses T_start = 293.15 K. |
X_start[3] | SI.MassFraction | 1 | {0.98, 0.01, 0.01} | Initial composition of the ammonia tank and vaporizer |
X_start_cracker[3] | SI.MassFraction | 1 | {0.01, 0.01, 0.98} | Initial composition of the cracker and cooler |
N | Integer | 1 | 10 | Number of cracker computational segments and distributed heater ports |
P_vap_start | SI.Pressure | Pa | P_out_PSA + 2*dp_inlet_start + dp_check_valve_start | Initial vaporizer pressure including header and check-valve losses |
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
dp_distributor | SI.Pressure | Pa | 0.2e5 | Nominal pressure drop of each cracker inlet and outlet header |
dp_small | SI.Pressure | Pa | 10 | Regularization pressure for the cracker flow law |
dp_check_valve_nominal | SI.Pressure | Pa | 3e4 | Nominal pressure drop of the ammonia feed check valve |
m_feed_max | SI.MassFlowRate | kg/s | 0.05 | Cracker design flow and nominal flow for pressure-loss sizing; not the pump command limit |
m_feed_control_max | SI.MassFlowRate | kg/s | 0.02 | Upper limit of the ammonia feed-controller output |
m_feed_control_min | SI.MassFlowRate | kg/s | m_feed_control_max/2 | Lower limit of the ammonia feed-controller output; also the default initial feed command |
m_feed_start | SI.MassFlowRate | kg/s | m_feed_control_min | Initial feed command and reference flow for pressure initialization |
dp_feed_control | SI.Pressure | Pa | 0.2e5 | Pressure-error scale used to set feed-controller proportional gain |
T_filter | SI.Time | s | 1 | Hydrogen tank pressure measurement filter time constant |
T_feed | SI.Time | s | 1 | Ammonia pump command filter time constant |
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
T_cool_target | SI.Temperature | K | 80 + 273.15 | Cracked-gas temperature target upstream of the PSA |
Q_cool_max | SI.HeatFlowRate | W | 1e6 | Maximum magnitude of cooling heat removal |
k_cool | Real | W/K | 2e3 | Cooler PI-controller proportional gain |
Ti_cool | SI.Time | s | 20 | Cooler PI-controller integral time |
dp_cooler_nominal | SI.Pressure | Pa | 1e4 | Linear (laminar) cooler pressure drop at m_feed_max. PSASimple has no storage and sets its feed pressure equal to the H2 tank pressure. Without a finite cooler resistance (the default pipe friction gives about 0.05 Pa), the cooler volume and H2 tank form a stiff pressure mode. At the 40 s purge-valve events this produces step-to-step flow ringing of about ±0.35 kg/s, including reverse flow. |
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
k_heater | Real | W/K | 2e3 | Proportional gain of the inner heater PI controller (bed-mean temperature) |
Ti_heater | SI.Time | s | 150 | Integral time of the inner heater PI controller |
k_heater_out | Real | 1 | 1 | Proportional gain of the outer outlet-temperature PI controller |
Ti_heater_out | SI.Time | s | 200 | Integral time of the outer outlet-temperature PI controller |
dT_bed_start | SI.TemperatureDifference | K | 0 | Initial offset of the bed-mean set-point from T_out_target |
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
y_inlet_start | Real | - | m_feed_start/m_feed_max*sqrt(dp_distributor) | Final auxiliary parameter for inversion of the regularized header flow law |
dp_inlet_start | SI.Pressure | Pa | y_inlet_start*sqrt(0.5*(y_inlet_start^2 + sqrt(y_inlet_start^4 + 4*dp_small^2))) | Final initial pressure drop across each cracker header |
dp_check_valve_start | SI.Pressure | Pa | dp_check_valve_nominal*m_feed_start/m_feed_max | Final initial pressure drop across the feed check valve |
This is a self-contained example with no external signal inputs or physical connectors. The electrical load is prescribed internally: resistance decreases linearly from 0.1 to 0.005 ohm between 20 and 40 s, increasing fuel-cell demand. Component-level settings include a total vaporizer heat input of 70 kW, a 5 m3 hydrogen buffer tank, and a PSA separation efficiency of 0.9. Like the cooler, the vaporizer uses one dynamic fluid node with modelStructure = av_b. A single prescribed heat source supplies the full 70 kW through heatPorts[1]. The pipe geometry and total fluid volume are unchanged. Dynamic mass storage is retained, so inlet and outlet mass flows can differ while the fluid inventory changes.
This example represents an ammonia-to-electricity system for ship power-system studies. It couples ammonia storage and feed conditioning, catalytic ammonia decomposition, gas cooling, simplified pressure-swing adsorption (PSA), hydrogen buffering, and a hydrogen fuel-cell system supplying a variable resistive load.
Ammonia-rich gas is drawn from the storage tank by a controlled pump, heated in the vaporizer pipe, and passed through a check valve into the segmented AmmoniaCrackerDyn. A distributed electric heater supplies heat to the endothermic cracking process. The cracked gas is cooled before entering PSASimple; the separated hydrogen enters the fuel-cell system's buffer tank, while the tail stream is discharged to a fixed-pressure boundary.
The ammonia feed PI controller compares a ramped hydrogen tank pressure target with a filtered pressure measurement. Its bounded output passes through a first-order filter before commanding the pump. A separate PI controller removes heat from the cooler to approach the PSA inlet temperature target; it cannot add heat. The fuel-cell assembly includes hydrogen pressure reduction, recirculation and purge, cathode air supply, cooling, and a battery supplying balance-of-plant equipment.
The cracker heater uses feed-forward plus a cascade. The feed-forward term Q_heater_ff supplies the reaction heat expected at the commanded NH3 feed. The inner PI controller trims this to hold the mean bed temperature, which responds quickly to heater changes. A slow outer PI controller shifts the bed-mean set-point so that the outlet temperature reaches T_out_target. Controlling the outlet temperature directly causes a limit cycle at low feed: when the heat supply is short, a cold reaction zone moves through the bed and reaches the outlet only after 150-200 s.
The model is intended to explore coupled process and electrical transients, controller interactions, and the effect of load changes on hydrogen inventory. The media and separation models are simplified system-level representations. In particular, the vaporizer uses the cracked-ammonia gas medium rather than an explicit liquid-to-vapor phase-change model. Initial conditions describe a preheated process, not a complete cold-start sequence.
Representative top-level relations are shown below. Component balance equations and fluid, thermal, and electrical connections define the complete system.
2 NH3 -> 3 H2 + N2 feedController.k = m_feed_control_max/dp_feed_control m_feed_control_min <= feedController.y <= m_feed_control_max -Q_cool_max <= coolController.y <= 0 fcs.subSystemHydrogen.reducer.dp_nominal = P_H2_tank_start - fcs.p_H2_set power_net = fcs.Power_system - electricHeatingDistr.PI_heater.y Q_heater_ff = max(0, feedController.y)*X_start[1]*deltaH_rxn/MM_NH3 PI_heater: u_s = T_out_target + outerPI.y, u_m = mean(ammoniaCracker.T), u_ff = Q_heater_ff outerPI: u_s = T_out_target, u_m = temp_out_cracker.T
The hydrogen reducer is sized at its nominal flow using the difference between the initial buffer-tank pressure and the anode pressure set-point. Net electrical power subtracts the distributed cracker heater demand from the fuel-cell system power, which already accounts for its balance-of-plant consumption. The separate vaporizer heat source and ammonia-pump power supply are not deducted in this expression.
See AmmoniaCrackerDyn, ElectricHeatingDistr, PSASimple, and FuelCellSystem for the component formulations.
No top-level output connectors are declared. The following variables and component signals are available for result inspection.
| Name | Direction | Interface | Unit | Description |
|---|---|---|---|---|
power_net | Monitored variable | SI.Power | W | Fuel-cell system power minus distributed cracker heater demand |
fcs.Power_system | Monitored variable | SI.Power | W | Fuel-cell power after balance-of-plant consumption |
p_H2_tank.p | Component signal | RealOutput | Pa | Hydrogen buffer-tank pressure |
temp_in_cracker.T | Component signal | RealOutput | K | Cracker inlet temperature |
temp_out_cracker.T | Component signal | RealOutput | K | Cracker outlet temperature used by the distributed heater control |
temp_in_psa.T | Component signal | RealOutput | K | Cooled gas temperature upstream of the PSA |
feedFilter.y | Component signal | RealOutput | kg/s | Filtered ammonia pump mass-flow command |
coolController.y | Component signal | RealOutput | W | Cooling heat-flow command, negative for heat removal |
electricHeatingDistr.PI_heater.y | Component signal | RealOutput | W | Distributed cracker heater power command |