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

Addition of some features implemented by ipudk #504

Open
wants to merge 107 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
9424307
regiter coolrop
Nov 3, 2023
9c46ff5
Cherry picked EEMAP/dev to avoid rewritten history
Nov 3, 2023
a260449
register nested root for coolprop
Nov 1, 2023
6712c5e
updating examples
Nov 1, 2023
99dbc57
successfully runing examples 1,4,8,9
Nov 1, 2023
4a92f6e
testing heat exchangers
Nov 1, 2023
f2cbc57
solving P > Psat for incompressible "water" :: I believe there is no …
Nov 1, 2023
b6867c7
updating SimpleHeatExchangerDeltaP with new jacobian structure
Nov 1, 2023
022d5f3
heat exchanger with loss updated with new jacobian structure
Nov 1, 2023
e24e4a7
Finally happy with all combinations of LF, Q_loss an Q_total working
Nov 1, 2023
5489598
solving P > Psat more elegantly :: INCOMP pressure is now limited by …
Nov 2, 2023
54196b8
updating some errors in jacobian derrivatives
Nov 2, 2023
8017ffa
updating heat exchanger and merge tests
Nov 2, 2023
6302fab
constraints are now inherited and deleted if necessary. Added Splitte…
Nov 2, 2023
a2b4624
Flow splitter working and added flow splitter with pressure drop
Nov 2, 2023
5d647a6
reorganizing splitters
Nov 2, 2023
de6c045
working on SFS
Nov 2, 2023
0c3fbeb
fixing tespy separator model (is_var on the jacobian outlets )
Nov 2, 2023
2ac4f23
cleaning test files for not using Food properties
Nov 2, 2023
5182217
And the BUS is running
Nov 2, 2023
5cd4b9a
splitting energySupplyComponents from newComponents.. Energy Supply m…
Nov 2, 2023
7448aa3
working energy models and examples
Nov 2, 2023
45b57fc
renaming example files
Nov 2, 2023
9e2df2f
deleting old energy supply models, updating names and examples
Nov 2, 2023
31234c2
new folder names
Nov 3, 2023
086991e
I think we should always include and fluid composition equations for …
Nov 5, 2023
ab0c8f5
I think we should always include and fluid composition equations for …
Nov 5, 2023
bbcb721
let's syncronize the way fluids are specified, also for the split_fluid
Nov 6, 2023
1046dd5
let's keep backward compatibility
Nov 6, 2023
14fb14f
need force_state, limit_increments and RobustRelax
Nov 7, 2023
9b2d719
more examples
Nov 7, 2023
7fc2484
models working again
Nov 7, 2023
35c5f80
Ensure seeing that enthalpy is limited
Nov 8, 2023
655e82a
Renamed new components
Nov 8, 2023
62370e3
Updating check_temperatures to ensure force_state
Nov 8, 2023
413a8fe
correct check_temperature back again... use iter > 8 to force closer …
Nov 8, 2023
c3fcc9c
lets make heat exchanger model simpler with only options of LF+KPI an…
Nov 8, 2023
8ddf6b1
Added pinch temperature calculation for heat exchanger
Nov 9, 2023
804421c
setting lower bounds, and typo fix
Nov 9, 2023
dbdeb0b
a drier model
Nov 10, 2023
6ca4464
two-phase state results with HEOS::WATER
Nov 10, 2023
dcf11aa
calculate incompressible two-phase states based on HEOS::Water
Nov 13, 2023
b06e0ee
fixing typo
Nov 13, 2023
db6cfeb
ensuring pT functions work at Tsat > Tmax
Nov 13, 2023
2852054
possibility to set mass flow out of a species
Nov 22, 2023
c747bc0
missing rule
Nov 22, 2023
1e5ed1f
validating ttd_min and kA
Nov 23, 2023
d7c8262
updating tespy issues with saturation
Nov 23, 2023
5c71b12
Revert "Auxiliary commit to revert individual files from d7c8262e1a65…
Nov 24, 2023
592441a
possibility to set delta H
Nov 24, 2023
12deb22
EXTREMELY IMPORTANT TO SET ENTHALPY BASED ON T0 WHEN SOLVING FOR TOUT
Nov 27, 2023
5f1028d
Possibility to set Q for SFS models
Nov 27, 2023
55599be
rename
Nov 27, 2023
b600d4e
workinng on Q for drier
Nov 27, 2023
91daf5b
EXTREMELY IMPORTANT TO UPDATE FLUIDS MASS FRACTION FROM ONE SOLUTION …
Nov 28, 2023
16daf72
working on the drier
Nov 28, 2023
d75ca80
still not workign as wished
Nov 28, 2023
dc11134
done drier
Nov 29, 2023
ee83b53
started working on the evaporator
Nov 29, 2023
7516340
missing setting fluid0 right
Nov 30, 2023
0760e60
print the branches for debug
Nov 30, 2023
eb99e6a
two stream evaporator thickener
Nov 30, 2023
22ef2dd
Changed some filenames
Nov 30, 2023
7e6e38c
write branch info
Dec 1, 2023
699093e
deltaP on hot side advanced evaporator
Dec 4, 2023
875464f
new drier
Dec 4, 2023
dd73494
New improved drier model
Dec 4, 2023
c9aee1a
switched vapor and liquid to be consistent
Dec 5, 2023
1000b48
Let's save guesses from one calculation to another
Dec 5, 2023
94ecca7
removing coolprop submodule
Dec 7, 2023
8bbb189
adding plotly and fluprodia
Dec 7, 2023
23e56e7
sankey diagram sk
Dec 7, 2023
08d5349
fix newComponents file name
Vily-ipu Dec 8, 2023
04bc1b5
3 different results tables
Dec 8, 2023
a71c915
Merge remote-tracking branch 'origin/EEMAP/dev' into EEMAP/dev
Dec 8, 2023
640a77b
handling units in components - the quick way ..
Dec 13, 2023
09b2f7f
deleting deprecated model
Dec 13, 2023
19afc75
adding more variables for component units
Dec 13, 2023
6d6cb89
more units for components
Dec 14, 2023
41fea62
goofy unit
Dec 14, 2023
2c29210
units
Dec 14, 2023
448c0e5
equal To of SFS model
Dec 15, 2023
a36009d
add to export debugging class list
Dec 15, 2023
89be247
Huge issue on scaling residuals and jacobians, which is missing in te…
Dec 15, 2023
e4c26e7
safe delete object
Dec 19, 2023
beae8fe
unit
Jan 30, 2024
b7be6f6
adding new features for energy supply, e.g. mass flow specification i…
Jan 31, 2024
e5a9e51
Fix unit conversion (switched MWh and GWh)
Vily-ipu Jan 31, 2024
57b9603
boiler, compressor, ref unit and heat pump with usefull ratios
Feb 6, 2024
9bb892c
adding functionality for energy supply
Feb 7, 2024
d7f4225
flow energy node
Feb 7, 2024
ab5a9f6
Changing SI unit of KPI
Vily-ipu Feb 21, 2024
118e210
fixing basic heatpump and refunit in energy supply
Apr 2, 2024
c70deca
working on custom fluid wrapper
Apr 15, 2024
28a2a4a
working mix of custom fluid wrapper and coolprop
Apr 15, 2024
b4aa8be
change folder
Apr 15, 2024
dd0857c
mixtures with custem wrapper and coolprop working
Apr 15, 2024
5a006b5
Merge EEMAP/dev into dev
fwitte Apr 16, 2024
54ee55a
Make some quick fixes to integrate state and force_state keywords and…
fwitte Apr 16, 2024
d0cb31b
Fix errors related to (temporary) kwargs in h_pT functions
fwitte Apr 16, 2024
eb8fd8b
Align some styling and run isort
fwitte Apr 16, 2024
05fc9bc
Fix examples related to removal of automatic fluid balance constraint
fwitte Apr 16, 2024
51f5e3c
Allow for higher temperatures in mixtures of gases
fwitte Apr 16, 2024
3766c2e
Temporarily remove the additions of new component classes and their t…
fwitte Apr 16, 2024
9720117
Remove unused imports
fwitte Apr 16, 2024
360b9f2
Fix more imports
fwitte Apr 16, 2024
f14d535
Add a value sanity check for fluid mass fraction to prevent tiny diff…
fwitte Apr 16, 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
2 changes: 1 addition & 1 deletion docs/modules/fluid_properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ isentropic change of pressure for an ideal gas.
... + self.coefficients[5] * y ** 2
... ) / self.coefficients[6]
...
... def h_pT(self, p, T):
... def h_pT(self, p, T, **kwargs):
... return self._h_pT(p, T) - self.h_ref
...
... def _h_pT(self, p, T):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exclude = ["docs/_build"]

[project]
name = "tespy"
version = "0.7.3"
version = "0.8"
description = "Thermal Engineering Systems in Python (TESPy)"
readme = "README.rst"
authors = [
Expand Down
17 changes: 17 additions & 0 deletions src/tespy/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from tespy.tools.data_containers import ComponentCharacteristicMaps as dc_cm
from tespy.tools.data_containers import ComponentCharacteristics as dc_cc
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.data_containers import ComponentPropertiesArray as dc_cpa
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
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
2 changes: 1 addition & 1 deletion src/tespy/components/nodes/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Merge(NodeBase):
>>> inc1.set_attr(fluid={'O2': 0.23, 'N2': 0.77}, p=1, T=T, m=5)
>>> inc2.set_attr(fluid={'O2': 1}, T=T, m=5)
>>> inc3.set_attr(fluid={'N2': 1}, T=T)
>>> outg.set_attr(fluid={'N2': 0.4})
>>> outg.set_attr(fluid={'N2': 0.4, 'O2': 0.6})
>>> nw.solve('design')
>>> round(inc3.m.val_SI, 2)
0.25
Expand Down
8 changes: 5 additions & 3 deletions src/tespy/components/nodes/separator.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class Separator(NodeBase):
mass fraction for this outlet.

>>> outg1.set_attr(m=None)
>>> outg2.set_attr(fluid={'O2': 0.3})
>>> outg2.set_attr(fluid={'O2': 0.3, 'N2': 0.7})
>>> nw.solve('design')
>>> outg2.fluid.val['O2']
0.3
Expand Down 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