Skip to content
Snippets Groups Projects
Commit df030e80 authored by Thomée Corentin's avatar Thomée Corentin
Browse files

Cleaner UPM test case + cm

parent 4a07ec64
No related branches found
No related tags found
No related merge requests found
Pipeline #20909 failed
......@@ -47,8 +47,8 @@ class UPMInterface(SolversInterface):
self.solver.saveCp('Cp'+sfx+'.dat') # Directly use the UPM function
def save(self, sfx='inviscid'):
# TODO, fonction pour restart ?
self.solver.save(self.argOut['wrt'], sfx)
# TODO
pass
def getAoA(self):
return self.solver.AoA
......@@ -63,8 +63,7 @@ class UPMInterface(SolversInterface):
return self.solver.cd
def getCm(self):
# TODO (Shouldn't be necessary, but not hard to code in the UPM solver. Required to add a reference [in cfg probably *or harcoded @ (0,0)*], then do some maths around it)
return 0 # Temporary value
return self.solver.cm
def getVerbose(self):
return 0 # Not necessary
......@@ -148,5 +147,4 @@ class UPMInterface(SolversInterface):
data[i,3] = i
self.iBnd[0].nodesCoord = np.column_stack((data[:,0], data[:,1],\
data[:,2], data[:,3]))
self.iBnd[0].setConnectList(connectListNodes, connectListElems)
\ No newline at end of file
# x Cp
1.00000 0.21975
0.99653 0.21132
0.99220 0.19608
0.98753 0.18111
0.98249 0.16606
0.97709 0.15126
0.97136 0.13685
0.96533 0.12291
0.95903 0.10954
0.95251 0.09676
0.94581 0.08460
0.93895 0.07304
0.93199 0.06205
0.92494 0.05161
0.91783 0.04168
0.91067 0.03221
0.90347 0.02315
0.89624 0.01449
0.88900 0.00617
0.88174 -0.00184
0.87447 -0.00956
0.86719 -0.01702
0.85990 -0.02425
0.85261 -0.03127
0.84531 -0.03810
0.83801 -0.04475
0.83071 -0.05124
0.82341 -0.05759
0.81610 -0.06381
0.80879 -0.06990
0.80148 -0.07589
0.79417 -0.08178
0.78686 -0.08758
0.77955 -0.09329
0.77224 -0.09893
0.76492 -0.10451
0.75761 -0.11002
0.75030 -0.11548
0.74298 -0.12089
0.73567 -0.12625
0.72835 -0.13158
0.72104 -0.13687
0.71372 -0.14213
0.70641 -0.14737
0.69909 -0.15258
0.69178 -0.15777
0.68447 -0.16295
0.67716 -0.16812
0.66984 -0.17327
0.66253 -0.17842
0.65522 -0.18357
0.64792 -0.18872
0.64061 -0.19386
0.63330 -0.19902
0.62600 -0.20417
0.61870 -0.20934
0.61139 -0.21451
0.60410 -0.21970
0.59680 -0.22490
0.58950 -0.23011
0.58221 -0.23535
0.57492 -0.24060
0.56763 -0.24587
0.56034 -0.25116
0.55306 -0.25648
0.54578 -0.26182
0.53850 -0.26718
0.53123 -0.27257
0.52396 -0.27799
0.51669 -0.28344
0.50943 -0.28892
0.50217 -0.29443
0.49491 -0.29996
0.48766 -0.30554
0.48041 -0.31114
0.47317 -0.31678
0.46593 -0.32245
0.45870 -0.32816
0.45147 -0.33390
0.44424 -0.33968
0.43702 -0.34550
0.42981 -0.35135
0.42261 -0.35724
0.41540 -0.36317
0.40821 -0.36913
0.40102 -0.37514
0.39384 -0.38118
0.38667 -0.38726
0.37950 -0.39338
0.37234 -0.39954
0.36519 -0.40573
0.35805 -0.41197
0.35091 -0.41824
0.34379 -0.42455
0.33667 -0.43090
0.32957 -0.43728
0.32247 -0.44370
0.31539 -0.45015
0.30832 -0.45664
0.30126 -0.46315
0.29421 -0.46970
0.28717 -0.47626
0.28015 -0.48284
0.27315 -0.48942
0.26616 -0.49600
0.25918 -0.50254
0.25222 -0.50903
0.24528 -0.51540
0.23836 -0.52159
0.23146 -0.52746
0.22458 -0.53281
0.21773 -0.53733
0.21089 -0.54088
0.20409 -0.54490
0.19731 -0.55730
0.19057 -0.59160
0.18386 -0.59147
0.17718 -0.59621
0.17055 -0.60253
0.16396 -0.60949
0.15741 -0.61678
0.15092 -0.62427
0.14449 -0.63190
0.13813 -0.63962
0.13183 -0.64742
0.12563 -0.65526
0.11951 -0.66313
0.11350 -0.67101
0.10761 -0.67888
0.10185 -0.68670
0.09623 -0.69445
0.09077 -0.70209
0.08549 -0.70959
0.08040 -0.71691
0.07552 -0.72399
0.07084 -0.73079
0.06638 -0.73725
0.06215 -0.74334
0.05814 -0.74900
0.05436 -0.75418
0.05079 -0.75882
0.04744 -0.76289
0.04429 -0.76634
0.04133 -0.76912
0.03855 -0.77115
0.03594 -0.77242
0.03348 -0.77285
0.03118 -0.77234
0.02901 -0.77088
0.02698 -0.76830
0.02506 -0.76461
0.02325 -0.75960
0.02154 -0.75323
0.01993 -0.74529
0.01840 -0.73569
0.01696 -0.72421
0.01560 -0.71070
0.01432 -0.69488
0.01310 -0.67661
0.01195 -0.65548
0.01086 -0.63141
0.00983 -0.60382
0.00886 -0.57271
0.00794 -0.53736
0.00708 -0.49781
0.00627 -0.45334
0.00551 -0.40392
0.00480 -0.34910
0.00415 -0.28871
0.00354 -0.22272
0.00298 -0.15106
0.00247 -0.07412
0.00201 0.00769
0.00159 0.09369
0.00123 0.18263
0.00091 0.27347
0.00065 0.36435
0.00043 0.45385
0.00025 0.54030
0.00013 0.62168
0.00005 0.69656
0.00000 0.76351
0.00000 0.82251
0.00005 0.87388
0.00013 0.91735
0.00025 0.95220
0.00043 0.97760
0.00065 0.99341
0.00091 0.99981
0.00123 0.99730
0.00159 0.98662
0.00201 0.96874
0.00247 0.94470
0.00298 0.91563
0.00354 0.88251
0.00415 0.84641
0.00480 0.80814
0.00551 0.76848
0.00627 0.72807
0.00708 0.68738
0.00794 0.64691
0.00886 0.60686
0.00983 0.56760
0.01086 0.52920
0.01195 0.49187
0.01310 0.45561
0.01432 0.42054
0.01560 0.38662
0.01696 0.35391
0.01840 0.32236
0.01993 0.29197
0.02154 0.26268
0.02325 0.23450
0.02506 0.20735
0.02698 0.18124
0.02901 0.15607
0.03118 0.13189
0.03348 0.10860
0.03594 0.08620
0.03855 0.06468
0.04133 0.04400
0.04429 0.02417
0.04744 0.00517
0.05079 -0.01300
0.05436 -0.03033
0.05814 -0.04682
0.06215 -0.06246
0.06638 -0.07723
0.07084 -0.09114
0.07552 -0.10417
0.08040 -0.11632
0.08549 -0.12761
0.09077 -0.13804
0.09623 -0.14764
0.10185 -0.15644
0.10761 -0.16447
0.11350 -0.17177
0.11951 -0.17837
0.12563 -0.18432
0.13183 -0.18966
0.13813 -0.19443
0.14449 -0.19866
0.15092 -0.20241
0.15741 -0.20569
0.16396 -0.20855
0.17055 -0.21102
0.17718 -0.21312
0.18386 -0.21488
0.19057 -0.21632
0.19731 -0.21747
0.20409 -0.21835
0.21089 -0.21897
0.21773 -0.21936
0.22458 -0.21952
0.23146 -0.21949
0.23836 -0.21925
0.24528 -0.21885
0.25222 -0.21827
0.25918 -0.21754
0.26616 -0.21666
0.27315 -0.21565
0.28015 -0.21450
0.28717 -0.21324
0.29421 -0.21187
0.30126 -0.21040
0.30832 -0.20883
0.31539 -0.20717
0.32247 -0.20542
0.32957 -0.20359
0.33667 -0.20169
0.34379 -0.19973
0.35091 -0.19770
0.35805 -0.19561
0.36519 -0.19346
0.37234 -0.19127
0.37950 -0.18903
0.38667 -0.18675
0.39384 -0.18443
0.40102 -0.18208
0.40821 -0.17970
0.41540 -0.17729
0.42261 -0.17487
0.42981 -0.17244
0.43702 -0.17000
0.44424 -0.16756
0.45147 -0.16515
0.45870 -0.16278
0.46593 -0.16049
0.47317 -0.15833
0.48041 -0.15643
0.48766 -0.15500
0.49491 -0.15475
0.50217 -0.15712
0.50943 -0.13812
0.51669 -0.12616
0.52396 -0.12354
0.53123 -0.12311
0.53850 -0.12256
0.54578 -0.12152
0.55306 -0.12004
0.56034 -0.11824
0.56763 -0.11619
0.57492 -0.11398
0.58221 -0.11163
0.58950 -0.10918
0.59680 -0.10664
0.60410 -0.10405
0.61139 -0.10139
0.61870 -0.09869
0.62600 -0.09595
0.63330 -0.09318
0.64061 -0.09037
0.64792 -0.08753
0.65522 -0.08466
0.66253 -0.08176
0.66984 -0.07883
0.67716 -0.07587
0.68447 -0.07289
0.69178 -0.06987
0.69909 -0.06681
0.70641 -0.06372
0.71372 -0.06060
0.72104 -0.05743
0.72835 -0.05423
0.73567 -0.05097
0.74298 -0.04768
0.75030 -0.04433
0.75761 -0.04092
0.76492 -0.03746
0.77224 -0.03393
0.77955 -0.03033
0.78686 -0.02666
0.79417 -0.02291
0.80148 -0.01907
0.80879 -0.01513
0.81610 -0.01110
0.82341 -0.00695
0.83071 -0.00269
0.83801 0.00171
0.84531 0.00625
0.85261 0.01095
0.85990 0.01581
0.86719 0.02087
0.87447 0.02613
0.88174 0.03162
0.88900 0.03736
0.89624 0.04338
0.90347 0.04972
0.91067 0.05639
0.91783 0.06345
0.92494 0.07093
0.93199 0.07889
0.93895 0.08737
0.94581 0.09644
0.95251 0.10613
0.95903 0.11652
0.96533 0.12767
0.97136 0.13961
0.97709 0.15243
0.98249 0.16615
0.98753 0.18087
0.99220 0.19628
0.99653 0.21365
1.00000 0.21975
# x Cp
1.00000 0.42175
0.99653 0.29063
0.99220 0.24881
0.98753 0.21527
0.98249 0.18951
0.97709 0.16759
0.97136 0.14834
0.96533 0.13105
0.95903 0.11530
0.95251 0.10081
0.94581 0.08739
0.93895 0.07489
0.93199 0.06321
0.92494 0.05222
0.91783 0.04186
0.91067 0.03205
0.90347 0.02273
0.89624 0.01384
0.88900 0.00533
0.88174 -0.00283
0.87447 -0.01069
0.86719 -0.01828
0.85990 -0.02561
0.85261 -0.03273
0.84531 -0.03964
0.83801 -0.04637
0.83071 -0.05293
0.82341 -0.05935
0.81610 -0.06563
0.80879 -0.07179
0.80148 -0.07784
0.79417 -0.08379
0.78686 -0.08964
0.77955 -0.09541
0.77224 -0.10111
0.76492 -0.10674
0.75761 -0.11231
0.75030 -0.11782
0.74298 -0.12328
0.73567 -0.12870
0.72835 -0.13408
0.72104 -0.13943
0.71372 -0.14474
0.70641 -0.15003
0.69909 -0.15530
0.69178 -0.16055
0.68447 -0.16579
0.67716 -0.17101
0.66984 -0.17623
0.66253 -0.18144
0.65522 -0.18665
0.64792 -0.19185
0.64061 -0.19706
0.63330 -0.20228
0.62600 -0.20750
0.61870 -0.21273
0.61139 -0.21798
0.60410 -0.22323
0.59680 -0.22850
0.58950 -0.23379
0.58221 -0.23910
0.57492 -0.24442
0.56763 -0.24977
0.56034 -0.25514
0.55306 -0.26054
0.54578 -0.26596
0.53850 -0.27140
0.53123 -0.27688
0.52396 -0.28239
0.51669 -0.28792
0.50943 -0.29349
0.50217 -0.29909
0.49491 -0.30472
0.48766 -0.31039
0.48041 -0.31609
0.47317 -0.32183
0.46593 -0.32761
0.45870 -0.33342
0.45147 -0.33928
0.44424 -0.34517
0.43702 -0.35110
0.42981 -0.35707
0.42261 -0.36308
0.41540 -0.36914
0.40821 -0.37523
0.40102 -0.38137
0.39384 -0.38755
0.38667 -0.39378
0.37950 -0.40004
0.37234 -0.40636
0.36519 -0.41271
0.35805 -0.41912
0.35091 -0.42556
0.34379 -0.43206
0.33667 -0.43859
0.32957 -0.44518
0.32247 -0.45181
0.31539 -0.45849
0.30832 -0.46522
0.30126 -0.47199
0.29421 -0.47881
0.28717 -0.48569
0.28015 -0.49261
0.27315 -0.49958
0.26616 -0.50660
0.25918 -0.51367
0.25222 -0.52079
0.24528 -0.52796
0.23836 -0.53519
0.23146 -0.54247
0.22458 -0.54980
0.21773 -0.55719
0.21089 -0.56463
0.20409 -0.57213
0.19731 -0.57969
0.19057 -0.58730
0.18386 -0.59497
0.17718 -0.60270
0.17055 -0.61049
0.16396 -0.61834
0.15741 -0.62625
0.15092 -0.63421
0.14449 -0.64222
0.13813 -0.65029
0.13183 -0.65839
0.12563 -0.66653
0.11951 -0.67470
0.11350 -0.68287
0.10761 -0.69104
0.10185 -0.69917
0.09623 -0.70725
0.09077 -0.71523
0.08549 -0.72309
0.08040 -0.73078
0.07552 -0.73825
0.07084 -0.74546
0.06638 -0.75236
0.06215 -0.75889
0.05814 -0.76501
0.05436 -0.77068
0.05079 -0.77583
0.04744 -0.78041
0.04429 -0.78440
0.04133 -0.78773
0.03855 -0.79032
0.03594 -0.79218
0.03348 -0.79320
0.03118 -0.79330
0.02901 -0.79249
0.02698 -0.79052
0.02506 -0.78751
0.02325 -0.78313
0.02154 -0.77746
0.01993 -0.77019
0.01840 -0.76130
0.01696 -0.75050
0.01560 -0.73770
0.01432 -0.72257
0.01310 -0.70502
0.01195 -0.68454
0.01086 -0.66119
0.00983 -0.63419
0.00886 -0.60376
0.00794 -0.56891
0.00708 -0.52992
0.00627 -0.48585
0.00551 -0.43680
0.00480 -0.38221
0.00415 -0.32191
0.00354 -0.25590
0.00298 -0.18399
0.00247 -0.10664
0.00201 -0.02420
0.00159 0.06270
0.00123 0.15271
0.00091 0.24493
0.00065 0.33739
0.00043 0.42865
0.00025 0.51712
0.00013 0.60058
0.00005 0.67769
0.00000 0.74690
0.00000 0.80818
0.00005 0.86184
0.00013 0.90766
0.00025 0.94485
0.00043 0.97257
0.00065 0.99062
0.00091 0.99915
0.00123 0.99863
0.00159 0.98980
0.00201 0.97360
0.00247 0.95107
0.00298 0.92331
0.00354 0.89138
0.00415 0.85627
0.00480 0.81886
0.00551 0.77993
0.00627 0.74012
0.00708 0.69993
0.00794 0.65987
0.00886 0.62013
0.00983 0.58113
0.01086 0.54289
0.01195 0.50569
0.01310 0.46950
0.01432 0.43447
0.01560 0.40055
0.01696 0.36781
0.01840 0.33619
0.01993 0.30571
0.02154 0.27631
0.02325 0.24801
0.02506 0.22071
0.02698 0.19445
0.02901 0.16911
0.03118 0.14475
0.03348 0.12127
0.03594 0.09868
0.03855 0.07696
0.04133 0.05606
0.04429 0.03602
0.04744 0.01681
0.05079 -0.00159
0.05436 -0.01914
0.05814 -0.03585
0.06215 -0.05171
0.06638 -0.06670
0.07084 -0.08082
0.07552 -0.09406
0.08040 -0.10643
0.08549 -0.11792
0.09077 -0.12855
0.09623 -0.13834
0.10185 -0.14732
0.10761 -0.15553
0.11350 -0.16299
0.11951 -0.16976
0.12563 -0.17586
0.13183 -0.18134
0.13813 -0.18625
0.14449 -0.19062
0.15092 -0.19449
0.15741 -0.19790
0.16396 -0.20088
0.17055 -0.20345
0.17718 -0.20565
0.18386 -0.20751
0.19057 -0.20905
0.19731 -0.21029
0.20409 -0.21125
0.21089 -0.21195
0.21773 -0.21242
0.22458 -0.21266
0.23146 -0.21269
0.23836 -0.21252
0.24528 -0.21218
0.25222 -0.21166
0.25918 -0.21098
0.26616 -0.21016
0.27315 -0.20920
0.28015 -0.20810
0.28717 -0.20689
0.29421 -0.20556
0.30126 -0.20412
0.30832 -0.20259
0.31539 -0.20096
0.32247 -0.19924
0.32957 -0.19744
0.33667 -0.19557
0.34379 -0.19362
0.35091 -0.19161
0.35805 -0.18953
0.36519 -0.18740
0.37234 -0.18521
0.37950 -0.18297
0.38667 -0.18068
0.39384 -0.17835
0.40102 -0.17598
0.40821 -0.17356
0.41540 -0.17111
0.42261 -0.16863
0.42981 -0.16612
0.43702 -0.16357
0.44424 -0.16100
0.45147 -0.15841
0.45870 -0.15579
0.46593 -0.15315
0.47317 -0.15048
0.48041 -0.14780
0.48766 -0.14510
0.49491 -0.14238
0.50217 -0.13965
0.50943 -0.13690
0.51669 -0.13413
0.52396 -0.13135
0.53123 -0.12856
0.53850 -0.12575
0.54578 -0.12293
0.55306 -0.12010
0.56034 -0.11726
0.56763 -0.11440
0.57492 -0.11153
0.58221 -0.10865
0.58950 -0.10576
0.59680 -0.10285
0.60410 -0.09993
0.61139 -0.09699
0.61870 -0.09404
0.62600 -0.09107
0.63330 -0.08809
0.64061 -0.08508
0.64792 -0.08206
0.65522 -0.07902
0.66253 -0.07595
0.66984 -0.07287
0.67716 -0.06975
0.68447 -0.06661
0.69178 -0.06344
0.69909 -0.06023
0.70641 -0.05700
0.71372 -0.05372
0.72104 -0.05041
0.72835 -0.04705
0.73567 -0.04364
0.74298 -0.04019
0.75030 -0.03668
0.75761 -0.03311
0.76492 -0.02948
0.77224 -0.02578
0.77955 -0.02201
0.78686 -0.01815
0.79417 -0.01421
0.80148 -0.01018
0.80879 -0.00604
0.81610 -0.00179
0.82341 0.00259
0.83071 0.00709
0.83801 0.01174
0.84531 0.01655
0.85261 0.02154
0.85990 0.02671
0.86719 0.03210
0.87447 0.03772
0.88174 0.04361
0.88900 0.04978
0.89624 0.05628
0.90347 0.06314
0.91067 0.07040
0.91783 0.07813
0.92494 0.08638
0.93199 0.09522
0.93895 0.10474
0.94581 0.11503
0.95251 0.12621
0.95903 0.13844
0.96533 0.15191
0.97136 0.16688
0.97709 0.18378
0.98249 0.20330
0.98753 0.22658
0.99220 0.25741
0.99653 0.29668
1.00000 0.42175
......@@ -41,7 +41,7 @@ def cfgInviscid(nthrds, verb):
'dt': 1e6,
'aoa': 2,
'naca':"0012",
'N': 400,
'N': 100,
'filename': os.path.dirname(os.path.abspath(__file__)) + '/../../models/upm/n0012.dat'
}
......@@ -85,7 +85,7 @@ def main():
print(' Re M alpha Cl Cd Cdp Cdf Cm')
print('{0:6.1f}e6 {1:8.2f} {2:8.1f} {3:8.4f} {4:8.4f} {5:8.4f} {6:8.4f} {7:8.4f}'.format(vcfg['Re']/1e6, iSolverAPI.getMinf(), iSolverAPI.getAoA()*180/math.pi, iSolverAPI.getCl(), vSolver.Cdt, vSolver.Cdp, vSolver.Cdf, iSolverAPI.getCm()))
# Write results to file.
# Write results to file.
vSolution = viscUtils.getSolution(vSolver)
vSolution['Cdt_int'] = vSolution['Cdf'] + iSolverAPI.getCd()
tms['total'].stop()
......@@ -95,25 +95,13 @@ def main():
print(tms)
print('SOLVERS statistics')
print(coupler.tms)
"""# Test solution
print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET)
tests = CTests()
tests.add(CTest('Cl', iSolverAPI.getCl(), 0.230, 5e-2)) # XFOIL 0.2325
tests.add(CTest('Cd wake', vSolution['Cdt_w'], 0.0056, 1e-3, forceabs=True)) # XFOIL 0.00531
tests.add(CTest('Cd integral', vSolution['Cdt_int'], 0.0059, 1e-3, forceabs=True)) # XFOIL 0.00531
tests.add(CTest('Cdf', vSolution['Cdf'], 0.00465, 1e-3, forceabs=True)) # XFOIL 0.00084, Cdf = 0.00447
tests.add(CTest('xtr_top', vSolution['xtrT'], 0.20, 0.03, forceabs=True)) # XFOIL 0.1877
tests.add(CTest('xtr_bot', vSolution['xtrB'], 0.40, 0.01, forceabs=True)) # XFOIL 0.4998
tests.add(CTest('Iterations', len(aeroCoeffs), 17, 0, forceabs=True))
tests.run()"""
# Show results
"""if not args.nogui:
if not args.nogui:
iCp = viscUtils.read('Cp_inviscid.dat', delim=" ", skip = 0)
vCp = viscUtils.read('Cp_viscous.dat', delim=" ", skip = 0)
xfoilCp = viscUtils.read('../../blast/models/references/cpXfoil_n0012.dat', delim=None, skip = 1)
xfoilCpInv = viscUtils.read('../../blast/models/references/cpXfoilInv_n0012.dat', delim=None, skip = 1)
xfoilCp = viscUtils.read('../../blast/models/upm/references/cp_0012.dat', delim=None, skip = 1)
xfoilCpInv = viscUtils.read('../../blast/models/upm/references/cp_0012_inviscid.dat', delim=None, skip = 1)
plotcp = {'curves': [np.column_stack((vCp[:,0], vCp[:,3])),
np.column_stack((xfoilCp[:,0], xfoilCp[:,1])),
np.column_stack((iCp[:,0], iCp[:,3])),
......@@ -130,21 +118,6 @@ def main():
'ylabel': '$c_p$'
}
viscUtils.plot(plotcp)
xfoilBl = viscUtils.read('../../blast/models/references/blXfoil_n0012.dat', delim=None, skip = 1)
plotcf = {'curves': [np.column_stack((vSolution['x'], vSolution['Cf'])),
np.column_stack((xfoilBl[:,1], xfoilBl[:,6]))],
'labels': ['Blast', 'XFOIL'],
'lw': [3, 3],
'color': ['firebrick', 'darkblue'],
'ls': ['-', '-'],
'reverse': True,
'xlim':[0, 1],
'legend': True,
'xlabel': '$x/c$',
'ylabel': '$c_f$'
}
viscUtils.plot(plotcf)"""
# eof
print('')
......
Subproject commit 7311f21b402abe5f8cde46043df01e959b24a5e4
Subproject commit 1df88d42af60498ab962f70ff3ff23e428478c41
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment