# Hydrogen Tank

The DISPATCHES Hydrogen Tank Model represents a quasi steady state implementation of a compressed hydrogen gas tank. This tank model supports tank filling and emptying operations for a fixed duration assuming a constant flow.

## Degrees of Freedom

The Hydrogen Tank Model has 5 degrees of freedom and they are previous state variables (temperature and pressure), tank dimensions (tank diameter and tank length), and time duration. In addition, the model needs a defined inlet-state and an operating scenario in terms of the outlet flow (e.g., outlet flow = 0 when tank is filled). By default, the tank is set to be adiabatic by fixing heat duty = 0.

## Model Structure

The Hydrogen Tank Model consists of a single ControlVolume0D (named control_volume) with 2 states (properties_in and properties_out) and 2 ports (named inlet and outlet). In addition, the tank model has another state named previous_state that denotes the state of the tank at the beginning of time period given by dt. The tank model then computes holdup terms integrated over the time dt. Custom material and energy balance are written to account for integrated holdup terms. Finally, an internal energy balance computes the outlet temperature.

## Governing Equations

previous_state material holdup rule:

$M_{prev, t, p , j} = V_{t} \times y_{t, p} \times \rho_{prev, t, p, j}$

previous_state energy holdup rule:

$M_{prev, t, p , j} = \sum_j{M_{prev, t, p, j}} \times U_{prev, t, p}$

Material balance equation:

$dM_{t, p , j} = F_{in, t, p, j} - F_{out, t, p, j}$

Material holdup calculation:

$M_{t, p , j} = V_{t} \times y_{t, p} \times \rho_{out, t, p, j}$

Material holdup integration over the time step $$dt$$ :

$M_{t, p , j} = dt_{t} \times dM_{t, p, j} + M_{prev, t, p, j}$

Internal enery balance at the end of time step $$dt$$ :

$E_{t, p} = E_{prev, t, p} + dt_{t} \times (F_{in, t, p, j} \times H_{in, t, p, j} - F_{out, t, p, j} \times H_{out, t, p, j})$

Energy holdup calculation:

$E_{t, p} = \sum_j{M_{t, p, j}} \times U_{t, p}$

Energy accumulation:

$\sum_p{dE_{t, p}} \times dt_{t} = \sum_p{E_{t, p}} - \sum_p{E_{t, p}}$

where, $$rho_{t, p}$$ is the density term $$U_{t, p, j}$$ is the specific internal energy term $$E_{t, p}$$ is the energy holdup term $$y_{t, p}$$ is the phase fraction $$H_{in, t, p, j}$$ is the specific inlet enthalpy $$H_{out, t, p, j}$$ is the specific outlet enthalpy $$F_{in, t, p, j}$$ is the inlet flow $$F_{out, t, p, j}$$ is the outlet flow

## Variables Used

The Hydrogen Tank Model uses the follow variables:

Variable

Name

Notes

$$V_{t}$$

volume

tank volume

$$Q_{t}$$

heat_duty

heat duty (default = 0,i.e., adiabatic)

$$D$$

tank_diameter

diameter of tank

$$L$$

tank_length

length of tank

$$dt_{t}$$

dt

time step

$$dM_{t, p, j}$$

material_accumulation

average material accumulation term over $$dt$$

$$dE_{t, p}$$

energy_accumulation

average energy accumulation term over $$dt$$

$$M_{t, p, j}$$

material_holdup

material holdup

$$E_{t, p}$$

energy_holdup

energy holdup

$$M_{prev, t, p, j}$$

previous_material_holdup

previous state material holdup

$$E_{prev, t, p}$$

previous_energy_holdup

previous state energy holdup

class dispatches.unit_models.hydrogen_tank.HydrogenTank(*args, **kwds)

Simple compressed hydrogen tank model

Parameters
• rule (function) – A rule function or None. Default rule calls build().

• concrete (bool) – If True, make this a toplevel model. Default - False.

• ctype (class) –

Pyomo ctype of the block. Default - pyomo.environ.Block

Config args
dynamic

Indicats if Hydrogen tank model is dynamic, default = False. Equilibrium Reactors do not support dynamic behavior.

has_holdup

Indicates whether holdup terms should be constructed or not. default - False. Hydrogen tank model uses custom equations for holdup.

momentum_balance_type

Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

property_package

Property parameter object used to define property calculations, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PhysicalParameterObject - a PhysicalParameterBlock object.}

property_package_args

A ConfigBlock with arguments to be passed to a property block(s) and used when constructing these, default - None. Valid values: { see property package for documentation.}

• initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.

• idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.

Returns

(HydrogenTank) New instance