-
Notifications
You must be signed in to change notification settings - Fork 10
/
CCMD_Backup_June27th.F90
1433 lines (1217 loc) · 54.3 KB
/
CCMD_Backup_June27th.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 change: FF 18 Nov 101 6:14 pm
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, iDVAnalysis
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
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
COMMON / Thermodynamic / rho01, rho02, rho1, rho2, P01, P1, P02, P2, T01, T2, T1
COMMON / FlowAngles / Beta1Prime, Alpha1, Alpha2, DiffuserLossFactor, VoluteLossFactor
COMMON / BladeAngles / Beta1, Beta2, Beta2guess
COMMON / Losses / LossesInternal, LossesParasitic, cf, Sigma, ShockLoss, LossIncidence, &
DiffusionLoss, ChokingLoss, BladeLoadingLoss, HSLoadingLoss, &
SkinFrictionLoss, TipClearanceLoss, LossMixing, SupercritMachNumberLoss
!INITIALIZE VARIABLES
MaxIter = 1000
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 Any Key To Begin..."
READ(*,*)
!MUST Be Named CompressorDimensions With .txt Extension
OPEN(UNIT=20,FILE='CompressorDimensions.txt',STATUS='OLD')
DO iread=1,48
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,iDVAnalysis
READ(20,13) a,DiffuserLossFactor
READ(20,13) a,r4
READ(20,13) a,b4
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,*)
READ(20,13) a,r1h!Check if 0
READ(20,13) a,r1h_min
READ(20,13) a,r1h_max
READ(20,*)
READ(20,*)
READ(20,13) a,r1s!Check if 0
READ(20,13) a,r1s_min
READ(20,13) a,r1s_max
READ(20,*)
READ(20,*)
READ(20,14) a,iFull!Check if 0
READ(20,14) a,iFull_Min
READ(20,14) a,iFull_Max
READ(20,*)
READ(20,*)
READ(20,14) a,iSplitter
READ(20,14) a,iSplitter_Min
READ(20,14) a,iSplitter_Max
READ(20,*)
READ(20,*)
READ(20,13) a,DeltaZ!Check if 0
READ(20,13) a,DeltaZ_Min
READ(20,13) a,DeltaZ_Max
READ(20,*)
READ(20,*)
READ(20,13) a,b2!Check if 0
READ(20,13) a,b2_Min
READ(20,13) a,b2_Max
READ(20,*)
READ(20,14) a,isteps
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(*,*) '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 (r1h/=0 .AND. r1s/=0 .AND. iFull/=0 .AND. DeltaZ/=0 .AND. b2/=0 .AND. iSplitter_Min==0 .AND. iSplitter_Max==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 HUB RADIUS CHOSEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (r1h==0 .AND. r1s/=0 .AND. iFull/=0 .AND. DeltaZ/=0 .AND. b2/=0) THEN
step = ((r1h_max-r1h_min)/isteps)
iPerformance = 1
WRITE(10,*) ' Carleton University'
WRITE(10,*) ' Department of Mechanical and Aerospace Engineering'
WRITE(10,*) ' INLET HUB RADIUS ANALYSIS'
WRITE(10,*) ' Gas Turbine Project'
WRITE(10,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
WRITE(10,*) ' r1h M1_tip M2_rel dH_tip dH_hub dH_m Phi Work Co. Efficiency'
DO m=0,isteps
r1h = r1h_min + step*m
CALL PERFORMANCE()
END DO
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
r1h=0
END IF
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! INLET TIP DIAMETER CHOSEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (r1h/=0 .AND. r1s==0 .AND. iFull/=0 .AND. DeltaZ/=0 .AND. b2/=0) THEN
step = ((r1s_max-r1s_min)/isteps)
iPerformance = 2
WRITE(10,*) ' Carleton University'
WRITE(10,*) ' Department of Mechanical and Aerospace Engineering'
WRITE(10,*) ' INLET SHROUD RADIUS ANALYSIS'
WRITE(10,*) ' Gas Turbine Project'
WRITE(10,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
WRITE(10,*) ' r1s M1_tip M2_rel dH_tip dH_hub dH_m Phi Work Co. Efficiency'
DO m=0,isteps
r1s = r1s_min + step*m
CALL PERFORMANCE()
END DO
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
r1s=0
END IF
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! NUMBER OF FULL BLADES CHOSEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (r1h/=0 .AND. r1s/=0 .AND. iFull==0 .AND. DeltaZ/=0 .AND. b2/=0) THEN
iPerformance = 3
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 Phi Work Co. Efficiency'
DO m=iFull_Min,iFull_Max
iFull = iFull_min
CALL PERFORMANCE()
iFull_Min = iFull_Min+1
END DO
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
iFull=0
END IF
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! NUMBER OF SPLITTER BLADES CHOSEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (r1h/=0 .AND. r1s/=0 .AND. iFull/=0 .AND. iSplitter_min/=0 .AND. iSplitter_max/=0 .AND. DeltaZ/=0 .AND. b2/=0) THEN
iPerformance = 6
WRITE(10,*) ' Carleton University'
WRITE(10,*) ' Department of Mechanical and Aerospace Engineering'
WRITE(10,*) ' NUMBER OF SPLITTER BLADES ANALYSIS'
WRITE(10,*) ' Gas Turbine Project'
WRITE(10,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
WRITE(10,*) '#Blades M1_tip M2_rel dH_tip dH_hub dH_m Phi Work Co. Efficiency'
DO m=iSplitter_Min,iSplitter_Max
iSplitter = iSplitter_min
CALL PERFORMANCE()
iSplitter_Min = iSplitter_Min+1
END DO
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
iSplitter_min=0
iSplitter_max=0
END IF
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! AXIAL LENGTH OF ROTOR CHOSEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (r1h/=0 .AND. r1s/=0 .AND. iFull/=0 .AND. DeltaZ==0 .AND. b2/=0) THEN
step = ((DeltaZ_max-DeltaZ_min)/isteps)
iPerformance = 4
WRITE(10,*) ' Carleton University'
WRITE(10,*) ' Department of Mechanical and Aerospace Engineering'
WRITE(10,*) ' ROTOR AXIAL LENGTH ANALYSIS'
WRITE(10,*) ' Gas Turbine Project'
WRITE(10,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
WRITE(10,*) 'Length M1_tip M2_rel dH_tip dH_hub dH_m Phi Work Co. Efficiency'
DO m=0,isteps
DeltaZ = DeltaZ_min + step*m
CALL PERFORMANCE()
END DO
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
DeltaZ = 0
END IF
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! OUTLET PASSAGE WIDTH CHOSEN
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF (r1h/=0 .AND. r1s/=0 .AND. iFull/=0 .AND. DeltaZ/=0 .AND. b2==0) THEN
step = ((b2_max-b2_min)/isteps)
iPerformance = 5
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,*) ' b2 M2_rel dH_tip dH_hub dH_m Phi Work Co. Efficiency'
DO m=0,isteps
b2 = b2_min + step*m
CALL PERFORMANCE()
END DO
CLOSE(10)
WRITE(*,*)
WRITE(*,*) "Analysis Complete! Please See Results File."
WRITE(*,*) "Press Any Key To Continue..."
READ(*,*)
b2 = 0
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, iDVAnalysis
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
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
COMMON / Thermodynamic / rho01, rho02, rho1, rho2, P01, P1, P02, P2, T01, T2, T1
COMMON / FlowAngles / Beta1Prime, Alpha1, Alpha2, DiffuserLossFactor, VoluteLossFactor
COMMON / BladeAngles / Beta1, Beta2, 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
A1=PI*(r1s**2)-PI*(r1h**2)-(r1s-r1h)*tb1*Z!Rotor Inlet Area (m^2)
r1m=(0.5*(r1s**2)+0.5*(r1h**2))**0.5!Inlet Meanline Radius (m)
D1=r1m*2
b1 = r1s - r1h
!ROTOR OUTLET DIMENSIONS
D2 = r2*2!Impeller Outlet Tip Diameter (m)
A2=(2*PI*r2-(iFull+iSplitter)*tb)*b2!m^2
!Lb = RadiusOfCurvature/(Alpha2-Alpha1) !Another option is Aungier, who uses the radius of curvature (rad/m) something like this..
!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=2.7!Rotor Pressure Ratio Guess
Effr=0.9!Rotor Isentropic Efficiency Guess
!Diffuser Dimensions
!iSteps = 1000 !Number of steps in diffuser analysis
!DiffuserLength = .0244
!b3 = .00625
!r3 = r2
!r4 = r3+DiffuserLength
!b4 = .0042
!Volute Dimensions
!VoluteExitDiameter = 0.045
!EVolute = .0001
!r5 = r4
PRrLast =0
k=0
DO WHILE (ABS((PRr - PRrLast)/PRr) .GT. 0.0000000001)
k=k+1
PRrLast = PRr
IF (k.GT.MaxIter) THEN
WRITE(*,*) "Error 1.0. Max iteration reached."
ENDIF
!~~~~~~~~~~~~~~~~~~~~~~~~~~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.00000001)
kbeta=kbeta+1
Beta2last = Beta2
IF (kbeta.GT.MaxIter) THEN
WRITE(*,*) "Error 1.1. Max iteration reached."
ENDIF
!Estimate of mean camber line length (Currently an input)
IF (ABS(Beta2) > 80 .AND. ABS(Beta2) <= 90) THEN
Beta2 = 50
END IF
Lb = (DeltaZ - b2/2) + (D2 - D1)/(2*COS(Beta2*PI/180))!Sjolander
Z = iFull + (LbSplitter/Lb)*iSplitter
!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
C1=zMdot/(rho1*A1*COS(Alpha1*PI/180))!Update C1
IF (j.GT.MaxIter) THEN
WRITE(*,*) "Max iteration reached at Rotor Inlet"
ELSE IF (ierr.NE.0) THEN
WRITE(*,*) "Error Flag at Rotor Inlet: ",ierr
WRITE(*,*) "Error String: ",herr
END IF
END DO
CALL TRNPRP (T1,rho1/wm,x1,eta,tcx,ierr,herr)
IF (ierr.NE.0) THEN
WRITE(*,*) "Viscosity Error Flag at Rotor Inlet: ",ierr
WRITE(*,*) "Error String: ",herr
END IF
Visc1=eta/1000000!kg/m*s
!CONVERGED ROTOR INLET VELOCITY TRIANGLES
!Meanline
Cu1 = C1 * SIN(Alpha1*PI/180)
Wu1 = Cu1 - U1
W1 = SQRT((Wu1)**2+(Cm1)**2)
Beta1 = ACOS(Cm1/W1)*(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
!~~~~~~~~~~~~~~~~~~~~~ROTOR OUTLET~~~~~~~~~~~~~~~~~~~!
EffrLast = 0
jEFF = 0
DO WHILE (ABS((Effr-EffrLast)/Effr).GT.0.00001)
jEFF = jEFF+1
EffrLast = Effr
IF (jEFF.GT.MaxIter) THEN
WRITE(*,*) "Rotor Outlet Meanline - Max iteration Reached."
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.000000001)
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
WRITE(*,*) "Max iteration Reached at Rotor Outlet Meanline"
ELSE IF (ierr.NE.0) THEN
WRITE(*,*) "Error Flag at Rotor Outlet Meanline: ",ierr
WRITE(*,*) "Error String: ",herr
END IF
END DO
!CONVERGED ROTOR OUTLET VELOCITY TRIANGLE
C2=SQRT(Cr2**2+Cu2**2)
Alpha2=ACOS(Cr2/C2)*(180/PI)
Wu2=U2-Cu2
W2=SQRT(Wu2**2+Cr2**2)
Beta2=ACOS(Cr2/W2)*(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
WRITE(*,*) "Viscosity Error Flag at Rotor Outlet: ",ierr
WRITE(*,*) "Error String: ",herr
END IF
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
END DO
!ROTOR DEHALLER NUMBER
dHm=W2/W1
dHh=W2/W1h
dHt=W2/W1s
Sigma = 1
SigmaLast = 0
!Estimate Metal Angle Based on Slip Factor (Aungier 2000)
DO WHILE (ABS((Sigma-SigmaLast)/Sigma).GT.0.00000001)
!Sigma = 1 - ((PI/Z)*COS(Beta2*PI/180))/(1-phi*TAN(Beta2*PI/180))!(Stodola)
!Sigma = 1 - (0.63*PI/Z)/(1-phi*TAN(Beta2*PI/180))!(Stanitz)
Sigma = 1 - SQRT(ABS(SIN(Beta2*PI/180)))*SIN(Alpha2*PI/180)/Z**0.7!(Wiesner/Busemann)
SigmaStar = SIN((19+0.2*Beta2)*PI/180)
E_limit = (Sigma - SigmaStar)/(1 - SigmaStar)
IF (r1m/r2 .GT. E_limit) THEN
Sigma = Sigma*(1 - (((r1m/r2)-E_limit)/(1-E_limit))**((Beta2*PI/180)/10))
END IF
SigmaLast = Sigma
phi=Cr2/U2
Cu2i = Cu2/Sigma
Wu2i = U2 - Cu2i
Beta2 = 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 = U2-Cu2
Beta2 = 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)
AungierFlowCoeff = zMdot/(rho01*PI*(r2**2)*U2)
RotationalMach = U2/a_1
END DO
!~~~~~~~~~~~~~~~~~~~~IMPELLER PARASITIC LOSSES~~~~~~~~~~~~~~~~~~~~~~~!
! These are calculated using the method overviewed
! in S.Sanghera (2013) Gas Turbine DR.
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
!~~~~~~~~~~~~~~~ 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,h,s,cv,cp,w,ierr,herr)
CALL TRNPRP (Tcl,rhocl,x,eta,tcx,ierr,herr)
IF (ierr.NE.0) THEN
WRITE(*,*) "Viscosity Error Flag for Disk Friction Calc: ",ierr
WRITE(*,*) "Error String: ",herr
END IF
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*(Alpha2*PI/180)**3)*Df**2*U2**2
!~~~~~~~~~~~~~~~ SUM PARASITIC LOSS COEFFICIENTS ~~~~~~~~~~~~~~~~~~~~~~!
LossesParasitic = DiskFriction + LeakageWork + RecirculationWork
IF (iDVAnalysis == 0) THEN
PRs = 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)
Effs = (H02ideal - H01)/(H02real - H01)
END IF
!~~~~~~~~~~~~~~~~~~ END OF IMPELLER ANALYSIS ~~~~~~~~~~~~~~~~~~~~~~~~~~!
IF (iDVAnalysis == 1) THEN
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) !Rotor Efficiency
!~~~~~~~~~~~~~~~~~~~~~~~~~~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
Cr3 = Cr2
r3 = r2
H03 = H02real
P03 = P02
P3 = P2
!Diffuser Outlet Conditions
H04 = H03
Cu4 = Cu3*r3/r4
Wu4 = Wu3*r3/r4
Cr4 = Cr3
!Possible Diffuser Loss Correlations
!!DiffusionFactor = -4.8597*(phi**3) + 6.782*(phi**2) - 3.2895*phi + 0.7948 !Johnston & Dean (1996)
!!DiffusionFactor = 0.0119*Alpha3 - 0.7035 !Yingkang & Sjolander Rotor A
!!DiffusionFactor = 0.0004*Alpha3**2 - 0.046*Alpha3 + 1.6704 !Yingkang & Sjolander Rotor B
!!DiffusionFactor = 0.0088*Alpha3 - 0.4924 !Yingkang & Sjolander Rotor C
!!DiffusionFactor = 0.0148*Alpha3 - 0.8952 !Yingkang & Sjolander Rotor D
!!DiffusionFactor = 0.0171*Alpha3 - 1.0389 !Yingkang & Sjolander Rotor E
!!DiffusionFactor = 0.0002*(Alpha3**2) - 0.0242*Alpha3 + 0.6283 +1
P04 = P03 - DiffuserLossFactor*(P03-P3)!kPa
CALL PHFLSH (P04,H04,zz,T04,rho04,Dl,Dv,x,y,q,e,S04,cv,cp,w,ierr,herr)
last=0
i=0
DO WHILE (ABS((Cr4 - last)/Cr4) .GT. 0.000000001)
i=i+1
last=Cr4
C4=SQRT(Cr4**2+Cu4**2)
!Stagnation is an isentropic process
H4=H04-(C4**2)*wm/2000!J/mol
S4=S04
CALL HSFLSH (H4,S4,zz,T4,P4,rho4,Dl,Dv,x,y,q,e,cv,cp,a_4,ierr,herr)
rho4 = rho4*wm!kg/m^3
Cr4 = zMdot/(rho4*(2*PI*r4*b4))!Update Cm4
IF (i.GT.MaxIter) THEN
WRITE(*,*) "Max iteration reached at Diffuser Outlet"
ELSE IF (ierr.NE.0) THEN
WRITE(*,*) "Error Flag at Diffuser Outlet: ",ierr
WRITE(*,*) "Error String: ",herr
END IF
END DO
C4=SQRT(Cr4**2+Cu4**2)
Alpha4=ATAN(Cu4/Cr4)*(180/PI)
Beta4=ATAN(Wu4/Cr4)*(180/PI)
W4=SQRT(Wu4**2+Cr4**2)
aM4=C4/a_4!Absolute Mach Number
rM4=W4/a_4!Relative Mach Number
!Isentropic efficiency for P01 to P04
!PRd = P04/P01
!S04ideal = S01
!CALL PSFLSH (P04,S04ideal,zz,T04ideal,rho04ideal,Dl,Dv,x,y,q,e,H04ideal,cv,cp,w,ierr,herr)
!Effd = (H04ideal-H01)/(H04 - H01)
!~~~~~~~~~~~~~~~~~~~~~ END OF DIFFUSER ANALYIS ~~~~~~~~~~~~~~~~~~~~~~!
!~~~~~~~~~~~~~~~~~~~~~~~~~~VOLUTE ANALYIS~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
!The volute 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
Cu5 = Cu4
Cr5 = Cr4
r5 = r4
H05 = H04
P05 = P04
P5 = P4
!Diffuser Outlet Conditions
H06 = H05
Cu6 = Cu5*r5/r6
Wu6 = Wu5*r5/r6
Cr6 = Cr5
P06 = P05 - VoluteLossFactor*(P05-P5)!kPa
CALL PHFLSH (P06,H06,zz,T06,rho06,Dl,Dv,x,y,q,e,S06,cv,cp,w,ierr,herr)
last=0
i=0
DO WHILE (ABS((Cr6 - last)/Cr6) .GT. 0.000000001)
i=i+1
last=Cr6
C6=SQRT(Cr6**2+Cu6**2)
!Stagnation is an isentropic process
H6=H06-(C6**2)*wm/2000!J/mol
S6=S06
CALL HSFLSH (H6,S6,zz,T6,P6,rho6,Dl,Dv,x,y,q,e,cv,cp,a_6,ierr,herr)
rho6 = rho6*wm!kg/m^3
Cr6 = zMdot/(rho6*(2*PI*r6*b6))!Update Cm6
IF (i.GT.MaxIter) THEN
WRITE(*,*) "Max iteration reached at Volute Outlet"
ELSE IF (ierr.NE.0) THEN
WRITE(*,*) "Error Flag at Volute Outlet: ",ierr
WRITE(*,*) "Error String: ",herr
END IF