Add combustion gasses dynamically
General
Implement a dynamic method to add combustion gasses (#760) . Therefore a new class COMBUSTION_GASES is created which is defined, initialized and located in global_vars. With the method "add_fluids" new combustion gasses can be added.
Example
An example from the turbine example from the documentation:
from tespy.networks import Network
from tespy.components import (
DiabaticCombustionChamber, Turbine, Source, Sink, Compressor,
)
from tespy.connections import Connection
from tespy.tools.global_vars import combustion_gases
#add a fluid with the heat of formation in kJ/mol:
combustion_gases.add_fluid('ethanol', hf=-2.3495E+02)
# or direct the heat of combustion value in J/mol:
combustion_gases.add_fluid('acetone', LHV=1.659E+06)
nw = Network()
nw.units.set_defaults(temperature="degC", pressure="bar", heat="MW", power="MW")
cp = Compressor("Compressor")
cc = DiabaticCombustionChamber("combustion chamber")
tu = Turbine("turbine")
air = Source("air source")
fuel = Source("fuel source")
fg = Sink("flue gas sink")
c2 = Connection(air, "out1", cc, "in1", label="2")
c3 = Connection(cc, "out1", fg, "in1", label="3")
c5 = Connection(fuel, "out1", cc, "in2", label="5")
nw.add_conns(c2, c3, c5)
cc.set_attr(pr=1, eta=1, lamb=1.5, ti=10)
c2.set_attr(
p=1, T=20,
fluid={"Ar": 0.0129, "N2": 0.7553, "CO2": 0.0004, "O2": 0.2314}
)
c5.set_attr(p=1, T=20, fluid={"CO2": 0.04, "ethanol": 0.96, "H2": 0})
nw.solve(mode="design")
nw.print_results()
nw2 = Network()
nw2.units.set_defaults(temperature="degC", pressure="bar", heat="MW", power="MW")
cp = Compressor("Compressor")
cc = DiabaticCombustionChamber("combustion chamber")
tu = Turbine("turbine")
air = Source("air source")
fuel = Source("fuel source")
fg = Sink("flue gas sink")
c2 = Connection(air, "out1", cc, "in1", label="2")
c3 = Connection(cc, "out1", fg, "in1", label="3")
c5 = Connection(fuel, "out1", cc, "in2", label="5")
nw2.add_conns(c2, c3, c5)
cc.set_attr(pr=1, eta=1, lamb=1.5, ti=10)
c2.set_attr(
p=1, T=20,
fluid={"Ar": 0.0129, "N2": 0.7553, "CO2": 0.0004, "O2": 0.2314}
)
c5.set_attr(p=1, T=20, fluid={"CO2": 0.04, "acetone": 0.96, "H2": 0})
nw2.solve(mode="design")
nw2.print_results()
ToDo
- [ ] documentation
- [ ] testing
Questions and Comments
- Right now the heat of formation needs to be passed in kJ/mol and heat of combustion in J/mol. This might be unified to SI, I just used the units as it was before.
- The resulting flue gas temperatures in the example varies greatly (Ethanol= 1545°C and Acetone = 122°C). I might miss a point but that seems a too high difference for me. So that should be validaded and if necessary debuged.
Hi Hannes, thank you for opening this up! I will have a look :). I think, the LHV should be specified per kg. Dividing the LHV of acetone by its molar mass yields ~1540 °C outlet temperature, which seems more reasonable. Thinking more about it, all the processing of the LHVs etc. could be externalized from the component to that class...
I will be out of office for a bit of time, will come back in about two weeks :)!