Features & Methodology

What each module models, the analysis that contributes to its results, and how it feeds the next stage

Engineering estimates only — not safety certification or code compliance. Results must be independently validated by a qualified engineer.

Shared engineering engine

Every module draws from one shared library (units, chemistry, transport, mass balance, sizing, scenarios). Inputs normalize to SI once, then flow through the same calculation path: reactions build the generation function, the filter supplies a transport sink, the mass-balance solver couples them over time, and the sizer converts the result into a filter count and a status. This keeps results traceable and unit-consistent across pages.

Inputs modeled
  • Total & gas (headspace) volume
  • Temperature, inside & outside pressure
  • Initial, external, and maximum allowable H₂ (x_max)
  • Analysis duration
Analysis that contributes to the result
  • All inputs normalize to SI via the units engine (volume→m³, pressure→Pa, temperature→K).
  • Gas-phase total moles from the ideal-gas relation: n_total = P·V_gas / (R·T).
  • Concentration units (mole fraction, mole %, ppm, mol/m³) all convert to a common mole fraction using P and T, so thresholds are comparable across unit systems.
  • x_max is the hard ceiling used by every downstream status check — it is the maximum allowable H₂ mole fraction inside the enclosure.
Feeds downstream

Provides boundary conditions (n_total, x_initial, x_external, x_max, T, P) to the mass-balance solver used by Sizing, Scenarios, Comparison, and Sensitivity.

Inputs modeled
  • Chemical equation (e.g. 2Al + 6HCl → 2AlCl₃ + 3H₂)
  • Reaction type (stoichiometric / rate-based / hybrid)
  • Efficiency, rate (+ unit), duration
  • Reactant amounts (mol)
Analysis that contributes to the result
  • A formula parser resolves element counts (incl. nested parentheses) and molecular weights from an IUPAC 2021 periodic table subset.
  • Stoichiometric mode: limiting-reactant yield — for each reactant, possible H₂ = (amount / coef) × H₂-coef × efficiency; the minimum wins.
  • Rate-based mode: total H₂ = rate (converted to mol/s) × duration.
  • Hybrid mode: the rate caps the stoichiometric total — total = min(stoich_yield, rate × duration).
  • Each reaction becomes a constant generation rate (total / duration) that is active only while t ≤ duration.
Feeds downstream

Builds the generation function ṅ_gen(t) = Σ reaction rates × scale, which is the source term in the mass-balance ODE.

Inputs modeled
  • All reaction records in the project
  • Container pressure & temperature (for volumetric conversion)
Analysis that contributes to the result
  • Sums per-reaction H₂ output to give cumulative production (mol) and peak generation rate (mol/s).
  • Converts the molar rate into multiple engineering flow units (mol/s, g/s, kg/hr, SLPM, standard m³/hr) using the ideal-gas reference conditions set in Settings.
  • Compares actual gas volume at container P/T against the standard-reference volume so users see the difference between operating and STP flow.
Feeds downstream

Surfaces the required capacity (ṅ_req = ṅ_gen at t=0) that Sizing uses to compute filter count and capacity margin.

Inputs modeled
  • Geometry: surface area, effective area, diameter, depth, membrane thickness, pore size
  • Porous structure: porosity, tortuosity, number of layers
  • Transport properties: diffusion coefficient, permeability, permeance, mole-fraction conductance, manufacturer H₂ transmission rate
  • Ratings: pressure rating, temperature range, source, datasheet, test method
Analysis that contributes to the result
  • Each property keeps its own unit and is converted to SI only when consumed by the transport engine.
  • availableModels() reports which transport models a filter can support based on which properties are present.
  • recommendModel() applies a data-richness decision tree (manufacturer → permeability/permeance → diffusion → mole-fraction).
  • A filter is never silently extrapolated beyond its data — missing properties produce an explicit "insufficient data" result, not a guess.
Feeds downstream

Supplies the filter object (geometry + transport coefficients) to every transport, sizing, and comparison calculation.

Inputs modeled
  • A filter from the catalog
  • Operating conditions (T, P_inside, P_outside, x_inside, x_outside)
  • Selected transport model
Analysis that contributes to the result
  • mole_fraction: ṅ = Gx · Δx (device-level conductance, not a diffusion coefficient).
  • diffusion (Fickian): J = D·ΔC / L; ṅ = J·A_eff, where ΔC comes from the ideal-gas concentration.
  • porous: D_eff = D·ε/τ, then Fickian with the effective diffusion coefficient.
  • permeability: J = Perm·Δp_H₂ / L; ṅ = J·A_eff (pressure-driven).
  • permeance: J = Permeance·Δp_H₂; thickness is already embedded, so it is not reapplied.
  • manufacturer: uses the rated H₂ transmission at stated test conditions — no temperature or pressure extrapolation.
  • Driving forces, partial pressures, concentrations, effective area, and diffusion path are all reported in the calculation trace. The diffusion path is NOT assumed equal to filter depth or membrane thickness.
Feeds downstream

Returns ṅ_transport(x) — the per-filter removal rate as a function of current mole fraction — which is the sink term in the mass-balance ODE and the per-filter capacity used for sizing.

Inputs modeled
  • Container, reactions, one filter
  • Selected transport model
  • Number of filters installed
  • Design margin
Analysis that contributes to the result
  • Per-filter capacity is evaluated at x_max (the maximum driving force), not at zero concentration — this is the conservative sizing point.
  • Theoretical minimum = ⌈ṅ_req / perFilter⌉; design count = ⌈(ṅ_req × (1 + margin)) / perFilter⌉.
  • Capacity margin = (N·perFilter − ṅ_req) / ṅ_req × 100%.
  • A transient mass balance (RK4) integrates dN_H₂/dt = ṅ_gen(t) − (N−failed)·filterScale·ṅ_transport(x(t)) to find the peak mole fraction.
  • Status: MEETS CALCULATION CRITERION if peak ≤ 0.80·x_max, NEAR THRESHOLD if ≤ x_max, EXCEEDS CALCULATION CRITERION if > x_max.
Feeds downstream

Produces the status badge, peak H₂, capacity margin, and concentration margin shown across Sizing, Scenarios, Comparison, and Reports.

Inputs modeled
  • Production scale (e.g. 1.5×)
  • Failed filter count
  • Filter degradation (filterScale)
  • Number of filters
  • Transport model
Analysis that contributes to the result
  • Each scenario overrides the base config and re-runs the full evaluateScenario pipeline (transport + RK4 mass balance + sizing).
  • Built-in templates cover normal, high-production (+10% to +100%), one/two filters failed, degradation (10%/25%), and a combined worst case.
  • Peak H₂, time-to-threshold, steady-state flag, and both margins are recomputed per scenario.
  • Each scenario row shows a description block: what it represents, how its result is defined, and the key math.
Feeds downstream

Provides the saved scenario set that Comparison and Reports aggregate.

Inputs modeled
  • Any saved scenarios (checkbox selection)
Analysis that contributes to the result
  • Re-evaluates every selected scenario through the same engine so the comparison is apples-to-apples.
  • Charts peak H₂ (with the x_max reference line), concentration margin, capacity margin, transport per filter, filter count, and time-to-threshold.
  • Bars are color-coded by status (green / amber / red) so the comparison communicates pass/fail at a glance.
Feeds downstream

No downstream feed — it is a decision-support view for choosing between scenarios.

Inputs modeled
  • All catalog filters
  • Transport model (auto or specific)
  • Filters installed, design margin
  • Sort criterion
Analysis that contributes to the result
  • In Auto mode, each filter is evaluated across all models it supports and the best capacity margin is kept (optimizeFilters).
  • In specific-model mode, every filter is evaluated with that one model so the comparison is strictly on filter geometry/properties.
  • Reports transport/filter, theoretical min, design count, peak H₂, concentration margin, capacity margin, and status per filter, ranked by the chosen sort.
Feeds downstream

No downstream feed — it is a selection-support view for choosing a filter type.

Inputs modeled
  • All catalog filters
  • Base scenario config
  • Sort criterion
Analysis that contributes to the result
  • Runs optimizeFilters across all filters and all available models, keeping the best model per filter.
  • Sorts the ranked list by the selected objective and surfaces the best-performing configuration.
  • Exposes the model chosen for each filter so the user can see which physics produced the ranking.
Feeds downstream

No downstream feed — it is a recommendation view for the best filter/model pairing.

Inputs modeled
  • A base scenario
  • A parameter to sweep
  • A range of values
Analysis that contributes to the result
  • For each value in the range, the base config is mutated and evaluateScenario is re-run, recording peak H₂ and transport.
  • Results are plotted as value-vs-result curves and ranked by relative influence on peak H₂.
  • Identifies the dominant design variables so engineering effort can focus on the inputs that matter.
Feeds downstream

No downstream feed — it is a risk-prioritization view.

Inputs modeled
  • Project, container, reactions, filters, scenarios
Analysis that contributes to the result
  • Re-runs the evaluation and serializes project info, operating conditions, reaction details, transport properties, sizing results, and the disclaimer/assumptions.
  • Exports as TXT, CSV, or JSON for hand-off to a reviewing engineer.
  • Carries the engineering disclaimer forward so the export cannot be mistaken for a safety certification.
Feeds downstream

No downstream feed — it is the documentation artifact of the analysis.

Math highlights behind every result

Unit normalization
Every input converts to SI through the units engine before any calculation. Temperature, pressure, volume, length, area, diffusion, and concentration all share one conversion path, so mixed unit systems produce consistent results.
Generation function
ṅ_gen(t) = Σ (reaction H₂ total / duration) × production_scale, active while t ≤ duration. Stoichiometric yields use limiting-reactant logic; rate-based and hybrid modes cap or replace the stoichiometric total.
Transport sink
ṅ_transport(x) is model-specific: Fickian (D·ΔC/L·A), porous (D·ε/τ·ΔC/L·A), permeability (Perm·Δp/L·A), permeance (Permeance·Δp·A), mole-fraction conductance (Gx·Δx), or manufacturer-rated. No generic T/P multiplier is ever applied.
Transient mass balance (RK4)
dN_H₂/dt = ṅ_gen(t) − (N−failed)·filterScale·ṅ_transport(x(t)), with x = N_H₂ / N_total and N_total from the ideal-gas law. A 4th-order Runge–Kutta integrator produces the concentration time series, peak, and time-to-threshold.
Sizing at x_max
Per-filter capacity is evaluated at x_max (maximum driving force), not at zero concentration. Design count = ⌈(ṅ_req × (1 + margin)) / perFilter⌉; capacity margin = (N·perFilter − ṅ_req) / ṅ_req × 100%.
Status logic
Peak H₂ from the transient run is compared to x_max: MEETS CALCULATION CRITERION if peak ≤ 0.80·x_max, NEAR THRESHOLD if ≤ x_max, EXCEEDS CALCULATION CRITERION if > x_max. Results are never labeled simply "safe".