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.
Files changed (24) hide show
  1. {thermosim-3.2.0/ThermoSim.egg-info → thermosim-3.2.1}/PKG-INFO +1 -1
  2. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/__init__.py +1 -1
  3. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/heat_exchangers.py +2 -2
  4. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/model.py +20 -1
  5. {thermosim-3.2.0 → thermosim-3.2.1/ThermoSim.egg-info}/PKG-INFO +1 -1
  6. {thermosim-3.2.0 → thermosim-3.2.1}/pyproject.toml +1 -1
  7. {thermosim-3.2.0 → thermosim-3.2.1}/setup.py +1 -1
  8. {thermosim-3.2.0 → thermosim-3.2.1}/CHANGELOG.md +0 -0
  9. {thermosim-3.2.0 → thermosim-3.2.1}/LICENSE +0 -0
  10. {thermosim-3.2.0 → thermosim-3.2.1}/MANIFEST.in +0 -0
  11. {thermosim-3.2.0 → thermosim-3.2.1}/README.md +0 -0
  12. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/analysis.py +0 -0
  13. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/base_component.py +0 -0
  14. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/config.py +0 -0
  15. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/heat_exchangers_old.py +0 -0
  16. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/plotting.py +0 -0
  17. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/simple_components.py +0 -0
  18. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/state.py +0 -0
  19. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim/turbomachinery.py +0 -0
  20. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim.egg-info/SOURCES.txt +0 -0
  21. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim.egg-info/dependency_links.txt +0 -0
  22. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim.egg-info/requires.txt +0 -0
  23. {thermosim-3.2.0 → thermosim-3.2.1}/ThermoSim.egg-info/top_level.txt +0 -0
  24. {thermosim-3.2.0 → thermosim-3.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ThermoSim
3
- Version: 3.2.0
3
+ Version: 3.2.1
4
4
  Summary: A Python package for thermodynamic cycle modelling and analysis
5
5
  Home-page: https://github.com/Nouman090/ThermoSim
6
6
  Author: Md. Waheduzzaman Basunia Nouman
@@ -13,7 +13,7 @@ Usage
13
13
  from ThermoSim.plotting import CyclePlotter
14
14
  from ThermoSim.analysis import SensitivityAnalyzer
15
15
  """
16
- __version__ = '3.2.0'
16
+ __version__ = '3.2.1'
17
17
 
18
18
  from .model import ThermodynamicModel
19
19
  from .state import Prop
@@ -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('MAX', CO.fluid), P=CO.P).H-1e-3
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 >= 4:
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. "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ThermoSim
3
- Version: 3.2.0
3
+ Version: 3.2.1
4
4
  Summary: A Python package for thermodynamic cycle modelling and analysis
5
5
  Home-page: https://github.com/Nouman090/ThermoSim
6
6
  Author: Md. Waheduzzaman Basunia Nouman
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ThermoSim"
7
- version = "3.2.0"
7
+ version = "3.2.1"
8
8
  description = "A Python package for thermodynamic cycle modelling and analysis"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -11,7 +11,7 @@ except FileNotFoundError:
11
11
 
12
12
  setup(
13
13
  name='ThermoSim', # ← your PyPI package name
14
- version='3.2.0', # ← NEW version number
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