프로젝트

일반

사용자정보

개정판 5c2736cf

ID5c2736cf26fccfd9f71c53212610b73bf070fd51
상위 cce7850b
하위 3dbdd69f

김연진이(가) 약 4년 전에 추가함

issue #1060 계산식 수정

Change-Id: I56bdbf1abbd64d0754aae3fe5c36745b18c3fa19

차이점 보기:

HYTOS/HYTOS/Calculation.py
213 213
            return value
214 214

  
215 215
        if pre_unit == 'kg/m3':
216
            if cur_unit == 'lb/ft3': convert_factor = 0.06242797
216
            if cur_unit == 'lb/ft3': convert_factor = 1 / 16.0185   # 0.06242797
217 217
        elif pre_unit == 'lb/ft3':
218
            if cur_unit == 'kg/m3': convert_factor = 1 / 0.06242797
218
            if cur_unit == 'kg/m3': convert_factor = 16.0185        # 1 / 0.06242797
219 219

  
220 220
        return round(value * convert_factor, self._decimal)
221 221

  
......
441 441

  
442 442
        if pre_unit == 'kg/cm2':
443 443
            if cur_unit == 'psi':
444
                convert_factor = 14.22334
444
                convert_factor = 14.7 / 1.033           # 14.22334
445 445
            elif cur_unit == 'atm':
446
                convert_factor = 0.9678411
446
                convert_factor = 1 / 1.033              # 0.9678411
447 447
            elif cur_unit == 'bar':
448
                convert_factor = 0.980665
448
                convert_factor = 1.013 / 1.033          # 0.980665
449 449
            elif cur_unit == 'mmHg':
450
                convert_factor = 735.5591
450
                convert_factor = 760 / 1.033            # 735.5591
451 451
            elif cur_unit == 'kPa':
452
                convert_factor = 98.0665
452
                convert_factor = 101.325 / 1.033        # 98.0665
453 453
            elif cur_unit == 'MPa':
454
                convert_factor = 0.0980665
454
                convert_factor = 0.101325 / 1.033       # 0.0980665
455 455
        elif pre_unit == 'psi':
456 456
            if cur_unit == 'kg/cm2':
457
                convert_factor = 1 / 14.22334
457
                convert_factor = 1.033 / 14.7           # 1 / 14.22334
458 458
            elif cur_unit == 'atm':
459
                convert_factor = 0.06804596
459
                convert_factor = 1 / 14.7               # 0.06804596
460 460
            elif cur_unit == 'bar':
461
                convert_factor = 0.06894757
461
                convert_factor = 1.013 / 14.7           # 0.06894757
462 462
            elif cur_unit == 'mmHg':
463
                convert_factor = 51.71492
463
                convert_factor = 760 / 14.7             # 51.71492
464 464
            elif cur_unit == 'kPa':
465
                convert_factor = 6.894757
465
                convert_factor = 101.325 / 14.7         # 6.894757
466 466
            elif cur_unit == 'MPa':
467
                convert_factor = 0.006894757
467
                convert_factor = 0.101325 / 14.7        # 0.006894757
468 468
        elif pre_unit == 'atm':
469 469
            if cur_unit == 'kg/cm2':
470
                convert_factor = 1 / 0.9678411
470
                convert_factor = 1.033                  # 1 / 0.9678411
471 471
            elif cur_unit == 'psi':
472
                convert_factor = 1 / 0.06804596
472
                convert_factor = 14.7                   # 1 / 0.06804596
473 473
            elif cur_unit == 'bar':
474
                convert_factor = 1.01325
474
                convert_factor = 1.013                  # 1.01325
475 475
            elif cur_unit == 'mmHg':
476
                convert_factor = 759.9998
476
                convert_factor = 760                    # 759.9998
477 477
            elif cur_unit == 'kPa':
478 478
                convert_factor = 101.325
479 479
            elif cur_unit == 'MPa':
480 480
                convert_factor = 0.101325
481 481
        elif pre_unit == 'bar':
482 482
            if cur_unit == 'kg/cm2':
483
                convert_factor = 1 / 0.980665
483
                convert_factor = 1.033 / 1.013          # 1 / 0.980665
484 484
            elif cur_unit == 'psi':
485
                convert_factor = 1 / 0.06894757
485
                convert_factor = 14.7 / 1.013           # 1 / 0.06894757
486 486
            elif cur_unit == 'atm':
487
                convert_factor = 1 / 1.01325
487
                convert_factor = 1 / 1.013              # 1 / 1.01325
488 488
            elif cur_unit == 'mmHg':
489
                convert_factor = 750.0615
489
                convert_factor = 760 / 1.013            # 750.0615
490 490
            elif cur_unit == 'kPa':
491
                convert_factor = 100
491
                convert_factor = 101.325 / 1.013        # 100
492 492
            elif cur_unit == 'MPa':
493
                convert_factor = 0.1
493
                convert_factor = 0.101325 / 1.013       # 0.1
494 494
        elif pre_unit == 'mmHg':
495 495
            if cur_unit == 'kg/cm2':
496
                convert_factor = 1 / 735.5591
496
                convert_factor = 1.013 / 760            # 1 / 735.5591
497 497
            elif cur_unit == 'psi':
498
                convert_factor = 1 / 51.71492
498
                convert_factor = 14.7 / 760             # 1 / 51.71492
499 499
            elif cur_unit == 'atm':
500
                convert_factor = 1 / 759.9998
500
                convert_factor = 1 / 760                # 1 / 759.9998
501 501
            elif cur_unit == 'bar':
502
                convert_factor = 1 / 750.0615
502
                convert_factor = 1.013 / 760            # 1 / 750.0615
503 503
            elif cur_unit == 'kPa':
504
                convert_factor = 0.1333224
504
                convert_factor = 101.325 / 760          # 0.1333224
505 505
            elif cur_unit == 'MPa':
506
                convert_factor = 0.0001333224
506
                convert_factor = 0.101325 / 760         # 0.0001333224
507 507
        elif pre_unit == 'kPa':
508 508
            if cur_unit == 'kg/cm2':
509
                convert_factor = 1 / 98.0665
509
                convert_factor = 1.033 / 101.325        # 1 / 98.0665
510 510
            elif cur_unit == 'psi':
511
                convert_factor = 1 / 6.894757
511
                convert_factor = 14.7 / 101.325         # 1 / 6.894757
512 512
            elif cur_unit == 'atm':
513 513
                convert_factor = 1 / 101.325
514 514
            elif cur_unit == 'bar':
515
                convert_factor = 1 / 100
515
                convert_factor = 1.013 / 101.325        # 1 / 100
516 516
            elif cur_unit == 'mmHg':
517
                convert_factor = 1 / 0.1333224
517
                convert_factor = 760 / 101.325          # 1 / 0.1333224
518 518
            elif cur_unit == 'MPa':
519
                convert_factor = 1 / 1000
519
                convert_factor = 0.101325 / 101.325     # 1 / 1000
520 520
        elif pre_unit == 'MPa':
521 521
            if cur_unit == 'kg/cm2':
522
                convert_factor = 1 / 98.0665 * 1000
522
                convert_factor = 1.033 / 0.101325       # 1 / 98.0665 * 1000
523 523
            elif cur_unit == 'psi':
524
                convert_factor = 1 / 6.894757 * 1000
524
                convert_factor = 14.7 / 0.101325        # 1 / 6.894757 * 1000
525 525
            elif cur_unit == 'atm':
526
                convert_factor = 1 / 101.325 * 1000
526
                convert_factor = 1 / 0.101325           # 1 / 101.325 * 1000
527 527
            elif cur_unit == 'bar':
528
                convert_factor = 1 / 100 * 1000
528
                convert_factor = 1.013 / 0.101325       # 1 / 100 * 1000
529 529
            elif cur_unit == 'mmHg':
530
                convert_factor = 1 / 0.1333224 * 1000
530
                convert_factor = 760 / 0.101325         # 1 / 0.1333224 * 1000
531 531
            elif cur_unit == 'kPa':
532 532
                convert_factor = 1  # 기존 소스에 없음
533 533

  
......
785 785

  
786 786
    def get_ref_baro(self):
787 787
        try:
788

  
789
            unit = self.units['Pressure']
790
            if unit == 'kg/cm2':
791
                conv_factor = 1
792
            elif unit == 'bar':
793
                conv_factor = 1 / (1.013 / 1.033)
794
            elif unit == 'psi':
795
                conv_factor = 1 / (14.7 / 1.033)
796
            elif unit == 'mmHg':
797
                conv_factor = 1 / (760 / 1.033)
798
            elif unit == 'kPa':
799
                conv_factor = 1 / (101.325 / 1.033)
800
            elif unit == 'MPa':
801
                conv_factor = 1 / (0.101325 / 1.033)
802

  
803
            unit = self.units['Pressure']
804
            if unit == 'kg/cm2':
805
                ref_baro = 1.033 * conv_factor
806
            elif unit == 'bar':
807
                ref_baro = 1.01325 * conv_factor
808
            elif unit == 'psi':
809
                ref_baro = 14.7 * conv_factor
810
            elif unit == 'mmHg':
811
                ref_baro = 760 * conv_factor
812
            elif unit == 'kPa':
813
                ref_baro = 101.325 * conv_factor
814
            elif unit == 'MPa':
815
                ref_baro = 0.101325 * conv_factor
816

  
817
            '''
788 818
            unit = self.units['Pressure']
789 819
            if unit == 'kg/cm2':
790 820
                ref_baro = 1.033
......
798 828
                ref_baro = 101.325 / 98.0665
799 829
            elif unit == 'MPa':
800 830
                ref_baro = 0.101325 / 0.0980665
831
            '''
801 832

  
802 833
            return ref_baro
803 834
        except Exception as ex:
......
808 839

  
809 840
    def get_barometric_pressure(self):
810 841
        try:
842
            Ref_baro = self.get_ref_baro()
843
            unit = self.units['Pressure']
844
            if unit == 'kg/cm2':
845
                conv_factor = 1
846
            elif unit == 'bar':
847
                conv_factor = 1.013 / 1.033
848
            elif unit == 'psi':
849
                conv_factor = 14.7 / 1.033
850
            elif unit == 'mmHg':
851
                conv_factor = 760 / 1.033
852
            elif unit == 'kPa':
853
                conv_factor = 101.325 / 1.033
854
            elif unit == 'MPa':
855
                conv_factor = 0.101325 / 1.033
856

  
857
            return Ref_baro * conv_factor
858

  
859
            '''
811 860
            unit = self.units['Pressure']
812 861
            if unit == 'kg/cm2':
813 862
                barometric_pressure = 1.033
......
823 872
                barometric_pressure = 0.101325
824 873

  
825 874
            return barometric_pressure
875
            '''
826 876
        except Exception as ex:
827 877
            from App import App
828 878
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
......
1054 1104
                if density_unit == 'kg/m3':
1055 1105
                    self.v_density = self.v_density * self.tp_pressure_ratio
1056 1106
                elif density_unit == 'lb/ft3':
1057
                    self.v_density = self.v_density * 16.0185 * self.tp_pressure_ratio
1107
                    self.v_density = self.v_density * self.tp_pressure_ratio
1058 1108
            else:
1059 1109
                temperature_unit = self.units['Temperature']
1060 1110
                if temperature_unit == '℃':
......
2088 2138
            elif pressure_unit == 'MPa':
2089 2139
                p = self.tp_pressure / 1.033 * 0.101325 - baro_P
2090 2140

  
2091
            if row is not None:
2092
                self.pressure[self.no] = p
2093
            else:
2094
                self.pressure[self.no] = float(self.process['tp_pressure'])
2141
            self.pressure[self.no] = p
2095 2142

  
2096 2143
            # density (현재 kg/m3)
2097 2144
            density_unit = self.units['Density']
......
2294 2341
                self.tp_max_vel = 122 / (self.tp_homo_den ** 0.5)
2295 2342

  
2296 2343
                # erosion velocity (m/s)
2297
                self.tp_ero_vel = 185 / (self.tp_homo_den ** 0.5)
2344
                self.tp_ero_vel = 183 / (self.tp_homo_den ** 0.5)
2298 2345
            else:
2299 2346
                return
2300 2347
        except Exception as ex:

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)