-
Notifications
You must be signed in to change notification settings - Fork 10
/
CCMD.F90
1594 lines (1387 loc) · 61 KB
/
CCMD.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
! Last Update: June 27th, 2013
PROGRAM MEANLINE
!VARIABLE DECLARTIONS
IMPLICIT DOUBLE PRECISION (a-h,l,o-z)
IMPLICIT INTEGER (i-k,m,n)
PARAMETER (ncmax=20) !max number of components in mixture
DIMENSION x(ncmax),xliq(ncmax),xvap(ncmax),f(ncmax)
CHARACTER hrf*3, herr*255, OutFile*30, a*54
CHARACTER*255 hf(ncmax)
CHARACTER*7 hfmix
COMMON / Constant / PI, Target_PR, isteps, iPerformance,iAir,iCarbonDioxide, iDiffAnalysis, iVoluteAnalysis
COMMON / Geometric / r1h, r1s, r1m, r2, r3, r4, r6, A1, A2, tb1, tb, b1, b2, b3, b4, b6, &
LbImpeller, TipClearance, RoughnessImp, &
iFull, iSplitter, LbSplitter, Z, Lb, DeltaZ, CurveKm1, FlowCoefficient
COMMON / Geometric2 / r1h_min, r1h_max, r1s_min, r1s_max, r2_min, r2_max
COMMON / Velocity / U1, U2, C1, C2, Cu1, Cu2, Cm1, Cr2, W1, W2, W1s, W1h, Wu2
COMMON / Properties / Visc1, Visc2, zMdot, N, MaxIter, m, isolution,iDiffSteps, iErrorCheck
COMMON / Thermodynamic / rho01, rho02, rho1, rho2, P01, P1, P02, P2, T01, T2, T1
COMMON / FlowAngles / Beta1Prime, Alpha1, Alpha2, DiffuserLossFactor, VoluteLossFactor
COMMON / BladeAngles / Beta1, Beta2, Beta2m, Beta2guess
COMMON / Losses / LossesInternal, LossesParasitic, cf, Sigma, ShockLoss, LossIncidence, &
DiffusionLoss, ChokingLoss, BladeLoadingLoss, HSLoadingLoss, &
SkinFrictionLoss, TipClearanceLoss, LossMixing, SupercritMachNumberLoss
!INITIALIZE VARIABLES
MaxIter = 500
PI = 3.1415926535898
WRITE(*,*)" CENTRIFUGAL COMPRESSOR MEANLINE DESIGN"
WRITE(*,*)" "
WRITE(*,*)" CC"
WRITE(*,*)" CC CCC"
WRITE(*,*)" C CCCCCCCC"
WRITE(*,*)" CCCCCCCCCC DDDD"
WRITE(*,*)" CCCCCCCCCC DDDDDDD"
WRITE(*,*)" CCCCCCCCCC MMM DDDDDDDD"
WRITE(*,*)" CCCCCCCCC MMMMMMM DDDDDDDD"
WRITE(*,*)" CCCCCCCCC MMMMMMMMMMM DDDDDDDDD"
WRITE(*,*)" CCCCCCCCC MMMMMMMMMMMMM DDDDDDDDD"
WRITE(*,*)" CCCCCCCCC MMMMMMMMMMMMM DDDDDDDDD"
WRITE(*,*)" CCCCCCCCC MMMMMMMMMMMMM DDDDDDDDD"
WRITE(*,*)" CCCCCCCCC MMMMMMMMMMM DDDDDDDDD"
WRITE(*,*)" CCCCCCCCC MMMMMMM DDDDDDDDDD"
WRITE(*,*)" CCCCCCCCC MMM DDDDDDDDDD"
WRITE(*,*)" CCCCCCCC DDDDDDDDDDD"
WRITE(*,*)" CCCCC DDDDDDDDDDD"
WRITE(*,*)" DDDDDDDD D"
WRITE(*,*)" DDD DD "
WRITE(*,*)" DD "
WRITE(*,*)" "
WRITE(*,*)" CARLETON UNIVERSITY GAS TURBINE PROJECT"
WRITE(*,*)" ...Press Enter To Begin..."
READ(*,*)
!MUST Be Named CompressorDimensions With .txt Extension
OPEN(UNIT=20,FILE='CompressorDimensions.txt',STATUS='OLD')
DO iread=1,67
READ(20,*)
END DO
!Read File Formatting (A = Character String, Field Width = 54)
12 FORMAT (A54,I8) !I = Integer, Field Width = 8
13 FORMAT (A54,F14.7) !F = Real, Field Width = 14, and 7 Decimal Places9
14 FORMAT (A54,I3) !I = Integer, Field Width = 2
!Read Rotor Dimensions From Text File
READ(20,14) a,iAir
READ(20,14) a,iCarbonDioxide
READ(20,*)
READ(20,*)
READ(20,*)
READ(20,13) a,Target_PR
READ(20,12) a,N
READ(20,13) a,zMdot
READ(20,13) a,T01
READ(20,13) a,P01
READ(20,*)
READ(20,13) a,r2
!READ(20,13) a,LbImpeller
READ(20,13) a,LbSplitter
!READ(20,13) a,Lb
READ(20,13) a,tb1!Inlet Blade Thickness
READ(20,13) a,tb!Outlet Blade Thickness
READ(20,13) a,RoughnessImp
READ(20,13) a,TipClearance
READ(20,13) a,Alpha1
READ(20,13) a,CurveKm1
READ(20,*)
READ(20,14) a,iDiffAnalysis
READ(20,13) a,r4
READ(20,13) a,b4
READ(20,14) a,iVoluteAnalysis
READ(20,13) a,VoluteLossFactor
READ(20,13) a,r6
READ(20,13) a,b6
READ(20,*)
READ(20,*)
READ(20,*)
READ(20,*)
READ(20,14) a,iStep1!Check if 0
READ(20,*)
READ(20,13) a,r1h
READ(20,13) a,r1s
READ(20,13) a,b2
READ(20,*)
READ(20,14) a,iStep2!Check if 0
READ(20,*)
READ(20,14) a,iFull
READ(20,14) a,iSplitter
READ(20,*)
READ(20,14) a,iTPcond!Check if 0
READ(20,*)
READ(20,14) a,iSteps
READ(20,14) a,iDiffSteps
READ(20,*)
READ(20,14) a,iErrorCheck
CLOSE(20)
!For Debugging The Inputs:
!WRITE(*,*) iAir
!WRITE(*,*) iCarbonDioxide
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*) Target_PR
!WRITE(*,*) N
!WRITE(*,*) zMdot
!WRITE(*,*) T01
!WRITE(*,*) P01
!WRITE(*,*)
!WRITE(*,*) r2
!WRITE(*,*) LbImpeller
!WRITE(*,*) LbSplitter
!WRITE(*,*) Lb
!WRITE(*,*) tb1!Inlet Blade Thickness
!WRITE(*,*) tb!Outlet Blade Thickness
!WRITE(*,*) RoughnessImp
!WRITE(*,*) TipClearance
!WRITE(*,*) Alpha1
!WRITE(*,*)
!WRITE(*,*) iDVAnalysis
!WRITE(*,*) DiffuserLossFactor
!WRITE(*,*) r4
!WRITE(*,*) b4
!WRITE(*,*) VoluteLossFactor
!WRITE(*,*) r6
!WRITE(*,*) b6
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*) r1h!Check if 0
!WRITE(*,*) r1h_min
!WRITE(*,*) r1h_max
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*) r1s!Check if 0
!WRITE(*,*) r1s_min
!WRITE(*,*) r1s_max
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*) iFull!Check if 0
!WRITE(*,*) iFull_Min
!WRITE(*,*) iFull_Max
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*) iSplitter
!WRITE(*,*) iSplitter_Min
!WRITE(*,*) iSplitter_Max
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*) DeltaZ!Check if 0
!WRITE(*,*) DeltaZ_Min
!WRITE(*,*) DeltaZ_Max
!WRITE(*,*)
!WRITE(*,*)
!WRITE(*,*) b2!Check if 0
!WRITE(*,*) b2_Min
!WRITE(*,*) b2_Max
!WRITE(*,*)
!WRITE(*,*) isteps
!READ(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*) 'Input Design Flow Coefficient:'
READ (*,*) FlowCoefficient
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*) 'Please Enter Output File Name (i.e. ConceptOne.txt):'
READ (*,*) Outfile
OPEN(UNIT=10,FILE=OutFile,STATUS='NEW')
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*)
WRITE(*,*) "Calculating Compressor Performance..."
m = 0
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! FULL ROTOR PERFORMANCE ANALYSIS
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (iStep1 == 0 .AND. iStep2 == 0 .AND. iTPCond == 0) THEN
iPerformance = 0
WRITE(10,*) ' Carleton University'
WRITE(10,*) ' Department of Mechanical and Aerospace Engineering'
WRITE(10,*) ' COMPRESSOR PERFORMANCE ANALYSIS RESULTS'
WRITE(10,*) ' Gas Turbine Project'
WRITE(10,*)
CALL PERFORMANCE()
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
END IF
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! INLET OPTIMIZATION CHOSEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (iStep1 == 1 .AND. iStep2 == 0 .AND. iTPCond == 0) THEN
r1h_min = r2*0.05
r1h_max = r2*0.5
r1s_min = r1h_min*1.1
r1s_max = r2*0.7
b2_min = (r1s_min - r1h_min)*0.5
b2_max = (r1s_max - r1h_min)*0.5
step3 = (b2_max - b2_min)/isteps
r1h = r1h_min
m3 = 0
isolution = 0
iPerformance = 1
WRITE(10,*) ' Carleton University'
WRITE(10,*) ' Department of Mechanical and Aerospace Engineering'
WRITE(10,*) ' INLET OPTIMIZATION DATA'
WRITE(10,*) ' Gas Turbine Project'
WRITE(10,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
WRITE(10,*) 'r1h r1s b2 M1_tip M2_rel dH_m Flow Co. Work Co. Efficiency'
DO WHILE (b2 <= b2_max)
b2 = b2_min + step3*m3
m3 = m3 + 1
m2 = 0
DO WHILE (r1s <= r1s_max)
r1s_min = r1h * 1.1
step2 = ((r1s_max-r1s_min)/isteps)
r1s = r1s_min + step2*m2
m2 = m2 + 1
m = 0
DO WHILE (r1h <= r1h_max)
r1h_max = r1s * 0.9
step = ((r1h_max-r1h_min)/isteps)
r1h = r1h_min + step*m
m = m + 1
isolution = isolution + 1
CALL PERFORMANCE()
END DO
r1h = r1h_min
r1h_max = r2*0.5
END DO
r1s = r1s_min
END DO
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
r1h=0
END IF
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! NUMBER OF FULL BLADES CHOSEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (iStep1 == 0 .AND. iStep2 == 1 .AND. iTPCond == 0) THEN
iPerformance = 2
WRITE(10,*) ' Carleton University'
WRITE(10,*) ' Department of Mechanical and Aerospace Engineering'
WRITE(10,*) ' NUMBER OF FULL BLADES ANALYSIS'
WRITE(10,*) ' Gas Turbine Project'
WRITE(10,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
WRITE(10,*) '#Blades M1_tip M2_rel dH_tip dH_hub dH_m Flow Co. Work Co. Efficiency Beta2'
iFull = 5
iFull_Max = 35
DO WHILE (iFull <= iFull_max)
CALL PERFORMANCE()
iFull = iFull + 1
END DO
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
iFull=0
END IF
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! INLET CONDITIONS CHOSEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (iStep1 == 0 .AND. iStep2 == 0 .AND. iTPCond == 1) THEN
iPerformance = 3
WRITE(10,*) ' Carleton University'
WRITE(10,*) ' Department of Mechanical and Aerospace Engineering'
WRITE(10,*) ' OUTLET PASSAGE WIDTH ANALYSIS'
WRITE(10,*) ' Gas Turbine Project'
WRITE(10,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
WRITE(10,*) ' T01 P01 M2_rel dH_tip dH_hub dH_m Flow Coeff. Work Co. Efficiency'
Tc = 304.25
Pc = 7380.0
T01max = T01
P01max = P01
!Step Sizes
PStep = (P01 - Pc)/isteps
TStep = (T01 - Tc)/isteps
inewsteps = isteps + 5
DO m=0,inewsteps
T01 = T01max - m*TStep
P01 = P01max - m*PStep
CALL PERFORMANCE()
END DO
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
END IF
END PROGRAM MEANLINE
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! SUBROUTINE: Meanline Performance Analysis
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SUBROUTINE PERFORMANCE()
IMPLICIT DOUBLE PRECISION (a-h,l,o-z)
IMPLICIT INTEGER (i-k,m,n)
PARAMETER (ncmax=20) !max number of components in mixture
DIMENSION x(ncmax),xliq(ncmax),xvap(ncmax),f(ncmax)
CHARACTER hrf*3, herr*255, OutFile*30, a*54
CHARACTER*255 hf(ncmax)
CHARACTER*7 hfmix
COMMON / Constant / PI, Target_PR, isteps, iPerformance,iAir,iCarbonDioxide, iDiffAnalysis, iVoluteAnalysis
COMMON / Geometric / r1h, r1s, r1m, r2, r3, r4, r6, A1, A2, tb1, tb, b1, b2, b3, b4, b6, &
LbImpeller, TipClearance, RoughnessImp, &
iFull, iSplitter, LbSplitter, Z, Lb, DeltaZ, CurveKm1, FlowCoefficient
COMMON / Geometric2 / r1h_min, r1h_max, r1s_min, r1s_max, r2_min, r2_max
COMMON / Velocity / U1, U2, C1, C2, Cu1, Cu2, Cm1, Cr2, W1, W2, W1s, W1h, Wu2
COMMON / Properties / Visc1, Visc2, zMdot, N, MaxIter, m, isolution,iDiffSteps,iErrorCheck
COMMON / Thermodynamic / rho01, rho02, rho1, rho2, P01, P1, P02, P2, T01, T2, T1
COMMON / FlowAngles / Beta1Prime, Alpha1, Alpha2, DiffuserLossFactor, VoluteLossFactor
COMMON / BladeAngles / Beta1, Beta2, Beta2m, Beta2guess
COMMON / Losses / LossesInternal, LossesParasitic, cf, Sigma, ShockLoss, LossIncidence, &
DiffusionLoss, ChokingLoss, BladeLoadingLoss, HSLoadingLoss, &
SkinFrictionLoss, TipClearanceLoss, LossMixing, SupercritMachNumberLoss
!Re-Initialize for unknown black magic reasons
r1m = 0
A1 = 0
A2 = 0
Z = 0
U1 = 0
U1s = 0
U1h = 0
U2 = 0
C1 = 0
C1s = 0
C1h = 0
C2 = 0
Cu1 = 0
Cu2 = 0
Cm1 = 0
Cm1s = 0
Cm1h = 0
Cr2 = 0
W1 = 0
W1s = 0
W1h = 0
W2 = 0
Wu2 = 0
Visc1 = 0
Visc2 = 0
rho01 = 0
rho02 = 0
rho1 = 0
rho2 = 0
P1 = 0
P02 = 0
P2 = 0
T1 = 0
T2 = 0
Beta1prime = 0
Alpha2 = 0
Beta1 = 0
Beta2 = 0
Beta2guess = 0
kbeta = 0
!SETUP & CALL REFPROP for CO2 Properties
IF (iAir == 1) THEN
i=1
hf(1)='AIR.ppf'
hfmix='hmx.bnc'
hrf='DEF'
CALL SETUP (i,hf,hfmix,hrf,ierr,herr)
IF (ierr.ne.0) WRITE (*,*) herr
CALL INFO (1,wm,ttp,tnbp,tc,pc,dc,zc,acf,dip,rgas)
END IF
IF (iCarbonDioxide == 1) THEN
i=1
hf(1)='CO2.fld'
hfmix='hmx.bnc'
hrf='DEF'
CALL SETUP (i,hf,hfmix,hrf,ierr,herr)
if (ierr.ne.0) write (*,*) herr
CALL INFO (1,wm,ttp,tnbp,tc,pc,dc,zc,acf,dip,rgas)
END IF
!VARY ROTOR DIMENSIONS FOR OPTIMIZATION
!ROTOR INLET DIMENSIONS
D1h = r1h*2!m
D1s = r1s*2!m
b1 = r1s - r1h
A1=PI*(r1s**2 - r1h**2)!m^2 / Rotor inlet area with blockage
r1m=(0.5*(r1s**2)+0.5*(r1h**2))**0.5!Inlet Meanline Radius (m)
D1=r1m*2
!ROTOR OUTLET DIMENSIONS
D2 = r2*2!Impeller Outlet Tip Diameter (m)
A2=(2*PI*r2-(iFull+iSplitter)*tb)*b2!m^2 / Rotor outlet area with blockage
!DESIGN POINT
CALL TPFLSH (T01,P01,x,d,dl,dv,xliq,xvap,q,e,H01,S01,cv,cp,w,ierr,herr)
R = rgas*1000/wm
rho01=d*wm!kg/m^3
U1=r1m*2*PI*N/60!Blade Speed (m/s)
U2=r2*2*PI*N/60!Blade Speed (m/s)
PRr=Target_PR+0.2!Rotor Pressure Ratio Guess
Effr=0.9!Rotor Isentropic Efficiency Guess
DeltaZ = D2*(0.014 + 0.023*D2/D1h + 1.58*FlowCoefficient) !Empirical estimate from Aungier (2000 pg 113)
!ROTOR INLET
!ROTOR INLET VELOCITY TRIANGLE
!First iteration using stagnation conditions
C1=zMdot/(rho01*A1*COS(Alpha1*PI/180))
last=0
j=0
DO WHILE (ABS((C1 - last)/C1) .GT. 0.0000001)
j=j+1
last=C1
!Stagnation is an isentropic process
H1=H01-(C1**2)*wm/2000!J/mol
S1=S01
CALL HSFLSH (H1,S1,zz,T1,P1,rho1,Dl,Dv,x1,y,q,e,cv,cp,a_1,ierr,herr)
rho1=rho1*wm!kg/m^3
Angle = Alpha1*PI/180
C1=zMdot/(rho1*A1*COS(Angle))!Update C1
!Error Checking
IF (j.GT.MaxIter) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 1.1 - Max iteration reached at rotor inlet."
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
ENDIF
END IF
IF (ierr.NE.0) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 1.2 - REFPROP (HSFLSH) error at rotor inlet:"
WRITE(*,*) herr
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
ENDIF
END IF
END DO
CALL TRNPRP (T1,rho1/wm,x1,eta,tcx,ierr,herr)
IF (ierr.NE.0) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 1.3 - REFPROP (TRNPRP) error at rotor inlet:"
WRITE(*,*) herr
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
ENDIF
END IF
Visc1=eta/1000000!kg/m*s
!CONVERGED ROTOR INLET VELOCITY TRIANGLES
!Meanline
Cm1 = C1 * COS(Alpha1*PI/180)
Cu1 = C1 * SIN(Alpha1*PI/180)
Wu1 = Cu1 - U1
W1 = SQRT(Wu1**2+Cm1**2)
Beta1 = ATAN(Wu1/Cm1)*(180/PI)
U1m = r1m*2*PI*N/60
zM1rel = W1/a_1
!Shroud
Cm1s = Cm1*(1-CurveKm1*b1/2)!Aungier(2000)
U1s = r1s*2*PI*N/60
Cu1s = Cu1 !Assume Cu1 = Cu1s
Wu1s = Cu1s - U1s
W1s = SQRT(Cm1s**2+Wu1s**2)
C1s = SQRT(Cm1s**2+Cu1s**2)
Beta1s = ATAN(Wu1s/Cm1s)*(180/PI)
zM1rels = W1s/a_1
!Hub
Cm1h = Cm1*(1+CurveKm1*b1/2)!Aungier(2000)
U1h = r1h*2*PI*N/60
Cu1h = Cu1 !Assume Cu1 = Cu1h
Wu1h = Cu1h - U1h
W1h = SQRT(Cm1h**2+Wu1h**2)
C1h = SQRT(Cm1h**2+Cu1h**2)
Beta1h = ATAN(Wu1h/Cm1h)*(180/PI)
zM1relh = W1h/a_1
! IF(zM1rel.GT.1) THEN
! WRITE(*,*) "Inlet is choked at meridional."
! READ(*,*)
! ELSE IF(zM1rels.GT.1) THEN
! WRITE(*,*) "Inlet is choked at tip."
! READ(*,*)
! ELSE IF(zM1relh.GT.1) THEN
! WRITE(*,*) "Inlet is choked at hub."
! READ(*,*)
! END IF
PRrLast =0
kPR=0
DO WHILE (ABS((PRr - PRrLast)/PRr) .GT. 0.0000001)
kPR=kPR+1
PRrLast = PRr
IF (kPR.GT.MaxIter) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 2.1 - Max iteration reached at PR loop."
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
END IF
END IF
!~~~~~~~~~~~~~~~~~~~~~~~~~~IMPELLER ANALYIS~~~~~~~~~~~~~~~~~~~~~~~~~~!
!The impeller analysis uses basic turbomachinery principles and
!an optimum set of loss models (Oh et al.) to correct for real effects
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
kbeta = 0
Beta2last = 100
DO WHILE (ABS((Beta2 - Beta2last)/Beta2) .GT. 0.000001)
kbeta=kbeta+1
Beta2last = Beta2
IF (kbeta.GT.MaxIter) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 2.2 - Max iteration reached at Beta2 loop."
READ(*,*)
END IF
IF(iErrorCheck == 0) THEN
GOTO 1337
END IF
END IF
IF (ABS(Beta2) > 80 .AND. ABS(Beta2) <= 90) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 2.1 - Beta2 iteration is diverging"
END IF
Beta2 = 40!Prevents divergence
IF(iErrorCheck == 0) THEN
GOTO 1337
END IF
END IF
!Estimate of mean camber line length and equivalent number of blades
Lb = (DeltaZ - b2/2) + (D2 - D1)/(2*COS(Beta2*PI/180))!Sjolander
Z = iFull + (LbSplitter/Lb)*iSplitter !Aungier
!~~~~~~~~~~~~~~~~~~~~~ROTOR OUTLET~~~~~~~~~~~~~~~~~~~!
EffrLast = 0
kEFF = 0
DO WHILE (ABS((Effr-EffrLast)/Effr).GT.0.000001)
kEFF = kEFF+1
EffrLast = Effr
IF (kEFF.GT.MaxIter) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 2.3 - Max iteration reached at efficiency loop."
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
END IF
END IF
P02=PRr*P01!kPa
!Ideal (isentropic) compression to P02
S02ideal=S01!J/mol-K
CALL PSFLSH (P02,S02ideal,zz,T02ideal,rho02ideal,Dl,Dv,x,y,q,e,H02ideal,cv,cp,w,ierr,herr)
!Actual total enthalpy at rotor outlet
H02=H01+(H02ideal-H01)/Effr!J/mol
!Actual total conditions at rotor outlet
CALL PHFLSH (P02,H02,zz,T02,rho02,Dl,Dv,x,y,q,e,S02,cv,cp,w,ierr,herr)
rho02=rho02*wm!kg/m^3
!Actual total enthalpy across rotor
DeltaH0Rotor=(H02-H01)*1000/wm!J/kg or m/s
!From the Euler turbine equation
Cu2=(1/U2)*(DeltaH0Rotor+U1*Cu1)!m/s
!ROTOR OUTLET VELOCITY TRIANGLE
!First iteration using stagnation density
Cr2=zMdot/(rho02*A2)
last=0
i=0
C2 = 1
DO WHILE (ABS((C2 - last)/C2) .GT. 0.0000001)
i=i+1
last=C2
C2=SQRT(Cr2**2+Cu2**2)
!Stagnation is an isentropic process
H2=H02-(C2**2)*wm/2000!J/mol
S2=S02
CALL HSFLSH (H2,S2,zz,T2,P2,rho2,Dl,Dv,x2,y,q,e,cv,cp,a_2,ierr,herr)
rho2=rho2*wm!kg/m^3
Cr2=zMdot/(rho2*A2)!Update Cr2
IF (i.GT.MaxIter) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 2.4 - Max iteration reached at continuity loop."
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
END IF
END IF
IF (ierr.NE.0) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 2.5 - REFPROP (HSFLSH) error at rotor inlet:"
WRITE(*,*) herr
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
ENDIF
END IF
END DO
!CONVERGED ROTOR OUTLET VELOCITY TRIANGLE
C2=SQRT(Cr2**2+Cu2**2)
Alpha2=ATAN(Cu2/Cr2)*(180/PI)
Wu2=Cu2-U2
W2=SQRT(Wu2**2+Cr2**2)
Beta2=ATAN(Wu2/Cr2)*(180/PI)
aM2=C2/a_2!Absolute Mach Number
rM2=W2/a_2!Relative Mach Number
CALL TRNPRP (T2,rho2/wm,x2,eta,tcx,ierr,herr)
IF (ierr.NE.0) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 2.6 - REFPROP (TRNPRP) error at rotor outlet:"
WRITE(*,*) herr
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
END IF
ENDIF
Visc2 = eta/1000000!kg/m*s
!CALCULATE LOSS MODELS
CALL InternalLosses()
!Calculate Actual Discharge Enthalpy
H02real = H02ideal + LossesInternal*wm/1000
CALL HSFLSH (H02real,S02,zz,T02,P02,rho02,Dl,Dv,x,y,q,e,cv,cp,w,ierr,herr)
Effr = (H02ideal - H01)/(H02real - H01) !Updated Rotor Efficiency
rho02 = rho02*wm!kg/m^3
END DO
!ROTOR DEHALLER NUMBER
dHm=W2/W1
dHh=W2/W1h
dHt=W2/W1s
Sigma = 1
SigmaLast = 0
Beta2m = Beta2
!Estimate Metal Angle Based on Slip Factor (Aungier 2000)
DO WHILE (ABS((Sigma-SigmaLast)/Sigma).GT.0.0000001)
!Sigma = 1 - ((PI/Z)*COS(Beta2m*PI/180))/(1-phi*TAN(Beta2m*PI/180))!(Stodola)
!Sigma = 1 - (0.63*PI/Z)/(1-phi*TAN(Beta2m*PI/180))!(Stanitz)
Sigma = 1 - (SQRT(ABS(COS(Beta2m*PI/180)))*SIN(Alpha2*PI/180)/Z**.7)!(Wiesner/Busemann)
SigmaStar = SIN(19+0.2*(Beta2m+90))
E_limit = (Sigma - SigmaStar)/(1 - SigmaStar)
IF (r1m/r2 .GT. E_limit) THEN
Sigma = Sigma*(1 - (((r1m/r2)-E_limit)/(1-E_limit))**(SQRT(ABS(90+Beta2m)/10)))
END IF
SigmaLast = Sigma
phi=Cr2/U2
Cu2i = Cu2/Sigma
Wu2i = Cu2i - U2
Beta2m = ATAN(Wu2i/Cr2)*(180/PI)
Alpha2 = ATAN(Cu2i/Cr2)*(180/PI)
END DO
!FINAL ROTOR OUTLET VELOCITY TRIANGLE (with slip factor)
Cu2= Cu2/Sigma
Wu2 = Cu2 - U2
Beta2m = ATAN(Wu2/Cr2)*180/PI
C2 = SQRT(Cr2**2+Cu2**2)
W2=SQRT(Wu2**2+Cr2**2)
Alpha2=ATAN(Cu2/Cr2)*(180/PI)
workcoeff = (H02real-H01)/(U2**2*wm/1000)
FlowCoeff = zMdot/(rho01*PI*(r2**2)*U2)
RotationalMach = U2/a_2
END DO
!~~~~~~~~~~~~~~~~~~~~IMPELLER PARASITIC LOSSES~~~~~~~~~~~~~~~~~~~~~~~!
! Follows the method overviewed in Aungier (2000)
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
!~~~~~~~~~~~~~~~ Disk Friction Work (Daily and Nece) ~~~~~~~~~~~~~~~~!
!First determine the flow conditions in the clearance gap as follows:
r_bar = (r1m + r2)/2
b_bar = (b1 + b2)/2
!Average pressure difference across the blade in the clearance gap
Pcl = zMdot*(r2*Cu2-r1m*Cu1)/(Z*r_bar*b_bar*Lb)
!Velocity of the clearance gap leakage flow
Ucl = 0.816*SQRT(2*Pcl/rho2)
!Blade clearance gap leakage mass flow rate for all the blades
clMdot = rho2*Ucl*(Z*TipClearance*Lb)
Tcl = T2!Assume temperature at the rotor outlet is the same as clearance gap
CALL TPFLSH (Tcl,Pcl,x,rhocl,dl,dv,xliq,xvap,q,e,hs,ss,cv,cp,w,ierr,herr)
CALL TRNPRP (Tcl,rhocl,x,eta,tcx,ierr,herr)
IF (ierr.NE.0) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 2.7 - REFPROP (TRNPRP) error at parasitic losses:"
WRITE(*,*) herr
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
END IF
ENDIF
Visc_cl = eta/1000000 !kg/m*s
ReDF = ABS(rho2*U2*r2/Visc_cl)
IF (ReDF.LT.300000) THEN
f_df = 2.67/(ReDF**0.5)
ELSE
f_df = 0.0622/(ReDF**0.2)
END IF
rho_bar = (rho1+rho2)/2
DiskFriction = f_df * rho_bar * r2**2 * U2**3 / (4*zMDot)
!~~~~~~~~~~~~~~~~~~~ Leakage Work (Aungier)~~~~~~~~~~~~~~~~~~~~~~~~~~~!
LeakageWork = clMdot*Ucl*U2/(2*zMdot)!Assuming an open impeller
!~~~~~~~~~~~~~~~~~~~~~~~ Recirculation Work ~~~~~~~~~~~~~~~~~~~~~~~~~~~!
Df = 1-W2/W1s+(0.75*(U2*Cu2-U1*Cu1)/U2**2)/((W1s/W2)*((Z/PI)*(1-r1s/r2)+(2*r1s/r2)))
RecirculationWork = 0.000008*SINH(3.5*(ATAN(Cu2/Cr2))**3)*Df**2*U2**2
!~~~~~~~~~~~~~~~ SUM PARASITIC LOSS COEFFICIENTS ~~~~~~~~~~~~~~~~~~~~~~!
LossesParasitic = DiskFriction + LeakageWork + RecirculationWork
PRr = P02/P01 !Rotor Pressure Ratio
H02real = H02real + LossesParasitic*wm/1000
S02ideal = S01
CALL PSFLSH (P02,S02ideal,zz,T02ideal,rho02ideal,Dl,Dv,x,y,q,e,H02ideal,cv,cp,w,ierr,herr)
Effr = (H02ideal - H01)/(H02real - H01)
!~~~~~~~~~~~~~~~~~~ END OF IMPELLER ANALYSIS ~~~~~~~~~~~~~~~~~~~~~~~~~~!
IF (iDiffAnalysis == 0 .AND. iVoluteAnalysis == 0) THEN !(If only impeller analysis is specified)
PRs = PRr
Effs = Effr
END IF
IF (iDiffAnalysis == 1) THEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~DIFFUSER ANALYIS~~~~~~~~~~~~~~~~~~~~~~~~~~!
!The diffuser analysis currently just uses an inputted loss factor.
!For a full analysis method see Aungier (2000), or Roberts (2003).
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
!Assume flow properties at rotor outlet are the same as diffuser inlet
Cu3 = Cu2
Cm3 = Cr2
C3 = C2
r3 = r2
b3 = b2
H03 = H02real
H3 = H2
S03 = S02
S3 = S2
P03 = P02
P3 = P2
T03 = T02
T3 = T2
rho03 = rho02
rho3 = rho2
!Diffuser geometry
Alpha = (ATAN((r4-r3)/((b3/2)-(b4/2))))*(180/PI)!Assuming constant taper. With respect to tangent.
DiffuserLength = r4 - r2
LengthM = DiffuserLength*SIN(Alpha*PI/180)
DeltaM = LengthM/iDiffSteps
!Initial step conditions
CuLast = Cu3
CmLast = Cm3
CLast = C3
rLast = r3
dIdLast = 0
blast = b3
CurrentLengthM = DeltaM
PLast = P3*1000
rhoLast = rho3
!Initial guess for next downstream location
H = H3
S = S3
rho = rho3
H0 = H03
!Initialize boundary layer information
Del = b3*(1-(b3/r3)**0.15)/2 !Initial boundary layer thickness estimate
rCue = rlast * CuLast !Assume this is conserved until boundary layers fill the passage
Blockage = Del/(4*blast)
Dmax = 0.4*((b3/LengthM)**0.35)*SIN(Alpha*PI/180) !Diffusion divergence parameter
i = 0
DO WHILE (i /= iDiffSteps)
!Get next downstream radius and diffuser width
radius = DeltaM*SIN(Alpha*PI/180) + rLast
b = b3 + (b4-b3)/(r4-r3)*(radius-r3)
! Calculate next downstream station whirl velocity
!Cu = ABS(radius*CuLast/(radius+DeltaM)) - ABS(radius*C*Cu*cf*DeltaM/(b*Cm)) !S.Roberts
Cu = -(DeltaM*rlast*CLast*CuLast*cf)/(radius*(blast*CmLast))+(rlast*CuLast/radius)
IF (Cu.LT.0) THEN
Cu = 0
END IF
!Estimate radial (meridional velocity) from continuity equation
Cm = zMdot / (2*PI*radius*rho*b*(1-Blockage))
kdiff=0
DO WHILE (ABS((Cm-CmLastIter)/Cm).GT.0.000001)
kdiff=kdiff+1
CmLastIter = Cm
C = SQRT(Cu**2+Cm**2)
H = H0 - (C**2)*wm/2000!J/mol
CALL HSFLSH (H,S,zz,T,P,rho,Dl,Dv,x,y,q,e,cv,cp,w,ierr,herr)
rho=rho*wm!kg/m^3
Cm = zMDot / (2*PI*radius*rho*b*(1-Blockage))
Slast=S
IF (kdiff.GT.MaxIter) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 3.1 - Max iteration reached at diffuser step",i
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
END IF
END IF
IF (ierr.NE.0) THEN
IF(iErrorCheck == 1) THEN
WRITE(*,*) "Error 3.2 - REFPROP (HSFLSH) error at diffuser step ",i,":"
WRITE(*,*) herr
READ(*,*)
ELSEIF(iErrorCheck == 0) THEN
GOTO 1337
ENDIF