Skip to content

Commit

Permalink
Merge branch 'dev' into fix/default-value-for-temperatures-0K
Browse files Browse the repository at this point in the history
  • Loading branch information
fwitte committed Jan 21, 2024
2 parents fef2f80 + be92091 commit b326feb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/tespy/tools/fluid_properties/mixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def exergy_chemical_ideal_cond(pamb, Tamb, fluid_data, Chem_Ex):

fluid_aliases = fluid_data[fluid]["wrapper"]._aliases

if molar_liquid > 0:
if molar_liquid > 0 and "water" in fluid_aliases:
y = [
Chem_Ex[k][2] for k in fluid_aliases if k in Chem_Ex
]
Expand Down
13 changes: 8 additions & 5 deletions tutorial/heat_pump_exergy/NH3_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import plotly.graph_objects as go
from fluprodia import FluidPropertyDiagram
import pandas as pd
import matplotlib.pyplot as plt

# %% network
pamb = 1.013 # ambient pressure
Expand Down Expand Up @@ -166,16 +167,18 @@
for key, data in result_dict.items():
result_dict[key]['datapoints'] = diagram.calc_individual_isoline(**data)

diagram.set_limits(x_min=0, x_max=2100, y_min=1e0, y_max=2e2)
diagram.calc_isolines()
diagram.draw_isolines('logph')

fig, ax = plt.subplots(1, figsize=(16, 10))
diagram.draw_isolines(fig, ax, 'logph', x_min=0, x_max=2100, y_min=1e0, y_max=2e2)

for key in result_dict.keys():
datapoints = result_dict[key]['datapoints']
diagram.ax.plot(datapoints['h'], datapoints['p'], color='#ff0000')
diagram.ax.scatter(datapoints['h'][0], datapoints['p'][0], color='#ff0000')
ax.plot(datapoints['h'], datapoints['p'], color='#ff0000')
ax.scatter(datapoints['h'][0], datapoints['p'][0], color='#ff0000')

diagram.save('NH3_logph.svg')
plt.tight_layout()
fig.savefig('NH3_logph.svg')

# %% exergy analysis

Expand Down
13 changes: 8 additions & 5 deletions tutorial/heat_pump_exergy/R410A_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import plotly.graph_objects as go
from fluprodia import FluidPropertyDiagram
import pandas as pd
import matplotlib.pyplot as plt

# %% network
pamb = 1.013 # ambient pressure
Expand Down Expand Up @@ -165,16 +166,18 @@
for key, data in result_dict.items():
result_dict[key]['datapoints'] = diagram.calc_individual_isoline(**data)

diagram.set_limits(x_min=200, x_max=500, y_min=0.8e1, y_max=0.8e2)
diagram.calc_isolines()
diagram.draw_isolines('logph')

fig, ax = plt.subplots(1, figsize=(16, 10))
diagram.draw_isolines(fig, ax, 'logph', x_min=200, x_max=500, y_min=0.8e1, y_max=0.8e2)

for key in result_dict.keys():
datapoints = result_dict[key]['datapoints']
diagram.ax.plot(datapoints['h'], datapoints['p'], color='#ff0000')
diagram.ax.scatter(datapoints['h'][0], datapoints['p'][0], color='#ff0000')
ax.plot(datapoints['h'], datapoints['p'], color='#ff0000')
ax.scatter(datapoints['h'][0], datapoints['p'][0], color='#ff0000')

diagram.save('R410A_logph.svg')
plt.tight_layout()
fig.savefig('R410A_logph.svg')

# %% exergy analysis

Expand Down

0 comments on commit b326feb

Please sign in to comment.