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

Agas - Van-der-Waals constant if mode=2 (=25000 for hydrogen) [Nm4/kg2]
Bgas - 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
mgas - Gas mass flow to the tank
Mode - 1 = ideal gas, 2 = real gas
Mol - Molar mass of gas
nstor - Storage number in data file
pgas - Pressure in the tank
pmax - Maximal allowed pressure in bar when SI units are used
V - Volume of tank
Tgas - Absolute Gas temperature in the tank

 

Mathematical Description

Ideal Gas (mode 1):

 

Real Gas (mode 2):

 

(agas = 25000. for hydrogen)

(bgas = 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: mgas - Gass mass flow rate to tank

2: Tgas - Absolute Gas temperature in the tank

 

OUTPUT NO. DESCRIPTION

1: mgas - Gass mass flow to the tank

2: m - Gas mass in the tank

3: pgas - 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