diff --git a/src/tespy/connections/connection.py b/src/tespy/connections/connection.py index 3c58eeafe..7e1f8b09c 100644 --- a/src/tespy/connections/connection.py +++ b/src/tespy/connections/connection.py @@ -36,6 +36,7 @@ from tespy.tools.fluid_properties import viscosity_mix_ph from tespy.tools.fluid_properties.functions import dT_mix_ph_dfluid from tespy.tools.fluid_properties.functions import p_sat_T +from tespy.tools.fluid_properties.helpers import get_mixture_temperature_range from tespy.tools.fluid_properties.helpers import get_number_of_fluids from tespy.tools.global_vars import ERR from tespy.tools.global_vars import fluid_property_data as fpd @@ -917,7 +918,15 @@ def calc_results(self): ) logger.error(msg) _converged = False - + else: + _, Tmax = get_mixture_temperature_range(self.fluid_data) + if self.T.val_SI > Tmax: + msg = ( + "The temperature value of the mixture is above the " + "upper temperature limit of a mixture component. " + "The resulting temperature might not be erroneous." + ) + logger.warning(msg) else: try: if not self.x.is_set: diff --git a/src/tespy/tools/fluid_properties/helpers.py b/src/tespy/tools/fluid_properties/helpers.py index 27740208a..155c5cfa6 100644 --- a/src/tespy/tools/fluid_properties/helpers.py +++ b/src/tespy/tools/fluid_properties/helpers.py @@ -70,6 +70,8 @@ def inverse_temperature_mixture(p=None, target_value=None, fluid_data=None, T0=N if T0 is None: T0 = (valmin + valmax) / 2.0 + valmax *= 2 + function_kwargs = { "p": p, "fluid_data": fluid_data, "T": T0, "function": f, "parameter": "T" , "delta": 0.01 diff --git a/tests/test_components/test_combustion.py b/tests/test_components/test_combustion.py index 7912781fb..b8290babd 100644 --- a/tests/test_components/test_combustion.py +++ b/tests/test_components/test_combustion.py @@ -9,9 +9,10 @@ SPDX-License-Identifier: MIT """ - import shutil +import pytest + from tespy.components import CombustionChamber from tespy.components import CombustionEngine from tespy.components import DiabaticCombustionChamber @@ -103,6 +104,20 @@ def test_CombustionChamber(self): str(round(self.c3.fluid.val['O2'], 4)) + '.') assert 0.0 == round(self.c3.fluid.val['O2'], 4), msg + def test_CombustionChamberHighTemperature(self): + instance = CombustionChamber('combustion chamber') + self.setup_CombustionChamber_network(instance) + + # connection parameter specification + air = {'N2': 0.8, 'O2': 0.2} + fuel = {'CH4': 1} + self.c1.set_attr(fluid=air, p=1, T=30, m=1) + self.c2.set_attr(fluid=fuel, T=30) + instance.set_attr(lamb=1) + self.nw.solve('design') + self.nw._convergence_check() + assert self.c3.T.val_SI == pytest.approx(2110, abs=0.1) + def test_DiabaticCombustionChamber(self): """ Test component properties of diabatic combustion chamber. diff --git a/tests/test_networks/test_binary_incompressible.py b/tests/test_networks/test_binary_incompressible.py index c5aa7be94..9683e71cd 100644 --- a/tests/test_networks/test_binary_incompressible.py +++ b/tests/test_networks/test_binary_incompressible.py @@ -51,4 +51,4 @@ def setup_method(self): self.nw.solve("design") def test_binaries(self): - self.nw._convergence_check() \ No newline at end of file + self.nw._convergence_check()