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

add exergoeconomic analysis #474

Open
wants to merge 49 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
82a5db9
add tests
FriederikeTUB Jan 12, 2024
f52d59d
add splitting for exergy cost stream of source
FriederikeTUB Jan 15, 2024
fd3a59d
add exergoeconomic analysis
FriederikeTUB Jan 15, 2024
78ea466
add exergoeconomic cost balances and auxiliary equations for some com…
FriederikeTUB Jan 15, 2024
b274b71
add cost attributes to connection
FriederikeTUB Jan 15, 2024
4449475
Add draft for refactoring of cost balacing
fwitte Jan 16, 2024
61aa2c1
refactor code for exergoeconomic analysis
FriederikeTUB Jan 23, 2024
f90c60c
add auxiliary equations and exergoeconomic balances for nodes
FriederikeTUB Jan 26, 2024
2251c5a
add auxiliary equations for heat exchanger
FriederikeTUB Jan 26, 2024
9cd1c45
edit auxiliary equations and exergoeconomic balances for combustion
FriederikeTUB Jan 26, 2024
68fb4a4
add auxiliary equations and exergoeconomic balances for valve
FriederikeTUB Jan 26, 2024
92523d6
edit auxiliary equations and exergoeconomic balances for compressor &…
FriederikeTUB Jan 26, 2024
4775c2c
add calc_zeta function
FriederikeTUB Jan 26, 2024
05dcd67
add c and C subdivision in printed table
FriederikeTUB Jan 26, 2024
ee82cdd
add some tests
FriederikeTUB Jan 26, 2024
b537836
add structure for dissipative components
FriederikeTUB Jan 26, 2024
fc7fd9f
edit auxiliary equations
FriederikeTUB Jan 26, 2024
4972a93
add structure for internal power supply
FriederikeTUB Jan 27, 2024
ca5c55f
edit code for dissipative components and tests
FriederikeTUB Jan 28, 2024
8455bea
auxiliary equations cycle closer
FriederikeTUB Feb 14, 2024
ba8192b
aktueller Stand
FriederikeTUB Feb 14, 2024
ff675fc
Merge branch 'dev' into HEAD
fwitte Feb 14, 2024
6a3b12c
Tidy up and draft concept for using bus exergy flows as variables
fwitte Feb 14, 2024
7681639
Remove some outdated stuff
fwitte Feb 14, 2024
58737c0
add division of massless streams in bus based and component based for…
FriederikeTUB Feb 14, 2024
6edc600
some more component tests
FriederikeTUB Feb 22, 2024
0a81455
change efficency calculation since E_bus["massless"] is not component…
FriederikeTUB Feb 22, 2024
b62527c
fix a problem with busses
FriederikeTUB Feb 22, 2024
a26788a
fix some more problems
FriederikeTUB Feb 22, 2024
9c671f8
some more tests
FriederikeTUB Mar 5, 2024
dc50f58
add conversion molar and mass flow
FriederikeTUB Mar 5, 2024
3847a69
try to build Jubrans gas turbine system
FriederikeTUB Mar 5, 2024
997cca4
add starting value for circular processes and tests
FriederikeTUB Mar 6, 2024
39de500
edit auxiliary equations, add case that only one exergy is 0 but the …
FriederikeTUB Mar 9, 2024
f80e138
edit unit handling
FriederikeTUB Apr 23, 2024
68f27ff
edit aux eq for compressor
FriederikeTUB Apr 23, 2024
0b32aaf
evaluate refrigerator results
FriederikeTUB Apr 23, 2024
87c16d1
change Ex_C_col for dissipative components
FriederikeTUB May 7, 2024
207e256
remove C_L for components
FriederikeTUB May 7, 2024
37c72a8
add air to fuel bus
FriederikeTUB May 7, 2024
d75c858
try cgam analysis
FriederikeTUB May 7, 2024
8a27d9b
revising auxiliary equations
FriederikeTUB May 8, 2024
95c41de
edit bus equations
FriederikeTUB Jun 5, 2024
787215e
clean up comments
FriederikeTUB Jun 7, 2024
89912cb
rename dissipative_balance to dis_eqs
FriederikeTUB Jun 15, 2024
61e7db4
change splitter equations
FriederikeTUB Jun 16, 2024
8c8eda6
minor changes
FriederikeTUB Jun 17, 2024
11477d0
correct definition of r_k
FriederikeTUB Jun 21, 2024
ee1d319
correct definition of r
FriederikeTUB Jun 23, 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
Prev Previous commit
Next Next commit
add cost attributes to connection
  • Loading branch information
FriederikeTUB committed Jan 15, 2024
commit b274b71c2c9d18e83e275d26f7f76d0892d401ff
24 changes: 19 additions & 5 deletions src/tespy/connections/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
SPDX-License-Identifier: MIT
"""

from collections import OrderedDict

import numpy as np

from tespy.components.component import Component
Expand Down Expand Up @@ -258,6 +260,18 @@ def __init__(self, source, outlet_id, target, inlet_id,
self.local_design = False
self.local_offdesign = False
self.printout = True
"""+F+F+F+F++++START++++F+F+F+F+"""
self.c_therm = np.nan
self.c_mech = np.nan
self.c_physical = np.nan
self.c_chemical = np.nan
self.c_tot = np.nan
self.C_therm = np.nan
self.C_mech = np.nan
self.C_physical = np.nan
self.C_chemical = np.nan
self.C_tot = np.nan
"""+F+F+F+F++++START++++F+F+F+F+"""

# set default values for kwargs
self.property_data = self.get_parameters()
Expand Down Expand Up @@ -301,7 +315,7 @@ def _check_connector_id(self, component, connector_id, connecter_locations):
if connector_id not in connecter_locations:
msg = (
"Error creating connection. Specified connector for "
f"{component.label} ({connector_id}) is not available. Choose "
f"{component.label} ({connector_id} is not available. Choose "
f"from " + ", ".join(connecter_locations) + "."
)
logger.error(msg)
Expand Down Expand Up @@ -624,7 +638,7 @@ def preprocess(self):
container._solved = False

self.residual = np.zeros(self.num_eq)
self.jacobian = {}
self.jacobian = OrderedDict()

def simplify_specifications(self):
systemvar_specs = []
Expand Down Expand Up @@ -724,7 +738,7 @@ def primary_ref_func(self, k, **kwargs):
ref = self.get_attr(f"{variable}_ref").ref
self.residual[k] = (
self.get_attr(variable).val_SI
- (ref.obj.get_attr(variable).val_SI * ref.factor + ref.delta_SI)
- ref.obj.get_attr(variable).val_SI * ref.factor + ref.delta_SI
)

def primary_ref_deriv(self, k, **kwargs):
Expand Down Expand Up @@ -759,7 +773,7 @@ def T_deriv(self, k, **kwargs):
def T_ref_func(self, k, **kwargs):
ref = self.T_ref.ref
self.residual[k] = (
self.calc_T() - (ref.obj.calc_T() * ref.factor + ref.delta_SI)
self.calc_T() - ref.obj.calc_T() * ref.factor + ref.delta_SI
)

def T_ref_deriv(self, k, **kwargs):
Expand Down Expand Up @@ -808,7 +822,7 @@ def v_ref_func(self, k, **kwargs):
ref = self.v_ref.ref
self.residual[k] = (
self.calc_vol(T0=self.T.val_SI) * self.m.val_SI
- (ref.obj.calc_vol(T0=ref.obj.T.val_SI) * ref.obj.m.val_SI * ref.factor + ref.delta_SI)
- ref.obj.calc_vol(T0=ref.obj.T.val_SI) * ref.obj.m.val_SI * ref.factor + ref.delta_SI
)

def v_ref_deriv(self, k, **kwargs):
Expand Down