-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsfoil.f90
5558 lines (5449 loc) · 183 KB
/
tsfoil.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
PROGRAM TSFOIL
! PROGRAM TSFOIL(INPUT,OUTPUT,TAPE5=INPUT,TAPE6=OUTPUT,TAPE3,TAPE7)
!***********************************************************************
!
! MAIN PROGRAM FOR TSFOIL
! PROGRAM COMPUTES TRANSONIC FLOW PAST A TWODIMENSIONAL
! LIFTING AIRFOIL USING TRANSONIC SMALL DISTURBANCE THE
!
! PROGRAM WRITTEN BY
! EARLL M. MURMAN AND FRANK R. BAILEY
! NASA-AMES RESEARCH CENTER
! AND
! MARGARET L. JOHNSON
! COMPUTER SCIENCES CORPORATION
! version for VT Aerospace Design Space software
!
! REFERENCES FOR PROGRAM USAGE ARE
! ( TO BE FILLED IN LATER)
!
! from Joh, VPI, with modifications
! by w.h. mason for mac operation
! and with diamond airfoil option
!
! mod to I/O to fix bug, April 2, 1998
! mod to output file for plotting, April 3, 2000
! mod to run on PC
! - Added directory selection
! - Added Pause statement at end of program
! - Added more comments in the header
! - Program outputs to a file now
! Andy Ko 4/2/03.
! Fixed bug in Jameson input section 4/9/03 - Andy Ko
!
!***********************************************************************
COMMON P(102,101),X(100) , Y(100)
COMMON / COM1/ IMIN , IMAX , IUP , IDOWN , ILE ,&
&ITE , JMIN , JMAX , JUP , JLOW ,&
&JTOP , JBOT , J1 , J2
COMMON / COM2/ AK , ALPHA , DUB , GAM1 , RTK
LOGICAL ABORT1
COMMON / COM3/ IREF , ABORT1 , ICUT , KSTEP
LOGICAL AMESH
COMMON / COM4/ XIN(100) , YIN(100), AMESH
COMMON / COM5/ XDIFF(100),YDIFF(100)
COMMON / COM6/ FL(100) , FXL(100), FU(100) , FXU(100),&
&CAMBER(100), THICK(100),VOL , XFOIL(100), IFOIL
COMMON / COM7/ CJUP , CJUP1 , CJLOW , CJLOW1
COMMON / COM8/ CVERGE , DVERGE , IPRTER , MAXIT ,&
&WE(3) , EPS
INTEGER BCFOIL
COMMON / COM9/ BCFOIL , NL , NU , XL(100) , XU(100) ,&
&YL(100) , YU(100) , RIGF,IFLAP,DELFLP,FLPLOC
COMMON /COM10/ YFREE(100),YTUN(100),GAM , JMXF , JMXT
INTEGER PSTART
LOGICAL PSAVE
COMMON /COM11/ ALPHAO , CLOLD , DELTAO , DUBO , EMACHO ,&
&IMINO , IMAXO , IMAXI , JMINO , JMAXO ,&
&JMAXI , PSAVE , PSTART ,TITLE(20),TITLEO(20),&
&VOLO , XOLD(100),YOLD(100)
COMMON /COM12/ F , H , HALFPI , PI , RTKPOR ,&
&TWOPI
COMMON /COM13/ CDFACT , CLFACT , CMFACT , CPFACT , CPSTAR
LOGICAL FCR , KUTTA
COMMON /COM14/ CLSET , FCR , KUTTA , WCIRC
COMMON /COM15/ B , BETA0 , BETA1 , BETA2 , PSI0 ,&
&PSI1 , PSI2
REAL JET
COMMON /COM16/ ALPHA0 , ALPHA1 , ALPHA2 , XSING ,&
&OMEGA0 , OMEGA1 , OMEGA2 , JET
COMMON /COM17/ CYYBLC , CYYBLD , CYYBLU , CYYBUC , CYYBUD ,&
&CYYBUU ,FXLBC(100),FXUBC(100), ITEMP1, ITEMP2
LOGICAL OUTERR
COMMON /COM18/ ERROR , I1 , I2 , IERROR , JERROR ,&
&OUTERR , EMU(100,2) , VC(100) ,&
&WI , DCIRC , POLD(100,2)
COMMON /COM19/ DIAG(100), RHS(100), SUB(100), SUP(100)
COMMON /COM20/ XMID(100), YMID(100)
COMMON /COM21/ CYYLC , CYYLD , CYYLU , CYYUC , CYYUD ,&
&CYYUU
COMMON /COM22/ CXC(100) , CXL(100), CXR(100), CXXC(100),CXXL(100),&
&CXXR(100), C1(100)
COMMON /COM23/ CYYC(100), CYYD(100),CYYU(100), IVAL
COMMON /COM24/ DTOP(100), DBOT(100),DUP(100), DDOWN(100),&
&VTOP(100), VBOT(100),VUP(100), VDOWN(100)
COMMON /COM25/ CPL(100) , CPU(100) , IDLA
COMMON /COM26/ PJUMP(100)
LOGICAL PHYS
INTEGER PRTFLO , SIMDEF
COMMON /COM27/ CL , DELTA , DELRT2 , EMACH , EMROOT ,&
&PHYS , PRTFLO , SIMDEF , SONVEL , VFACT ,&
&YFACT
INTEGER BCTYPE
COMMON /COM28/ BCTYPE , CIRCFF , FHINV , POR , CIRCTE
COMMON /COM32/ BIGRL , IRL , JRL
COMMON /COM33/ THETA(100,100)
COMMON /COM34/ NWDGE , WSLP(100,2) , XSHK(2,3) ,&
&THAMAX(2,3) , AM1(2,3), ZETA(2,3) ,&
&NVWPRT(2), WCONST , REYNLD , NISHK
1001 FORMAT(4X,69(1H*))
1002 FORMAT(4X,1H*,67X,1H*)
1003 FORMAT(4X,1H*,25X,15H PROGRAM TSFOIL,27X,1H*/&
&4X,1H*,29X, 7H SOLVES,31X,1H*/&
&4X,1H*, 5X,'INVISCID FLOW PAST THIN TWO DIMENSIONAL LIFTING',&
&' AIRFOIL',7X,1H*/&
&4X,1H*,29X, 6H USING,32X,1H*/&
&4X,1H*,15X,35H TRANSONIC SMALL DISTURBANCE THEORY,17X,1H*/&
&4X,1H*, 9X,'FULLY CONSERVATIVE FINITE DIFFERENCE EQUATIONS',&
&12X,1H*/&
&4X,1H*,17X,31H SUCCESSIVE LINE OVERRELAXATION,19X,1H*)
1004 FORMAT(4X,1H*,27X,11H WRITTEN BY,29X,1H*)
1005 FORMAT(4X,1H*,15X,36H EARLL M. MURMAN AND FRANK R. BAILEY,16X,1H*&
&/ 4X,1H*,19X,26H NASA-AMES RESEARCH CENTER,22X,1H*/&
&4X,1H*,19X,26H MOFFETT FIELD, CALIFORNIA,22X,1H*/&
&4X,1H*,31X, 4H AND,32X,1H*/&
&4X,1H*,23X,20H MARGARET L. JOHNSON,24X,1H*/&
&4X,1H*,18X,30H COMPUTER SCIENCES CORPORATION,19X,1H*/&
&4X,1H*,20X,26H MOUNTAIN VIEW, CALIFORNIA,21X,1H*/&
&4X,1H*,67X,1H*/&
&4X,1H*,12X,43H Documented in NASA SP-347 and NASA CR-3064&
&,12X,1H*)
1006 FORMAT(4X,1H*,27X,12H Version for, 28X,1H*/&
&4X,1H*,15X,36H VT Aerospace Design Software Series,16X,1H*/&
&4X,1H*,67X,1H*/&
&4X,1H*,15X,14H Contact info:,38X,1H*/&
&4X,1H*,15X,21H Dr. William H. Mason,31X,1H*/&
&4X,1H*,15X,45H Aerospace & Ocean Engineering, Virginia Tech&
&,7X,1H*/&
&4X,1H*,15X, 20H Blacksburg, VA24061, 32X,1H*/&
&4X,1H*,15X, 22H Email: [email protected],30X,1H*)
OPEN (UNIT=15, FILE='tsfoil2.out')
OPEN (UNIT=16, FILE='smry.out')
OPEN (UNIT=17, FILE='cpxs.out')
OPEN (UNIT=18, FILE='mmap.out')
OPEN (UNIT=19, FILE='cnvg.out')
OPEN (UNIT=20, FILE='mesh.out')
OPEN (UNIT=21, FILE='cpmp.out')
WRITE (15,1001)
WRITE (15,1002)
WRITE (15,1003)
WRITE (15,1002)
WRITE (15,1004)
WRITE (15,1002)
WRITE (15,1005)
WRITE (15,1002)
WRITE (15,1006)
WRITE (15,1002)
WRITE (15,1001)
!
! THE MAIN PROGRAM DOES NO COMPUTATIONS
! ALL COMPUTATIONS ARE DONE IN SUBROUTINES CALLED BY
! TSFOIL.
! SUBROUTINE ECHINP PROVIDES A LISTING OF ALL DATA
! CARDS FOR ENTIRE JOB. CAN BE DELETED, IF DESIRED.
! CALL ECHINP
! SUBROUTINE READIN READS ALL INPUT AND CHECKS IT
1 CONTINUE
CALL READIN
!
! SUBROUTNIE SCALE RESCALES ALL PHYSICAL VARIABLES TO
! TRANSONIC SIMILARITY FORM
CALL SCALE
!
! SUBROUTINE FARFLD SETS FAR FIELD BOUNDARY CONDITIONS.
CALL FARFLD
!
! SUBROUTINE BODY COMPUTES AIRFOIL GEOMETRY AND PRINTS
! OUT GEOMETRICAL INFORMATION
CALL BODY
!
! SUBROUTINE CUTOUT REMOVES MESH POINTS FROM THE INPUT
! MESH. CALCULATIONS ARE DONE FIRST ON COARSE MESH,
! AND THEN ON PROGRESSIVELY REFINED MESHES UNTIL
! INPUT MESH IS ACHIEVED.
CALL CUTOUT
!
! SUBROUTINE GUESSP INITIALIZES P ARRAY
CALL GUESSP
!
! SUBROUTINE DIFCOE CALCULATES FINITE DIFFERENCE
! EQUATION COEFFICIENTS WHICH DEPEND ON MESH SIZE.
CALL DIFCOE
!
! SUBROUTINE SETBC ADJUSTS THE AIRFOIL SLOPE BOUNDARY
! CONDITION FOR THE CURRENT X Y MESH. ALSO, THE LIMITS
! ON I AND J INDICIES FOR SOLVING THE DIFFERENCE
! EQUATIONS ARE SET.
CALL SETBC(0)
!
! SUBROUTINE SOLVE EXECUTES THE MAIN RELAXATION
! SOLUTION OF THE DIFFERENCE EQUATIONS
CALL SOLVE
!
! IF FINAL MESH HAS BEEN REACHED, RESULTS ARE PRINTED
! OUT IN FINAL FORM. IF NOT, INTERMEDIATE RESULTS
! ARE PRINTED OUT AND THE MESH IS REFINED. THE ABOVE
! SEQUENCE OF CALCULATIONS ARE THEN REPEATED
IF(IREF .LE. 0) GO TO 5
IF (ABORT1) GO TO 5
!
! SUBROUTINE PRINT1 PRINTS OUT BODY PRESSURE
! DISTRIBUTION.
CALL PRINT1
IF (ABORT1) GO TO 1
!
! SUBROUTINE REFINE ADDS MESH POINTS
CALL REFINE
!
! REPEAT SEQUENCE OF RELAXATION CALCULATIONS
CALL DIFCOE
CALL SETBC(0)
CALL SOLVE
!
! IF FINAL MESH HAS BEEN REACHED, RESULTS ARE PRINTED
! OUT IN FINAL FORM. IF NOT, INTERMEDIATE RESULTS
! ARE PRINTED OUT AND THE MESH IS REFINED. THE ABOVE
! SEQUENCE OF CALCULATIONS ARE THEN REPEATED
IF(IREF .LE. 0) GO TO 5
IF (ABORT1) GO TO 5
CALL PRINT1
CALL REFINE
CALL DIFCOE
CALL SETBC(0)
CALL SOLVE
!
! RELAXATION SOLUTION IS COMPLETED
5 CONTINUE
!
! PRINTOUT FINAL INFORMATION
CALL PRINT
IF (IREF .GT. 0 ) CALL REFINE
IF (IREF .GT. 0 ) CALL REFINE
IF (IDLA.NE.0) CALL DLAOUT(ILE,ITE,ALPHA,DELFLP,EMACH,&
&VFACT,REYNLD)
!
! STORE SOLUTION FOR NEXT CASE OR ON TAPE 3
CALL SAVEP
!
! RETURN TO READIN TO COMPUTE NEXT CASE OR TERMINATE
! CALCULATIONS.
CLOSE (UNIT=15)
CLOSE (UNIT=16)
CLOSE (UNIT=17)
CLOSE (UNIT=18)
CLOSE (UNIT=19)
CLOSE (UNIT=20)
CLOSE (UNIT=21)
END PROGRAM
SUBROUTINE ANGLE
! SUBROUTINE TO COMPUTE THE ANGLE THETA AT
! EACH MESH POINT.
! CALLED BY - FARFLD.
COMMON / COM1/ IMIN , IMAX , IUP , IDOWN , ILE ,&
&ITE , JMIN , JMAX , JUP , JLOW ,&
&JTOP , JBOT , J1 , J2
COMMON / COM2/ AK , ALPHA , DUB , GAM1 , RTK
LOGICAL AMESH
COMMON / COM4/ XIN(100) , YIN(100), AMESH
COMMON /COM12/ F , H , HALFPI , PI , RTKPOR ,&
&TWOPI
REAL JET
COMMON /COM16/ ALPHA0 , ALPHA1 , ALPHA2 , XSING ,&
&OMEGA0 , OMEGA1 , OMEGA2 , JET
COMMON /COM33/ THETA(100,100)
R2PI = 1.0 / TWOPI
DO 20 I=IMIN,IMAX
XX = XIN(I) - XSING
DO 10 J=JMIN,JMAX
YY = YIN(J) * RTK
R = SQRT(YIN(J)**2 + XX*XX)
ATN = ATAN2(YY,XX)
Q = PI - SIGN(PI,YY)
THETA(J,I) = -(ATN + Q) * R2PI
IF ( R .LE. 1.0 ) THETA(J,I) = THETA(J,I) * R
10 CONTINUE
20 CONTINUE
RETURN
END
FUNCTION ARF (X)
!
! EVALUATES ERF WITH AN ERROR .LT. 1.5E-7 BY RATIONAL
! APPROXIMATION 7.1.26 FO HANDBOOK OF MATH. FUNCTIONS
! U. S. DEPT. OF COMMERCE. NBS APPL MATH SER 55.
! CALLED BY - AYMESH.
!
DIMENSION C(5)
DATA C /1.061405429,-1.453152027,1.421413741, -.284496736,&
&.254829592/
!
Y = X
IF ( X .LT. 0.0 ) Y = -Y
IF ( Y .LT. 10. ) GO TO 10
ARF = 1.0
GO TO 30
10 CONTINUE
T = 1.0 / (1.0 + .3275911*Y)
POLY = 0.0
DO 20 I=1,5
POLY = (POLY + C(I)) * T
20 CONTINUE
ARF = 1.0 - POLY * EXP(-Y*Y)
30 CONTINUE
IF (X .LT. 0.0) ARF = -ARF
RETURN
END
SUBROUTINE AYMESH
! COMPUTES ANALYTICAL X AND Y MESH POINTS.
! CALLED BY - READIN.
LOGICAL AMESH
COMMON / COM4/ XIN(100) , YIN(100), AMESH
INTEGER PSTART
LOGICAL PSAVE
COMMON /COM11/ ALPHAO , CLOLD , DELTAO , DUBO , EMACHO ,&
&IMINO , IMAXO , IMAXI , JMINO , JMAXO ,&
&JMAXI , PSAVE , PSTART ,TITLE(20),TITLEO(20),&
&VOLO , XOLD(100),YOLD(100)
COMMON /COM12/ F , H , HALFPI , PI , RTKPOR ,&
&TWOPI
INTEGER BCTYPE
COMMON /COM28/ BCTYPE , CIRCFF , FHINV , POR , CIRCTE
COMMON /COM30/ BXH(401) , REST(3)
!
DIMENSION XH(401) , BX(100)
DATA A0/.225/, A1/1.4/, A2/1.6/, A3/.6188/, A4/.75/, A5/30./,&
&A6/.603/, A7/2.0/
DATA CT1/2.0/, CT2/2.0/, CT3/1.0/, CF1/1.0/, CF2/1.0/, CF3/5.2/
!
IF (IMAXI .EQ. 77) IMAXI=81
IMA = (IMAXI - 1) / 2
A22 = A2 * A2
A72 = A7 * A7
FACT = HALFPI * .005
DO 10 I=201,400
EX = TAN(FACT * (I-201) )
XH(I) = EX
EX2 = EX * EX
EX22 = A22 * EX2
EX72 = A72 * EX2
IF (EX72 .LT. 173.0) GO TO 4
TEX7 = 0.0
IF (EX22 .LT. 173.0) GO TO 6
TEX2 = 0.0
GO TO 8
4 TEX7 = 1.0/EXP(EX72)
6 TEX2 = 1.0/EXP(EX22)
8 BXH(I) = A1*EX*TEX2 + (1.0-TEX7)*ARF(A4*EX)
10 CONTINUE
XH(401) = 1.E30
BXH(401) = 1.0
DO 20 I=1,200
XH(I) = - XH(402-I)
BXH(I) = -BXH(402-I)
20 CONTINUE
TOOPI = 2.0 / PI
!
! ADD 2/PI ATAN(AK(X+A6)) TO BXH TO GIVE MORE
! POINTS NEAR THE LEADING EDGE.
!
DO 30 I=1,401
BXH(I) = BXH(I) * (1.-A0) + TOOPI*A0*ATAN(A5*(XH(I)+A6))
30 CONTINUE
!
DX = 1.0 / IMA
IM2 = IMA * 2
IM2P1= IM2 + 1
!
DO 42 I=1,IM2P1
IF (I .EQ. 1 .OR. I .EQ. IM2P1) GO TO 31
BX(I) = (I-1) * DX - 1.0
GO TO 32
31 CONTINUE
IF (I .EQ. 1) BX(I) = -.999
IF (I .EQ. IM2P1) BX(I) = .999
32 CONTINUE
J = 0
33 CONTINUE
J = J + 1
IF (BX(I) .GT. BXH(J)) GO TO 33
IF (BX(I) .LT. BXH(J)) GO TO 34
XI = XH(J)
GO TO 40
!
34 CONTINUE
BT1 = BX(I) - BXH(J-1)
BHT1 = BXH(J) - BXH(J-1)
XHT1 = XH(J) - XH(J-1)
T1 = XHT1 / BHT1
XI = XH(J-1) + BT1 * T1
IF (J .EQ. 2) GO TO 40
!
BT2 = BX(I) - BXH(J)
BHT2 = BXH(J) - BXH(J-2)
BHT3 = BXH(J-1) - BXH(J-2)
XHT2 = XH(J-1) - XH(J-2)
T2 = XHT2 / BHT3
T12 = T1 - T2
BT12 = BT1 * BT2
TBT2 = T12 / BHT2
XI = XI + BT12 * TBT2
IF (J .GE. 400) GO TO 40
!
BT3 = BX(I) - BXH(J-2)
BHT4 = BXH(J+1) - BXH(J-2)
BHT5 = BXH(J+1) - BXH(J)
BHT6 = BXH(J+1) - BXH(J-1)
XHT3 = XH(J+1) - XH(J)
T3 = XHT3 / BHT5
XI = XI + BT12 * BT3/BHT4 * ((T3-T1)/BHT6 - TBT2)
40 CONTINUE
XIN(I) = XI + A3
42 CONTINUE
IMAXI = IM2P1
JM2 = JMAXI
JMA = JM2 / 2
FJ = JMA
IF (BCTYPE .NE. 1) GO TO 44
C1 = CF1
C2 = CF2
C3 = CF3
GO TO 45
44 CONTINUE
C1 = CT1
C2 = CT2
C3 = CT3
45 CONTINUE
DETA = 1.0 / (FJ*C1)
IF (BCTYPE .EQ. 1) DETA = 1.0 / ((FJ+1.0)*C1)
C = C3 / (TAN(HALFPI*DETA*FJ))**C2
DO 50 I=1,JMA
J = JMA + I
ETAI = I * DETA
YIN(J) = C * (TAN(HALFPI*ETAI))**C2
YIN(J-2*I+1) = -YIN(J)
50 CONTINUE
RETURN
END
BLOCK DATA
!
! AND ALL COMMONS WHETHER THEY ARE NEEDED OR NOT.
!
COMMON P(102,101),X(100) , Y(100)
COMMON / COM1/ IMIN , IMAX , IUP , IDOWN , ILE ,&
&ITE , JMIN , JMAX , JUP , JLOW ,&
&JTOP , JBOT , J1 , J2
COMMON / COM2/ AK , ALPHA , DUB , GAM1 , RTK
LOGICAL ABORT1
COMMON / COM3/ IREF , ABORT1 , ICUT , KSTEP
LOGICAL AMESH
COMMON / COM4/ XIN(100) , YIN(100), AMESH
COMMON / COM5/ XDIFF(100),YDIFF(100)
COMMON / COM6/ FL(100) , FXL(100), FU(100) , FXU(100),&
&CAMBER(100), THICK(100),VOL , XFOIL(100), IFOIL
COMMON / COM7/ CJUP , CJUP1 , CJLOW , CJLOW1
COMMON / COM8/ CVERGE , DVERGE , IPRTER , MAXIT ,&
&WE(3) , EPS
INTEGER BCFOIL
COMMON / COM9/ BCFOIL , NL , NU , XL(100) , XU(100) ,&
&YL(100) , YU(100) , RIGF,IFLAP,DELFLP,FLPLOC
COMMON /COM10/ YFREE(100),YTUN(100),GAM , JMXF , JMXT
INTEGER PSTART
LOGICAL PSAVE
COMMON /COM11/ ALPHAO , CLOLD , DELTAO , DUBO , EMACHO ,&
&IMINO , IMAXO , IMAXI , JMINO , JMAXO ,&
&JMAXI , PSAVE , PSTART ,TITLE(20),TITLEO(20),&
&VOLO , XOLD(100),YOLD(100)
COMMON /COM12/ F , H , HALFPI , PI , RTKPOR ,&
&TWOPI
COMMON /COM13/ CDFACT , CLFACT , CMFACT , CPFACT , CPSTAR
LOGICAL FCR , KUTTA
COMMON /COM14/ CLSET , FCR , KUTTA , WCIRC
COMMON /COM15/ B , BETA0 , BETA1 , BETA2 , PSI0 ,&
&PSI1 , PSI2
REAL JET
COMMON /COM16/ ALPHA0 , ALPHA1 , ALPHA2 , XSING ,&
&OMEGA0 , OMEGA1 , OMEGA2 , JET
COMMON /COM17/ CYYBLC , CYYBLD , CYYBLU , CYYBUC , CYYBUD ,&
&CYYBUU ,FXLBC(100),FXUBC(100), ITEMP1, ITEMP2
LOGICAL OUTERR
COMMON /COM18/ ERROR , I1 , I2 , IERROR , JERROR ,&
&OUTERR , EMU(100,2) , VC(100) ,&
&WI , DCIRC , POLD(100,2)
COMMON /COM19/ DIAG(100), RHS(100), SUB(100), SUP(100)
COMMON /COM20/ XMID(100), YMID(100)
COMMON /COM21/ CYYLC , CYYLD , CYYLU , CYYUC , CYYUD ,&
&CYYUU
COMMON /COM22/ CXC(100) , CXL(100), CXR(100), CXXC(100),CXXL(100),&
&CXXR(100), C1(100)
COMMON /COM23/ CYYC(100), CYYD(100),CYYU(100), IVAL
COMMON /COM24/ DTOP(100), DBOT(100),DUP(100), DDOWN(100),&
&VTOP(100), VBOT(100),VUP(100), VDOWN(100)
COMMON /COM25/ CPL(100) , CPU(100) , IDLA
COMMON /COM26/ PJUMP(100)
LOGICAL PHYS
INTEGER PRTFLO , SIMDEF
COMMON /COM27/ CL , DELTA , DELRT2 , EMACH , EMROOT ,&
&PHYS , PRTFLO , SIMDEF , SONVEL , VFACT ,&
&YFACT
INTEGER BCTYPE
COMMON /COM28/ BCTYPE , CIRCFF , FHINV , POR , CIRCTE
COMMON /COM32/ BIGRL , IRL , JRL
COMMON /COM33/ THETA(100,100)
COMMON /COM34/ NWDGE , WSLP(100,2) , XSHK(2,3) ,&
&THAMAX(2,3) , AM1(2,3), ZETA(2,3) ,&
&NVWPRT(2), WCONST , REYNLD , NISHK
!
DATA WSLP /200*0.0/ , NWDGE / 0 / , WCONST / 4.0 / ,&
&REYNLD / 4.0E+06 / , ZETA /6*0.0/ , IDLA / 0 /
DATA IFLAP / 0 /, DELFLP / 5.0 /, FLPLOC / 0.77 /
DATA BCFOIL / 3 / , BCTYPE / 1 / , PSTART / 1 / ,&
&PRTFLO / 1 / , SIMDEF / 3 /
DATA PHYS /.TRUE. / , PSAVE / .FALSE. / , FCR / .TRUE. / ,&
&KUTTA / .TRUE. /, ABORT1 / .TRUE. /, AMESH / .FALSE. /
DATA EMACH /.75/ , DELTA /.115/ , ALPHA /.12/ ,&
&AK /0.0/, GAM/1.4/, RIGF/0.0/, EPS/.2/
DATA CLSET /0.0/, CVERGE/.00001/, DVERGE/10./,&
&F / 0.0 /, H / 0.0 / , POR / 0.0/,&
&WCIRC/1.0/, WE/1.8,1.9,1.95/
DATA IMAXI/77/, JMXF/56/, MAXIT/500/,&
&NL / 75 /, NU / 100 / , IPRTER / 10 /
DATA PI /3.14159265/ , HALFPI /1.570796325/ ,&
&TWOPI/ 6.28318531/
DATA IMIN /1/ , JMIN /1/ , ICUT /2/
DATA YIN /100*0.0 /, JMAXI / 64 / , JMXT /48 /
DATA XIN / -1.075 , -.950 ,&
&-.825 , -.7 , -.575 , -.45 , -.35 ,&
&-.25 , -.175 , -.125 , -.075 , -.0525 ,&
&-.035 , -.0225 , -.015 , -.0075 , -.0025 ,&
&.0025 , .0075 , .0125 , .0175 , .0225 ,&
&.0275 , .0325 , .0375 , .045 , .055 ,&
&.065 , .075 , .085 , .0975 , .115 ,&
&.140625 , .171875, .203125, .234375, .265625,&
&.296875 , .328125, .359375, .390625, .421875,&
&.453125 , .484375, .515625, .546875, .578125,&
&.609375 , .640625, .671875, .703125, .734375,&
&.765625 , .796875, .828125, .859375, .885 ,&
&.9 , .915 , .93 , .945 , .96 ,&
&.975 , .99 , 1.0 , 1.01 , 1.025 ,&
&1.05 , 1.09 , 1.15 , 1.225 , 1.3 ,&
&1.4 , 1.5 , 1.625 , 1.75 , 1.875 ,&
&23*0.0 /
DATA YFREE / -5.2 , -4.4 , -3.6 , -3.0 , -2.4 ,&
&-1.95 , -1.6 , -1.35 , -1.15 , -.95 ,&
&-.80 , -.65 , -.55 , -.45 , -.39 ,&
&-.34 , -.30 , -.27 , -.24 , -.21 ,&
&-.18 , -.15 , -.125 , -.1 , -.075 ,&
&- .05 , - .03 , - .01 , .01 , .03 ,&
&.05 , .075 , .1 , .125 , .15 ,&
&.18 , .21 , .24 , .27 , .30 ,&
&.34 , .39 , .45 , .55 , .65 ,&
&.8 , .95 , 1.15 , 1.35 , 1.60 ,&
&1.95 , 2.4 , 3.0 , 3.6 , 4.4 ,&
&5.2 , 44*0.0 /
DATA YTUN / -2.0 , -1.8 , -1.6 , -1.4 , -1.2 ,&
&-1.0 , -.8 , -.65 , -.55 , -.45 ,&
&-.39 , -.34 , -.30 , -.27 , -.24 ,&
&-.21 , -.18 , -.15 , -.125 , -.1 ,&
&- .075 , - .05 , - .03 , - .01 , .01 ,&
&.03 , .05 , .075 , .1 , .125 ,&
&.15 , .18 , .21 , .24 , .27 ,&
&.3 , .34 , .39 , .45 , .55 ,&
&.65 , .8 , 1.0 , 1.2 , 1.4 ,&
&1.6 , 1.8 , 2.0 , 52*0.0 /
DATA XU / 0.000008, 0.000167, 0.000391, 0.000799, 0.001407,&
&0.002153, 0.003331, 0.005336, 0.008648, 0.014583,&
&0.023481, 0.033891, 0.040887, 0.053973, 0.056921,&
&0.058456, 0.059966, 0.061445, 0.062909, 0.065925,&
&0.068785, 0.071482, 0.074007, 0.075322, 0.076603,&
&0.077862, 0.079112, 0.080445, 0.081819, 0.083269,&
&0.084841, 0.086702, 0.088848, 0.091378, 0.094413,&
&0.098308, 0.103104, 0.109010, 0.116244, 0.125452,&
&0.136635, 0.150037, 0.165853, 0.184699, 0.195177,&
&0.206361, 0.218244, 0.230813, 0.244047, 0.257917,&
&0.272371, 0.287410, 0.302990, 0.319057, 0.335555,&
&0.352421, 0.369591, 0.386995, 0.404133, 0.421391,&
&0.438708, 0.456013, 0.473246, 0.490343, 0.507242,&
&0.523881, 0.539536, 0.554867, 0.569823, 0.584351,&
&0.598405, 0.611936, 0.624904, 0.637273, 0.648435,&
&0.659016, 0.668987, 0.678321, 0.687012, 0.695090,&
&0.706936, 0.728406, 0.738649, 0.761390, 0.777010,&
&0.792241, 0.809068, 0.824992, 0.836953, 0.857188,&
&0.875621, 0.898268, 0.913686, 0.927686, 0.939804,&
&0.952002, 0.971789, 0.989100, 0.997860, 1.000000/
DATA YU / 0.000787, 0.003092, 0.004538, 0.006137, 0.007683,&
&0.009056, 0.010675, 0.012803, 0.015607, 0.019624,&
&0.024441, 0.029035, 0.031698, 0.035966, 0.036837,&
&0.037277, 0.037700, 0.038103, 0.038497, 0.039276,&
&0.039986, 0.040625, 0.041195, 0.041483, 0.041756,&
&0.042019, 0.042274, 0.042539, 0.042804, 0.043079,&
&0.043368, 0.043700, 0.044072, 0.044497, 0.044989,&
&0.045595, 0.046312, 0.047154, 0.048132, 0.049301,&
&0.050626, 0.052089, 0.053663, 0.055351, 0.056210,&
&0.057068, 0.057918, 0.058751, 0.059559, 0.060335,&
&0.061068, 0.061751, 0.062381, 0.062947, 0.063445,&
&0.063867, 0.064213, 0.064473, 0.064646, 0.064733,&
&0.064735, 0.064651, 0.064477, 0.064218, 0.063871,&
&0.063438, 0.062945, 0.062376, 0.061731, 0.061014,&
&0.060232, 0.059389, 0.058496, 0.057562, 0.056650,&
&0.055721, 0.054791, 0.053867, 0.052965, 0.052086,&
&0.050722, 0.048045, 0.046680, 0.043441, 0.041053,&
&0.038606, 0.035768, 0.032958, 0.030775, 0.026954,&
&0.023361, 0.018848, 0.015750, 0.012954, 0.010567,&
&0.008213, 0.004559, 0.001620, 0.000293, 0.000000/
DATA XL / 0.000000, 0.000012, 0.000043, 0.000183, 0.000249,&
&0.000348, 0.000455, 0.000680, 0.001011, 0.001481,&
&0.001875, 0.002316, 0.003055, 0.004201, 0.004747,&
&0.005779, 0.007035, 0.008265, 0.009969, 0.012286,&
&0.015346, 0.019276, 0.025335, 0.029379, 0.039095,&
&0.052516, 0.062469, 0.073329, 0.085290, 0.099822,&
&0.118563, 0.140987, 0.167184, 0.202933, 0.228511,&
&0.247895, 0.263995, 0.282047, 0.297045, 0.310147,&
&0.324075, 0.344872, 0.363502, 0.387644, 0.404492,&
&0.426308, 0.450016, 0.475378, 0.521837, 0.549843,&
&0.578612, 0.605305, 0.623479, 0.642152, 0.657543,&
&0.671212, 0.690340, 0.708891, 0.726684, 0.746683,&
&0.768502, 0.784892, 0.801149, 0.819187, 0.838548,&
&0.858817, 0.879431, 0.903723, 0.926504, 0.943652,&
&0.958668, 0.973623, 0.986187, 0.996582, 1.000000,&
&25*0.0/
DATA YL / 0.000000,-0.000700,-0.001385,-0.002868,-0.003330,&
&-0.003880,-0.004379,-0.005199,-0.006133,-0.007183,&
&-0.007933,-0.008676,-0.009776,-0.011204,-0.011815,&
&-0.012861,-0.013983,-0.014962,-0.016175,-0.017636,&
&-0.019336,-0.021258,-0.023836,-0.025373,-0.028634,&
&-0.032423,-0.034840,-0.037182,-0.039456,-0.041862,&
&-0.044483,-0.047017,-0.049298,-0.051443,-0.052406,&
&-0.052859,-0.053062,-0.053117,-0.053027,-0.052849,&
&-0.052562,-0.051951,-0.051218,-0.050013,-0.049004,&
&-0.047495,-0.045601,-0.043288,-0.038336,-0.034916,&
&-0.031104,-0.027333,-0.024661,-0.021854,-0.019517,&
&-0.017429,-0.014527,-0.011771,-0.009228,-0.006537,&
&-0.003868,-0.002086,-0.000524, 0.000950, 0.002227,&
&0.003224, 0.003885, 0.004212, 0.004067, 0.003657,&
&0.003067, 0.002242, 0.001329, 0.000376, 0.000000,&
&25*0.0/
END
SUBROUTINE BCEND
! SUBROUTINE BCEND MODIFIES THE DIAG AND RHS VECTORS
! ON EACH I LINE IN THE APPROPRIATE WAY TO INCLUDE THE
! BOUNDARY CONDITIONS AT JBOT AND JTOP.
! CALLED BY - SYOR.
!
COMMON P(102,101),X(100) , Y(100)
COMMON / COM1/ IMIN , IMAX , IUP , IDOWN , ILE ,&
&ITE , JMIN , JMAX , JUP , JLOW ,&
&JTOP , JBOT , J1 , J2
COMMON / COM2/ AK , ALPHA , DUB , GAM1 , RTK
COMMON / COM5/ XDIFF(100),YDIFF(100)
COMMON /COM19/ DIAG(100), RHS(100), SUB(100), SUP(100)
COMMON /COM23/ CYYC(100), CYYD(100),CYYU(100), IVAL
INTEGER BCTYPE
COMMON /COM28/ BCTYPE , CIRCFF , FHINV , POR , CIRCTE
!
I = IVAL
! BRANCH TO APPROPRIATE ADDRESS FOR BCTYPE
GO TO (10,20,30,40,50,60) , BCTYPE
! BCTYPE = 1, FREE AIR
10 CONTINUE
! DIRCHLET BOUNDARY CONDITION FOR SUBSONIC FREESTREAM
IF (AK .GT. 0.0) RETURN
! NEUMAN BOUNDARY CONDITION FOR SUPERSONIC FREESTREAM
DFACL = -CYYD(JBOT) * RTK * XDIFF(I)
DFACU = -CYYU(JTOP) * RTK * XDIFF(I)
RFACL = DFACL * (P(JMIN,I) - P(JMIN,I-1))
RFACU = DFACU * (P(JMAX,I) - P(JMAX,I-1))
GO TO 95
! BCTYPE = 2, SOLID WALL
20 CONTINUE
! NEUMAN BOUNDARY CONDITION = 0.
! NO MODIFICATION NECESSARY TO DIAG OR RHS
RETURN
! BCTYPE = 3, FREE JET
30 CONTINUE
! DIRCHLET BOUNDARY CONDITION
IF (AK .LT. 0.0) GO TO 31
PJMIN = -.75 * CIRCFF
PJMAX = -.25 * CIRCFF
GO TO 32
31 CONTINUE
PJMIN = 0.0
PJMAX = 0.0
32 CONTINUE
GO TO 90
! BCTYPE = 4, IDEAL SLOTTED WALL
40 CONTINUE
! NEUMAN BOUNDARY CONDITION
DFACL =-FHINV * CYYD(JBOT)
DFACU =-FHINV * CYYU(JTOP)
IF (AK .LT. 0.0) GO TO 41
RFACL = DFACL * ( .75 * CIRCFF + P(JBOT,I))
RFACU = DFACU * ( .25 * CIRCFF + P(JTOP,I))
GO TO 42
41 CONTINUE
RFACL = DFACL * P(JBOT,I)
RFACU = DFACU * P(JTOP,I)
42 CONTINUE
GO TO 95
! BCTYPE = 5, POROUS/PERFORATED WALL
50 CONTINUE
IF(POR .GT. 1.5) GO TO 55
! NEUMAN BOUNDARY CONDITION FOR POR .LT. 1.5
DFACL = -CYYD(JBOT) * POR * XDIFF(I)
DFACU = -CYYU(JTOP) * POR * XDIFF(I)
RFACL = DFACL * (P(JMIN,I) - P(JMIN,I-1))
RFACU = DFACU * (P(JMAX,I) - P(JMAX,I-1))
GO TO 95
55 CONTINUE
! DIRCHLET BOUNDARY CONDITION FOR POR .GT. 1.5
IF (I .NE. IUP) RETURN
! SET VALUES OF P ON BOUNDARY BY INTEGRATING PX USING
! OLD VALUES OF POTENTIAL
PJMIN = P(JMIN,IUP)
TERM = -.5 / (POR * (Y(JMIN) - Y(JMIN+1)))
DO 57 II=IUP,IDOWN
P(JMIN,II) = P(JMIN,II-1) - TERM * (X(II)-X(II-1)) *&
&(P(JMIN,II)+P(JMIN,II-1)-P(JMIN+1,II)-P(JMIN+1,II-1))
57 CONTINUE
PJMAX = P(JMAX,IUP)
TERM = .5 / (POR * (Y(JMAX) - Y(JMAX-1)))
DO 58 II=IUP,IDOWN
P(JMAX,II) = P(JMAX,II-1) - TERM*(X(II) - X(II-1)) *&
&(P(JMAX,II)+P(JMAX,II-1)-P(JMAX-1,II)-P(JMAX-1,II-1))
58 CONTINUE
RHS(JBOT) = RHS(JBOT) - (CYYD(JBOT)*(P(JBOT-1,I)-PJMIN))
RHS(JTOP) = RHS(JTOP) - (CYYU(JTOP)*(P(JTOP+1,I)-PJMAX))
RETURN
! BCTYPE = 6, GENERAL WALL BOUNDARY CONDITION
! DIFFERENCE EQUATIONS FOR THIS BOUNDARY CONDITION
! HAVE NOT YET BEEN WORKED OUT. USER MUST INSERT
! INFORMATION NEEDED FOR CALCULATION
60 CONTINUE
! Changed to write to a file - Andy Ko 4/3/03
! WRITE(6,1000)
WRITE(15,1000)
1000 FORMAT(34H1ABNORMAL STOP IN SUBROUTINE BCEND/&
&24H BCTYPE=6 IS NOT USEABLE)
STOP
! DIRCHLET BOUNDARY CONDITIONS
90 CONTINUE
RHS(JBOT) = RHS(JBOT) - (CYYD(JBOT)*(PJMIN-P(JBOT-1,I)))
RHS(JTOP) = RHS(JTOP) - (CYYU(JTOP)*(PJMAX-P(JTOP+1,I)))
RETURN
95 CONTINUE
! NEUMAN BOUNDARY CONDITIONS
DIAG(JBOT) = DIAG(JBOT) + DFACL
DIAG(JTOP) = DIAG(JTOP) + DFACU
RHS(JBOT) = RHS(JBOT) - RFACL + CYYD(JBOT)*P(JBOT-1,I)
RHS(JTOP) = RHS(JTOP) - RFACU + CYYU(JTOP)*P(JTOP+1,I)
RETURN
END
SUBROUTINE BODY
! COMPUTES BODY GEOMETRY INFORMATION FOR BOUNDARY
! CONDITIONS AND OUTPUT INFORMATION. Five CHOICES OF
! BODY DESCRIPTION ARE AVAILABLE AS FOLLOWS
! BCFOIL = 1 NACA 00XX AIRFOIL
! BCFOIL = 2 PARABOLIC ARC AIRFOIL
! BCFOIL = 3 AIRFOIL ORDINATES READ IN
! BCFOIL = 4 JAMESON'S AIRFOIL INPUT FORMAT
! BCFOIL = 5 diamond airfoil
! BODY ORDINATES AND SLOPES ARE COMPUTED AT THE INPUT
! X MESH LOCATIONS AND ARE DIVIDED BY THE THICKNESS
! RATIO DELTA. THE BODY VOLUME, CAMBER, AND THICKNESS
! ARE ALSO COMPUTED.
! ACTUAL BOUNDARY CONDITION IS SET IN SUBROUTINE SETBC
! CALLED BY - TSFOIL.
!
COMMON / COM1/ IMIN , IMAX , IUP , IDOWN , ILE ,&
&ITE , JMIN , JMAX , JUP , JLOW ,&
&JTOP , JBOT , J1 , J2
COMMON / COM2/ AK , ALPHA , DUB , GAM1 , RTK
LOGICAL AMESH
COMMON / COM4/ XIN(100) , YIN(100), AMESH
COMMON / COM6/ FL(100) , FXL(100), FU(100) , FXU(100),&
&CAMBER(100), THICK(100),VOL , XFOIL(100), IFOIL
INTEGER BCFOIL
COMMON / COM9/ BCFOIL , NL , NU , XL(100) , XU(100) ,&
&YL(100) , YU(100) , RIGF,IFLAP,DELFLP,FLPLOC
LOGICAL PHYS
INTEGER PRTFLO , SIMDEF
COMMON /COM27/ CL , DELTA , DELRT2 , EMACH , EMROOT ,&
&PHYS , PRTFLO , SIMDEF , SONVEL , VFACT ,&
&YFACT
common /com99/ iread
COMMON /SPLN/ A(200) , B(200) , DY1 , DY2 , K1 ,&
&K2 , XP , YP ,DYP
!
! SET NUMBER OF POINTS ON AIRFOIL
IFOIL = ITE - ILE + 1
! ZERO ALL THICKNESSES AND SLOPES
DO 10 I=IMIN,IMAX
FU(I) = 0.
FL(I) = 0.
FXU(I) = 0.
FXL(I) = 0.
10 CONTINUE
! BRANCH TO APPROPRIATE AIRFOIL SPECIFICATION
GO TO (100,200,300,400,250), BCFOIL
100 CONTINUE
! BCFOIL = 1
! FORMULA FOR NACA 00XX SHAPE
IC = 0
DO 125 I = ILE,ITE
IC = IC + 1
Z = XIN(I)
XFOIL(IC) = Z
RTZ = SQRT(Z)
Z2 = Z*Z
Z3 = Z*Z2
Z4 = Z*Z3
FU(IC) = 1.4845*RTZ - .63*Z - 1.758*Z2 + 1.4215*Z3 - .5075*Z4
FL(IC) = -FU(IC)
FXU(IC) = .74225/RTZ - .63 - 3.516*Z + 4.2645*Z2 - 2.03*Z3
FXL(IC) = -FXU(IC)
125 CONTINUE
GO TO 500
200 CONTINUE
! BCFOIL = 2
! PARABOLIC ARC AIRFOIL*******BI-CONVEX.
IC = 0
DO 225 I = ILE,ITE
IC = IC + 1
Z = XIN(I)
XFOIL(IC) = Z
Z2 = Z*Z
FU(IC) = 2.*(Z - Z2)
FL(IC) = -FU(IC)
FXU(IC) = 2. - 4.*Z
FXL(IC) = -FXU(IC)
225 CONTINUE
go to 500
! mod to treat diamond airfoil
250 continue
! bcfoil = 5
! diamond airfoil
ic = 0
do 265 i = ile,ite
ic = ic + 1
z = xin(i)
xfoil(ic) = z
if (z .le. 0.5) fu(ic) = .5*z
if (z .gt. 0.5) fu(ic) = (1. - z)
fl(ic) = -fu(ic)
if (z .le. 0.5) fxu(ic) = 1.0
if (z .gt. 0.5) fxu(ic) = -1.0
fxl(ic) = -fxu(ic)
265 continue
GO TO 500
300 CONTINUE
! BCFOIL = 3
! BODY ORDINATES READ IN NAMELIST
DELINV = 1.
IF(PHYS) DELINV = 1./DELTA
! COMPUTE ORDINATES AND SLOPES AT X MESH LOCATION ON
! AIRFOIL BY CUBIC SPLINE INTERPOLATION.
! DERIVATIVE END CONDITIONS ARE SPECIFIED AT X=0
! AND X=1
K1 = 1
K2 = 1
! UPPER SURFACE
! CALCULATE DY/DX AT END POINTS BY FINITE DIFFERENCE
! FORMULA.
DY1 = (YU(2) - YU(1)) / (XU(2) - XU(1))
DY2 = (YU(NU) - YU(NU-1)) / (XU(NU) - XU(NU-1))
! INITIALIZE CUBIC SPLINE INTERPOLATION
CALL SPLN1(XU,YU,NU)
! CALCULATE ORDINATES AND SLOPES
IC = 0
DO 320 I=ILE,ITE
IC = IC + 1
XP = XIN(I)
XFOIL(IC) = XP
CALL SPLN1X(XU,YU,NU)
! SET ORDINATE AND SLOPE OF AIRFOIL TO INTERPOLATED
! VALUE DIVIDED BY THICKNESS RATIO
FU(IC) = YP*DELINV
FXU(IC) = DYP*DELINV
320 CONTINUE
! LOWER SURFACE
! CALCULATE DY/DX AT END POINTS BY FINITE DIFFERENCE
! FORMULA.
DY1 = (YL(2) - YL(1)) / (XL(2) - XL(1))
DY2 = (YL(NL) - YL(NL-1)) / (XL(NL) - XL(NL-1))
! INITIALIZE CUBIC SPLINE INTERPOLATION
CALL SPLN1(XL,YL,NL)
! CALCULATE ORDINATES AND SLOPES
IC = 0
DO 330 I=ILE,ITE
IC = IC + 1
XP = XIN(I)
CALL SPLN1X(XL,YL,NL)
! SET ORDINATE AND SLOPE OF AIRFOIL TO INTERPOLATED
! VALUE DIVIDED BY THICKNESS RATIO
FL(IC) = YP* DELINV
FXL(IC) = DYP*DELINV
330 CONTINUE
GO TO 500
400 CONTINUE
! BCFOIL = 4
! AIRFOIL INPUT IN JAMESON'S FORMAT
K1 = 1
K2 = 1
DELINV = 1.
IF (PHYS) DELINV = 1./DELTA
READ(iread,470)
READ(iread,480) FSYM,FNU,FNL
ISYM = FSYM
NU = FNU
NL = FNL
READ(iread,470)
READ(iread,490) (XU(N),YU(N),N=1,NU)
DY1 = (YU(2) - YU(1)) / (XU(2) - XU(1))
! Bug: N = NU + 1, and therefore, the derivative is wrong - Andy Ko 4/9/03
! DY2 = (YU(N) - YU(N-1)) / (XU(N) - XU(N-1))
DY2 = (YU(NU) - YU(NU-1)) / (XU(NU) - XU(NU-1))
CALL SPLN1(XU,YU,NU)
IC = 0
DO 410 I=ILE,ITE
IC = IC + 1
XP = XIN(I)
XFOIL(IC) = XP
CALL SPLN1X(XU,YU,NU)
FU(IC) = YP * DELINV
FXU(IC) = DYP * DELINV
410 CONTINUE
IF (ISYM.EQ.0) GO TO 440
NL = NU
IC = 0
DO 420 I=ILE,ITE
IC = IC + 1
FL(IC) = -FU(IC)
420 FXL(IC) = -FXU(IC)
DO 430 N=1,NL
XL(N) = XU(N)
430 YL(N) = -YU(N)
GO TO 500
440 CONTINUE
READ(iread,470)
READ(iread,490) (XL(N),YL(N),N=1,NL)
DY1 = (YL(2) - YL(1)) / (XL(2) - XL(1))
! Bug: N = NL + 1 and therefore derivative is calculated wrong - Andy Ko 4/9/03
! DY2 = (YL(N) - YL(N-1)) / (XL(N) - XL(N-1))
DY2 = (YL(NL) - YL(NL-1)) / (XL(NL) - XL(NL-1))
CALL SPLN1(XL,YL,NL)
IC = 0
DO 450 I=ILE,ITE
IC = IC + 1
XP = XIN(I)
CALL SPLN1X(XL,YL,NL)
FL(IC) = YP * DELINV
FXL(IC) = DYP * DELINV
450 CONTINUE
470 FORMAT(1X)
480 FORMAT(3F10.0)
490 FORMAT(2F10.0)
500 CONTINUE
! EXECUTE CALCULATIONS COMMON TO ALL AIRFOILS
!
! COMPUTE AIRFOIL VOLUMNE
CALL SIMP(VOLU,XFOIL,FU,IFOIL,IERR)
CALL SIMP(VOLL,XFOIL,FL,IFOIL,IERR)
VOL = VOLU - VOLL
! ADD IN FLAP DEFLECTION
IF (IFLAP .EQ. 0) GO TO 524
DFLAP = DELFLP/57.29578
SDFLAP = SIN(DFLAP)
DO 505 I=1,IFOIL
IF (XFOIL(I) .GE. FLPLOC) GO TO 510
505 CONTINUE
GO TO 524
510 IFP = I
DO 520 I = IFP,IFOIL
DELY = (XFOIL(I)-FLPLOC)*SDFLAP*DELINV
FU(I) = FU(I) - DELY
FL(I) = FL(I) - DELY
FXU(I) = FXU(I) - DFLAP*DELINV
FXL(I) = FXL(I) - DFLAP*DELINV
520 CONTINUE
! COMPUTE CAMBER AND THICKNESS
524 DO 525 I = 1,IFOIL
CAMBER(I) = .5*(FU(I) + FL(I))