VirtualFCS.Examples.Ships.NH3CrackerFCS

1. Parameters and inputs

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}.

Process conditions and initialization

NameTypeUnitDefaultDescription
P_H2_tank_setSI.PressurePa20e5Hydrogen buffer-tank pressure target
P_H2_tank_startSI.PressurePaP_H2_tank_set*0.99Initial hydrogen tank pressure and reference for downstream process initialization
dpdt_setRealPa/s1e4Rate of change of the hydrogen tank pressure target
P_NH3_tank_startSI.PressurePa15e5Initial ammonia storage-tank pressure
P_out_PSASI.PressurePaP_H2_tank_startPSA tail-boundary pressure and reference for cracker and cooler initialization
T_out_targetSI.TemperatureK550 + 273.15Cracker outlet temperature target; also sets vaporizer initial temperature to T_out_target - 50
T_startSI.TemperatureK550 + 273.15Initial temperature of the cracker and cooler
T_NH3_tankSI.TemperatureK20 + 273.15Declared ammonia tank temperature parameter; currently not connected to a component modifier. The tank uses T_start = 293.15 K.
X_start[3]SI.MassFraction1{0.98, 0.01, 0.01}Initial composition of the ammonia tank and vaporizer
X_start_cracker[3]SI.MassFraction1{0.01, 0.01, 0.98}Initial composition of the cracker and cooler
NInteger110Number of cracker computational segments and distributed heater ports
P_vap_startSI.PressurePaP_out_PSA + 2*dp_inlet_start + dp_check_valve_startInitial vaporizer pressure including header and check-valve losses

Feed flow and pressure control

NameTypeUnitDefaultDescription
dp_distributorSI.PressurePa0.2e5Nominal pressure drop of each cracker inlet and outlet header
dp_smallSI.PressurePa10Regularization pressure for the cracker flow law
dp_check_valve_nominalSI.PressurePa3e4Nominal pressure drop of the ammonia feed check valve
m_feed_maxSI.MassFlowRatekg/s0.05Cracker design flow and nominal flow for pressure-loss sizing; not the pump command limit
m_feed_control_maxSI.MassFlowRatekg/s0.02Upper limit of the ammonia feed-controller output
m_feed_control_minSI.MassFlowRatekg/sm_feed_control_max/2Lower limit of the ammonia feed-controller output; also the default initial feed command
m_feed_startSI.MassFlowRatekg/sm_feed_control_minInitial feed command and reference flow for pressure initialization
dp_feed_controlSI.PressurePa0.2e5Pressure-error scale used to set feed-controller proportional gain
T_filterSI.Times1Hydrogen tank pressure measurement filter time constant
T_feedSI.Times1Ammonia pump command filter time constant

Cooling control

NameTypeUnitDefaultDescription
T_cool_targetSI.TemperatureK80 + 273.15Cracked-gas temperature target upstream of the PSA
Q_cool_maxSI.HeatFlowRateW1e6Maximum magnitude of cooling heat removal
k_coolRealW/K2e3Cooler PI-controller proportional gain
Ti_coolSI.Times20Cooler PI-controller integral time
dp_cooler_nominalSI.PressurePa1e4Linear (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.

Cracker heater control

NameTypeUnitDefaultDescription
k_heaterRealW/K2e3Proportional gain of the inner heater PI controller (bed-mean temperature)
Ti_heaterSI.Times150Integral time of the inner heater PI controller
k_heater_outReal11Proportional gain of the outer outlet-temperature PI controller
Ti_heater_outSI.Times200Integral time of the outer outlet-temperature PI controller
dT_bed_startSI.TemperatureDifferenceK0Initial offset of the bed-mean set-point from T_out_target

Derived initialization parameters

NameTypeUnitDefaultDescription
y_inlet_startReal-m_feed_start/m_feed_max*sqrt(dp_distributor)Final auxiliary parameter for inversion of the regularized header flow law
dp_inlet_startSI.PressurePay_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_startSI.PressurePadp_check_valve_nominal*m_feed_start/m_feed_maxFinal initial pressure drop across the feed check valve

Inputs and input-side interfaces

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.

2. Model description

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.

3. Governing equations and references

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.

4. Outputs

No top-level output connectors are declared. The following variables and component signals are available for result inspection.

NameDirectionInterfaceUnitDescription
power_netMonitored variableSI.PowerWFuel-cell system power minus distributed cracker heater demand
fcs.Power_systemMonitored variableSI.PowerWFuel-cell power after balance-of-plant consumption
p_H2_tank.pComponent signalRealOutputPaHydrogen buffer-tank pressure
temp_in_cracker.TComponent signalRealOutputKCracker inlet temperature
temp_out_cracker.TComponent signalRealOutputKCracker outlet temperature used by the distributed heater control
temp_in_psa.TComponent signalRealOutputKCooled gas temperature upstream of the PSA
feedFilter.yComponent signalRealOutputkg/sFiltered ammonia pump mass-flow command
coolController.yComponent signalRealOutputWCooling heat-flow command, negative for heat removal
electricHeatingDistr.PI_heater.yComponent signalRealOutputWDistributed cracker heater power command

Contents