Replies: 3 comments
-
Hi @jase64, Thank you for pointing that out, the documentation should be improved regarding customization of characteristic functions. I will make an update with the next release, which is planned for early January. I have a different feature I am working on at the moment, which I want to deploy with that release, too. Regarding the example, the characteristic function is eta_design * f(m/m_design), meaning that you y values of the char_line need to be relative to the design point efficiency value. In order to match the curve to your design point efficiency, you'll need to divide all values by the respective value (which is somewhere between 0.85 and 0.79, or?). Or maybe the 0.9 as specified in the turbine specification values? The code could look like so. I added one more x value (1.0) to the line and the corresponding value of the efficiency in the y values and divided those by that design value. This is to make sure, the design value efficiency is observed at design mass flow. At m/m_design = 0.3 as specified for the offdesign calculation, the efficiency value will therefore be at 0.65. from tespy.components import sink, source, turbine
from tespy.connections import connection
from tespy.networks import network
from tespy.tools.characteristics import char_line
fluid_list = ['water']
nw = network(fluids=fluid_list, p_unit='bar', T_unit='C', h_unit='kJ / kg', iterinfo=False)
si = sink('sink')
so = source('source')
t = turbine('turbine')
inc = connection(so, 'out1', t, 'in1')
outg = connection(t, 'out1', si, 'in1')
nw.add_conns(inc, outg)
eta_s_design = 0.84
t.set_attr(eta_s=eta_s_design, design=['eta_s'], offdesign=['eta_s_char','cone'])
# Characteristics x as m/m_design and y as eta_s(m)/eta_s_design
t.set_attr(eta_s_char=char_line(x=[0.1, 0.3, 0.5, 0.7, 0.9, 1.0, 1.1], y=np.array([0.6, 0.65, 0.75, 0.82, 0.85, eta_s_design, 0.79]) / eta_s_design, extrapolate=False))
inc.set_attr(fluid={'water': 1}, m=10, T=550, p=110, design=['p'])
outg.set_attr(p=0.5)
nw.solve('design')
nw.print_results()
nw.save('tmp')
inc.set_attr(m=3)
nw.solve('offdesign', design_path='tmp')
nw.print_results() Best regards, have a good Christmas holiday! |
Beta Was this translation helpful? Give feedback.
-
Hi Francesco, Thanks for your reply. I understand that the default characteristic line for the turbine, ie eta_s=eta_s_design*f(m/m_design). However the documentation was quoting the existence of 3 other char lines. This might be an error, but when I looked at the source code of if self.eta_s_char.param == 'm':
if not np.isnan(i_d[0]):
expr = i[0] / i_d[0]
elif self.eta_s_char.param == 'pr':
if not np.isnan([i_d[1], o_d[1]]).any():
expr = (o[1] * i_d[1]) / (i[1] * o_d[1]) The question is how do I pass the "param" parameter to eta_s_char to change the curve ? The replay can wait for January. In the meantime, enjoy your Christmas holiday ! Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hi Serge, mychar=dc_cc(
func=char_line(x=[0.1, 0.3, 0.5, 0.7, 0.9, 1.1], y=[0.6, 0.65, 0.75, 0.82, 0.85, 0.79], extrapolate=False),
param='pr',
is_set=False # will be switched to True automatically in offdesign mode as eta_s_char is specified as offdesign parameter
)
t.set_attr(eta_s_char=mychar) The upcoming API changes will make this easier, I will add this example to the documentation, which will be available once the new version is live. I will let you know once this is the case. Also, the new API will offer easier implementation of different referencing methods. Do you have some spare time this or the next week? Maybe we can have short talk about what features could be implemented here. |
Beta Was this translation helpful? Give feedback.
-
Hi everybody,
I'm trying to configure a turbine based on vendor documents. So usually vendor provides several curves from which a characteristic curve eta_s=f(m) can be derived. However, even after reading the documentation thoroughly, I still cannot figure out the way to pass properly my custom
eta_s_char
.Documentation says that for turbine component :
but doesn't tell how (at least I didn't find it).
So I think documentation could benefit from a clear reference on how do I tell TESPY:
However, by running the following code taken from the documentation examples, it doesn't appear clearly to me.
Has anyone a clue ? Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions