ThermoSim 3.2.0__tar.gz → 3.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {thermosim-3.2.0/ThermoSim.egg-info → thermosim-3.2.1}/PKG-INFO +1 -1
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/__init__.py +1 -1
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/heat_exchangers.py +2 -2
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/model.py +20 -1
- {thermosim-3.2.0 → thermosim-3.2.1/ThermoSim.egg-info}/PKG-INFO +1 -1
- {thermosim-3.2.0 → thermosim-3.2.1}/pyproject.toml +1 -1
- {thermosim-3.2.0 → thermosim-3.2.1}/setup.py +1 -1
- {thermosim-3.2.0 → thermosim-3.2.1}/CHANGELOG.md +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/LICENSE +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/MANIFEST.in +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/README.md +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/analysis.py +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/base_component.py +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/config.py +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/heat_exchangers_old.py +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/plotting.py +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/simple_components.py +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/state.py +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/turbomachinery.py +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim.egg-info/SOURCES.txt +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim.egg-info/dependency_links.txt +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim.egg-info/requires.txt +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim.egg-info/top_level.txt +0 -0
- {thermosim-3.2.0 → thermosim-3.2.1}/setup.cfg +0 -0
|
@@ -365,7 +365,7 @@ class HeatExchanger(Component):
|
|
|
365
365
|
# ════════════════════════════════════════════════════════════════════
|
|
366
366
|
# CASES involving one mass-flow unknown + one enthalpy
|
|
367
367
|
# ════════════════════════════════════════════════════════════════════
|
|
368
|
-
|
|
368
|
+
sign_factor = 1
|
|
369
369
|
# H_hi unknown, mh known, mc known → free: mh, derive H_hi
|
|
370
370
|
if unknowns == frozenset({'H_hi', 'mh'}):
|
|
371
371
|
Q_c = mc * (CO.H - CI.H)
|
|
@@ -460,7 +460,7 @@ class HeatExchanger(Component):
|
|
|
460
460
|
except:
|
|
461
461
|
return 1e10*sign_factor # large penalty if state point is invalid
|
|
462
462
|
H_lo = self.Model.Prop(CO.fluid, StatePointName='_co_lo', T=CP.PropsSI('TMIN', CO.fluid), P=CO.P).H+1e-3
|
|
463
|
-
H_hi_bound = self.Model.Prop(CO.fluid, StatePointName='_co_hi', T=CP.PropsSI('
|
|
463
|
+
H_hi_bound = self.Model.Prop(CO.fluid, StatePointName='_co_hi', T=CP.PropsSI('TMAX', CO.fluid), P=CO.P).H-1e-3
|
|
464
464
|
sign_factor = _fun_sign_fac(f,H_lo,H_hi_bound)
|
|
465
465
|
try:
|
|
466
466
|
try:
|
|
@@ -176,6 +176,7 @@ class ThermodynamicModel:
|
|
|
176
176
|
3b. Other HeatExchanger types, sorted by hot-inlet T (descending)
|
|
177
177
|
4. Everything else
|
|
178
178
|
"""
|
|
179
|
+
from .heat_exchangers import HeatExchanger
|
|
179
180
|
self.enable_flow_propagation()
|
|
180
181
|
self.flow_graph_summary()
|
|
181
182
|
number_of_components = len(self.Component)
|
|
@@ -238,7 +239,25 @@ class ThermodynamicModel:
|
|
|
238
239
|
else:
|
|
239
240
|
breakFlag = 0
|
|
240
241
|
|
|
241
|
-
if breakFlag >=
|
|
242
|
+
if breakFlag >= 3:
|
|
243
|
+
for key, comp in ordered_components:
|
|
244
|
+
flag1 = True
|
|
245
|
+
try:
|
|
246
|
+
print("Try to solve: ", comp.ID)
|
|
247
|
+
if comp.Solution_Status == True:
|
|
248
|
+
flag1 = False
|
|
249
|
+
if isinstance(comp, HeatExchanger):
|
|
250
|
+
comp.PPT_graph = 1
|
|
251
|
+
comp.Cal()
|
|
252
|
+
print(f'{comp.ID} is solved')
|
|
253
|
+
if comp.Solution_Status == True:
|
|
254
|
+
error_list.pop(key, None)
|
|
255
|
+
if flag1:
|
|
256
|
+
Solve_components += 1
|
|
257
|
+
solved_comp.append(str(key))
|
|
258
|
+
except Exception as e:
|
|
259
|
+
print(f"Can't solve {comp.ID}. {e}")
|
|
260
|
+
error_list[key] = str(e)
|
|
242
261
|
print(
|
|
243
262
|
f"Solver stopped because no new component is solved for "
|
|
244
263
|
f"3 consecutive iterations. "
|
|
@@ -11,7 +11,7 @@ except FileNotFoundError:
|
|
|
11
11
|
|
|
12
12
|
setup(
|
|
13
13
|
name='ThermoSim', # ← your PyPI package name
|
|
14
|
-
version='3.2.
|
|
14
|
+
version='3.2.1', # ← NEW version number
|
|
15
15
|
description='A Python package for thermodynamic cycle modelling and analysis',
|
|
16
16
|
long_description=long_description,
|
|
17
17
|
long_description_content_type='text/markdown',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|