개정판 ae3e5e31
issue #1201 : 2 Phase 계산식
Change-Id: I48cf971732456b4ea1170d65e82a33436554ddb8
HYTOS/HYTOS/HMBTable.py | ||
---|---|---|
55 | 55 |
self._pressure_drop_static = None |
56 | 56 |
self._pressure_pipe_end_point = None |
57 | 57 |
self._power = None |
58 |
self._vapor_flowrate_mass = None |
|
59 |
self._vapor_density = None |
|
60 |
self._vapor_viscosity = None |
|
61 |
self._vapor_pressure = None |
|
62 |
self._vapor_temperature = None |
|
63 |
self._vapor_molecular_weight = None |
|
64 |
self._vapor_compress_factor = None |
|
65 |
self._liquid_flowrate_mass = None |
|
66 |
self._liquid_density = None |
|
67 |
self._liquid_viscosity = None |
|
58 | 68 |
self.isDeleted = False |
59 | 69 |
|
60 | 70 |
''' |
... | ... | |
228 | 238 |
|
229 | 239 |
@property |
230 | 240 |
def equivalent_length_input(self): |
231 |
return float(self._equivalent_length_input) if isfloat(self._equivalent_length_input) else self._equivalent_length_input |
|
241 |
return float(self._equivalent_length_input) if isfloat( |
|
242 |
self._equivalent_length_input) else self._equivalent_length_input |
|
232 | 243 |
|
233 | 244 |
@equivalent_length_input.setter |
234 | 245 |
def equivalent_length_input(self, value): |
... | ... | |
252 | 263 |
|
253 | 264 |
@property |
254 | 265 |
def equivalent_length_cal(self): |
255 |
return float(self._equivalent_length_cal) if isfloat(self._equivalent_length_cal) else self._equivalent_length_cal |
|
266 |
return float(self._equivalent_length_cal) if isfloat( |
|
267 |
self._equivalent_length_cal) else self._equivalent_length_cal |
|
256 | 268 |
|
257 | 269 |
@equivalent_length_cal.setter |
258 | 270 |
def equivalent_length_cal(self, value): |
... | ... | |
276 | 288 |
|
277 | 289 |
@property |
278 | 290 |
def limitation_pressure_drop(self): |
279 |
return float(self._limitation_pressure_drop) if isfloat(self._limitation_pressure_drop) else self._limitation_pressure_drop |
|
291 |
return float(self._limitation_pressure_drop) if isfloat( |
|
292 |
self._limitation_pressure_drop) else self._limitation_pressure_drop |
|
280 | 293 |
|
281 | 294 |
@limitation_pressure_drop.setter |
282 | 295 |
def limitation_pressure_drop(self, value): |
... | ... | |
316 | 329 |
|
317 | 330 |
@property |
318 | 331 |
def pressure_drop_friction(self): |
319 |
return float(self._pressure_drop_friction) if isfloat(self._pressure_drop_friction) else self._pressure_drop_friction |
|
332 |
return float(self._pressure_drop_friction) if isfloat( |
|
333 |
self._pressure_drop_friction) else self._pressure_drop_friction |
|
320 | 334 |
|
321 | 335 |
@pressure_drop_friction.setter |
322 | 336 |
def pressure_drop_friction(self, value): |
... | ... | |
332 | 346 |
|
333 | 347 |
@property |
334 | 348 |
def pressure_pipe_end_point(self): |
335 |
return float(self._pressure_pipe_end_point) if isfloat(self._pressure_pipe_end_point) else self._pressure_pipe_end_point |
|
349 |
return float(self._pressure_pipe_end_point) if isfloat( |
|
350 |
self._pressure_pipe_end_point) else self._pressure_pipe_end_point |
|
336 | 351 |
|
337 | 352 |
@pressure_pipe_end_point.setter |
338 | 353 |
def pressure_pipe_end_point(self, value): |
... | ... | |
346 | 361 |
def power(self, value): |
347 | 362 |
self._power = value |
348 | 363 |
|
364 |
@property |
|
365 |
def vapor_flowrate_mass(self): |
|
366 |
return float(self._vapor_flowrate_mass) if isfloat(self._vapor_flowrate_mass) else self._vapor_flowrate_mass |
|
367 |
|
|
368 |
@vapor_flowrate_mass.setter |
|
369 |
def vapor_flowrate_mass(self, value): |
|
370 |
self._vapor_flowrate_mass = value |
|
371 |
|
|
372 |
@property |
|
373 |
def vapor_density(self): |
|
374 |
return float(self._vapor_density) if isfloat(self._vapor_density) else self._vapor_density |
|
375 |
|
|
376 |
@vapor_density.setter |
|
377 |
def vapor_density(self, value): |
|
378 |
self._vapor_density = value |
|
379 |
|
|
380 |
@property |
|
381 |
def vapor_viscosity(self): |
|
382 |
return float(self._vapor_viscosity) if isfloat(self._vapor_viscosity) else self._vapor_viscosity |
|
383 |
|
|
384 |
@vapor_viscosity.setter |
|
385 |
def vapor_viscosity(self, value): |
|
386 |
self._vapor_viscosity = value |
|
387 |
|
|
388 |
@property |
|
389 |
def vapor_pressure(self): |
|
390 |
return float(self._vapor_pressure) if isfloat(self._vapor_pressure) else self._vapor_pressure |
|
391 |
|
|
392 |
@vapor_pressure.setter |
|
393 |
def vapor_pressure(self, value): |
|
394 |
self._vapor_pressure = value |
|
395 |
|
|
396 |
@property |
|
397 |
def vapor_temperature(self): |
|
398 |
return float(self._vapor_temperature) if isfloat(self._vapor_temperature) else self._vapor_temperature |
|
399 |
|
|
400 |
@vapor_temperature.setter |
|
401 |
def vapor_temperature(self, value): |
|
402 |
self._vapor_temperature = value |
|
403 |
|
|
404 |
@property |
|
405 |
def vapor_molecular_weight(self): |
|
406 |
return float(self._vapor_molecular_weight) if isfloat( |
|
407 |
self._vapor_molecular_weight) else self._vapor_molecular_weight |
|
408 |
|
|
409 |
@vapor_molecular_weight.setter |
|
410 |
def vapor_molecular_weight(self, value): |
|
411 |
self._vapor_molecular_weight = value |
|
412 |
|
|
413 |
@property |
|
414 |
def vapor_compress_factor(self): |
|
415 |
return float(self._vapor_compress_factor) if isfloat( |
|
416 |
self._vapor_compress_factor) else self._vapor_compress_factor |
|
417 |
|
|
418 |
@vapor_compress_factor.setter |
|
419 |
def vapor_compress_factor(self, value): |
|
420 |
self._vapor_compress_factor = value |
|
421 |
|
|
422 |
@property |
|
423 |
def liquid_flowrate_mass(self): |
|
424 |
return float(self._liquid_flowrate_mass) if isfloat( |
|
425 |
self._liquid_flowrate_mass) else self._liquid_flowrate_mass |
|
426 |
|
|
427 |
@liquid_flowrate_mass.setter |
|
428 |
def liquid_flowrate_mass(self, value): |
|
429 |
self._liquid_flowrate_mass = value |
|
430 |
|
|
431 |
@property |
|
432 |
def liquid_density(self): |
|
433 |
return float(self._liquid_density) if isfloat( |
|
434 |
self._liquid_density) else self._liquid_density |
|
435 |
|
|
436 |
@liquid_density.setter |
|
437 |
def liquid_density(self, value): |
|
438 |
self._liquid_density = value |
|
439 |
|
|
440 |
@property |
|
441 |
def liquid_viscosity(self): |
|
442 |
return float(self._liquid_viscosity) if isfloat( |
|
443 |
self._liquid_viscosity) else self._liquid_viscosity |
|
444 |
|
|
445 |
@liquid_viscosity.setter |
|
446 |
def liquid_viscosity(self, value): |
|
447 |
self._liquid_viscosity = value |
|
448 |
|
|
349 | 449 |
def fromRow(row): |
350 | 450 |
hmb = HMBData() |
351 | 451 |
hmb._uid = row[0] |
... | ... | |
380 | 480 |
hmb._pressure_drop_static = row[29] |
381 | 481 |
hmb._pressure_pipe_end_point = row[30] |
382 | 482 |
hmb._power = row[31] |
483 |
hmb._vapor_flowrate_mass = row[32] |
|
484 |
hmb._vapor_density = row[33] |
|
485 |
hmb._vapor_viscosity = row[34] |
|
486 |
hmb._vapor_pressure = row[35] |
|
487 |
hmb._vapor_temperature = row[36] |
|
488 |
hmb._vapor_molecular_weight = row[37] |
|
489 |
hmb._vapor_compress_factor = row[38] |
|
490 |
hmb._liquid_flowrate_mass = row[39] |
|
491 |
hmb._liquid_density = row[40] |
|
492 |
hmb._liquid_viscosity = row[41] |
|
383 | 493 |
|
384 | 494 |
return hmb |
385 | 495 |
|
... | ... | |
489 | 599 |
hmb.pressure_pipe_end_point = values['Pressure_Pipe_End_Point'] |
490 | 600 |
if 'Power' in values: |
491 | 601 |
hmb.power = values['Power'] |
602 |
if 'Vapor_Flowrate_Mass' in values: |
|
603 |
hmb.vapor_flowrate_mass = values['Vapor_Flowrate_Mass'] |
|
604 |
if 'Vapor_Density' in values: |
|
605 |
hmb.vapor_density = values['Vapor_Density'] |
|
606 |
if 'Vapor_Viscosity' in values: |
|
607 |
hmb.vapor_viscosity = values['Vapor_Viscosity'] |
|
608 |
if 'Vapor_Pressure' in values: |
|
609 |
hmb.vapor_pressure = values['Vapor_Pressure'] |
|
610 |
if 'Vapor_Temperature' in values: |
|
611 |
hmb.vapor_temperature = values['Vapor_Temperature'] |
|
612 |
if 'Vapor_Molecular_Weight' in values: |
|
613 |
hmb.vapor_molecular_weight = values['Vapor_Molecular_Weight'] |
|
614 |
if 'Vapor_Compress_Factor' in values: |
|
615 |
hmb.vapor_compress_factor = values['Vapor_Compress_Factor'] |
|
616 |
if 'Liquid_Flowrate_Mass' in values: |
|
617 |
hmb.liquid_flowrate_mass = values['Liquid_Flowrate_Mass'] |
|
618 |
if 'Liquid_Density' in values: |
|
619 |
hmb.liquid_density = values['Liquid_Density'] |
|
620 |
if 'Liquid_Viscosity' in values: |
|
621 |
hmb.liquid_viscosity = values['Liquid_Viscosity'] |
|
492 | 622 |
|
493 | 623 |
break |
494 | 624 |
except Exception as ex: |
... | ... | |
549 | 679 |
, h.Pressure_Drop_Static |
550 | 680 |
, h.Pressure_Pipe_End_Point |
551 | 681 |
, h.Power |
682 |
, h.Vapor_Flowrate_Mass |
|
683 |
, h.Vapor_Density |
|
684 |
, h.Vapor_Viscosity |
|
685 |
, h.Vapor_Pressure |
|
686 |
, h.Vapor_Temperature |
|
687 |
, h.Vapor_Molecular_Weight |
|
688 |
, h.Vapor_Compress_Factor |
|
689 |
, h.Liquid_Flowrate_Mass |
|
690 |
, h.Liquid_Density |
|
691 |
, h.Liquid_Viscosity |
|
552 | 692 |
from HMB h |
553 | 693 |
left join Components c |
554 | 694 |
on h.Components_UID = c.UID |
... | ... | |
601 | 741 |
'Density', 'Viscosity', |
602 | 742 |
'Temperature', 'Molecular_Weight', 'Specific_Heat_Ratio', 'Compress_Factor', |
603 | 743 |
'Nominal_Pipe_Size', 'Inside_Pipe_Size', |
604 |
'Schedule_No', 'Straight_Length', 'Equivalent_Length', 'Equivalent_Length_Input', 'Fitting_Length', |
|
744 |
'Schedule_No', 'Straight_Length', 'Equivalent_Length', 'Equivalent_Length_Input', |
|
745 |
'Fitting_Length', |
|
605 | 746 |
'Fitting_K', 'Equivalent_Length_Cal', 'Roughness', 'Limitation_Velocity', |
606 | 747 |
'Limitation_Pressure_Drop', |
607 | 748 |
'Velocity', 'Reynolds', 'Friction_Factor', 'Pressure_Drop', 'Pressure_Drop_Friction', |
608 |
'Pressure_Drop_Static', 'Pressure_Pipe_End_Point', 'Power'] |
|
609 |
values = ['?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', |
|
610 |
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?'] |
|
749 |
'Pressure_Drop_Static', 'Pressure_Pipe_End_Point', 'Power', 'Vapor_Flowrate_Mass', |
|
750 |
'Vapor_Density', 'Vapor_Viscosity', 'Vapor_Pressure', 'Vapor_Temperature', |
|
751 |
'Vapor_Molecular_Weight', 'Vapor_Compress_Factor', 'Liquid_Flowrate_Mass', |
|
752 |
'Liquid_Density', 'Liquid_Viscosity'] |
|
753 |
values = ['?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', |
|
754 |
'?', |
|
755 |
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', |
|
756 |
'?', '?', '?', '?', '?', '?', '?'] |
|
611 | 757 |
param = ( |
612 | 758 |
str(data.uid), str(data.components_uid), data.stream_no, data.phase_type, |
613 | 759 |
data.flowrate_mass, |
614 | 760 |
data.flowrate_volume, data.density, |
615 | 761 |
data.viscosity, data.temperature, data.molecular_weight, data.specific_heat_ratio, |
616 | 762 |
data.compress_factor, data.nominal_pipe_size, |
617 |
data.inside_pipe_size, data.schedule_no, data.straight_length, data.equivalent_length, data.equivalent_length_input, |
|
763 |
data.inside_pipe_size, data.schedule_no, data.straight_length, data.equivalent_length, |
|
764 |
data.equivalent_length_input, |
|
618 | 765 |
data.fitting_length, data.fitting_K, data.equivalent_length_cal, data.roughness, |
619 | 766 |
data.limitation_velocity, |
620 | 767 |
data.limitation_pressure_drop, data.velocity, data.reynolds, data.friction_factor, |
621 | 768 |
data.pressure_drop, data.pressure_drop_friction, |
622 |
data.pressure_drop_static, data.pressure_pipe_end_point, data.power) |
|
769 |
data.pressure_drop_static, data.pressure_pipe_end_point, data.power, |
|
770 |
data.vapor_flowrate_mass, |
|
771 |
data.vapor_density, data.vapor_viscosity, data.vapor_pressure, data.vapor_temperature, |
|
772 |
data.vapor_molecular_weight, |
|
773 |
data.vapor_compress_factor, data.liquid_flowrate_mass, data.liquid_density, |
|
774 |
data.liquid_viscosity) |
|
623 | 775 |
|
624 | 776 |
sql = 'insert or replace into HMB({}) values({})'.format(','.join(cols), ','.join(values)) |
625 | 777 |
cursor.execute(sql, param) |
내보내기 Unified diff