개정판 928be99b
issue #1060 계산식 수정 -Pipe end point
Change-Id: Id3ccf4b8b005daf9de43c9121785b4de0a5b4e16
HYTOS/HYTOS/Commands/HydroCalculationCommand.py | ||
---|---|---|
38 | 38 |
|
39 | 39 |
return False |
40 | 40 |
|
41 |
def final_loss_input(self): |
|
42 |
pass |
|
43 |
|
|
41 | 44 |
def init_units(self): |
42 | 45 |
from AppDocData import AppDocData |
43 | 46 |
try: |
... | ... | |
173 | 176 |
loop.pressure_drops[loop.items[items_count - 2]] |
174 | 177 |
|
175 | 178 |
loop.deviation = deviation |
179 |
self.final_loss_input() |
|
176 | 180 |
|
177 | 181 |
self.init_units() |
178 | 182 |
self.loop_result() |
... | ... | |
226 | 230 |
|
227 | 231 |
self.stream_input() # static 및 end.p 값 입력 |
228 | 232 |
|
233 |
def get_govern_loop(self): |
|
234 |
govern_loop = None |
|
235 |
max_deviation = None |
|
236 |
for loop in self.loops: |
|
237 |
if max_deviation is None: |
|
238 |
max_deviation = loop.deviation |
|
239 |
govern_loop = loop |
|
240 |
continue |
|
241 |
|
|
242 |
if max_deviation > loop.deviation: |
|
243 |
max_deviation = loop.deviation |
|
244 |
govern_loop = loop |
|
245 |
|
|
246 |
return govern_loop |
|
247 |
|
|
229 | 248 |
def stream_input(self): |
230 | 249 |
from AppDocData import AppDocData |
231 | 250 |
try: |
232 | 251 |
""" update pressure drop and pressure of stream data """ |
252 |
|
|
253 |
govern_loop = self.get_govern_loop() |
|
254 |
|
|
233 | 255 |
app_doc_data = AppDocData.instance() |
234 | 256 |
for hmb in app_doc_data.activeDrawing.hmbTable._hmbs: |
235 | 257 |
matches = [loop for loop in self.loops if |
... | ... | |
239 | 261 |
str(matches[0].items[index].uid) == str(hmb.components_uid)] |
240 | 262 |
if indices: |
241 | 263 |
hmb.pressure_drop_static = matches[0].pressure_drops[matches[0].items[indices[0] - 1]] |
242 |
hmb.pressure_pipe_end_point = matches[0].pressures[matches[0].items[indices[0] + 1]] |
|
264 |
|
|
265 |
if len(matches) > 1: |
|
266 |
if matches[0].items[indices[0] + 1] in govern_loop.pressures: |
|
267 |
hmb.pressure_pipe_end_point = govern_loop.pressures[matches[0].items[indices[0] + 1]] |
|
268 |
else: |
|
269 |
hmb.pressure_pipe_end_point = matches[0].pressures[matches[0].items[indices[0] + 1]] |
|
270 |
else: |
|
271 |
hmb.pressure_pipe_end_point = matches[0].pressures[matches[0].items[indices[0] + 1]] |
|
243 | 272 |
|
244 | 273 |
if hmb.phase_type == 'Vapor': |
245 | 274 |
hmb.pressure_drop_friction = matches[0].pressure_drops[matches[0].items[indices[0]]] |
... | ... | |
257 | 286 |
|
258 | 287 |
def loop_comps_hy(self): |
259 | 288 |
if self.loops: |
289 |
tag_nos = [] |
|
260 | 290 |
for loop in self.loops: |
261 |
tag_nos = [] |
|
262 | 291 |
indices = [index for index in range(len(loop.items)) if |
263 | 292 |
str(loop.items[index])[:3] == 'R_K' or str(loop.items[index])[:3] == 'L_K'] |
264 | 293 |
attribute = {} |
... | ... | |
339 | 368 |
hhp = self.pump_hydp_hy(flowrate_mass, density, head) |
340 | 369 |
|
341 | 370 |
attribute = {} |
371 |
|
|
372 |
attribute['Tag_No'] = tag_no |
|
373 |
attribute['Suct.P'] = suct_p |
|
374 |
attribute['Disc.P'] = disc_p |
|
375 |
attribute['Diff.P'] = diff_p |
|
376 |
attribute['Head'] = head |
|
377 |
attribute['NPSHa'] = npsha |
|
378 |
attribute['Vap. P'] = vapr_p |
|
379 |
attribute['HHP'] = hhp |
|
380 |
loop.items[indices[i]].parent.attribute = attribute |
|
381 |
|
|
382 |
''' |
|
342 | 383 |
if len(loop.items[indices[i]].parent.attribute) == 0: |
343 | 384 |
attribute['Tag_No'] = tag_no |
344 | 385 |
attribute['Suct.P'] = suct_p |
... | ... | |
359 | 400 |
attribute['Vap. P'] = vapr_p |
360 | 401 |
attribute['HHP'] = hhp |
361 | 402 |
loop.items[indices[i]].parent.attribute = attribute |
403 |
''' |
|
362 | 404 |
|
363 | 405 |
def get_barometric_pressure(self): |
364 | 406 |
pressure_unit = self.units['Pressure'] |
... | ... | |
607 | 649 |
(not conn in loop.items) and conn.connectedItem and |
608 | 650 |
int(conn.connectedItem._conn_index) == 1] |
609 | 651 |
if matches: |
610 |
# sort by stream no of line
|
|
611 |
matches.sort(key=lambda conn: conn.connectedItem.parentItem().stream_no) |
|
652 |
# sort by nozzle no
|
|
653 |
matches.sort(key=lambda conn: conn._conn_index) # .connectedItem.parentItem().stream_no)
|
|
612 | 654 |
for match in matches[1:]: |
613 | 655 |
res.append(QEngineeringLoopItem(loop.items + [match])) |
614 | 656 |
loop.items.append(matches[0]) |
HYTOS/HYTOS/Valve_Control.py | ||
---|---|---|
252 | 252 |
|
253 | 253 |
pressure_drop = self.ui.lineEdit_Pressure_Drop.text() |
254 | 254 |
if pressure_drop: |
255 |
connector.data.pressure_drop = float(pressure_drop) |
|
255 |
if float(pressure_drop) == 0: |
|
256 |
connector.data.pressure_drop = None |
|
257 |
else: |
|
258 |
connector.data.pressure_drop = float(pressure_drop) |
|
256 | 259 |
else: |
257 | 260 |
connector.data.pressure_drop = None |
258 | 261 |
|
내보내기 Unified diff