**TYPE 74: GAS TANK**

**General Description**

This subroutine models a gas tank after /1/. The calculations can be either for a ideal gas (mode=1) or a gas that follows the Van-der-Waal equation for real gases (mode=2).

The gas pressure should be given in [bar] if SI-units are used.

**Nomenclature**

- A
_{gas}- Van-der-Waals constant if mode=2 (=25000 for hydrogen) [Nm4/kg2] - B
_{gas}- Van-der-Waals constant if mode=2 (=0.0267 for hydrogen) [m3/kg] - Dsfp - Warning is printed when storage is empty (capacity less than dsfp)or when storage is full (capacity greater than 1-dsfp)
- f - Capacity of tank (0.0=empty, 1.0=full)
- lud - Logical unit number for data file
- m - Gas mass in the tank
- m
_{gas}- Gas mass flow to the tank - Mode - 1 = ideal gas, 2 = real gas
- Mol - Molar mass of gas
- nstor - Storage number in data file
- p
_{gas }- Pressure in the tank - p
_{max}- Maximal allowed pressure in bar when SI units are used - V - Volume of tank
- T
_{gas}- Absolute Gas temperature in the tank

**Mathematical Description**

__Ideal Gas (mode 1):__

__Real Gas (mode 2):__

(a_{gas} = 25000. for hydrogen)

(b_{gas} = 0.0267 for hydrogen)

**TRNSYS Component Configuration**

__PARAMETER NO.__ __DESCRIPTION__

1: pmax - Maximal allowed pressure

2: V - volume of tank

3: nstor - Storage number in data file

4: lud - logical unit number for data file

__INPUT NO.__ __DESCRIPTION__

1: m_{gas} - Gass mass flow rate to tank

2: T_{gas} - Absolute Gas temperature in the tank

__OUTPUT NO.__ __DESCRIPTION__

1: m_{gas} - Gass mass flow to the tank

2: m - Gas mass in the tank

3: p_{gas }- pressure in the tank

4: f - Capacity of tank (0.0=empty, 1.0=full)

__DERIVATIV NO.__ __DESCRIPTION__

1: m - Gas mass in the tank

**Informational Flow Diagrams**

**Data file input**

The data for the gas has to be given in a separate file. The first line in this file will give the number of gases given in the file. The for each different gas will have two lines; the first line will give the number of the gas in the file, the second line will give the data for the gas. The data file for the gas will be like this (the third line (P1-P5) should not be in the file, but are included here to show which data means what):

- 1,hydrogen
- 2 2.016 0.005 25000 0.0267
- P1 P2 P3 P4 P5

OUTPUT to file logical unit 6 will look like this:

- Parameters from file to Storage tank, unit 30:
- mode = 2 mol = 2.0160E+00 dfsp = 5.0000E-03
- agas = 2.5000E+04 bgas = 2.6700E-02

**References**

/1/ F. Steinhardt, Photovoltaische Energieversorgung f9r ein

Wohnhaus, Studienarbeit, FhG-ISE Freiburg, 1988