oemof / tespy

Thermal Engineering Systems in Python (TESPy). This package provides a powerful simulation toolkit for thermal engineering plants such as power plants, district heating systems or heat pumps.
https://tespy.readthedocs.io
MIT License
256 stars 80 forks source link

Almost stoichiometric combustion calculation with lambda=1.05 fails #471

Closed tub-hofmann closed 5 months ago

tub-hofmann commented 5 months ago

Simulating a simple combustion of methane using air as ideal mixture of oxygen and nitrogen.

First attempt with lambda=1.1 results in flue gas temperature of around 1700 °C.

But calculations for lambda=1.05 or lower values fail. That means stoichiometric combustion calculation is not possible.

Python-Code:

from tespy.networks import Network
from tespy.components import (Sink, Source, CombustionChamber)
from tespy.connections import Connection

# fluids
air = {'O2': 0.2, 'N2': 0.8}
fuel = {'CH4': 1}

# network
combustion = Network(T_unit='C', p_unit='bar', h_unit='kJ / kg', m_unit='kg / s')

# components
src_air = Source('air-source')
src_fuel = Source('fuel-source')
snk_fluegas = Sink('flue-gas-sink')
cmp_cc = CombustionChamber('combustion chamber')

# connection
c01 = Connection(src_air, 'out1', cmp_cc, 'in1')
c02 = Connection(src_fuel, 'out1', cmp_cc, 'in2')
c03 = Connection(cmp_cc, 'out1', snk_fluegas, 'in1')

combustion.add_conns(c01, c02, c03)

# parameters

# components
cmp_cc.set_attr(lamb=1.1)

# connections
c01.set_attr(p=1, T=25, fluid=air)
c02.set_attr(m=1, T=25, fluid=fuel)

# solve
combustion.solve(mode='design')
combustion.print_results()

cmp_cc.set_attr(lamb=1.05)
combustion.solve(mode='design')
combustion.print_results()
fwitte commented 5 months ago

Hi @tub-hofmann,

the reason for this is that the upper limit of the fluid property database for water is reached (2000 K). I will change the upper limit if possible and add a warning output in case the results are outside of the fluid's limits.

Best

fwitte commented 5 months ago

Should be fixed in the newly released version

tub-hofmann commented 5 months ago

The new warning text: "The resulting temperature might not be erroneous." is highly misleading. It should be something like: "The resulting temperature may have larger deviations compared to the tolerance specified in the corresponding substance property library."

fwitte commented 5 months ago

Ah... The not is a typo, I can fix it this week

fwitte commented 5 months ago

Fixed it and uploaded to pypi, thanks for reporting it!