Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge commits from ipudk/tespy #502

Closed
wants to merge 97 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
0cf8a03
regiter coolrop
Nov 3, 2023
a0c6361
Cherry picked EEMAP/dev to avoid rewritten history
Nov 3, 2023
0a52301
register nested root for coolprop
Nov 1, 2023
929a9ee
updating examples
Nov 1, 2023
5a69098
successfully runing examples 1,4,8,9
Nov 1, 2023
1dc1b10
testing heat exchangers
Nov 1, 2023
13e0145
fsolving P > Psat for incompressible "water" :: I believe there is no…
Nov 1, 2023
09f4875
updating SimpleHeatExchangerDeltaP with new jacobian structure
Nov 1, 2023
73b14ad
heat exchanger with loss updated with new jacobian structure
Nov 1, 2023
6a1fd93
Finally happy with all combinations of LF, Q_loss an Q_total working
Nov 1, 2023
2da06de
solving P > Psat more elegantly :: INCOMP pressure is now limited by …
Nov 2, 2023
171c940
updating some errors in jacobian derrivatives
Nov 2, 2023
5cbbd38
updating heat exchanger and merge tests
Nov 2, 2023
2ae1851
constraints are now inherited and deleted if necessary. Added Splitte…
Nov 2, 2023
5432a8d
Flow splitter working and added flow splitter with pressure drop
Nov 2, 2023
c5231d0
reorganizing splitters
Nov 2, 2023
ed31e26
working on SFS
Nov 2, 2023
5f42e74
fixing tespy separator model (is_var on the jacobian outlets )
Nov 2, 2023
b5233fe
cleaning test files for not using Food properties
Nov 2, 2023
d29249c
And the BUS is running
Nov 2, 2023
dd85c7e
splitting energySupplyComponents from newComponents.. Energy Supply m…
Nov 2, 2023
230c7a7
working energy models and examples
Nov 2, 2023
0ec3f77
renaming example files
Nov 2, 2023
2fc7a4e
deleting old energy supply models, updating names and examples
Nov 2, 2023
cc69ce1
new folder names
Nov 3, 2023
c9d910a
I think we should always include and fluid composition equations for …
Nov 5, 2023
4c3f339
I think we should always include and fluid composition equations for …
Nov 5, 2023
e7156aa
let's syncronize the way fluids are specified, also for the split_fluid
Nov 6, 2023
edb1a0d
let's keep backward compatibility
Nov 6, 2023
9af1ca9
need force_state, limit_increments and RobustRelax
Nov 7, 2023
5436622
more examples
Nov 7, 2023
5f0c9bd
models working again
Nov 7, 2023
db2b320
Ensure seeing that enthalpy is limited
Nov 8, 2023
5e4bee9
Renamed new components
Nov 8, 2023
23eb7a2
Updating check_temperatures to ensure force_state
Nov 8, 2023
95b40f5
correct check_temperature back again... use iter > 8 to force closer …
Nov 8, 2023
9116bcc
lets make heat exchanger model simpler with only options of LF+KPI an…
Nov 8, 2023
87d4685
Added pinch temperature calculation for heat exchanger
Nov 9, 2023
aa9bf25
setting lower bounds, and typo fix
Nov 9, 2023
ef5b5ec
a drier model
Nov 10, 2023
f2baac3
two-phase state results with HEOS::WATER
Nov 10, 2023
c30b7ee
calculate incompressible two-phase states based on HEOS::Water
Nov 13, 2023
634d236
fixing typo
Nov 13, 2023
a11f45c
ensuring pT functions work at Tsat > Tmax
Nov 13, 2023
f8c77f0
possibility to set mass flow out of a species
Nov 22, 2023
575fcfe
missing rule
Nov 22, 2023
ddeae5a
validating ttd_min and kA
Nov 23, 2023
8e38734
updating tespy issues with saturation
Nov 23, 2023
8bc1472
Revert "Auxiliary commit to revert individual files from d7c8262e1a65…
Nov 24, 2023
c1fab6b
possibility to set delta H
Nov 24, 2023
d581f1f
EXTREMELY IMPORTANT TO SET ENTHALPY BASED ON T0 WHEN SOLVING FOR TOUT
Nov 27, 2023
dbca66f
Possibility to set Q for SFS models
Nov 27, 2023
3f19deb
rename
Nov 27, 2023
0edbc38
workinng on Q for drier
Nov 27, 2023
522b118
EXTREMELY IMPORTANT TO UPDATE FLUIDS MASS FRACTION FROM ONE SOLUTION …
Nov 28, 2023
950b8c8
working on the drier
Nov 28, 2023
791741c
still not workign as wished
Nov 28, 2023
a2d410b
done drier
Nov 29, 2023
54943d1
started working on the evaporator
Nov 29, 2023
679e502
missing setting fluid0 right
Nov 30, 2023
cfca0d9
print the branches for debug
Nov 30, 2023
ee7e6fc
two stream evaporator thickener
Nov 30, 2023
e38b7e0
Changed some filenames
Nov 30, 2023
bfa8b57
write branch info
Dec 1, 2023
e7c00fc
deltaP on hot side advanced evaporator
Dec 4, 2023
95a6dbb
new drier
Dec 4, 2023
fa4414f
New improved drier model
Dec 4, 2023
761defc
switched vapor and liquid to be consistent
Dec 5, 2023
416b1fc
Let's save guesses from one calculation to another
Dec 5, 2023
623da43
removing coolprop submodule
Dec 7, 2023
7d747ef
adding plotly and fluprodia
Dec 7, 2023
ba72fc5
sankey diagram sk
Dec 7, 2023
30d5334
fix newComponents file name
Vily-ipu Dec 8, 2023
e4df9a2
3 different results tables
Dec 8, 2023
90767c3
thandling units in components - the quick way ..
Dec 13, 2023
d479cbd
deleting deprecated model
Dec 13, 2023
65058e2
adding more variables for component units
Dec 13, 2023
5037025
more units for components
Dec 14, 2023
aa9cbfe
goofy unit
Dec 14, 2023
17f2625
units
Dec 14, 2023
f330529
equal To of SFS model
Dec 15, 2023
f47f768
add to export debugging class list
Dec 15, 2023
bf92602
Huge issue on scaling residuals and jacobians, which is missing in te…
Dec 15, 2023
6418176
safe delete object
Dec 19, 2023
2cbeb8a
unit
Jan 30, 2024
fafc390
adding new features for energy supply, e.g. mass flow specification i…
Jan 31, 2024
db1a26f
Fix unit conversion (switched MWh and GWh)
Vily-ipu Jan 31, 2024
91b2a07
boiler, compressor, ref unit and heat pump with usefull ratios
Feb 6, 2024
eb82fd9
adding functionality for energy supply
Feb 7, 2024
896aa8d
flow energy node
Feb 7, 2024
c509c11
Changing SI unit of KPI
Vily-ipu Feb 21, 2024
f0aaeb9
fixing basic heatpump and refunit in energy supply
Apr 2, 2024
82280db
working on custom fluid wrapper
Apr 15, 2024
5cd9c06
working mix of custom fluid wrapper and coolprop
Apr 15, 2024
141193b
change folder
Apr 15, 2024
56a3ab7
mixtures with custem wrapper and coolprop working
Apr 15, 2024
0ac907c
Delete application specific files
fwitte Apr 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 27 additions & 44 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[tool.flit.sdist]
include = [
"CHANGELOG.rst",
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.md",
"MANIFEST.in",
"LICENSE*",
"PULL_REQUEST_TEMPLATE.md",
".coveragerc",
".editorconfig",
".pep8speaks.yml",
".readthedocs.yml",
"paper.bib",
"paper.md",
"tox.ini",
"docs/",
"tests/",
"tutorial/",
]
exclude = ["docs/_build"]

[project]
[tool.poetry]
name = "tespy"
version = "0.7.3"
description = "Thermal Engineering Systems in Python (TESPy)"
Expand Down Expand Up @@ -56,25 +31,33 @@ dependencies = [
]
license = {text = "MIT"}

[project.urls]
Homepage = "https://github.com/oemof/tespy"
Documentation = "https://tespy.readthedocs.io/"
Changelog = "https://tespy.readthedocs.io/en/main/whats_new.html"
"Issue Tracker" = "https://github.com/oemof/tespy/issues"
[tool.poetry.dependencies]
python = "^3.9"
numpy = "^1.25.1"
matplotlib = "^3.7.2"
pandas = "^2.0.3"
tabulate = "^0.9.0"
coolprop = "^6.6.0"

[project.optional-dependencies]
dev = [
"build",
"flit",
"furo",
"iapws",
"pyromat",
"pytest",
"sphinx>=7.2.2",
"sphinx-copybutton",
"sphinx-design",
"sphinxcontrib.bibtex",
"tox",
[tool.poetry.group.coolprop.dependencies]
cython = "^0.29.35"
setuptools = "^67.8.0"
wheel = "^0.40.0"
requests = "^2.31.0"
jinja2 = "^3.1.2"
pyyaml = "^6.0"



[tool.poetry.group.dev.dependencies]
ipykernel = "^6.26.0"

[build-system]
requires = [
"poetry-core",
"setuptools>=30.3.0",
"wheel",
"setuptools_scm>=3.3.1",
]

[tool.pytest.ini_options]
Expand Down
6 changes: 6 additions & 0 deletions src/tespy/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@
from .turbomachinery.compressor import Compressor # noqa: F401
from .turbomachinery.pump import Pump # noqa: F401
from .turbomachinery.turbine import Turbine # noqa: F401

# New components
from .newComponents import *
from .newAdvancedComponents import *
from .energySupplyComponents import *

17 changes: 17 additions & 0 deletions src/tespy/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from tespy.tools.data_containers import GroupedComponentCharacteristics as dc_gcc
from tespy.tools.data_containers import GroupedComponentProperties as dc_gcp
from tespy.tools.data_containers import SimpleDataContainer as dc_simple
from tespy.tools.data_containers import ComponentPropertiesArray as dc_cpa
from tespy.tools.document_models import generate_latex_eq
from tespy.tools.fluid_properties import v_mix_ph
from tespy.tools.global_vars import ERR
Expand Down Expand Up @@ -209,6 +210,22 @@ def set_attr(self, **kwargs):
logger.error(msg)
raise TypeError(msg)

elif isinstance(data, dc_cpa):
floats = [isinstance(f, float) for f in kwargs[key]]
vars = [f == 'var' for f in kwargs[key]]
is_numeric = any(floats)
is_var = any(vars)
num_eq = floats.count(True)

if is_numeric or is_var:
data.set_attr(val=kwargs[key], is_set=floats, is_var=vars, num_eq = num_eq)
else:
msg = (
'Bad datatype for keyword argument ' + key +
' at ' + self.label + '.')
logger.error(msg)
raise TypeError(msg)

elif key in ['design', 'offdesign']:
if not isinstance(kwargs[key], list):
msg = (
Expand Down
4 changes: 4 additions & 0 deletions src/tespy/components/nodes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ def initialise_source(c, key):
return 1e5
elif key == 'h':
return 5e5
elif key == 'T': # maybe add more parameters
return 300

@staticmethod
def initialise_target(c, key):
Expand Down Expand Up @@ -201,6 +203,8 @@ def initialise_target(c, key):
return 1e5
elif key == 'h':
return 5e5
elif key == 'T': # maybe add more parameters
return 300

def propagate_to_target(self, branch):

Expand Down
6 changes: 4 additions & 2 deletions src/tespy/components/nodes/separator.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,10 @@ def energy_balance_deriv(self, increment_filter, k):
# for fluid in i.fluid.is_var:
# self.jacobian[k, i.fluid.J_col[fluid]] = dT_dfluid_in[fluid]
args = (o.p.val_SI, o.h.val_SI, o.fluid_data, o.mixing_rule)
self.jacobian[k, o.p.J_col] = -dT_mix_dph(*args)
self.jacobian[k, o.h.J_col] = -dT_mix_pdh(*args)
if self.is_variable(o.p):
self.jacobian[k, o.p.J_col] = -dT_mix_dph(*args)
if self.is_variable(o.h):
self.jacobian[k, o.h.J_col] = -dT_mix_pdh(*args)
# for fluid in o.fluid.is_var:
# self.jacobian[k, o.fluid.J_col[fluid]] = -dT_mix_ph_dfluid(o)
k += 1
Loading
Loading