Welcome to tespy Discussions! #304
Replies: 2 comments 1 reply
-
#439 I have solved these 2 conditions
Please help me write the code, from that I can get my idea. Thank you |
Beta Was this translation helpful? Give feedback.
-
Please i need help with the code below from tespy.networks import Network import numpy as np %% networkDefine the working fluids, units, and mass flow ratesnw = Network( %% componentsDefine sources & sinks for the networkcc = CycleCloser('coolant cycle closer') Components from your schematicsp = Splitter('splitter') %% connectionsConsumer system connectionsc_in_cd = Connection(cc, 'out1', cd, 'in1') nw.add_conns(c_in_cd, cb_dhp, dhp_cd, cd_cons, cons_cf) Condenser to evaporator connectioncd_ves = Connection(cd, 'out1', ves, 'in1') Evaporator system connectionsves_dr = Connection(ves, 'out1', dr, 'in1') amb_fan = Connection(amb, 'out1', fan, 'in1') Evaporator to compressor connectionssu_cp1 = Connection(su, 'out2', cp1, 'in1') Compressor-system connectionscp1_he = Connection(cp1, 'out1', ic, 'in1') %% component parametrizationCondensercd.set_attr(pr1=0.99, pr2=0.99, ttd_u=5, design=['pr2', 'ttd_u'], Air fanfan.set_attr(eta_s=0.65, design=['eta_s'], offdesign=['eta_s_char']) Evaporator systemkA_char1 = ldc('heat exchanger', 'kA_char1', 'DEFAULT', CharLine) Compressor systemcp1.set_attr(eta_s=0.85, design=['eta_s'], offdesign=['eta_s_char']) %% connection parametrizationWorking fluid mass flow rates and pressures from your schematicc_in_cd.set_attr(fluid={'air': 0, 'NH3': 1, 'water': 0}) Evaporator mass flow rate and pressure setuperp_ev.set_attr(m=Ref(ves_dr, 1.25, 0), p0=5) su_cp1.set_attr(p0=5, state='g') Evaporator system hot sideamb_fan.set_attr(T=12, p=1, fluid={'air': 1, 'NH3': 0, 'water': 0}, Compressor-systemhe_cp2.set_attr(Td_bp=5, p0=20, design=['Td_bp']) Set power based on your system schematiccons.set_attr(Q=-200e3) %% CalculationDesign mode solutionnw.solve('design') Off-design testnw.solve('offdesign', design_path='heat_pump_air') document_model(nw, path='./reports', filename='report_air_offdesign.tex') is flaging |
Beta Was this translation helpful? Give feedback.
-
👋 Welcome to the TESPy user forum
We’re using Discussions as a place to connect with other users and developers of our community. Our goals are
To get started, simply open a new discussion or go through the list of topics and engage with others.
Beta Was this translation helpful? Give feedback.
All reactions