Commit c0b0318b authored by ccfd's avatar ccfd
Browse files

first commit

parents
Apache License
Copyright Li Xinliang & Dang Guanlin
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Do not disclose the software source code to a third party without the consent of the software developer..
* If the software is used in scientific research or engineering applications or refers to its source code, it should be marked (quote or thanks, etc) in the relevant papers or reports.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
0.35639366 0.00000000 0.00000000 2.84000000
0.35679395 0.00673511 0.00001281 2.83681376
0.35720877 0.01363237 0.00002540 2.83351851
0.35763972 0.02069208 0.00003754 2.83010321
0.35808823 0.02791468 0.00004915 2.82655730
0.35855604 0.03530028 0.00006018 2.82286829
0.35904499 0.04284893 0.00007063 2.81902284
0.35955708 0.05056068 0.00008057 2.81500659
0.36009442 0.05843574 0.00009004 2.81080469
0.36065920 0.06647453 0.00009915 2.80640193
0.36125365 0.07467774 0.00010799 2.80178293
0.36188007 0.08304639 0.00011666 2.79693223
0.36254081 0.09158186 0.00012527 2.79183430
0.36323827 0.10028586 0.00013390 2.78647361
0.36397491 0.10916045 0.00014265 2.78083454
0.36475328 0.11820806 0.00015158 2.77490142
0.36557597 0.12743139 0.00016076 2.76865841
0.36644570 0.13683344 0.00017024 2.76208949
0.36736527 0.14641745 0.00018006 2.75517839
0.36833764 0.15618689 0.00019025 2.74790850
0.36936589 0.16614538 0.00020084 2.74026281
0.37045326 0.17629669 0.00021183 2.73222385
0.37160319 0.18664469 0.00022325 2.72377358
0.37281933 0.19719333 0.00023510 2.71489338
0.37410555 0.20794661 0.00024738 2.70556395
0.37546598 0.21890854 0.00026010 2.69576528
0.37690506 0.23008314 0.00027325 2.68547661
0.37842752 0.24147444 0.00028685 2.67467636
0.38003843 0.25308639 0.00030088 2.66334214
0.38174326 0.26492295 0.00031535 2.65145070
0.38354788 0.27698797 0.00033027 2.63897792
0.38545861 0.28928527 0.00034564 2.62589874
0.38748224 0.30181854 0.00036146 2.61218716
0.38962614 0.31459137 0.00037776 2.59781618
0.39189822 0.32760722 0.00039454 2.58275775
0.39430708 0.34086938 0.00041185 2.56698270
0.39686201 0.35438094 0.00042971 2.55046061
0.39957313 0.36814475 0.00044817 2.53315975
0.40245147 0.38216339 0.00046725 2.51504690
0.40550911 0.39643910 0.00048702 2.49608727
0.40875929 0.41097374 0.00050748 2.47624426
0.41221662 0.42576872 0.00052867 2.45547943
0.41589723 0.44082497 0.00055054 2.43375232
0.41981900 0.45614281 0.00057312 2.41102065
0.42400164 0.47172190 0.00059629 2.38724019
0.42846706 0.48756101 0.00062013 2.36236558
0.43323914 0.50365819 0.00064450 2.33634994
0.43834470 0.52001055 0.00066989 2.30914628
0.44381187 0.53661508 0.00069598 2.28070807
0.44967400 0.55346119 0.00072270 2.25098558
0.45596546 0.57053808 0.00075087 2.21993484
0.46272383 0.58783284 0.00078067 2.18751969
0.46998800 0.60533013 0.00081234 2.15371617
0.47779799 0.62301226 0.00084600 2.11851889
0.48619158 0.64086070 0.00088188 2.08195146
0.49520181 0.65885994 0.00092073 2.04407883
0.50485545 0.67699954 0.00096277 2.00500137
0.51518016 0.69526383 0.00100878 1.96483172
0.52620019 0.71361743 0.00105851 1.92369487
0.53792699 0.73198398 0.00111236 1.88177482
0.55038004 0.75030312 0.00117119 1.83921585
0.56358293 0.76852967 0.00123488 1.79615302
0.57756149 0.78661209 0.00130161 1.75270463
0.59237560 0.80448962 0.00136789 1.70889543
0.60812146 0.82209205 0.00143239 1.66466441
0.62491522 0.83933827 0.00149434 1.61993931
0.64288317 0.85613606 0.00155331 1.57466813
0.66215100 0.87238255 0.00161029 1.52885283
0.68282108 0.88796816 0.00166656 1.48258319
0.70495608 0.90277936 0.00172443 1.43605635
0.72848525 0.91668510 0.00178577 1.38969932
0.75302603 0.92956936 0.00186146 1.34443787
0.77814360 0.94141584 0.00194613 1.30105073
0.80379028 0.95216144 0.00202312 1.25955617
0.82973753 0.96165234 0.00210072 1.22022015
0.85523959 0.96982445 0.00217804 1.18388890
0.87960203 0.97668580 0.00224692 1.15116231
0.90224565 0.98231990 0.00230826 1.12233247
0.92273382 0.98683473 0.00236165 1.09746899
0.94077936 0.99035300 0.00240831 1.07647161
0.95623758 0.99301193 0.00244924 1.05912454
0.96910008 0.99495773 0.00248385 1.04512061
0.97948429 0.99633605 0.00251073 1.03408467
0.98762141 0.99728087 0.00253034 1.02560170
0.99381787 0.99790767 0.00254631 1.01924814
0.99841124 0.99831057 0.00256163 1.01461480
1.00172732 0.99856283 0.00257657 1.01132319
1.00405783 0.99871890 0.00258890 1.00904311
1.00565191 0.99881764 0.00259765 1.00750648
1.00671797 0.99888600 0.00260412 1.00650116
1.00741758 0.99894019 0.00260884 1.00586276
1.00786599 0.99898822 0.00261041 1.00546742
1.00814853 0.99903311 0.00260851 1.00522697
1.00833351 0.99907500 0.00260602 1.00508341
1.00846986 0.99911247 0.00260590 1.00499903
1.00858318 0.99914343 0.00260799 1.00494690
1.00868475 0.99916587 0.00261058 1.00490858
1.00878221 0.99917833 0.00261301 1.00487393
1.00887871 0.99918016 0.00261465 1.00483735
1.00897212 0.99917116 0.00261415 1.00479558
1.00906275 0.99915161 0.00261181 1.00474972
1.00915546 0.99912257 0.00260998 1.00470484
1.00925199 0.99908628 0.00261006 1.00466550
1.00934787 0.99904608 0.00261121 1.00463362
1.00943640 0.99900599 0.00261163 1.00460967
1.00951121 0.99896996 0.00260939 1.00459330
1.00956938 0.99894116 0.00260344 1.00458417
1.00961488 0.99892125 0.00259485 1.00458338
1.00965575 0.99890999 0.00258594 1.00459244
1.00969706 0.99890548 0.00257781 1.00461039
1.00973848 0.99890465 0.00256963 1.00463299
1.00977679 0.99890400 0.00255953 1.00465426
1.00981088 0.99890032 0.00254648 1.00466911
1.00984623 0.99889128 0.00253199 1.00467593
1.00989235 0.99887573 0.00251931 1.00467642
1.00995314 0.99885387 0.00251029 1.00467234
1.01002197 0.99882732 0.00250355 1.00466335
1.01008767 0.99879888 0.00249635 1.00464871
1.01014437 0.99877189 0.00248768 1.00463020
1.01019507 0.99874936 0.00247932 1.00461267
1.01024612 0.99873333 0.00247393 1.00460136
1.01029800 0.99872446 0.00247177 1.00459780
1.01034261 0.99872202 0.00246986 1.00459872
1.01037184 0.99872394 0.00246501 1.00459976
1.01038785 0.99872728 0.00245752 1.00460008
1.01040164 0.99872933 0.00245082 1.00460254
1.01042075 0.99872898 0.00244740 1.00460918
1.01044131 0.99872757 0.00244596 1.00461809
1.01045394 0.99872845 0.00244325 1.00462535
1.01045598 0.99873506 0.00243811 1.00462942
1.01045476 0.99874851 0.00243260 1.00463229
1.01045925 0.99876633 0.00242934 1.00463634
1.01047073 0.99878320 0.00242849 1.00464086
1.01048274 0.99879333 0.00242790 1.00464246
1.01049001 0.99879263 0.00242614 1.00463913
1.01049541 0.99877950 0.00242482 1.00463323
1.01050535 0.99875415 0.00242669 1.00462918
1.01051896 0.99871789 0.00243192 1.00462859
1.01052888 0.99867351 0.00243824 1.00462987
1.01053322 0.99862631 0.00244482 1.00463232
1.01053776 0.99858445 0.00245296 1.00463674
1.01054571 0.99855758 0.00246274 1.00464186
1.01055557 0.99855391 0.00247252 1.00464423
1.01056879 0.99857726 0.00248183 1.00464179
1.01058964 0.99862573 0.00249142 1.00463380
1.01061933 0.99869176 0.00250136 1.00461856
1.01065671 0.99876300 0.00251133 1.00459476
1.01070065 0.99882401 0.00252165 1.00456420
1.01074713 0.99885932 0.00253235 1.00453164
1.01078868 0.99885847 0.00254275 1.00450354
1.01081878 0.99882150 0.00255235 1.00448625
1.01083465 0.99876118 0.00256090 1.00448312
1.01083711 0.99869890 0.00256790 1.00449285
1.01083051 0.99865576 0.00257284 1.00451084
1.01082224 0.99864407 0.00257541 1.00453060
1.01081946 0.99866266 0.00257535 1.00454569
1.01082602 0.99869863 0.00257290 1.00455247
1.01084157 0.99873428 0.00256925 1.00455191
1.01086239 0.99875448 0.00256630 1.00454889
1.01088383 0.99875062 0.00256586 1.00454942
1.01090388 0.99872242 0.00256881 1.00455690
1.01092473 0.99867814 0.00257463 1.00456968
1.01095078 0.99863253 0.00258209 1.00458298
1.01098457 0.99860161 0.00259039 1.00459326
1.01102343 0.99859464 0.00259971 1.00460102
1.01106015 0.99860749 0.00261090 1.00460954
1.01108806 0.99862416 0.00262451 1.00462114
1.01110593 0.99862857 0.00263974 1.00463337
1.01111819 0.99861872 0.00265395 1.00463896
1.01113079 0.99861019 0.00266382 1.00463128
1.01114609 0.99862304 0.00266751 1.00461074
1.01116014 0.99866228 0.00266618 1.00458642
1.01116547 0.99870981 0.00266379 1.00457114
1.01115835 0.99873710 0.00266533 1.00457371
1.01114438 0.99872863 0.00267379 1.00459294
1.01113634 0.99869428 0.00268769 1.00461817
1.01114496 0.99865792 0.00270162 1.00463704
1.01117055 0.99863397 0.00271014 1.00464354
1.01120236 0.99861583 0.00271210 1.00464025
1.01122705 0.99858842 0.00271213 1.00463419
1.01123964 0.99855043 0.00271752 1.00463033
1.01124517 0.99852113 0.00273181 1.00462861
1.01125047 0.99852379 0.00275064 1.00462601
1.01125676 0.99856321 0.00276491 1.00462163
1.01125907 0.99862028 0.00276925 1.00462067
1.01125133 0.99866823 0.00276762 1.00463174
1.01123355 0.99869300 0.00277034 1.00465730
1.01121595 0.99869825 0.00278539 1.00468794
1.01121660 0.99869446 0.00281213 1.00470721
1.01125108 0.99868725 0.00284233 1.00470311
1.01131789 0.99867537 0.00286672 1.00467857
1.01139324 0.99865542 0.00288155 1.00465159
1.01144537 0.99862742 0.00288968 1.00464189
1.01145783 0.99859759 0.00289625 1.00465540
1.01144037 0.99857702 0.00290406 1.00468238
1.01141836 0.99857687 0.00291278 1.00470929
1.01141283 0.99860189 0.00292119 1.00472949
1.01143050 0.99864491 0.00292925 1.00474178
1.01146925 0.99868697 0.00293785 1.00474255
1.01152602 0.99870594 0.00294744 1.00472650
1.01159649 0.99869042 0.00295762 1.00469837
1.01167108 0.99864842 0.00296782 1.00468029
1.01173527 0.99860232 0.00297698 1.00469728
1.01177581 0.99857350 0.00298253 1.00475197
1.01179057 0.99856881 0.00298281 1.00481888
1.01179420 0.99858100 0.00298156 1.00486480
1.01181010 0.99859972 0.00298732 1.00487613
1.01185557 0.99861726 0.00300659 1.00486802
1.01193316 0.99862362 0.00303728 1.00486873
1.01203137 0.99860475 0.00306893 1.00489476
1.01213441 0.99855485 0.00309076 1.00494027
1.01223177 0.99848970 0.00310058 1.00498701
1.01231777 0.99844058 0.00310455 1.00501715
1.01238711 0.99842811 0.00311073 1.00502768
1.01243947 0.99844459 0.00312503 1.00503488
1.01248613 0.99846480 0.00314952 1.00505811
1.01254172 0.99846990 0.00318066 1.00509745
1.01260361 0.99845781 0.00320836 1.00513026
1.01264802 0.99843669 0.00322185 1.00513636
1.01266737 0.99841540 0.00322409 1.00512910
1.01270200 0.99839798 0.00323586 1.00514667
1.01279333 0.99838049 0.00327117 1.00519824
1.01291405 0.99835328 0.00331431 1.00524018
1.01299876 0.99831366 0.00334053 1.00523446
1.01302825 0.99827661 0.00335158 1.00521154
1.01302986 0.99826382 0.00336862 1.00523492
1.01302082 0.99827581 0.00339813 1.00531084
1.01300243 0.99828195 0.00342651 1.00537270
1.01298841 0.99825150 0.00344333 1.00535800
1.01300090 0.99819498 0.00345495 1.00527702
1.01305209 0.99815967 0.00347878 1.00520300
1.01313472 0.99817357 0.00352786 1.00520101
1.01320685 0.99820760 0.00359349 1.00526503
1.01321713 0.99821377 0.00364974 1.00533091
1.01317761 0.99818617 0.00368393 1.00535225
1.01317531 0.99815958 0.00371348 1.00534537
1.01325391 0.99815652 0.00375667 1.00535516
1.01331673 0.99816210 0.00379661 1.00539485
1.01326443 0.99814935 0.00381356 1.00546570
1.01313558 0.99810238 0.00382550 1.00560058
variables=y,d,u,v,T
0.00000000 0.35639366 0.00000000 0.00000000 2.84000000
0.01000000 0.35679395 0.00673511 0.00001281 2.83681376
0.02017415 0.35720877 0.01363237 0.00002540 2.83351851
0.03052548 0.35763972 0.02069208 0.00003754 2.83010321
0.04105709 0.35808823 0.02791468 0.00004915 2.82655730
0.05177210 0.35855604 0.03530028 0.00006018 2.82286829
0.06267371 0.35904499 0.04284893 0.00007063 2.81902284
0.07376518 0.35955708 0.05056068 0.00008057 2.81500659
0.08504980 0.36009442 0.05843574 0.00009004 2.81080469
0.09653095 0.36065920 0.06647453 0.00009915 2.80640193
0.10821204 0.36125365 0.07467774 0.00010799 2.80178293
0.12009656 0.36188007 0.08304639 0.00011666 2.79693223
0.13218805 0.36254081 0.09158186 0.00012527 2.79183430
0.14449011 0.36323827 0.10028586 0.00013390 2.78647361
0.15700641 0.36397491 0.10916045 0.00014265 2.78083454
0.16974069 0.36475328 0.11820806 0.00015158 2.77490142
0.18269673 0.36557597 0.12743139 0.00016076 2.76865841
0.19587841 0.36644570 0.13683344 0.00017024 2.76208949
0.20928964 0.36736527 0.14641745 0.00018006 2.75517839
0.22293443 0.36833764 0.15618689 0.00019025 2.74790850
0.23681685 0.36936589 0.16614538 0.00020084 2.74026281
0.25094103 0.37045326 0.17629669 0.00021183 2.73222385
0.26531118 0.37160319 0.18664469 0.00022325 2.72377358
0.27993159 0.37281933 0.19719333 0.00023510 2.71489338
0.29480661 0.37410555 0.20794661 0.00024738 2.70556395
0.30994068 0.37546598 0.21890854 0.00026010 2.69576528
0.32533832 0.37690506 0.23008314 0.00027325 2.68547661
0.34100410 0.37842752 0.24147444 0.00028685 2.67467636
0.35694271 0.38003843 0.25308639 0.00030088 2.66334214
0.37315888 0.38174326 0.26492295 0.00031535 2.65145070
0.38965747 0.38354788 0.27698797 0.00033027 2.63897792
0.40644337 0.38545861 0.28928527 0.00034564 2.62589874
0.42352161 0.38748224 0.30181854 0.00036146 2.61218716
0.44089726 0.38962614 0.31459137 0.00037776 2.59781618
0.45857551 0.39189822 0.32760722 0.00039454 2.58275775
0.47656163 0.39430708 0.34086938 0.00041185 2.56698270
0.49486097 0.39686201 0.35438094 0.00042971 2.55046061
0.51347900 0.39957313 0.36814475 0.00044817 2.53315975
0.53242127 0.40245147 0.38216339 0.00046725 2.51504690
0.55169342 0.40550911 0.39643910 0.00048702 2.49608727
0.57130119 0.40875929 0.41097374 0.00050748 2.47624426
0.59125043 0.41221662 0.42576872 0.00052867 2.45547943
0.61154709 0.41589723 0.44082497 0.00055054 2.43375232
0.63219721 0.41981900 0.45614281 0.00057312 2.41102065
0.65320696 0.42400164 0.47172190 0.00059629 2.38724019
0.67458260 0.42846706 0.48756101 0.00062013 2.36236558
0.69633049 0.43323914 0.50365819 0.00064450 2.33634994
0.71845713 0.43834470 0.52001055 0.00066989 2.30914628
0.74096910 0.44381187 0.53661508 0.00069598 2.28070807
0.76387311 0.44967400 0.55346119 0.00072270 2.25098558
0.78717601 0.45596546 0.57053808 0.00075087 2.21993484
0.81088472 0.46272383 0.58783284 0.00078067 2.18751969
0.83500632 0.46998800 0.60533013 0.00081234 2.15371617
0.85954800 0.47779799 0.62301226 0.00084600 2.11851889
0.88451708 0.48619158 0.64086070 0.00088188 2.08195146
0.90992099 0.49520181 0.65885994 0.00092073 2.04407883
0.93576732 0.50485545 0.67699954 0.00096277 2.00500137
0.96206376 0.51518016 0.69526383 0.00100878 1.96483172
0.98881815 0.52620019 0.71361743 0.00105851 1.92369487
1.01603847 0.53792699 0.73198398 0.00111236 1.88177482
1.04373284 0.55038004 0.75030312 0.00117119 1.83921585
1.07190950 0.56358293 0.76852967 0.00123488 1.79615302
1.10057687 0.57756149 0.78661209 0.00130161 1.75270463
1.12974347 0.59237560 0.80448962 0.00136789 1.70889543
1.15941802 0.60812146 0.82209205 0.00143239 1.66466441
1.18960935 0.62491522 0.83933827 0.00149434 1.61993931
1.22032646 0.64288317 0.85613606 0.00155331 1.57466813
1.25157851 0.66215100 0.87238255 0.00161029 1.52885283
1.28337482 0.68282108 0.88796816 0.00166656 1.48258319
1.31572486 0.70495608 0.90277936 0.00172443 1.43605635
1.34863828 0.72848525 0.91668510 0.00178577 1.38969932
1.38212489 0.75302603 0.92956936 0.00186146 1.34443787
1.41619468 0.77814360 0.94141584 0.00194613 1.30105073
1.45085778 0.80379028 0.95216144 0.00202312 1.25955617
1.48612455 0.82973753 0.96165234 0.00210072 1.22022015
1.52200549 0.85523959 0.96982445 0.00217804 1.18388890
1.55851130 0.87960203 0.97668580 0.00224692 1.15116231
1.59565286 0.90224565 0.98231990 0.00230826 1.12233247
1.63344125 0.92273382 0.98683473 0.00236165 1.09746899
1.67188771 0.94077936 0.99035300 0.00240831 1.07647161
1.71100373 0.95623758 0.99301193 0.00244924 1.05912454
1.75080096 0.96910008 0.99495773 0.00248385 1.04512061
1.79129125 0.97948429 0.99633605 0.00251073 1.03408467
1.83248669 0.98762141 0.99728087 0.00253034 1.02560170
1.87439954 0.99381787 0.99790767 0.00254631 1.01924814
1.91704231 0.99841124 0.99831057 0.00256163 1.01461480
1.96042771 1.00172732 0.99856283 0.00257657 1.01132319
2.00456867 1.00405783 0.99871890 0.00258890 1.00904311
2.04947834 1.00565191 0.99881764 0.00259765 1.00750648
2.09517012 1.00671797 0.99888600 0.00260412 1.00650116
2.14165762 1.00741758 0.99894019 0.00260884 1.00586276
2.18895471 1.00786599 0.99898822 0.00261041 1.00546742
2.23707548 1.00814853 0.99903311 0.00260851 1.00522697
2.28603427 1.00833351 0.99907500 0.00260602 1.00508341
2.33584568 1.00846986 0.99911247 0.00260590 1.00499903
2.38652456 1.00858318 0.99914343 0.00260799 1.00494690
2.43808602 1.00868475 0.99916587 0.00261058 1.00490858
2.49054542 1.00878221 0.99917833 0.00261301 1.00487393
2.54391841 1.00887871 0.99918016 0.00261465 1.00483735
2.59822089 1.00897212 0.99917116 0.00261415 1.00479558
2.65346905 1.00906275 0.99915161 0.00261181 1.00474972
2.70967936 1.00915546 0.99912257 0.00260998 1.00470484
2.76686857 1.00925199 0.99908628 0.00261006 1.00466550
2.82505374 1.00934787 0.99904608 0.00261121 1.00463362
2.88425221 1.00943640 0.99900599 0.00261163 1.00460967
2.94448162 1.00951121 0.99896996 0.00260939 1.00459330
3.00575993 1.00956938 0.99894116 0.00260344 1.00458417
3.06810541 1.00961488 0.99892125 0.00259485 1.00458338
3.13153663 1.00965575 0.99890999 0.00258594 1.00459244
3.19607251 1.00969706 0.99890548 0.00257781 1.00461039
3.26173229 1.00973848 0.99890465 0.00256963 1.00463299
3.32853554 1.00977679 0.99890400 0.00255953 1.00465426
3.39650217 1.00981088 0.99890032 0.00254648 1.00466911
3.46565244 1.00984623 0.99889128 0.00253199 1.00467593
3.53600697 1.00989235 0.99887573 0.00251931 1.00467642
3.60758673 1.00995314 0.99885387 0.00251029 1.00467234
3.68041305 1.01002197 0.99882732 0.00250355 1.00466335
3.75450764 1.01008767 0.99879888 0.00249635 1.00464871
3.82989260 1.01014437 0.99877189 0.00248768 1.00463020
3.90659039 1.01019507 0.99874936 0.00247932 1.00461267
3.98462388 1.01024612 0.99873333 0.00247393 1.00460136
4.06401632 1.01029800 0.99872446 0.00247177 1.00459780
4.14479139 1.01034261 0.99872202 0.00246986 1.00459872
4.22697316 1.01037184 0.99872394 0.00246501 1.00459976
4.31058613 1.01038785 0.99872728 0.00245752 1.00460008
4.39565523 1.01040164 0.99872933 0.00245082 1.00460254
4.48220581 1.01042075 0.99872898 0.00244740 1.00460918
4.57026367 1.01044131 0.99872757 0.00244596 1.00461809
4.65985506 1.01045394 0.99872845 0.00244325 1.00462535
4.75100670 1.01045598 0.99873506 0.00243811 1.00462942
4.84374574 1.01045476 0.99874851 0.00243260 1.00463229
4.93809984 1.01045925 0.99876633 0.00242934 1.00463634
5.03409712 1.01047073 0.99878320 0.00242849 1.00464086
5.13176620 1.01048274 0.99879333 0.00242790 1.00464246
5.23113619 1.01049001 0.99879263 0.00242614 1.00463913
5.33223671 1.01049541 0.99877950 0.00242482 1.00463323
5.43509791 1.01050535 0.99875415 0.00242669 1.00462918
5.53975044 1.01051896 0.99871789 0.00243192 1.00462859
5.64622550 1.01052888 0.99867351 0.00243824 1.00462987
5.75455483 1.01053322 0.99862631 0.00244482 1.00463232
5.86477072 1.01053776 0.99858445 0.00245296 1.00463674
5.97690602 1.01054571 0.99855758 0.00246274 1.00464186
6.09099417 1.01055557 0.99855391 0.00247252 1.00464423
6.20706917 1.01056879 0.99857726 0.00248183 1.00464179
6.32516562 1.01058964 0.99862573 0.00249142 1.00463380
6.44531873 1.01061933 0.99869176 0.00250136 1.00461856
6.56756431 1.01065671 0.99876300 0.00251133 1.00459476
6.69193881 1.01070065 0.99882401 0.00252165 1.00456420
6.81847929 1.01074713 0.99885932 0.00253235 1.00453164
6.94722348 1.01078868 0.99885847 0.00254275 1.00450354
7.07820976 1.01081878 0.99882150 0.00255235 1.00448625
7.21147718 1.01083465 0.99876118 0.00256090 1.00448312
7.34706545 1.01083711 0.99869890 0.00256790 1.00449285
7.48501500 1.01083051 0.99865576 0.00257284 1.00451084
7.62536695 1.01082224 0.99864407 0.00257541 1.00453060
7.76816313 1.01081946 0.99866266 0.00257535 1.00454569
7.91344612 1.01082602 0.99869863 0.00257290 1.00455247
8.06125922 1.01084157 0.99873428 0.00256925 1.00455191
8.21164650 1.01086239 0.99875448 0.00256630 1.00454889
8.36465277 1.01088383 0.99875062 0.00256586 1.00454942
8.52032366 1.01090388 0.99872242 0.00256881 1.00455690
8.67870557 1.01092473 0.99867814 0.00257463 1.00456968
8.83984570 1.01095078 0.99863253 0.00258209 1.00458298
9.00379210 1.01098457 0.99860161 0.00259039 1.00459326
9.17059364 1.01102343 0.99859464 0.00259971 1.00460102
9.34030003 1.01106015 0.99860749 0.00261090 1.00460954
9.51296187 1.01108806 0.99862416 0.00262451 1.00462114
9.68863063 1.01110593 0.99862857 0.00263974 1.00463337
9.86735867 1.01111819 0.99861872 0.00265395 1.00463896
10.04919926 1.01113079 0.99861019 0.00266382 1.00463128
10.23420662 1.01114609 0.99862304 0.00266751 1.00461074
10.42243589 1.01116014 0.99866228 0.00266618 1.00458642
10.61394319 1.01116547 0.99870981 0.00266379 1.00457114
10.80878559 1.01115835 0.99873710 0.00266533 1.00457371
11.00702119 1.01114438 0.99872863 0.00267379 1.00459294
11.20870907 1.01113634 0.99869428 0.00268769 1.00461817
11.41390936 1.01114496 0.99865792 0.00270162 1.00463704
11.62268322 1.01117055 0.99863397 0.00271014 1.00464354
11.83509289 1.01120236 0.99861583 0.00271210 1.00464025
12.05120168 1.01122705 0.99858842 0.00271213 1.00463419
12.27107403 1.01123964 0.99855043 0.00271752 1.00463033
12.49477546 1.01124517 0.99852113 0.00273181 1.00462861
12.72237266 1.01125047 0.99852379 0.00275064 1.00462601
12.95393348 1.01125676 0.99856321 0.00276491 1.00462163
13.18952695 1.01125907 0.99862028 0.00276925 1.00462067
13.42922329 1.01125133 0.99866823 0.00276762 1.00463174
13.67309395 1.01123355 0.99869300 0.00277034 1.00465730
13.92121163 1.01121595 0.99869825 0.00278539 1.00468794
14.17365030 1.01121660 0.99869446 0.00281213 1.00470721
14.43048520 1.01125108 0.99868725 0.00284233 1.00470311
14.69179290 1.01131789 0.99867537 0.00286672 1.00467857
14.95765128 1.01139324 0.99865542 0.00288155 1.00465159
15.22813960 1.01144537 0.99862742 0.00288968 1.00464189
15.50333849 1.01145783 0.99859759 0.00289625 1.00465540
15.78332999 1.01144037 0.99857702 0.00290406 1.00468238
16.06819755 1.01141836 0.99857687 0.00291278 1.00470929
16.35802610 1.01141283 0.99860189 0.00292119 1.00472949
16.65290202 1.01143050 0.99864491 0.00292925 1.00474178
16.95291323 1.01146925 0.99868697 0.00293785 1.00474255
17.25814915 1.01152602 0.99870594 0.00294744 1.00472650
17.56870077 1.01159649 0.99869042 0.00295762 1.00469837
17.88466066 1.01167108 0.99864842 0.00296782 1.00468029
18.20612301 1.01173527 0.99860232 0.00297698 1.00469728
18.53318365 1.01177581 0.99857350 0.00298253 1.00475197
18.86594006 1.01179057 0.99856881 0.00298281 1.00481888
19.20449145 1.01179420 0.99858100 0.00298156 1.00486480
19.54893873 1.01181010 0.99859972 0.00298732 1.00487613
19.89938457 1.01185557 0.99861726 0.00300659 1.00486802
20.25593345 1.01193316 0.99862362 0.00303728 1.00486873
20.61869165 1.01203137 0.99860475 0.00306893 1.00489476
20.98776730 1.01213441 0.99855485 0.00309076 1.00494027
21.36327043 1.01223177 0.99848970 0.00310058 1.00498701
21.74531296 1.01231777 0.99844058 0.00310455 1.00501715
22.13400878 1.01238711 0.99842811 0.00311073 1.00502768
22.52947377 1.01243947 0.99844459 0.00312503 1.00503488
22.93182579 1.01248613 0.99846480 0.00314952 1.00505811
23.34118480 1.01254172 0.99846990 0.00318066 1.00509745
23.75767282 1.01260361 0.99845781 0.00320836 1.00513026
24.18141401 1.01264802 0.99843669 0.00322185 1.00513636
24.61253466 1.01266737 0.99841540 0.00322409 1.00512910
25.05116331 1.01270200 0.99839798 0.00323586 1.00514667
25.49743070 1.01279333 0.99838049 0.00327117 1.00519824
25.95146986 1.01291405 0.99835328 0.00331431 1.00524018
26.41341614 1.01299876 0.99831366 0.00334053 1.00523446
26.88340724 1.01302825 0.99827661 0.00335158 1.00521154
27.36158326 1.01302986 0.99826382 0.00336862 1.00523492
27.84808674 1.01302082 0.99827581 0.00339813 1.00531084
28.34306271 1.01300243 0.99828195 0.00342651 1.00537270
28.84665871 1.01298841 0.99825150 0.00344333 1.00535800
29.35902486 1.01300090 0.99819498 0.00345495 1.00527702
29.88031390 1.01305209 0.99815967 0.00347878 1.00520300
30.41068121 1.01313472 0.99817357 0.00352786 1.00520101
30.95028490 1.01320685 0.99820760 0.00359349 1.00526503
31.49928582 1.01321713 0.99821377 0.00364974 1.00533091
32.05784762 1.01317761 0.99818617 0.00368393 1.00535225
32.62613680 1.01317531 0.99815958 0.00371348 1.00534537
33.20432277 1.01325391 0.99815652 0.00375667 1.00535516
33.79257788 1.01331673 0.99816210 0.00379661 1.00539485
34.39107749 1.01326443 0.99814935 0.00381356 1.00546570
35.00000000 1.01313558 0.99810238 0.00382550 1.00560058
#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE *fp;
MPI_File tmp_file;
MPI_Status status;
char str[100];
int _DOU = sizeof(double);
int my_id, n_processe;
int nx, ny, nz, N, NZ, *NPZ, *NP;
int nx_inlet, nx_flat, nx_conner_in, nx_conner_out, nx_reattach, nx_buff;
int ny_nearwall, ny_outer;
double *d1, *u1, *v1, *T1, *yy;
double *d2, *u2, *v2, *T2, *w2;
void mpi_init(int *Argc, char ***Argv);
void Read_parameter();
void Read_flow1d_inlet();
void Creat_flow2d();
void Output_flow3d();
void Finalize();
void output1d(int n, double *xx);
void output2d(int nx, int ny, double *xx);
int main(int argc, char *argv[]){
mpi_init(&argc , &argv);
Read_parameter();
Read_flow1d_inlet();
Creat_flow2d();
Output_flow3d();
Finalize();
return 0;
}
void mpi_init(int *Argc , char *** Argv){
MPI_Init(Argc, Argv);
MPI_Comm_rank(MPI_COMM_WORLD , &my_id);
MPI_Comm_size(MPI_COMM_WORLD, &n_processe);
N = n_processe;
}
void Read_parameter(){
if(my_id == 0){
if((fp = fopen("swept-compression-grid.in", "r")) == NULL){
printf("Can't open this file: 'swept-compression-grid.in'\n");
exit(0);
}
fgets(str, 100, fp);
fscanf(fp, "%d%d%d%d%d%d\n", &nx_inlet, &nx_flat, &nx_conner_in, &nx_conner_out, &nx_reattach, &nx_buff);
nx = nx_inlet + nx_flat + nx_conner_in + nx_conner_out + nx_reattach + nx_buff;
fgets(str, 100, fp);
fgets(str, 100, fp);
fgets(str, 100, fp);
fscanf(fp, "%d%d\n", &ny_nearwall, &ny_outer);
ny = ny_nearwall + ny_outer;
fgets(str, 100, fp);
fgets(str, 100, fp);
fgets(str, 100, fp);
fscanf(fp, "%d\n", &nz);
fclose(fp);
printf("Read_parameter is OK!\n");
printf("nx, ny, nz is %d, %d, %d\n", nx, ny, nz);
printf("The Number of total Processes is %d!\n", n_processe);
}
int tmp[4];
if(my_id == 0){
tmp[0] = nx;
tmp[1] = ny;
tmp[2] = nz;
tmp[3] = N;
}
MPI_Bcast(tmp, 4, MPI_INT, 0, MPI_COMM_WORLD);
if(my_id != 0){
nx = tmp[0];
ny = tmp[1];
nz = tmp[2];
N = tmp[3];
}
NZ = nz/N;
if(my_id < nz%N) NZ += 1;
NPZ = (int*)malloc(N * sizeof(int));
NP = (int*)malloc(N * sizeof(int));
memset((void*)NPZ, 0, N);
memset((void*)NP, 0, N);
for(int i = 0; i < N; i++){
if(i < nz%N){
NPZ[i] = (int)nz/N + 1;
}else{
NPZ[i] = (int)nz/N;
}
NP[0] = 0;
if(i != 0) NP[i] = NP[i-1] + NPZ[i-1];
}
yy = (double*)malloc(ny * _DOU);
d1 = (double*)malloc(ny * _DOU);
u1 = (double*)malloc(ny * _DOU);
v1 = (double*)malloc(ny * _DOU);
T1 = (double*)malloc(ny * _DOU);
d2 = (double*)malloc(nx * ny * _DOU);
u2 = (double*)malloc(nx * ny * _DOU);
v2 = (double*)malloc(nx * ny * _DOU);
w2 = (double*)malloc(nx * ny * _DOU);
T2 = (double*)malloc(nx * ny * _DOU);
if(my_id == 0) printf("Read_parameter is OK!\n");
}
void Read_flow1d_inlet(){
if(my_id == 0){
if((fp = fopen("flow1d-inlet.dat", "r")) == NULL){
printf("Can't open this file: 'flow1d-inlet.dat'\n");
exit(0);
}
fgets(str, 100, fp);
for(int j = 0; j < ny; j++){
fscanf(fp, "%lf%lf%lf%lf%lf\n", &yy[j], &d1[j], &u1[j], &v1[j], &T1[j]);
}
fclose(fp);
}
MPI_Bcast(yy, ny, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Bcast(d1, ny, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Bcast(u1, ny, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Bcast(v1, ny, MPI_DOUBLE, 0, MPI_COMM_WORLD);
MPI_Bcast(T1, ny, MPI_DOUBLE, 0, MPI_COMM_WORLD);
if(my_id == 0) printf("Read flow1d-inlet.dat is OK!\n");
}
void Creat_flow2d(){
double (*pd2)[nx] = (double(*)[nx])(d2);
double (*pu2)[nx] = (double(*)[nx])(u2);
double (*pv2)[nx] = (double(*)[nx])(v2);
double (*pw2)[nx] = (double(*)[nx])(w2);
double (*pT2)[nx] = (double(*)[nx])(T2);
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx; i++){
pd2[j][i] = d1[j];
pu2[j][i] = u1[j];
pv2[j][i] = v1[j];
pw2[j][i] = 0;
pT2[j][i] = T1[j];
}
}
if(my_id == 0) printf("Creat_flow2d is OK!\n");
}
#define FWRITE_MPI(ptr , size , num , stream){\
int _ENCODE_START = num * size;\
int _ENCODE_END = num * size;\
MPI_File_write(stream, &_ENCODE_START, 1, MPI_INT, &status);\
MPI_File_write(stream, ptr, size, MPI_DOUBLE, &status);\
MPI_File_write(stream, &_ENCODE_END, 1, MPI_INT, &status);\
}
void Output_flow3d(){
int nstep = 0;
int num = nx * ny;
int num_byte = nx * ny * sizeof(double);
double ntime = 0.;
int DI = sizeof(int) + sizeof(double);
MPI_File_open(MPI_COMM_WORLD, "flow3d0.dat", MPI_MODE_WRONLY | MPI_MODE_CREATE, MPI_INFO_NULL, &tmp_file);
MPI_File_seek(tmp_file, 0, MPI_SEEK_SET);
MPI_File_write_all(tmp_file, &DI, 1, MPI_INT, &status);
MPI_File_write_all(tmp_file, &nstep, 1, MPI_INT, &status);
MPI_File_write_all(tmp_file, &ntime, 1, MPI_DOUBLE, &status);
MPI_File_write_all(tmp_file, &DI, 1, MPI_INT, &status);
if(my_id == 0) printf("Write d ...\n");
MPI_File_seek(tmp_file, NP[my_id]*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, d2, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
if(my_id == 0) printf("Write u ...\n");
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, u2, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
if(my_id == 0) printf("Write v ...\n");
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, v2, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
if(my_id == 0) printf("Write w ...\n");
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, w2, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
if(my_id == 0) printf("Write T ...\n");
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, T2, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_close(&tmp_file);
if(my_id == 0) printf("Wirte flow3d0.dat is OK!\n");
}
#undef FWRITE_MPI
void Finalize(){
free(yy);
free(d1);
free(u1);
free(v1);
free(T1);
free(d2);
free(u2);
free(v2);
free(w2);
free(T2);
MPI_Finalize();
}
void output1d(int n, double *xx){
for(int i = 0; i < n; i++){
printf("%d\t%lf\n", i, xx[i]);
}
}
void output2d(int nx, int ny, double *xx){
double (*x)[nx] = (double(*)[nx])(xx);
for(int j = 0; j < ny; j++){
for(int i =0; i < nx; i++){
printf("%d\t%d\t%lf\n", i, j, x[j][i]);
}
}
}
\ No newline at end of file
implicit none
integer,parameter:: SPLINE_INIT=-1, SPLINE_NORMAL=1
integer:: ny, ny1, j,tmp , Iflag
real*8,dimension(:),allocatable:: yy, d,u,v,T, yy1,d1,u1,v1,T1
print*, "interpolate 1d profiles for inlet (flow1d-inlet.dat)......"
print*, "origin data : flow1d-inlet.dat.origin (y,d,u,v,T), new coordinate y1d.dat"
print*, "please input ny (orginate grid number), ny1 (new) "
read(*,*) ny, ny1
allocate(yy(ny),d(ny),u(ny),v(ny),T(ny), yy1(ny1),d1(ny1),u1(ny1),v1(ny1),T1(ny1))
open(99,file="flow1d-inlet.dat.origin")
read(99,*)
do j=1, ny
read(99,*) yy(j), d(j), u(j), v(j), T(j)
enddo
close(99)
open(100,file="y1d.dat")
do j=1,ny1
read(100,*) yy1(j)
enddo
print*, " input 1 for 6th Lagrange interpolation; 2 for 3rd Spline interpolation "
read(*,*) Iflag
if(Iflag .eq. 1) then
print*, "Interpolation (6th Lagrange) ..."
do j=1,ny1
call inter1d_6th(yy1(j),d1(j),ny,yy,d)
call inter1d_6th(yy1(j),u1(j),ny,yy,u)
call inter1d_6th(yy1(j),v1(j),ny,yy,v)
call inter1d_6th(yy1(j),T1(j),ny,yy,T)
enddo
else
print*, "Interpolation (3rd Spline) ..."
!--------interpolation for d, u, v, T -------------
call spline(ny,yy,d,0.d0,0.d0,SPLINE_INIT)
do j=1,ny1
call spline(ny,yy,d,yy1(j),d1(j),SPLINE_NORMAL)
enddo
call spline(ny,yy,u,0.d0,0.d0,SPLINE_INIT)
do j=1,ny1
call spline(ny,yy,u,yy1(j),u1(j),SPLINE_NORMAL)
enddo
call spline(ny,yy,v,0.d0,0.d0,SPLINE_INIT)
do j=1,ny1
call spline(ny,yy,v,yy1(j),v1(j),SPLINE_NORMAL)
enddo
call spline(ny,yy,T,0.d0,0.d0,SPLINE_INIT)
do j=1,ny1
call spline(ny,yy,T,yy1(j),T1(j),SPLINE_NORMAL)
enddo
endif
!----------------------------------
open(99,file="flow1d-inlet.dat")
write(99,*) "variables=y, d, u, v, T"
do j=1,ny1
write(99,"(5F16.8)") yy1(j), d1(j), u1(j), v1(j), T1(j)
enddo
close(99)
open(99,file="flow-inlet.dat")
do j=1,ny1
write(99,"(4F16.8)") d1(j), u1(j), v1(j), T1(j)
enddo
close(99)
deallocate(yy,d,u,v,T, yy1,d1,u1,v1,T1)
end
!------------------------------------------------------------------------
! 6th order Langrage interpolation in one-dimension
subroutine inter1d_6th(x0, f0, nx, xx,ff)
implicit none
integer:: nx,k,k0,ik,ikm,km,ka,kb
real*8:: xx(nx),ff(nx), x0, f0, Ai(6)
if(x0<=xx(1)) then
f0=ff(1)
return
endif
if(x0>=xx(nx)) then
f0=ff(nx)
return
endif
k0=0
do k=1,nx
if(x0 >= xx(k) .and. x0 < xx(k+1) ) then
k0=k
goto 100
endif
enddo
100 continue
ka= max(4-k0,1)
kb= min(nx+3-k0,6)
f0=0.d0
do k=ka,kb
ik=k0+k-3
Ai(k)=1.d0
do km=ka,kb
ikm=k0+km-3
if(km .ne. k) Ai(k)=Ai(k)*(x0-xx(ikm))/(xx(ik)-xx(ikm))
enddo
f0=f0+Ai(k)*ff(ik)
enddo
end
! Spline interpolation
! eg.
! step1: call spline (n, xx,yy, x0, y0, SPLINE_INIT)
! Step2: call spline (n, xx, yy, x0, y0, SPLINE_NORMAL)
subroutine spline(n,xx,yy,x0,y0,Iflag)
implicit none
integer,parameter:: SPLINE_INIT=-1, SPLINE_NORMAL=1
integer,parameter:: Nmax=1000000
integer:: n,j,k, Iflag
integer,save:: Flag1=0
real*8:: xx(n), yy(n), x0,y0,hj
real*8:: a(n),b(n),c(n),d(n),h(n)
real*8,save:: MM(Nmax)
if(Iflag == SPLINE_INIT) then
Flag1=1
if(n > Nmax) then
print*, "Error !!! n> Nmax, please modify Nmax in subroutine spline() "
stop
endif
do j=2,n
h(j)=xx(j)-xx(j-1)
enddo
do j=2,n-1
a(j)=h(j)/(h(j)+h(j+1))
b(j)=2.d0
c(j)=h(j+1)/(h(j)+h(j+1))
d(j)=6.d0*((yy(j+1)-yy(j))/h(j+1)-(yy(j)-yy(j-1))/h(j))/(h(j)+h(j+1))
enddo
a(1)=0.d0 ; b(1)=1.d0 ; c(1)= 0.d0 ; d(1)=0.d0
a(n)=0.d0 ; b(n)=1.d0 ; c(n)=0.d0; d(n)=0.d0
call LU3(n,a,b,c,d,MM)
else
if(Flag1 .ne. 1) then
print*, "Error ! Spline interpolation is not initialized !, please run spline(,,,,,-1) first"
stop
endif
! call find_k(n,xx,x0,k)
call find_k_dichotomy(n,xx,x0,k)
j=k+1
hj=xx(j)-xx(j-1)
y0=(MM(j-1)*(xx(j)-x0)**3/6.d0+MM(j)*(x0-xx(j-1))**3/6.d0 &
+(yy(j-1)-MM(j-1)*hj*hj/6.d0)*(xx(j)-x0) + (yy(j)-MM(j)*hj*hj/6.d0)*(x0-xx(j-1)) ) /hj
endif
end
!--------------搜索插值区间: 线性搜索法 ---------------------------------
subroutine find_k(n,xx,x0,k)
implicit none
integer:: n,k,j
real*8 :: xx(n), x0
if(x0 <= xx(2)) then
k=1
else if(x0 >= xx(n-1)) then
k=n-1
else
do j=2,n-2
if( x0 >= xx(j) .and. x0<= xx(j+1)) then
k=j
goto 100
endif
enddo
100 continue
endif
end
!------------------------- 搜索插值区间: 二分法 ---------------------
subroutine find_k_dichotomy(n,xx,x0,k)
implicit none
integer:: n,k,kb,ke,k0
real*8 :: xx(n), x0
if(x0 <= xx(2)) then
k=1
else if(x0 >= xx(n-1)) then
k=n-1
else
kb=2
ke=n-1
do while( (ke-kb)>1)
k0=(kb+ke)/2
if(x0 <= xx(k0)) then
ke=k0
else
kb=k0
endif
enddo
k=kb
endif
end
! Chasing method (3-line LU ) for 3-line Eq
subroutine LU3(N,a,b,c,d,x)
implicit none
integer:: N,j
real*8,dimension(N):: a,b,c,d,x
real*8,dimension(N):: AA,BB
real*8:: tmp
AA(1)=0.d0
BB(1)=d(1)
x(N)=d(N)
x(1)=d(1)
do j=2,N
tmp=1.d0/(a(j)*AA(j-1)+b(j))
AA(j)=-c(j)*tmp
BB(j)=(d(j)-a(j)*BB(j-1))*tmp
enddo
do j=N-1,2,-1
x(j)=AA(j)*x(j+1)+BB(j)
enddo
end
# OpenCFD-SCU-Ver1.00 input file
GRID_3D = 25 240 20
PARALLEL_3D = 1 1 1
STREAM = 0
CHARTERIC = 0
TEST = 0
IPERIODIC = 0 0 1
JAC_BOUND = 1 1 1
DIF_BOUND = 0 1 0 1 0 0
NON_REFLETION = 0 1 0 1 0 0
SCHEME_INVIS = WENO7_SYMBO
#SCHEME_INVIS = NND2
SCHEME_VIS = CD8
#SCHEME_INVIS = SCHEME_HYBRIDAUTO
HY_DP_INTV = 0.01 0.2
HY_SMOOTH_DP = 0
HY_STYLE = 2
HY_PATCH_ZONE = 0
HY_ZONE0 = 10 25 100 240 5 20 20.0
RE = 5581.4
AMA = 2.9
GAMMA = 1.40
PR = 0.70
T_REF = 108.1
EPSL_SW = 0.0
DT = 0.01
END_TIME = 10
KSTEP_SHOW = 1
KSTEP_SAVE = 1000
INIT_STAT = 1
IBC = 108
#mzmax, mtmax, Inlet_boundary, If_wall_not_normal
BC_NPARA = 10 5 1 0
#Tw, epsl, x_dis_begin, x_dis_end, beta, x_wall_begin, x_up_bound_begin, SLZ
BC_RPARA = 2.84 0.2 -320. -300 0.1 -400. -50. 14.
#nstep_filter, Filter_X, Filter_Y, Filter_Z, ib, ie, jb, je, kb, ke, Filter_scheme // s0, rth, Filter_end_time
#FILTER_NPARA0 = 100 1 1 1 0 25 0 240 0 20 2
#FILTER_RPARA0 = 1.0 1.e-5 1000000
#ANA_EVENT0 = 101 1
#ANA_EVENT1 = 105 10
#ANA_NPARA1 = 2 5 10 15
#ANA_EVENT2 = 107 10
#ANA_NPARA0 = 0
#ANA_RPARA0 = 0
#*****************************************************************************************************
# IBC nk nr IF_symmetry IF_withleading Iflag_upperboundary AoA Tw epsl_wall epsl_upper wall_dis_begin wall_dis_end //(liftbody)
124 3 6 1 0 1 0. 3.797 0.02 0. 50. 60.
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Hybrid Scheme enabled, Hybrid style is 2
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
##################################################################################################
OpenCFD-SCU-V1.00 CopyRight by Li-Xinliang, LHD, Institute of Mechanics, CAS (lixl@imech.ac.cn)
Coded by Liu-Shiwei, ICMSEC, Academy of Mathematics and Systems Science, CAS (liusw@lsec.cc.ac.cn)
Coded by Dang-Guanlin, LHD, Institute of Mechanics, CAS (dangguanlin@imech.ac.cn) 2020-01
Mesh(Nx,Ny,Nz): (25,240,20)
3D Partation: 1*1*1 Total procs=1
Re=5581.400000 , Ma=2.900000 , Gamma=1.400000 , dt=0.010000
Start Computing ......
//coded by Dgl
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "mpi.h"
#include "pthread.h"
#define PI 3.141592653589793
FILE *fp;
FILE *fp1;
MPI_Status status;
char str[1000];
int init[3];
int my_id, n_processe;
int nx, ny, nz, NZ, *NPZ, *NP, *head;
double Re, Ama, Gamma, Pr, T_Ref, Tr, Tw, Amu, Cp, hh, tmp, Place;
double *x3d, *y3d, *z3d;
double *pd, *pu, *pv, *pw, *pT, *BC_rpara;
typedef struct configItem_
{
char name[1000];
char value[1000];
} configItem;
configItem configList[8] = {
{"GRID_3D", 0}, //0
{"RE", 0}, //1
{"AMA", 0}, //2
{"GAMMA", 0}, //3
{"PR", 0}, //4
{"T_REF", 0}, //5
{"BC_RPARA", 0}, //6
{"PLACE", 0}, //7
};
void mpi_init(int *Argc, char ***Argv);
void Data_malloc();
void Read_parameter();
void Read_mesh();
void Read_data();
void Write_data_new();
void Write_data_new_extension();
void Read_mesh_1d();
void Read_data_1d();
void Write_grid_format();
void Write_data_format();
void Write_dataxy2d_first_format();
void Write_dataxy2d_first_format_total();
void Write_datayz2d_format();
void Write_dataxz2d_format();
void Write_datayz2d1_format();
void Write_dataxy2d1_format();
void Write_dataxyz3d_format();
void Write_flow1d_inlet();
void Write_cf2d_format();
void Write_cf3d_format();
void Write_cf3d_format_total();
void Write_dataxz2d_cf_double_cone(int i0);
void Write_dataxy2d_cf_compress_ramp(int i0);
//void Write_dataxy2d_yp();
void Finalize();
int main(int argc, char *argv[]){
mpi_init(&argc , &argv);
Read_parameter();
Data_malloc();
Read_mesh();
Read_data();
//Write_data_new();
//Write_data_new_extension();
//Write_cf2d_format();
//Write_dataxy2d_first_format();
//Write_grid_format();
//Write_data_format();
//Write_cf3d_format();
// Write_datayz2d_format();
// Write_dataxz2d_format();
//Write_datayz2d1_format();
//Write_dataxyz3d_format();
//Write_flow1d_inlet();
// Write_dataxy2d1_format();
Write_dataxy2d_cf_compress_ramp(Place);
//Write_dataxy2d_yp();
//-------double-cone---------------------
{
//Write_cf2d_format();
//Write_dataxy2d_first_format_total();
//Write_cf3d_format_total();
//Write_datayz2d_format();
//Write_dataxz2d_format();
//Write_dataxz2d_cf_double_cone(Place);
}
Finalize();
return 0;
}
void mpi_init(int *Argc , char *** Argv){
MPI_Init(Argc, Argv);
MPI_Comm_rank(MPI_COMM_WORLD , &my_id);
MPI_Comm_size(MPI_COMM_WORLD, &n_processe);
}
int ExtarctItem(char *src, char *name, char *value){
char *eq, *lf;
eq = strchr(src, '=');
lf = strchr(src, '\n');
if(eq != NULL && lf != NULL){
*lf = '\0';
strncpy(name, src, eq-src);
strcpy(value, eq+1);
return 1;
}
return 0;
}
void ModifyItem(char *name, char *buff){
while(*name != '\0')
{
if(*name != ' '){
*buff = *name;
buff++;
}
name++;
}
}
void SearchItem(FILE *file, configItem *List, int configNum){
int N = 1000;
char buff[N];
char name[N];
char value[N];
rewind(file);
while(fgets(buff, N, file))
{
if(ExtarctItem(buff, name, value)){
memset(buff, 0, strlen(buff));
ModifyItem(name, buff);
for(int i = 0; i < configNum; i++){
if(strcmp(buff, List[i].name) == 0){
strcpy(List[i].value, value);
}
}
memset(name, 0, strlen(name));
}
}
}
void RemovalNUM(char *buff){
int i, j;
for(i=j=0; buff[i]!='\0'; i++){
if(buff[i]<'0' || buff[i]>'9')
buff[j++] = buff[i];
}
buff[j] = '\0';
}
int StringToInteger(char *buff){
int value = 0;
while(*buff != '\0')
{
if(*buff>='0' && *buff<='9')
value = value*10 + *buff - '0';
buff++;
}
return value;
}
int ItemNUM(FILE *file, char *Item_name, int *NameNUM){
int N = 1000;
int i = 0;
char buff[N];
char name[N];
char value[N];
rewind(file);
while(fgets(buff, N, file))
{
if(ExtarctItem(buff, name, value)){
memset(buff, 0, strlen(buff));
ModifyItem(name, buff);
RemovalNUM(buff);
if(strcmp(buff, Item_name) == 0){
i += 1;
*NameNUM = StringToInteger(name);
NameNUM++;
}
memset(name, 0, strlen(name));
}
}
return i;
}
int PartItem(char *src, char part[][1000]){
const char blank[2] = " ";
int num = 0;
char *buff;
buff = strtok(src, blank);
while (buff != NULL)
{
strcpy(part[num], buff);
buff = strtok(NULL, blank);
num += 1;
}
return num;
}
void Read_parameter(){
char Part_buff[50][1000];
int configNum = sizeof(configList)/sizeof(configItem);
if(my_id == 0){
int nr;
FILE *file = fopen("opencfd-scu.in","r");
if(file == NULL){
printf("\033[31mopencfd-scu.in is not find!\033[0m\n");
exit(-1);
}
SearchItem(file, configList, configNum);
sscanf(configList[0].value, "%d%d%d", &nx, &ny, &nz);
sscanf(configList[1].value, "%lf", &Re);
sscanf(configList[2].value, "%lf", &Ama);
sscanf(configList[3].value, "%lf", &Gamma);
sscanf(configList[4].value, "%lf", &Pr);
sscanf(configList[5].value, "%lf", &T_Ref);
printf("Computation start...\nRe is %lf\nAma is %lf\nGamma is %lf\nPr is %lf\nT_Ref is %lf\n",
Re, Ama, Gamma, Pr, T_Ref);
BC_rpara = (double*)malloc(sizeof(double)*100);
nr = PartItem(configList[6].value, Part_buff);
for(int i=0;i<nr;i++) sscanf(Part_buff[i],"%lf",BC_rpara+i);
Tw = BC_rpara[0];
Tr = 1 + 0.89 * (Gamma - 1.0) / 2.0 * Ama * Ama;
printf("Tw is %lf\n", Tw);
sscanf(configList[7].value, "%lf", &Place);
printf("Place is %lf\n", Place);
fclose(file);
}
//-----------------------------------------------------------------------------------------------------
int tmp1[3];
double tmp2[7];
if(my_id == 0){
tmp1[0] = nx;
tmp1[1] = ny;
tmp1[2] = nz;
tmp2[0] = Re;
tmp2[1] = Ama;
tmp2[2] = Gamma;
tmp2[3] = Pr;
tmp2[4] = T_Ref;
tmp2[5] = Tw;
tmp2[6] = Place;
}
MPI_Bcast(tmp1, 3, MPI_INT, 0, MPI_COMM_WORLD);
MPI_Bcast(tmp2, 7, MPI_DOUBLE, 0, MPI_COMM_WORLD);
if(my_id != 0){
nx = tmp1[0];
ny = tmp1[1];
nz = tmp1[2];
Re = tmp2[0];
Ama = tmp2[1];
Gamma = tmp2[2];
Pr = tmp2[3];
T_Ref = tmp2[4];
Tw = tmp2[5];
Place = tmp2[6];
}
//-------------------------------------------------------------------------------------------
Amu = 1.0/Re*(1.0 + 110.4/T_Ref)*sqrt(Tw*Tw*Tw)/(110.4/T_Ref + Tw);
Cp = Gamma/((Gamma - 1)*Ama*Ama);
//-------------------------------------------------------------------------------------------
NZ = nz/n_processe;
if(my_id < nz%n_processe) NZ += 1;
NPZ = (int*)malloc(n_processe * sizeof(int));
NP = (int*)malloc(n_processe * sizeof(int));
memset((void*)NPZ, 0, n_processe*sizeof(int));
memset((void*)NP, 0, n_processe*sizeof(int));
for(int i = 0; i < n_processe; i++){
if(i < nz%n_processe){
NPZ[i] = (int)nz/n_processe + 1;
}else{
NPZ[i] = (int)nz/n_processe;
}
NP[0] = 0;
if(i != 0) NP[i] = NP[i-1] + NPZ[i-1];//偏移
}
if(NP[n_processe-1] != nz-NPZ[n_processe-1]) printf("NP is wrong![debug]\n");
}
#define Malloc_Judge(Memory)\
{ if(Memory == NULL){\
printf("Memory allocate error ! Can not allocate enough momory !!!\n");\
exit(0); }\
}
void Data_malloc(){
x3d = (double*)malloc(nx * ny * NZ * sizeof(double));
Malloc_Judge(x3d);
y3d = (double*)malloc(nx * ny * NZ * sizeof(double));
Malloc_Judge(y3d);
z3d = (double*)malloc(nx * ny * NZ * sizeof(double));
Malloc_Judge(z3d);
head = (int*)malloc(5 * sizeof(int));
pd = (double*)malloc(nx * ny * NZ * sizeof(double));
Malloc_Judge(pd);
pu = (double*)malloc(nx * ny * NZ * sizeof(double));
Malloc_Judge(pu);
pv = (double*)malloc(nx * ny * NZ * sizeof(double));
Malloc_Judge(pv);
pw = (double*)malloc(nx * ny * NZ * sizeof(double));
Malloc_Judge(pw);
pT = (double*)malloc(nx * ny * NZ * sizeof(double));
Malloc_Judge(pT);
}
#undef Malloc_Judge
#define FREAD(ptr , size , num , stream) \
{ int tmp_buffer;\
fread(&tmp_buffer , sizeof(int) , 1 , stream);\
fread(ptr , size , num , stream);\
fread(&tmp_buffer , sizeof(int) , 1 , stream);\
}
void Read_mesh_1d(){
if(my_id == 0){
if((fp = fopen("OCFD3d-Mesh.dat", "r")) == NULL){
printf("Can't open this file: 'OCFD3d-Mesh.dat'\n");
exit(0);
}
int num = nx * ny;
printf("Read OCFD3d-Mesh.dat-X ...\n");
for(int k = 0; k < 2; k++){
FREAD(x3d + num * k, sizeof(double), num, fp);
}
printf("Read OCFD3d-Mesh.dat-Y ...\n");
for(int k = 0; k < 2; k++){
FREAD(y3d + num * k, sizeof(double), num, fp);
}
printf("Read OCFD3d-Mesh.dat-Z ...\n\n");
for(int k = 0; k < 2; k++){
FREAD(z3d + num * k, sizeof(double), num, fp);
}
fclose(fp);
}
}
void Read_data_1d(){
if(my_id == 0){
if((fp = fopen("opencfd.ana", "r")) == NULL){
printf("Can't open this file: 'opencfd.ana'\n");
exit(0);
}
int num = nx * ny;
printf("Read opencfd.ana-d ...\n");
fread(head , sizeof(int) , 5 , fp);
for(int k = 0; k < 2; k++){
FREAD(pd + num * k, sizeof(double), num, fp);
}
printf("Read opencfd.ana-u ...\n");
for(int k = 0; k < 2; k++){
FREAD(pu + num * k, sizeof(double), num, fp);
}
printf("Read opencfd.ana-v ...\n");
for(int k = 0; k < 2; k++){
FREAD(pv + num * k, sizeof(double), num, fp);
}
printf("Read opencfd.ana-w ...\n");
for(int k = 0; k < 2; k++){
FREAD(pw + num * k, sizeof(double), num, fp);
}
printf("Read opencfd.ana-T ...\n");
for(int k = 0; k < 2; k++){
FREAD(pT + num * k, sizeof(double), num, fp);
}
fclose(fp);
}
}
#undef FREAD
void Write_flow1d_inlet(){
double tmp[ny][4];
if(my_id == 0){
char str[100];
double tmp1;
fp = fopen("flow1d-inlet.dat", "r");
printf("read inlet boundary data: flow-inlet.dat\n");
fgets(str, 100, fp);
for(int j = 0; j < ny; j++){
fscanf(fp, "%lf%lf%lf%lf%lf\n", &tmp1, &tmp[j][0], &tmp[j][1], &tmp[j][2], &tmp[j][3]);
}
fclose(fp);
fp = fopen("flow1d-inlet.dat", "w");
fscanf(fp, "variables=y, d, u, v, T\n");
for(int j = 0; j < ny-1; j++){
fprintf(fp, "%lf%lf%lf%lf%lf\n", tmp1, tmp[j][0], tmp[j][1], tmp[j][2], tmp[j][3]);
fprintf(fp, "%lf%lf%lf%lf%lf\n", tmp1, (tmp[j][0]+tmp[j+1][1])/2, (tmp[j][1]+tmp[j+1][1])/2, (tmp[j][2]+tmp[j+1][2])/2, (tmp[j][3]+tmp[j+1][3])/2);
}
fprintf(fp, "%lf%lf%lf%lf%lf\n", tmp1, tmp[ny-1][0], tmp[ny-1][1], tmp[ny-1][2], tmp[ny-1][3]);
fprintf(fp, "%lf%lf%lf%lf%lf\n", tmp1, tmp[ny-1][0], tmp[ny-1][1], tmp[ny-1][2], tmp[ny-1][3]);
fclose(fp);
}
}
void Read_mesh(){
int num = nx * ny;
int num_byte = nx * ny * sizeof(double);
MPI_File tmp_file;
MPI_File_open(MPI_COMM_WORLD, "OCFD3d-Mesh.dat", MPI_MODE_RDONLY, MPI_INFO_NULL, &tmp_file);
MPI_File_seek(tmp_file, 0, MPI_SEEK_SET);
if(my_id == 0) printf("READ X3d ...\n");
MPI_File_seek(tmp_file, NP[my_id]*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_read(tmp_file, x3d+num*k, num, MPI_DOUBLE, &status);
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("READ Y3d ...\n");
for(int k = 0; k < NZ; k++){
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_read(tmp_file, y3d+num*k, num, MPI_DOUBLE, &status);
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("READ Z3d ...\n");
for(int k = 0; k < NZ; k++){
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_read(tmp_file, z3d+num*k, num, MPI_DOUBLE, &status);
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
}
//output3d(nx, ny, nz, z3d);
MPI_File_close(&tmp_file);
}
void Read_data(){
int num = nx * ny;
int num_byte = nx * ny * sizeof(double);
MPI_File tmp_file;
MPI_File_open(MPI_COMM_WORLD, "opencfd.ana", MPI_MODE_RDONLY, MPI_INFO_NULL, &tmp_file);
MPI_File_seek(tmp_file, 0, MPI_SEEK_SET);
MPI_File_seek(tmp_file, sizeof(int), MPI_SEEK_CUR);
MPI_File_read_all(tmp_file, init, 1, MPI_INT, &status);
MPI_File_read_all(tmp_file, init+1, 1, MPI_DOUBLE, &status);
MPI_File_seek(tmp_file, sizeof(int), MPI_SEEK_CUR);
if(my_id == 0) printf("READ d ...\n");
MPI_File_seek(tmp_file, NP[my_id]*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_read(tmp_file, pd+num*k, num, MPI_DOUBLE, &status);
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("READ u ...\n");
for(int k = 0; k < NZ; k++){
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_read(tmp_file, pu+num*k, num, MPI_DOUBLE, &status);
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("READ v ...\n");
for(int k = 0; k < NZ; k++){
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_read(tmp_file, pv+num*k, num, MPI_DOUBLE, &status);
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("READ w ...\n");
for(int k = 0; k < NZ; k++){
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_read(tmp_file, pw+num*k, num, MPI_DOUBLE, &status);
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("READ T ...\n");
for(int k = 0; k < NZ; k++){
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_read(tmp_file, pT+num*k, num, MPI_DOUBLE, &status);
MPI_File_read(tmp_file, &num_byte, 1, MPI_INT, &status);
}
//output3d(nx, ny, nz, z3d);
MPI_File_close(&tmp_file);
}
void Write_data_new_extension(){
int num = nx * ny;
int num_byte = nx * ny * sizeof(double);
int DI = sizeof(int) + sizeof(double);
MPI_File tmp_file;
double *tmp2d;
int nx_new = nx - 25;
int num_new = nx_new*ny;
tmp2d = (double*)malloc(nx*ny * sizeof(double));
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double (*tmp)[nx] = (double (*)[nx])(tmp2d);
MPI_File_open(MPI_COMM_WORLD, "opencfd.md", MPI_MODE_WRONLY | MPI_MODE_CREATE, MPI_INFO_NULL, &tmp_file);
MPI_File_seek(tmp_file, 0, MPI_SEEK_SET);
MPI_File_write_all(tmp_file, &DI, 1, MPI_INT, &status);
MPI_File_write_all(tmp_file, &init, 1, MPI_INT, &status);
MPI_File_write_all(tmp_file, &init[1], 1, MPI_DOUBLE, &status);
MPI_File_write_all(tmp_file, &DI, 1, MPI_INT, &status);
if(my_id == 0) printf("WRITE d ...\n");
MPI_File_seek(tmp_file, NP[my_id]*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = d[k][j][i];
}
for(int i = nx_new; i < nx; i++){
tmp[j][i] = d[k][j][nx_new-1];
}
}
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("WRITE u ...\n");
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = u[k][j][i];
}
for(int i = nx_new; i < nx; i++){
tmp[j][i] = u[k][j][nx_new-1];
}
}
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("WRITE v ...\n");
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = v[k][j][i];
}
for(int i = nx_new; i < nx; i++){
tmp[j][i] = v[k][j][nx_new-1];
}
}
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("WRITE w ...\n");
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = w[k][j][i];
}
for(int i = nx_new; i < nx; i++){
tmp[j][i] = w[k][j][nx_new-1];
}
}
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("WRITE T ...\n");
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = T[k][j][i];
}
for(int i = nx_new; i < nx; i++){
tmp[j][i] = T[k][j][nx_new-1];
}
}
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num, 1, MPI_INT, &status);
}
//output3d(nx, ny, nz, z3d);
MPI_File_close(&tmp_file);
}
void Write_data_new(){
int num = nx * ny;
int num_byte = nx * ny * sizeof(double);
int DI = sizeof(int) + sizeof(double);
MPI_File tmp_file;
double *tmp2d;
int nx_new = nx - 10;
int num_new = nx_new*ny;
tmp2d = (double*)malloc(num_new * sizeof(double));
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double (*tmp)[nx_new] = (double (*)[nx_new])(tmp2d);
fp = fopen("flow1d-inlet.dat", "w");
fscanf(fp, "variables=y, d, u, v, T\n");
for(int j = 0; j < ny; j++){
fprintf(fp, "%15.6lf%15.6lf%15.6lf%15.6lf%15.6lf\n", 1.0, d[0][j][250], u[0][j][250], v[0][j][250], T[0][j][250]);
}
fclose(fp);
exit(0);
MPI_File_open(MPI_COMM_WORLD, "opencfd.md", MPI_MODE_WRONLY | MPI_MODE_CREATE, MPI_INFO_NULL, &tmp_file);
MPI_File_seek(tmp_file, 0, MPI_SEEK_SET);
MPI_File_write_all(tmp_file, &DI, 1, MPI_INT, &status);
MPI_File_write_all(tmp_file, &init, 1, MPI_INT, &status);
MPI_File_write_all(tmp_file, &init[1], 1, MPI_DOUBLE, &status);
MPI_File_write_all(tmp_file, &DI, 1, MPI_INT, &status);
if(my_id == 0) printf("WRITE d ...\n");
MPI_File_seek(tmp_file, NP[my_id]*(num_new*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = d[k][j][i];
}
}
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num_new, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num_new*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("WRITE u ...\n");
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = u[k][j][i];
}
}
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num_new, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num_new*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("WRITE v ...\n");
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = v[k][j][i];
}
}
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num_new, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num_new*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("WRITE w ...\n");
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = w[k][j][i];
}
}
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num_new, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num_new*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("WRITE T ...\n");
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx_new; i++){
tmp[j][i] = T[k][j][i];
}
}
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, tmp2d, num_new, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
//output3d(nx, ny, nz, z3d);
MPI_File_close(&tmp_file);
}
void Write_grid_format(){
int div = 10;
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
if(my_id == 0) printf("Write grid.dat\n");
char filename[100];
int *MP = (int*)malloc(div * sizeof(int));
int *MP_offset = (int*)malloc(div * sizeof(int));
for(int i = 0; i < div; i++){
if(i < nx%div){
MP[i] = (int)nx/div + 1;
}else{
MP[i] = (int)nx/div;
}
MP_offset[0] = 0;
if(i != 0) MP_offset[i] = MP_offset[i-1] + MP[i-1];
}
for(int m = 0; m < div; m++){
if(my_id == 0){
sprintf(filename, "grid%02d.dat", m);
fp = fopen(filename, "w");
fprintf(fp, "variables=x,y,z\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", MP[m], ny, nz);
fclose(fp);
}
}
for(int n = 0; n < n_processe; n++){
for(int m = 0; m < div; m++){
sprintf(filename, "grid%02d.dat", m);
if(my_id == 0){
fp = fopen(filename, "a");
for(int k = 0; k < NPZ[n]; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < MP[m]; i++){
int tmp = MP_offset[m] + i;
fprintf(fp, "%15.6f%15.6f%15.6f\n", xx3d[k][j][tmp], yy3d[k][j][tmp], zz3d[k][j][tmp]);
}
}
}
fclose(fp);
}
}
if(my_id != 0){
MPI_Send(x3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(y3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(z3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != n_processe-1){
MPI_Recv(x3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(y3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(z3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
}
void Write_data_format(){
int div = 10;
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
if(my_id == 0) printf("Write grid.dat\n");
char filename[100];
int *MP = (int*)malloc(div * sizeof(int));
int *MP_offset = (int*)malloc(div * sizeof(int));
for(int i = 0; i < div; i++){
if(i < nx%div){
MP[i] = (int)nx/div + 1;
}else{
MP[i] = (int)nx/div;
}
MP_offset[0] = 0;
if(i != 0) MP_offset[i] = MP_offset[i-1] + MP[i-1];
}
for(int m = 0; m < div; m++){
if(my_id == 0){
sprintf(filename, "grid%02d.dat", m);
fp = fopen(filename, "w");
fprintf(fp, "variables=x,y,z,d,u,v,w,T\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", MP[m], ny, nz);
fclose(fp);
}
}
for(int n = 0; n < n_processe; n++){
for(int m = 0; m < div; m++){
sprintf(filename, "grid%02d.dat", m);
if(my_id == 0){
fp = fopen(filename, "a");
for(int k = 0; k < NPZ[n]; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < MP[m]; i++){
int tmp = MP_offset[m] + i;
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d[k][j][tmp], yy3d[k][j][tmp], zz3d[k][j][tmp],
d[k][j][tmp], u[k][j][tmp], v[k][j][tmp], w[k][j][tmp], T[k][j][tmp]);
}
}
}
fclose(fp);
}
}
if(my_id != 0){
MPI_Send(x3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(y3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(z3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pd, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pu, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pv, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pw, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pT, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != n_processe-1){
MPI_Recv(x3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(y3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(z3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pd, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pu, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pv, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pw, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pT, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
}
void Write_dataxy2d_first_format(){
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double cf, Tk;
if(my_id == 0){
printf("Write dataxy2d.dat\n");
fp = fopen("dataxy.dat", "w");
fprintf(fp, "variables=x,y,z,d,u,v,w,T,cf,Tk\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", nx, 2*ny-1, 1);
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx; i++){
hh = sqrt((xx3d[1][j][i] - xx3d[0][j][i])*(xx3d[1][j][i] - xx3d[0][j][i]) +
(yy3d[1][j][i] - yy3d[0][j][i])*(yy3d[1][j][i] - yy3d[0][j][i]) +
(zz3d[1][j][i] - zz3d[0][j][i])*(zz3d[1][j][i] - zz3d[0][j][i]));
cf = 2*Amu*sqrt(u[1][j][i]*u[1][j][i] + v[1][j][i]*v[1][j][i] + w[1][j][i]*w[1][j][i])/hh;
Tk = 2*Amu*Cp/Pr*(T[1][0][i] - T[0][0][i])/hh;
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d[1][j][i],
yy3d[1][j][i], zz3d[1][j][i], d[1][j][i], u[1][j][i], v[1][j][i], w[1][j][i], T[1][j][i], cf, Tk);
}
}
for(int j = ny-2; j >= 0; j--){
for(int i = 0; i < nx; i++){
hh = sqrt((xx3d[1][j][i] - xx3d[0][j][i])*(xx3d[1][j][i] - xx3d[0][j][i]) +
(yy3d[1][j][i] - yy3d[0][j][i])*(yy3d[1][j][i] - yy3d[0][j][i]) +
(zz3d[1][j][i] - zz3d[0][j][i])*(zz3d[1][j][i] - zz3d[0][j][i]));
cf = 2*Amu*sqrt(u[1][j][i]*u[1][j][i] + v[1][j][i]*v[1][j][i] + w[1][j][i]*w[1][j][i])/hh;
Tk = 2*Amu*Cp/Pr*(T[1][ny-1][i] - T[0][ny-1][i])/hh;
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d[1][j][i],
-yy3d[1][j][i], zz3d[1][j][i], d[1][j][i], u[1][j][i], v[1][j][i], w[1][j][i], T[1][j][i], cf, Tk);
}
}
fclose(fp);
}
}
void Write_dataxy2d_first_format_total(){
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double cf, Tk;
if(my_id == 0){
printf("Write dataxy2d.dat\n");
fp = fopen("dataxy.dat", "w");
fprintf(fp, "variables=x,y,z,d,u,v,w,T,cf,Tk\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", nx, ny, 1);
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx; i++){
hh = sqrt((xx3d[1][j][i] - xx3d[0][j][i])*(xx3d[1][j][i] - xx3d[0][j][i]) +
(yy3d[1][j][i] - yy3d[0][j][i])*(yy3d[1][j][i] - yy3d[0][j][i]) +
(zz3d[1][j][i] - zz3d[0][j][i])*(zz3d[1][j][i] - zz3d[0][j][i]));
cf = 2*Amu*sqrt(u[1][j][i]*u[1][j][i] + v[1][j][i]*v[1][j][i] + w[1][j][i]*w[1][j][i])/hh;
Tk = 2*Amu*Cp/Pr*(T[1][0][i] - T[0][0][i])/hh;
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d[1][j][i],
yy3d[1][j][i], zz3d[1][j][i], d[1][j][i], u[1][j][i], v[1][j][i], w[1][j][i], T[1][j][i], cf, Tk);
}
}
fclose(fp);
}
}
void Write_cf2d_format(){
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double cf, Tk;
if(my_id == 0){
printf("Write cf2d.dat\n");
fp = fopen("cf2d_bottom.dat", "w");
fprintf(fp, "variables=x,cf,Tk\n");
fprintf(fp, "zone i=%d\n", nx);
for(int i = 0; i < nx; i++){
hh = sqrt((xx3d[1][0][i] - xx3d[0][0][i])*(xx3d[1][0][i] - xx3d[0][0][i]) +
(yy3d[1][0][i] - yy3d[0][0][i])*(yy3d[1][0][i] - yy3d[0][0][i]) +
(zz3d[1][0][i] - zz3d[0][0][i])*(zz3d[1][0][i] - zz3d[0][0][i]));
cf = 2*Amu*sqrt(u[1][0][i]*u[1][0][i] + v[1][0][i]*v[1][0][i] + w[1][0][i]*w[1][0][i])/hh;
Tk = 2*Amu*Cp/Pr*(T[1][0][i] - T[0][0][i])/hh;
fprintf(fp, "%15.6f%15.6f%15.6f\n", xx3d[1][0][i], cf, Tk);
}
fclose(fp);
fp = fopen("cf2d_top.dat", "w");
fprintf(fp, "variables=x,cf,Tk\n");
fprintf(fp, "zone i=%d\n", nx);
for(int i = 0; i < nx; i++){
hh = sqrt((xx3d[1][ny-1][i] - xx3d[0][ny-1][i])*(xx3d[1][ny-1][i] - xx3d[0][ny-1][i]) +
(yy3d[1][ny-1][i] - yy3d[0][ny-1][i])*(yy3d[1][ny-1][i] - yy3d[0][ny-1][i]) +
(zz3d[1][ny-1][i] - zz3d[0][ny-1][i])*(zz3d[1][ny-1][i] - zz3d[0][ny-1][i]));
cf = 2*Amu*sqrt(u[1][ny-1][i]*u[1][ny-1][i] + v[1][ny-1][i]*v[1][ny-1][i] + w[1][ny-1][i]*w[1][ny-1][i])/hh;
Tk = 2*Amu*Cp/Pr*(T[1][ny-1][i] - T[0][ny-1][i])/hh;
fprintf(fp, "%15.6f%15.6f%15.6f\n", xx3d[1][ny-1][i], cf, Tk);
}
fclose(fp);
}
}
void Write_cf3d_format(){
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double cf;
if(my_id == 0){
printf("Write cf3d.dat\n");
fp = fopen("cf3d.dat", "w");
fprintf(fp, "variables=x,y,z,cf\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", nx, 2*ny-1, 1);
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx; i++){
cf = 2*Amu*sqrt(u[1][j][i]*u[1][j][i] + v[1][j][i]*v[1][j][i] + w[1][j][i]*w[1][j][i])/
sqrt((xx3d[1][j][i] - xx3d[0][j][i])*(xx3d[1][j][i] - xx3d[0][j][i]) +
(yy3d[1][j][i] - yy3d[0][j][i])*(yy3d[1][j][i] - yy3d[0][j][i]) +
(zz3d[1][j][i] - zz3d[0][j][i])*(zz3d[1][j][i] - zz3d[0][j][i]));
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f\n", xx3d[1][j][i],
yy3d[1][j][i], zz3d[1][j][i], cf);
}
}
for(int j = ny-2; j >= 0; j--){
for(int i = 0; i < nx; i++){
cf = 2*Amu*sqrt(u[1][j][i]*u[1][j][i] + v[1][j][i]*v[1][j][i] + w[1][j][i]*w[1][j][i])/
sqrt((xx3d[1][j][i] - xx3d[0][j][i])*(xx3d[1][j][i] - xx3d[0][j][i]) +
(yy3d[1][j][i] - yy3d[0][j][i])*(yy3d[1][j][i] - yy3d[0][j][i]) +
(zz3d[1][j][i] - zz3d[0][j][i])*(zz3d[1][j][i] - zz3d[0][j][i]));
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f\n", xx3d[1][j][i],
-yy3d[1][j][i], zz3d[1][j][i], cf);
}
}
fclose(fp);
}
}
void Write_cf3d_format_total(){
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double cf;
if(my_id == 0){
printf("Write cf3d.dat\n");
fp = fopen("cf3d.dat", "w");
fprintf(fp, "variables=x,y,z,cf\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", nx, ny, 1);
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx; i++){
cf = 2*Amu*sqrt(u[1][j][i]*u[1][j][i] + v[1][j][i]*v[1][j][i] + w[1][j][i]*w[1][j][i])/
sqrt((xx3d[1][j][i] - xx3d[0][j][i])*(xx3d[1][j][i] - xx3d[0][j][i]) +
(yy3d[1][j][i] - yy3d[0][j][i])*(yy3d[1][j][i] - yy3d[0][j][i]) +
(zz3d[1][j][i] - zz3d[0][j][i])*(zz3d[1][j][i] - zz3d[0][j][i]));
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f\n", xx3d[1][j][i],
yy3d[1][j][i], zz3d[1][j][i], cf);
}
}
fclose(fp);
}
}
void Write_datayz2d1_format(){//写出一个yz截面的数据,7/10位置
int div = 10;
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double *x3d_buff, *y3d_buff, *z3d_buff, *pd_buff, *pu_buff, *pv_buff, *pw_buff, *pT_buff;
x3d_buff = (double*)malloc(ny * NZ * sizeof(double));
y3d_buff = (double*)malloc(ny * NZ * sizeof(double));
z3d_buff = (double*)malloc(ny * NZ * sizeof(double));
pd_buff = (double*)malloc(ny * NZ * sizeof(double));
pu_buff = (double*)malloc(ny * NZ * sizeof(double));
pv_buff = (double*)malloc(ny * NZ * sizeof(double));
pw_buff = (double*)malloc(ny * NZ * sizeof(double));
pT_buff = (double*)malloc(ny * NZ * sizeof(double));
double (*xx3d_buff)[ny] = (double(*)[ny])x3d_buff;
double (*yy3d_buff)[ny] = (double(*)[ny])y3d_buff;
double (*zz3d_buff)[ny] = (double(*)[ny])z3d_buff;
double (*ppd_buff)[ny] = (double(*)[ny])pd_buff;
double (*ppu_buff)[ny] = (double(*)[ny])pu_buff;
double (*ppv_buff)[ny] = (double(*)[ny])pv_buff;
double (*ppw_buff)[ny] = (double(*)[ny])pw_buff;
double (*ppT_buff)[ny] = (double(*)[ny])pT_buff;
if(my_id == 0) printf("Write datayz2d_1.dat\n");
char filename[100];
int *MP = (int*)malloc(div * sizeof(int));
int *MP_offset = (int*)malloc((div+1) * sizeof(int));
for(int i = 0; i < div; i++){
if(i < nx%div){
MP[i] = (int)nx/div + 1;
}else{
MP[i] = (int)nx/div;
}
MP_offset[0] = 0;
if(i != 0) MP_offset[i] = MP_offset[i-1] + MP[i-1];
}
MP_offset[div] = nx;
int m=7;
int tmp = MP_offset[m+1];
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
xx3d_buff[k][j] = xx3d[k][j][tmp];
yy3d_buff[k][j] = yy3d[k][j][tmp];
zz3d_buff[k][j] = zz3d[k][j][tmp];
ppd_buff[k][j] = d[k][j][tmp];
ppu_buff[k][j] = u[k][j][tmp];
ppv_buff[k][j] = v[k][j][tmp];
ppw_buff[k][j] = w[k][j][tmp];
ppT_buff[k][j] = T[k][j][tmp];
}
}
if(my_id == 0){
sprintf(filename, "datayz%02d.dat", m);
fp = fopen(filename, "w");
fprintf(fp, "variables=x,y,z,d,u,v,w,T\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", 1, 2*ny-1, nz);
fclose(fp);
}
for(int n = 0; n < n_processe; n++){
sprintf(filename, "datayz%02d.dat", m);
if(my_id == 0){
fp = fopen(filename, "a");
for(int k = 0; k < NPZ[n]; k++){
for(int j = 0; j < ny; j++){
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d_buff[k][j],
yy3d_buff[k][j], zz3d_buff[k][j], ppd_buff[k][j], ppu_buff[k][j], ppv_buff[k][j],
ppw_buff[k][j], ppT_buff[k][j]);
}
for(int j = ny-2; j >= 0; j--){
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d_buff[k][j],
-yy3d_buff[k][j], zz3d_buff[k][j], ppd_buff[k][j], ppu_buff[k][j], ppv_buff[k][j],
ppw_buff[k][j], ppT_buff[k][j]);
}
}
fclose(fp);
}
if(my_id != 0){
MPI_Send(x3d_buff, ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(y3d_buff, ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(z3d_buff, ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pd_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pu_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pv_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pw_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pT_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != n_processe-1){
MPI_Recv(x3d_buff, ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(y3d_buff, ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(z3d_buff, ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pd_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pu_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pv_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pw_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pT_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
}
void Write_datayz2d_format(){
int div = 10;
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double *x3d_buff, *y3d_buff, *z3d_buff, *pd_buff, *pu_buff, *pv_buff, *pw_buff, *pT_buff;
x3d_buff = (double*)malloc(ny * NZ * sizeof(double));
y3d_buff = (double*)malloc(ny * NZ * sizeof(double));
z3d_buff = (double*)malloc(ny * NZ * sizeof(double));
pd_buff = (double*)malloc(ny * NZ * sizeof(double));
pu_buff = (double*)malloc(ny * NZ * sizeof(double));
pv_buff = (double*)malloc(ny * NZ * sizeof(double));
pw_buff = (double*)malloc(ny * NZ * sizeof(double));
pT_buff = (double*)malloc(ny * NZ * sizeof(double));
double (*xx3d_buff)[ny] = (double(*)[ny])x3d_buff;
double (*yy3d_buff)[ny] = (double(*)[ny])y3d_buff;
double (*zz3d_buff)[ny] = (double(*)[ny])z3d_buff;
double (*ppd_buff)[ny] = (double(*)[ny])pd_buff;
double (*ppu_buff)[ny] = (double(*)[ny])pu_buff;
double (*ppv_buff)[ny] = (double(*)[ny])pv_buff;
double (*ppw_buff)[ny] = (double(*)[ny])pw_buff;
double (*ppT_buff)[ny] = (double(*)[ny])pT_buff;
if(my_id == 0) printf("Write datayz2d.dat\n");
char filename[100];
int *MP = (int*)malloc(div * sizeof(int));
int *MP_offset = (int*)malloc((div+1) * sizeof(int));
for(int i = 0; i < div; i++){
if(i < nx%div){
MP[i] = (int)nx/div + 1;
}else{
MP[i] = (int)nx/div;
}
MP_offset[0] = 0;
if(i != 0) MP_offset[i] = MP_offset[i-1] + MP[i-1];
}
MP_offset[div] = nx;
for(int m = 0; m < div; m++){
if(my_id == 0){
sprintf(filename, "datayz%02d.dat", m);
fp = fopen(filename, "w");
fprintf(fp, "variables=x,y,z,d,u,v,w,T\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", 1, ny, nz);
// fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", 1, 2*ny-1, nz);
fclose(fp);
}
}
for(int m = 0; m < div; m++){
int tmp = MP_offset[m+1];
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
xx3d_buff[k][j] = xx3d[k][j][tmp];
yy3d_buff[k][j] = yy3d[k][j][tmp];
zz3d_buff[k][j] = zz3d[k][j][tmp];
ppd_buff[k][j] = d[k][j][tmp];
ppu_buff[k][j] = u[k][j][tmp];
ppv_buff[k][j] = v[k][j][tmp];
ppw_buff[k][j] = w[k][j][tmp];
ppT_buff[k][j] = T[k][j][tmp];
}
}
for(int n = 0; n < n_processe; n++){
sprintf(filename, "datayz%02d.dat", m);
if(my_id == 0){
fp = fopen(filename, "a");
for(int k = 0; k < NPZ[n]; k++){
for(int j = 0; j < ny; j++){
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d_buff[k][j],
yy3d_buff[k][j], zz3d_buff[k][j], ppd_buff[k][j], ppu_buff[k][j], ppv_buff[k][j],
ppw_buff[k][j], ppT_buff[k][j]);
}
// for(int j = ny-2; j >= 0; j--){
// fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d_buff[k][j],
// -yy3d_buff[k][j], zz3d_buff[k][j], ppd_buff[k][j], ppu_buff[k][j], ppv_buff[k][j],
// ppw_buff[k][j], ppT_buff[k][j]);
// }
}
fclose(fp);
}
if(my_id != 0){
MPI_Send(x3d_buff, ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(y3d_buff, ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(z3d_buff, ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pd_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pu_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pv_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pw_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pT_buff , ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != n_processe-1){
MPI_Recv(x3d_buff, ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(y3d_buff, ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(z3d_buff, ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pd_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pu_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pv_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pw_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pT_buff , ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
}
}
void Write_dataxz2d_format(){
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double *x3d_buff, *y3d_buff, *z3d_buff, *pd_buff, *pu_buff, *pv_buff, *pw_buff, *pT_buff;
x3d_buff = (double*)malloc(nx * NZ * sizeof(double));
y3d_buff = (double*)malloc(nx * NZ * sizeof(double));
z3d_buff = (double*)malloc(nx * NZ * sizeof(double));
pd_buff = (double*)malloc(nx * NZ * sizeof(double));
pu_buff = (double*)malloc(nx * NZ * sizeof(double));
pv_buff = (double*)malloc(nx * NZ * sizeof(double));
pw_buff = (double*)malloc(nx * NZ * sizeof(double));
pT_buff = (double*)malloc(nx * NZ * sizeof(double));
double (*xx3d_buff)[nx] = (double(*)[nx])x3d_buff;
double (*yy3d_buff)[nx] = (double(*)[nx])y3d_buff;
double (*zz3d_buff)[nx] = (double(*)[nx])z3d_buff;
double (*ppd_buff)[nx] = (double(*)[nx])pd_buff;
double (*ppu_buff)[nx] = (double(*)[nx])pu_buff;
double (*ppv_buff)[nx] = (double(*)[nx])pv_buff;
double (*ppw_buff)[nx] = (double(*)[nx])pw_buff;
double (*ppT_buff)[nx] = (double(*)[nx])pT_buff;
if(my_id == 0) printf("Write dataxz2d.dat\n");
char filename[100];
for(int k = 0; k < NZ; k++){
for(int i = 0; i < nx; i++){
xx3d_buff[k][i] = xx3d[k][9][i];
yy3d_buff[k][i] = yy3d[k][9][i];
zz3d_buff[k][i] = zz3d[k][9][i];
ppd_buff[k][i] = d[k][9][i];
ppu_buff[k][i] = u[k][9][i];
ppv_buff[k][i] = v[k][9][i];
ppw_buff[k][i] = w[k][9][i];
ppT_buff[k][i] = T[k][9][i];
}
}
if(my_id == 0){
sprintf(filename, "dataxz.dat");
fp = fopen(filename, "w");
fprintf(fp, "variables=x,y,z,d,u,v,w,T\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", nx, 1, nz);
}
for(int n = 0; n < n_processe; n++){
if(my_id == 0){
for(int k = 0; k < NPZ[n]; k++){
for(int i = 0; i < nx; i++){
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d_buff[k][i],
yy3d_buff[k][i], zz3d_buff[k][i], ppd_buff[k][i], ppu_buff[k][i], ppv_buff[k][i],
ppw_buff[k][i], ppT_buff[k][i]);
}
}
}
if(my_id != 0){
MPI_Send(x3d_buff, nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(y3d_buff, nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(z3d_buff, nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pd_buff , nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pu_buff , nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pv_buff , nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pw_buff , nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pT_buff , nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != n_processe-1){
MPI_Recv(x3d_buff, nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(y3d_buff, nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(z3d_buff, nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pd_buff , nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pu_buff , nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pv_buff , nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pw_buff , nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pT_buff , nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
if(my_id == 0) fclose(fp);
}
void Write_dataxy2d1_format(){
int div = 10;
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
if(my_id == 0) printf("Write dataxy2d_1.dat\n");
char filename[100];
int m=(nz-1)/2, n, id = n_processe-1;
for(int i = 0; i < n_processe-1; i++){
if(NP[i] < m && NP[i+1] > m){
id = i;
}
}
n = m - NP[id];
if(my_id == id){
sprintf(filename, "dataxy%06d.dat", m);
fp = fopen(filename, "w");
fprintf(fp, "variables=x,y,z,d,u,v,w,T\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", nx, ny, 1);
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx; i++){
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d[n][j][i],
yy3d[n][j][i], zz3d[n][j][i], d[n][j][i], u[n][j][i], v[n][j][i], w[n][j][i],
T[n][j][i]);
}
}
fclose(fp);
}
MPI_Barrier(MPI_COMM_WORLD);
}
void average_data_xy(double (*data2d)[nx], double (*data3d)[ny][nx]){
double *pdata_buff = (double*)malloc(nx*ny*sizeof(double));
double (*data_buff)[nx] = (double (*)[nx])(pdata_buff);
for(int j=0; j<ny; j++){
for(int i=0; i<nx; i++){
data2d[j][i] = 0.0;
data_buff[j][i] = 0.0;
for(int k=0; k<NZ; k++){
data_buff[j][i] += data3d[k][j][i];
}
}
}
MPI_Reduce(&data_buff[0][0], &data2d[0][0], nx*ny, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
for(int j=0; j<ny; j++){
for(int i=0; i<nx; i++){
data2d[j][i] /= nz;
}
}
}
void average_data_xz(double (*data2d)[nx], double (*data3d)[ny][nx]){
double *pdata_buff = (double*)malloc(nx*NZ*sizeof(double));
double (*data_buff)[nx] = (double (*)[nx])(pdata_buff);
for(int k=0; k<NZ; k++){
for(int i=0; i<nx; i++){
data_buff[k][i] = 0.0;
for(int j=0; j<ny; j++){
data_buff[k][i] += data3d[k][j][i];
}
data_buff[k][i] /= ny;
}
}
for(int n = 0; n < n_processe; n++){
if(my_id == 0){
for(int k = 0; k < NPZ[n]; k++){
for (int i=0; i<nx; i++)
{
data2d[NP[n] + k][i] = data_buff[k][i];
}
}
}
if(my_id != 0){
MPI_Send(pdata_buff, nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != n_processe-1){
MPI_Recv(pdata_buff, nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
}
void comput_yh_us_compress_ramp(double (*yh2d)[nx], double (*us2d)[nx], double (*u2d)[nx], double (*v2d)[nx], int i0){//针对压缩折角,计算点到壁面距离与平行壁面速度(展向总和)
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double length, length_min;
double seta0 = 24.0*PI/180.0;
//double seta0 = 0;
int start_point = 8000;
double seta;
for(int j=0; j<ny; j++){
for(int i=0; i<nx; i++){
us2d[j][i] = 0.0;
// if(i <= i0){
// length_min = yy3d[0][j][i];
// }else{
length_min = 10000;
for(int iw=0; iw<nx; iw++){
length = sqrt(pow(xx3d[0][j][iw] - xx3d[0][0][iw], 2) +
pow(yy3d[0][j][iw] - yy3d[0][0][iw], 2));
if(length <= length_min) length_min = length;//计算格点与壁面最近的距离
}
// }
yh2d[j][i] = length_min;
if(xx3d[0][0][i] <= 0){
seta = 0.0;
}else{
seta = seta0;/* 如果是在角区,则将速度投影至避面平行方向*/
}
us2d[j][i] = u2d[j][i]*cos(seta) + v2d[j][i]*sin(seta);
}
}
}
void comput_zh_us_compress_ramp(double (*zh2d)[nx], double (*us2d)[nx]){//针对压缩折角,计算点到壁面距离与平行壁面速度(展向总和)
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double length;
double seta0 = 7.0*PI/180.0;
double seta1 = 0.0;
int start_point = 8000;
double seta;
double *pxx_buff = (double*)malloc(nx*NZ*sizeof(double));
double (*xx_buff)[nx] = (double (*)[nx])(pxx_buff);
double *pzz_buff = (double*)malloc(nx*NZ*sizeof(double));
double (*zz_buff)[nx] = (double (*)[nx])(pzz_buff);
double *puu_buff = (double*)malloc(nx*NZ*sizeof(double));
double (*uu_buff)[nx] = (double (*)[nx])(puu_buff);
double (*xx2d)[nx] = (double(*)[nx])malloc(nx*nz*sizeof(double));
double (*zz2d)[nx] = (double(*)[nx])malloc(nx*nz*sizeof(double));
double *pVx = (double*)malloc(nx * ny * NZ * sizeof(double));
double *pVseta = (double*)malloc(nx * ny * NZ * sizeof(double));
double *pVr = (double*)malloc(nx * ny * NZ * sizeof(double));
double (*Vx)[ny][nx] = (double (*)[ny][nx])(pVx);
double (*Vseta)[ny][nx] = (double (*)[ny][nx])(pVseta);
double (*Vr)[ny][nx] = (double (*)[ny][nx])(pVr);
for(int i=0; i<nx; i++){
for(int k=0; k<NZ; k++){
for(int j=0; j<ny; j++){
Vr[k][j][i] = v[k][j][i]*sin(2*PI/(ny-1)*j) + w[k][j][i]*cos(2*PI/(ny-1)*j);
Vseta[k][j][i] = v[k][j][i]*cos(2*PI/(ny-1)*j) - w[k][j][i]*sin(2*PI/(ny-1)*j);
Vx[k][j][i] = u[k][j][i]*cos(seta0) + Vr[k][j][i]*sin(seta0);
Vr[k][j][i] = -u[k][j][i]*sin(seta0) + Vr[k][j][i]*cos(seta0);
}
}
}
for(int k=0; k<NZ; k++){
for(int i=0; i<nx; i++){
xx_buff[k][i] = xx3d[k][0][i];
zz_buff[k][i] = zz3d[k][0][i];
uu_buff[k][i] = 0.0;
for (int j=0; j<ny; j++)
{
uu_buff[k][i] += Vx[k][j][i];
}
uu_buff[k][i] /= ny;
}
}
for(int n = 0; n < n_processe; n++){
if(my_id == 0){
for(int k = 0; k < NPZ[n]; k++){
for (int i=0; i<nx; i++)
{
xx2d[NP[n] + k][i] = xx_buff[k][i];
zz2d[NP[n] + k][i] = zz_buff[k][i];
us2d[NP[n] + k][i] = uu_buff[k][i];
}
}
}
if(my_id != 0){
MPI_Send(pxx_buff, nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pzz_buff, nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(puu_buff, nx*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != n_processe-1){
MPI_Recv(pxx_buff, nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pzz_buff, nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(puu_buff, nx*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
for(int k=0; k<nz; k++){
for(int i=0; i<nx; i++){
length = sqrt(pow(xx2d[k][i] - xx2d[0][i], 2) +
pow(zz2d[k][i] - zz2d[0][i], 2));
zh2d[k][i] = length;
}
}
}
void Write_OCFDYZ_Mesh(int i0){
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double *x2d = (double*)malloc(ny * NZ * sizeof(double));
double *y2d = (double*)malloc(ny * NZ * sizeof(double));
double *z2d = (double*)malloc(ny * NZ * sizeof(double));
double (*xx2d)[ny] = (double (*)[ny])(x2d);
double (*yy2d)[ny] = (double (*)[ny])(y2d);
double (*zz2d)[ny] = (double (*)[ny])(z2d);
if(my_id == 0)
{
fp = fopen("zz1d.dat", "w");
for(int i = 0; i < nz; i++){
fprintf(fp, "%d%15.6f\n", i, zz3d[i][0][i0]);
}
fclose(fp);
}
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
xx2d[k][j] = xx3d[k][j][i0];
yy2d[k][j] = yy3d[k][j][i0];
zz2d[k][j] = zz3d[k][j][i0];
}
}
if(my_id == 0){
printf("Write OCFDYZ-Mesh.dat\n");
fp = fopen("OCFDYZ-Mesh.dat", "w");
}
for(int n = 0; n < n_processe; n++){
if(my_id == 0){
for(int k = 0; k < NPZ[n]; k++){
for(int j = 0; j < ny; j++){
fprintf(fp, "%15.6f%15.6f%15.6f\n", xx2d[k][j], yy2d[k][j], zz2d[k][j]);
}
}
}
if(my_id != 0){
MPI_Send(x2d, ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(y2d, ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(z2d, ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != n_processe-1){
MPI_Recv(x2d, ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(y2d, ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(z2d, ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
if(my_id == 0) fclose(fp);
}
void Write_dataxz2d_cf_double_cone(int i0){//针对顿锥问题的后处理,写出表面摩阻
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double cf, Tk, us1, us2, h1, h2, uy, P, xp, yp, zp;
double *cf0 = (double*)malloc(nx*sizeof(double));
double *Tk0 = (double*)malloc(nx*sizeof(double));
double *Ut = (double*)malloc(nx*sizeof(double));
double *Ret = (double*)malloc(nx*sizeof(double));
double *up = (double*)malloc(nz*sizeof(double));
double *uvd = (double*)malloc(nz*sizeof(double));
double (*zh2d)[nx] = (double(*)[nx])malloc(nx*nz*sizeof(double));//格点距离壁面距离
double (*us2d)[nx] = (double(*)[nx])malloc(nx*nz*sizeof(double));//延壁面水平方向投影过的流向速度
double (*d2d)[nx] = (double(*)[nx])malloc(nx*nz*sizeof(double));
double (*cf2d)[nx] = (double(*)[nx])malloc(nx*ny*sizeof(double));
double (*Tk2d)[nx] = (double(*)[nx])malloc(nx*ny*sizeof(double));
double (*T2d)[nx] = (double(*)[nx])malloc(nx*nz*sizeof(double));
average_data_xz(T2d, T);
average_data_xz(d2d, d);
comput_zh_us_compress_ramp(zh2d, us2d);
Write_OCFDYZ_Mesh(i0);
if(my_id == 0){
for(int i = 0; i < nx; i++){
us1 = us2d[1][i];
us2 = us2d[2][i];
h1 = zh2d[1][i];
h2 = zh2d[2][i];
uy = (h2*h2*us1 - h1*h1*us2)/(h2*h2*h1 - h1*h1*h2);//展向速度梯度之和
cf0[i] = 2*Amu*uy;
Tk0[i] = 2*Amu*Cp/Pr*(T2d[1][i] - T2d[0][i])/h1;//计算展向热流和
}
printf("Write cf2d.dat\n");
fp = fopen("cf2d.dat", "w");
fprintf(fp, "variables=x,cf,Tk,pw\n");
fprintf(fp, "zone i=%d\n", nx);
for(int i = 0; i < nx; i++){
P = d2d[1][i]*T2d[1][i];
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f\n", xx3d[0][0][i], cf0[i], Tk0[i], P);
}
fclose(fp);
//--------------------------------------------------------------------------------------
for(int i = 0; i < nx; i++){
Ut[i] = sqrt( fabs(cf0[i]) / (2*d2d[0][i]) );//摩擦速度
Ret[i] = d2d[0][i]*Ut[i]/Amu;//粘性尺度倒数
}
fp = fopen("xyzp.dat", "w");
fprintf(fp, "zone i=%d\n", nx-1);
for(int i = 1; i < nx; i++){
xp = (xx3d[0][0][i] - xx3d[0][0][i-1])*Ret[i];
yp = (yy3d[0][1][i] - yy3d[0][0][i])*Ret[i];
zp = (zz3d[1][0][i] - zz3d[0][0][i])*Ret[i];
fprintf(fp, "%15.6f%15.6f%15.6f\n", xp, yp, zp);
}
fclose(fp);
printf("Write one-dimension profiles\n");
double zp;
printf("i0 is %d, Axx is %lf\n", i0, xx3d[0][0][i0]);
up[0] = 0;
uvd[0] = 0;
fp = fopen("U1d.dat", "w");
fprintf(fp, "variables=yp,up,uvd,u_log\n");
fprintf(fp, "zone i=%d\n", nz-2);
for(int k = 1; k < nz-1; k++){
zp = zh2d[k][i0]*Ret[i0];
up[k] = us2d[k][i0]/Ut[i0];
uvd[k] = uvd[k-1] + sqrt(d2d[k][i0]/d2d[0][i0])*(up[k] - up[k-1]);
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f\n", zp, up[k], uvd[k], 2.44*log(zp)+5.1);
}
fclose(fp);
//---------------------------------------------------------------------------------------
printf("Write delt\n");
double delt0, delt1, delt2;
int z0;
fp = fopen("delta.dat", "w");
for(int i = 0; i < nx; i++){
delt1 = 0;
delt2 = 0;
for(int k = 0; k < nz; k++){
if(us2d[k][i] > 0.99){
z0 = k-1;
goto end_comput_delt;
}
}
end_comput_delt:;
delt0 = zh2d[z0][i];//速度边界层厚度
for(int k = 1; k <= z0; k++){
delt1 += (1 - d2d[k][i]*us2d[k][i]/(d2d[z0][i]*us2d[z0][i]))*(zh2d[k][i] - zh2d[k-1][i]);
delt2 += d2d[k][i]*us2d[k][i]/(d2d[z0][i]*us2d[z0][i])*(1 - us2d[k][i]/us2d[z0][i])*(zh2d[k][i] - zh2d[k-1][i]);
}
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f\n", xx3d[0][0][i], delt0, delt1, delt2);
}
fclose(fp);
}
}
void Write_dataxy2d_cf_compress_ramp(int i0){//针对压缩折角问题的后处理,写出表面摩阻
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double cf, Tk, us1, us2, h1, h2, uy, P;
double *cf0 = (double*)malloc(nx*sizeof(double));
double *Tk0 = (double*)malloc(nx*sizeof(double));
double *Ut = (double*)malloc(nx*sizeof(double));
double *Ret = (double*)malloc(nx*sizeof(double));
double *up = (double*)malloc(ny*sizeof(double));
double *uvd = (double*)malloc(ny*sizeof(double));
double (*yh2d)[nx] = (double(*)[nx])malloc(nx*ny*sizeof(double));//格点距离壁面距离
double (*us2d)[nx] = (double(*)[nx])malloc(nx*ny*sizeof(double));//延壁面水平方向投影过的流向速度
double (*d2d)[nx] = (double(*)[nx])malloc(nx*ny*sizeof(double));
double (*u2d)[nx] = (double(*)[nx])malloc(nx*ny*sizeof(double));
double (*v2d)[nx] = (double(*)[nx])malloc(nx*ny*sizeof(double));
double (*T2d)[nx] = (double(*)[nx])malloc(nx*ny*sizeof(double));
double xp, yp, zp;
average_data_xy(u2d, u);
average_data_xy(v2d, v);
average_data_xy(T2d, T);
average_data_xy(d2d, d);
if(my_id == 0){
comput_yh_us_compress_ramp(yh2d, us2d, u2d, v2d, i0);
for(int i = 0; i < nx; i++){
us1 = us2d[1][i];
us2 = us2d[2][i];
h1 = yh2d[1][i];
h2 = yh2d[2][i];
uy = (h2*h2*us1 - h1*h1*us2)/(h2*h2*h1 - h1*h1*h2);//展向速度梯度之和
cf0[i] = 2*Amu*uy;
Tk0[i] = Amu*(T2d[1][i] - T2d[0][i])/(h1*Pr*(Tr-Tw));//计算展向热流和
}
printf("Write cf2d.dat\n");
fp = fopen("cf2d.dat", "w");
fprintf(fp, "variables=x,cf,Tk,P\n");
fprintf(fp, "zone i=%d\n", nx);
for(int i = 0; i < nx; i++){
P = d2d[1][i]*T2d[1][i];
// fprintf(fp, "%15.6f%15.6f%15.6f\n", xx3d[0][0][i], cf0[i], Tk0[i]);
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f\n", xx3d[0][0][i], cf0[i], Tk0[i], P);
}
fclose(fp);
//--------------------------------------------------------------------------------------
for(int i = 0; i < nx; i++){
Ut[i] = sqrt( fabs(cf0[i]) / (2*d2d[0][i]) );//摩擦速度
Ret[i] = d2d[0][i]*Ut[i]/Amu;//粘性尺度倒数
}
fp = fopen("xyzp.dat", "w");
fprintf(fp, "zone i=%d\n", nx-1);
for(int i = 1; i < nx; i++){
xp = (xx3d[0][0][i] - xx3d[0][0][i-1])*Ret[i];
yp = (yy3d[0][1][i] - yy3d[0][0][i])*Ret[i];
zp = (zz3d[1][0][i] - zz3d[0][0][i])*Ret[i];
fprintf(fp, "%15.6f%15.6f%15.6f\n", xp, yp, zp);
}
fclose(fp);
printf("Write one-dimension profiles\n");
double yp;
printf("i0 is %d, Axx is %lf\n", i0, xx3d[0][0][i0]);
up[0] = 0;
uvd[0] = 0;
fp = fopen("U1d.dat", "w");
fprintf(fp, "variables=yp,up,uvd,u_log\n");
fprintf(fp, "zone i=%d\n", ny-2);
for(int j = 1; j < ny-1; j++){
yp = yh2d[j][i0]*Ret[i0];
up[j] = us2d[j][i0]/Ut[i0];
uvd[j] = uvd[j-1] + sqrt(d2d[j][i0]/d2d[0][i0])*(up[j] - up[j-1]);
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f\n", yp, up[j], uvd[j], 2.44*log(yp)+5.1);
}
fclose(fp);
//---------------------------------------------------------------------------------------
printf("Write delt\n");
double delt0, delt1, delt2;
int j0;
fp = fopen("delta.dat", "w");
for(int i = 0; i < nx; i++){
delt1 = 0;
delt2 = 0;
for(int j = 0; j < ny; j++){
if(us2d[j][i] > 0.99){
j0 = j-1;
goto end_comput_delt;
}
}
end_comput_delt:;
delt0 = yh2d[j0][i];//速度边界层厚度
for(int j = 1; j <= j0; j++){
delt1 += (1 - d2d[j][i]*us2d[j][i]/(d2d[j0][i]*us2d[j0][i]))*(yh2d[j][i] - yh2d[j-1][i]);
delt2 += d2d[j][i]*us2d[j][i]/(d2d[j0][i]*us2d[j0][i])*(1 - us2d[j][i]/us2d[j0][i])*(yh2d[j][i] - yh2d[j-1][i]);
}
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f\n", xx3d[0][0][i], delt0, delt1, delt2);
}
fclose(fp);
}
}
void Write_dataxyz3d_format(){
int div = 10;
int m = 7;
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
double *x3d_buff, *y3d_buff, *z3d_buff, *pd_buff, *pu_buff, *pv_buff, *pw_buff, *pT_buff;
if(my_id == 0) printf("Write dataxyz3d.dat\n");
char filename[100];
int *MP = (int*)malloc(div * sizeof(int));
int *MP_offset = (int*)malloc((div+1) * sizeof(int));
for(int i = 0; i < div; i++){
if(i < nx%div){
MP[i] = (int)nx/div + 1;
}else{
MP[i] = (int)nx/div;
}
MP_offset[0] = 0;
if(i != 0) MP_offset[i] = MP_offset[i-1] + MP[i-1];
}
MP_offset[div] = nx;
x3d_buff = (double*)malloc(MP[m] * ny * NZ * sizeof(double));
y3d_buff = (double*)malloc(MP[m] * ny * NZ * sizeof(double));
z3d_buff = (double*)malloc(MP[m] * ny * NZ * sizeof(double));
pd_buff = (double*)malloc(MP[m] * ny * NZ * sizeof(double));
pu_buff = (double*)malloc(MP[m] * ny * NZ * sizeof(double));
pv_buff = (double*)malloc(MP[m] * ny * NZ * sizeof(double));
pw_buff = (double*)malloc(MP[m] * ny * NZ * sizeof(double));
pT_buff = (double*)malloc(MP[m] * ny * NZ * sizeof(double));
double (*xx3d_buff)[ny][MP[m]] = (double(*)[ny][MP[m]])x3d_buff;
double (*yy3d_buff)[ny][MP[m]] = (double(*)[ny][MP[m]])y3d_buff;
double (*zz3d_buff)[ny][MP[m]] = (double(*)[ny][MP[m]])z3d_buff;
double (*ppd_buff)[ny][MP[m]] = (double(*)[ny][MP[m]])pd_buff;
double (*ppu_buff)[ny][MP[m]] = (double(*)[ny][MP[m]])pu_buff;
double (*ppv_buff)[ny][MP[m]] = (double(*)[ny][MP[m]])pv_buff;
double (*ppw_buff)[ny][MP[m]] = (double(*)[ny][MP[m]])pw_buff;
double (*ppT_buff)[ny][MP[m]] = (double(*)[ny][MP[m]])pT_buff;
int tmp;
for(int k = 0; k < NZ; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < MP[m]; i++){
tmp = MP_offset[m] + i;
xx3d_buff[k][j][i] = xx3d[k][j][tmp];
yy3d_buff[k][j][i] = yy3d[k][j][tmp];
zz3d_buff[k][j][i] = zz3d[k][j][tmp];
ppd_buff[k][j][i] = d[k][j][tmp];
ppu_buff[k][j][i] = u[k][j][tmp];
ppv_buff[k][j][i] = v[k][j][tmp];
ppw_buff[k][j][i] = w[k][j][tmp];
ppT_buff[k][j][i] = T[k][j][tmp];
}
}
}
if(my_id == 0){
sprintf(filename, "data07.dat");
fp = fopen(filename, "w");
fclose(fp);
}
for(int n = 0; n < n_processe; n++){
sprintf(filename, "data07.dat");
if(my_id == 0){
fp = fopen(filename, "a");
if(n == 0){
fprintf(fp, "variables=x,y,z,d,u,v,w,T\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", MP[m], 2*ny-1, nz);
}
for(int k = 0; k < NPZ[n]; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < MP[m]; i++){
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d_buff[k][j][i],
yy3d_buff[k][j][i], zz3d_buff[k][j][i], ppd_buff[k][j][i], ppu_buff[k][j][i], ppv_buff[k][j][i],
ppw_buff[k][j][i], ppT_buff[k][j][i]);
}
}
for(int j = ny-2; j >= 0; j--){
for(int i = 0; i < MP[m]; i++){
fprintf(fp, "%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f%15.6f\n", xx3d_buff[k][j][i],
-yy3d_buff[k][j][i], zz3d_buff[k][j][i], ppd_buff[k][j][i], ppu_buff[k][j][i], ppv_buff[k][j][i],
ppw_buff[k][j][i], ppT_buff[k][j][i]);
}
}
}
fclose(fp);
}
if(my_id != 0){
MPI_Send(x3d_buff, MP[m]*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(y3d_buff, MP[m]*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(z3d_buff, MP[m]*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pd_buff , MP[m]*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pu_buff , MP[m]*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pv_buff , MP[m]*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pw_buff , MP[m]*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(pT_buff , MP[m]*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != n_processe-1){
MPI_Recv(x3d_buff, MP[m]*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(y3d_buff, MP[m]*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(z3d_buff, MP[m]*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pd_buff , MP[m]*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pu_buff , MP[m]*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pv_buff , MP[m]*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pw_buff , MP[m]*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(pT_buff , MP[m]*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
}
//void Write_grid(){
// double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
// double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
// double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
//
// printf("Write grid.dat\n");
// if(my_id == 0){
// fp = fopen("grid.dat", "w");
// fprintf(fp, "variables=x,y,z\n");
// fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", nx, ny, nz);
// }
//
// for(int n = 0; n < n_processe; n++){
//
// if(my_id == 0){
// for(int k = 0; k < NPZ[n]; k++){
// for(int j = 0; j < ny; j++){
// for(int i = 0; i < nx; i++){
// fprintf(fp, "%15.6f%15.6f%15.6f\n", xx3d[k][j][i], yy3d[k][j][i], zz3d[k][j][i]);
// }
// }
// }
// }
//
// if(my_id != 0){
// MPI_Send(x3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
// MPI_Send(y3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
// MPI_Send(z3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
// }
//
// if(my_id != n_processe-1){
// MPI_Recv(x3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
// MPI_Recv(y3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
// MPI_Recv(z3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
// }
// }
//
// if(my_id == 0) fclose(fp);
//}
//void Write_data(){
// double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
// double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
// double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
//
// double (*d)[ny][nx] = (double (*)[ny][nx])(pd);
// double (*u)[ny][nx] = (double (*)[ny][nx])(pu);
// double (*v)[ny][nx] = (double (*)[ny][nx])(pv);
// double (*w)[ny][nx] = (double (*)[ny][nx])(pw);
// double (*T)[ny][nx] = (double (*)[ny][nx])(pT);
//
// fp = fopen("opencfd.format", "w");
//
// fprintf(fp, "variables=x,y,z,d,u,v,w,T\n");
// fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", nx, ny, nz);
// for(int k = 0; k < nz; k++){
// for(int j = 0; j < ny; j++){
// for(int i = 0; i < nx; i++){
// fprintf(fp, "%32.10lf%32.10lf%32.10lf%32.10lf%32.10lf%32.10lf%32.10lf%32.10lf\n",
// xx3d[k][j][i], yy3d[k][j][i], zz3d[k][j][i],
// d[k][j][i], u[k][j][i], v[k][j][i],
// w[k][j][i], T[k][j][i]);
// }
// }
// }
//
// fclose(fp);
//}
void Finalize(){
free(x3d);
free(y3d);
free(z3d);
free(head);
free(pd);
free(pu);
free(pv);
free(pw);
free(pT);
}
! read-flow v1.2 for compression conner
! Mach 2.9-24 compression corner
implicit doubleprecision (a-h,o-z)
real*8,allocatable,dimension(:,:,:):: d,u,v,w,T
real*8,allocatable,dimension(:,:):: d0,u0,v0,w0,T0,us0,yh
real*8,allocatable,dimension(:,:)::xx,yy
real*8,allocatable,dimension(:):: pw0,uvd,up,Ret,Ut,length
real*8 tt, length_min
integer istep,if_read_average
!------------------------------------------------------
open(33,file="opencfd.in")
do k=1,4
read(33,*)
enddo
read(33,*) nx,ny,nz
do k=1,7
read(33,*)
enddo
read(33,*) tmp, tmp, SLZ
read(33,*)
read(33,*) Re
close(33)
!------------------------------------------------------
allocate(d(nx,ny,nz),u(nx,ny,nz),v(nx,ny,nz),w(nx,ny,nz), T(nx,ny,nz))
allocate(d0(nx,ny),u0(nx,ny),v0(nx,ny),w0(nx,ny),T0(nx,ny),us0(nx,ny),yh(nx,ny))
allocate(xx(nx,ny),yy(nx,ny),pw0(nx),up(ny),uvd(ny),Ret(nx),Ut(nx),length(nx))
print*, "nx, ny ,nz =", nx,ny,nz
print*, "SLZ, Re=", SLZ,Re
!------------------------------------------------------
gamma=1.4d0
PI=3.14159265358979d0
seta0=24.d0*PI/180.d0 !conner angle
hz=SLZ/nz !展向周期边条
T_ref=108.1d0
Tsb=110.4/T_ref
Tw=2.84d0
Amu_w=1.0/Re*(1.0+Tsb)*sqrt(Tw**3)/(Tsb+Tw)
!---------read grid message ---------------------------
open(66,file="OCFD2d-Mesh.dat",form="unformatted")
read(66) xx
read(66) yy
close(66)
!---------read data file-------------------------------
pw0=0.d0;d0=0.d0;u0=0.d0;v0=0.d0;w0=0.d0;T0=0.d0
print*,"read opencfd.dat for (0) & read opencfd.dat.average for (1)"
read(*,*) if_read_average
if (if_read_average .eq. 1) then
open(33,file="opencfd.dat.average",form="unformatted")
else
open(33,file="opencfd.dat",form="unformatted")
end if
print*, 'reading data......'
read(33) Istep,tt
print*, "Istep,tt=",Istep,tt
call read3d(33,d,nx,ny,nz)
call read3d(33,u,nx,ny,nz)
call read3d(33,v,nx,ny,nz)
call read3d(33,w,nx,ny,nz)
call read3d(33,T,nx,ny,nz)
close(33)
print*, "read data OK ..."
!---------------------展项平均---------------------------------
do i=1,nx
do k=1,nz
pw0(i)=pw0(i)+d(i,1,k)*T(i,1,k)
enddo
enddo
do k=1,nz
do j=1,ny
do i=1,nx
d0(i,j)=d0(i,j)+d(i,j,k)
u0(i,j)=u0(i,j)+u(i,j,k)
v0(i,j)=v0(i,j)+v(i,j,k)
w0(i,j)=w0(i,j)+w(i,j,k)
T0(i,j)=T0(i,j)+T(i,j,k)
enddo
enddo
enddo
d0=d0/nz
u0=u0/nz
v0=v0/nz
w0=w0/nz
T0=T0/nz
pw0=pw0/nz
!------------------------------------------------------
if (if_read_average .eq. 1) then
open(44,file="pw-av.dat")
else
open(44,file="pw-ins.dat")
endif
write(44,*) "variables=x,p"
do i=1,nx
write(44,*) xx(i,1),pw0(i)
enddo
close(44)
!------------------------------------------------------
! do j=1,ny
! do i=1,nx
! if(xx(i,1) .le. 0) then
! seta=0.d0
! else
! seta=seta0
! endif
! yh(i,j)=sqrt( ( (xx(i,j)-xx(i,1)) * (1.d0-cos(seta)) ) **2 &
! +((yy(i,j)-yy(i,1))*(1.d0-sin(seta))) **2 )
! us0(i,j)=u0(i,j)*cos(seta)+v0(i,j)*sin(seta) !切向速度
! enddo
! enddo
!------------------------------------------------------
print*, "comput yh ..."
! seta2d=0.d0
yh=0.d0
do j=1,ny
! print*, "j=",j
do i=1,nx!控制流场动点
length_min=10000.d0
do iw=1,nx!控制壁面动点,搜寻两点间最短距离length
length(iw)=dsqrt((xx(i,j)-xx(iw,1))**2+(yy(i,j)-yy(iw,1))**2)
if(length(iw).le.length_min)then
length_min=length(iw)
! i0=iw
endif
enddo
yh(i,j)=length_min
! seta2d(i,j)=seta(i0)
if(xx(i,1) .le. 0)then
seta=0.d0
else
seta=seta0
end if
us0(i,j)=u0(i,j)*cos(seta)+v0(i,j)*sin(seta) !切向速度
enddo
enddo
!------------------------------------------------------
print*, "comput Cf ..."
if(if_read_average .eq. 1)then
open(55,file="cf-av.dat")
else
open(55,file="cf-ins.dat")
endif
do i=1,nx
us1=us0(i,2) ; us2=us0(i,3) ; h1=yh(i,2) ; h2=yh(i,3)
uy=(h2*h2*us1-h1*h1*us2)/(h2*h2*h1-h1*h1*h2)
tw=Amu_w*uy
Ut(i)=sqrt(abs(tw)/d0(i,1))
Ret(i)= d0(i,1)*Ut(i)/Amu_w
write(55,*) xx(i,1), 2.d0*tw, Ret(i)
enddo
close(55)
!------------------------------------------------------
print*, "Comput delt0, delt1, delt2 "
if (if_read_average .eq. 1) then
open(66,file="delta-av.dat")
else
open(66,file="delta-ins.dat")
endif
do i=1,nx
delt0=0.d0
delt1=0.d0
delt2=0.d0
do j=1,ny
if( us0(i,j) .gt. 0.99d0) goto 200
enddo
200 continue
j0=j-1
delt0= yh(i,j0) !边界层位移厚度
ue=us0(i,j0)
de=d0(i,j0)
!print*, " j_0.99 , ue, de =", j0-1 , ue, de
a1 = j0 + 0.0
do j=2,j0
delt1=delt1+(1.d0-d0(i,j)*us0(i,j)/(ue*de))*(yh(i,j)-yh(i,j-1))
delt2=delt2+d0(i,j)*us0(i,j)/(ue*de)*(1.d0-us0(i,j)/ue)*(yh(i,j)-yh(i,j-1))!动量边界层厚度
enddo
write(66,"(5f15.6)") a1,xx(i,1),delt0,delt1,delt2
enddo
close(66)
!------------------------------------------------------
print*, "output one-dimension profiles, please input i0 "
read(*,*) i0
print*, "x=",xx(i0,1)
if (if_read_average .eq. 1) then
open(99,file="U1d-av.dat")
else
open(99,file="U1d-ins.dat")
endif
uvd(1)=0.d0
up(1)=0.d0
write(99,*) "variables=yp,up,uvd,u_log"
do j=2,ny-1
yp=yh(i0,j)*Ret(i0)
up(j)=us0(i0,j)/ut(i0)
uvd(j)=uvd(j-1)+sqrt(d0(i0,j)/d0(i0,1))*(up(j)-up(j-1))
write(99,"(6f16.8)") yp, up(j),uvd(j),2.44*log(yp)+5.1d0
enddo
close(99)
if (if_read_average .eq. 1) then
open(100,file="U1da-av.dat")
else
open(100,file="U1da-ins.dat")
endif
do j=1,ny
write(100,"(6f16.8)") yh(i0,j),us0(i0,j),d0(i0,j),T0(i0,j)
enddo
close(100)
!------------------------------------------------------
if(if_read_average .eq. 1)then
print*,"writing flow2d_av..."
open(44,file="flow2d-av.dat")
write(44,*) "variables=x,y,d,u,v,w,T,p,s"
write(44,*) "zone i= ",nx, " j= ",ny
do j=1,ny
do i=1,nx
write(44,"(9f15.6)") xx(i,j),yy(i,j),d0(i,j),u0(i,j),v0(i,j),w0(i,j),T0(i,j), &
d0(i,j)*T0(i,j), T0(i,j)*d0(i,j)/d0(i,j)**gamma
enddo
enddo
close(44)
endif
!------------------------------------------------------
if(if_read_average .eq. 0)then
print*,"writing flow2d_xy..."
print*, "please input k"
read(*,*) k
open(44,file="flow2d_xy.dat")
write(44,*) "variables=x,y,z,d,u,v,w,T,p,s"
write(44,*) "zone i= ",nx, " j= ",ny
! k=nz/2+1
z=(k-1.)*hz
do j=1,ny
do i=1,nx
write(44,"(9f15.6)") xx(i,j),yy(i,j),z,d(i,j,k),u(i,j,k),v(i,j,k),w(i,j,k),T(i,j,k), &
d(i,j,k)*T(i,j,k),T(i,j,k)*d(i,j,k)/d(i,j,k)**gamma
enddo
enddo
close(44)
!------------------------------------------------------
print*,"writing flow2d_xz..."
print*, "please input j"
read(*,*) j
print*, "yn=", sqrt((xx(1,j)-xx(1,1))**2+(yy(1,j)-yy(1,1))**2)
open(44,file="flow2d_xz.dat")
write(44,*) "variables=x,y,z,d,u,v,w,T,p,s,us"
write(44,*) "zone i= ",nx, " j= ",nz
do k=1,nz
do i=1,nx
z=(k-1.)*hz
if(xx(i,j) .gt. 0 ) then
us=u(i,j,k)*cos(seta0)+v(i,j,k)*sin(seta0)
else
us=u(i,j,k)
endif
write(44,"(10f15.6)") xx(i,j),yy(i,j),z,d(i,j,k),u(i,j,k), &
v(i,j,k),w(i,j,k),T(i,j,k), &
d(i,j,k)*T(i,j,k), T(i,j,k)*d(i,j,k)/d(i,j,k)**gamma,us
enddo
enddo
close(44)
!------------------------------------------------------
print*,"writing flow2d_yz..."
print*, "please input i"
read(*,*) i
print*, "x=", xx(i,1)
open(44,file="flow2d_yz.dat")
write(44,*) "variables=x,y,z,d,u,v,w,T,p,s"
write(44,*) "zone i= ",ny, " j= ",nz
do k=1,nz
do j=1,ny
z=(k-1.)*hz
write(44,"(9f15.6)") xx(i,j),yy(i,j),z,d(i,j,k),u(i,j,k), &
v(i,j,k),w(i,j,k),T(i,j,k), &
d(i,j,k)*T(i,j,k), T(i,j,k)*d(i,j,k)/d(i,j,k)**gamma
enddo
enddo
close(44)
end if
!------------------------------------------------------
end
subroutine read3d(no,u,nx,ny,nz)
real*8 u(nx,ny,nz)
print*, "read 3d data ..."
do k=1,nz
read(no) u(:,:,k)
enddo
end
nx ny nz
25 240 20
nx_inlet nx_conner nx_buff
12 12 1
dx_inlet Lx_inlet Lx_conner alfax_buff
0.05 300. 50. 1.01
sw_angle comp_angle
0. 24.
High hy_wall Lz
35. 0.01 14.
Tecplot2D Mesh2D Tecplot3D
1 1 0
//Mesh for swept-compression-ramp, coded by Dglin, 2019-11
#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define PI 3.1415926535897932
FILE *fp;
MPI_File tmp_file;
MPI_Status status;
char str[100];
int my_id, n_processe;
int Tec1, Tec2, Mesh2D;
int nx, ny, nz, N, NZ, *NPZ, *NP;
int nx_inlet, nx_conner, nx_buff;
double dx_inlet, Lx_inlet, Lx_conner, alfax_buff;
double sw_angle, comp_angle;
double High, hy_wall, Lz;
double hx0, R;
double *xa, *xb, *ya, *yb, *xx, *yy, *xs, *ys, *x3d, *y3d, *z3d;
void mpi_init(int *Argc, char ***Argv);
void Read_parameter();
void gridx_inlet(int nx, double Length, double dx1, double dx2, double *xx);
void gridx();
void gridxy();
void gridxyz();
void Wall_Orthonormalization();
void output();
void Finalize();
void output1d(int n);
void output2d(int nx, int ny, double *xx);
void output3d(int nx, int ny, int nz, double *xx);
int main(int argc, char *argv[]){
mpi_init(&argc , &argv);
Read_parameter();
gridx_inlet(nx_inlet + 1, Lx_inlet, dx_inlet, hx0, xa);
gridx();
gridxy();
Wall_Orthonormalization();
gridxyz();
output();
//output1d(nx);
//output2d(nx, ny, xx);
Finalize();
return 0;
}
void mpi_init(int *Argc , char *** Argv){
MPI_Init(Argc, Argv);
MPI_Comm_rank(MPI_COMM_WORLD , &my_id);
MPI_Comm_size(MPI_COMM_WORLD, &n_processe);
}
void Read_parameter(){
if(my_id == 0){
if((fp = fopen("swept-compression-grid.in", "r")) == NULL){
printf("Can't open this file: 'swept-compression-grid.in'\n");
exit(0);
}
fgets(str, 100, fp);
fscanf(fp, "%d%d%d%d\n", &nx,&ny,&nz,&N);
fgets(str, 100, fp);
fscanf(fp, "%d%d%d\n", &nx_inlet, &nx_conner, &nx_buff);
fgets(str, 100, fp);
fscanf(fp, "%lf%lf%lf%lf\n", &dx_inlet, &Lx_inlet, &Lx_conner, &alfax_buff);
fgets(str, 100, fp);
fscanf(fp, "%lf%lf\n", &sw_angle, &comp_angle);
fgets(str, 100, fp);
fscanf(fp, "%lf%lf%lf\n", &High, &hy_wall, &Lz);
fgets(str, 100, fp);
fscanf(fp, "%d%d%d\n", &Tec1, &Mesh2D, &Tec2);
fclose(fp);
if(nx_inlet + nx_conner + nx_buff != nx){
printf("Error ! nx_conner+nx_inlet+nx_buff != nx\n");
exit(0);
}
printf("Read_parameter is OK!\n");
printf("The Number of total Processes is %d!\n", N);
}
int tmp1[10];
double tmp2[9];
if(my_id == 0){
tmp1[0] = nx;
tmp1[1] = ny;
tmp1[2] = nz;
tmp1[3] = N;
tmp1[4] = nx_inlet;
tmp1[5] = nx_conner;
tmp1[6] = nx_buff;
tmp1[7] = Tec1;
tmp1[8] = Mesh2D;
tmp1[9] = Tec2;
tmp2[0] = dx_inlet;
tmp2[1] = Lx_inlet;
tmp2[2] = Lx_conner;
tmp2[3] = alfax_buff;
tmp2[4] = sw_angle;
tmp2[5] = comp_angle;
tmp2[6] = High;
tmp2[7] = hy_wall;
tmp2[8] = Lz;
}
MPI_Bcast(tmp1, 10, MPI_INT, 0, MPI_COMM_WORLD);
MPI_Bcast(tmp2, 9, MPI_DOUBLE, 0, MPI_COMM_WORLD);
if(my_id != 0){
nx = tmp1[0];
ny = tmp1[1];
nz = tmp1[2];
N = tmp1[3];
nx_inlet = tmp1[4];
nx_conner = tmp1[5];
nx_buff = tmp1[6];
Tec1 = tmp1[7];
Mesh2D = tmp1[8];
Tec2 = tmp1[9];
dx_inlet = tmp2[0];
Lx_inlet = tmp2[1];
Lx_conner = tmp2[2];
alfax_buff = tmp2[3];
sw_angle = tmp2[4];
comp_angle = tmp2[5];
High = tmp2[6];
hy_wall = tmp2[7];
Lz = tmp2[8];
}
sw_angle = sw_angle * PI / 180.;
comp_angle = comp_angle * PI / 180.;
hx0 = 2. * Lx_conner/(nx_conner - 1);
R = Lx_conner/tan(comp_angle/2.) - High;
NZ = nz/N;
if(my_id < nz%N) NZ += 1;
NPZ = (int*)malloc(N * sizeof(int));
NP = (int*)malloc(N * sizeof(int));
memset((void*)NPZ, 0, N);
memset((void*)NP, 0, N);
for(int i = 0; i < N; i++){
if(i < nz%N){
NPZ[i] = (int)nz/N + 1;
}else{
NPZ[i] = (int)nz/N;
}
NP[0] = 0;
if(i != 0) NP[i] = NP[i-1] + NPZ[i-1];
}
if(NP[N-1] != nz-NPZ[N-1]) printf("NP is wrong![debug]\n");
xa = (double*)malloc(nx * sizeof(double));
xb = (double*)malloc(nx * sizeof(double));
ya = (double*)malloc(nx * sizeof(double));
yb = (double*)malloc(nx * sizeof(double));
xx = (double*)malloc(nx * ny * sizeof(double));
yy = (double*)malloc(nx * ny * sizeof(double));
if(N != n_processe){
if(my_id == 0) printf("The Number of total Processes is not equal to N!\n");
MPI_Finalize();
exit(0);
}
}
void gridx_inlet(int nx, double Length, double dx1, double dx2, double *xx){
double dx, x, Ah1, Sh0, Sh1;
dx = Length/(nx - 1.);
if(my_id == 0) printf("dx1 is %lf, dx0 is %lf, dx2 is %lf!\n", dx1, dx, dx2);
if((dx < dx1 && dx < dx2) || (dx > dx1 && dx > dx2)){
if(my_id == 0) printf("warning ! dx0 should between dx1 and dx2 !!!\n");
}
for(int i = 1; i <= nx; i++){
x = (i -1.)/(nx - 1.);
Ah1 = (1. - 2. * (x - 1.)) * x * x;
Sh0 = x * pow(x - 1.,2);
Sh1 = (x - 1.) * x * x;
*(xx + i - 1) = Length * Ah1 + dx1 * (nx -1.) * Sh0 + dx2 * (nx - 1.) * Sh1;
}
}
void gridx(){
double seta, dx;
//inlet region
for(int i = 0; i < nx_inlet; i++){
xa[i] = xa[i] - Lx_conner - Lx_inlet;
ya[i] = 0.;
xb[i] = xa[i];
yb[i] = High;
}
//conner region
for(int i = 0; i < nx_conner; i++){
seta = comp_angle * i /(nx_conner - 1.);
if(seta < comp_angle/2){
xa[i + nx_inlet] = i * hx0 - Lx_conner;
ya[i + nx_inlet] = 0.;
}else
{
xa[i + nx_inlet] = (i * hx0 - Lx_conner) * cos(comp_angle);
ya[i + nx_inlet] = (i * hx0 - Lx_conner) * sin(comp_angle);
}
xb[i + nx_inlet] = R * sin(seta) - Lx_conner;
yb[i + nx_inlet] = R * (1. - cos(seta)) + High;
}
//buff region
for(int i = 0; i < nx_buff; i++){
dx = (xa[i + nx_inlet + nx_conner -1] - xa[i + nx_inlet + nx_conner - 2]) * alfax_buff;
xa[i + nx_inlet + nx_conner] = xa[i + nx_inlet + nx_conner -1] + dx;
ya[i + nx_inlet + nx_conner] = ya[i + nx_inlet + nx_conner -1] + dx * tan(comp_angle);
xb[i + nx_inlet + nx_conner] = xb[i + nx_inlet + nx_conner -1] + dx;
yb[i + nx_inlet + nx_conner] = yb[i + nx_inlet + nx_conner -1] + dx * tan(comp_angle);
}
MPI_Barrier(MPI_COMM_WORLD);
if(my_id == 0) printf("Comput gridx is OK!\n");
}
void gridxy(){
double SL, dy, delta, bnew, fb, fbx, s, sy, a, b = 3.5, continue_b = 0;
double (*x)[nx] = (double(*)[nx])(xx);
double (*y)[nx] = (double(*)[nx])(yy);
for(int i = 0; i < nx; i++){
SL = sqrt(pow(xb[i] - xa[i], 2) + pow(yb[i] - ya[i], 2));
dy = 1. / (ny - 1.);
delta = hy_wall / SL;
do{
continue_bnew:;
fb = (exp(b / (ny - 1.)) - 1.)/(exp(b) - 1.) - delta;
fbx = (exp(b / (ny - 1.))/(ny - 1.)*(exp(b) - 1.) -
(exp(b / (ny - 1.)) - 1.)*exp(b))/pow(exp(b) - 1., 2);
bnew = b - fb / fbx;
b = bnew;
continue_b += 1;
}
while(abs(bnew - b) > 1.e-6);
if(continue_b < 10) goto continue_bnew;
a = 1./(exp(b) - 1.);
for(int j = 0; j < ny; j++){
s = j * dy;
sy = a * (exp(s * b) - 1);
x[j][i] = xa[i] + (xb[i] - xa[i]) * sy;
y[j][i] = ya[i] + (yb[i] - ya[i]) * sy;
}
}
MPI_Barrier(MPI_COMM_WORLD);
if(my_id == 0) printf("Comput gridxy is OK!\n");
}
void gridxyz(){
double z, tmp_inlet, tmp_conner;
x3d = (double*)malloc(nx * ny * NZ * sizeof(double));
y3d = (double*)malloc(nx * ny * NZ * sizeof(double));
z3d = (double*)malloc(nx * ny * NZ * sizeof(double));
double (*x)[nx] = (double (*)[nx])(xx);
double (*y)[nx] = (double (*)[nx])(yy);
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
//for(int i = 0; i < nx_conner; i++){
//
// sx[j][i + nx_inlet] = sx[j][nx_inlet - 1] + x[j][i + nx_inlet] - tmp_inlet;
// sy[j][i + nx_inlet] = y[j][i + nx_inlet];
// x[j][i + nx_inlet] = x[j][nx_inlet - 1] + x[j][i + nx_inlet] - tmp_inlet;
//}
//
//for(int i = 0; i < nx_buff; i++){
//
// lx_buff = x[j][nx - 1] - tmp_conner;
// lx_buff_left = lx_buff + (N - my_id - 1) * Lz * tan(sw_angle)/N;
// lx_buff_right = lx_buff + (N - my_id) * Lz * tan(sw_angle)/N;
//
// sx[j][i + nx_inlet + nx_conner] = (x[j][i +nx_inlet + nx_conner] -
// tmp_conner) * lx_buff_right / lx_buff + sx[j][nx_inlet + nx_conner - 1];
//
// sy[j][i + nx_inlet + nx_conner] = (y[j][i +nx_inlet + nx_conner] -
// y[j][nx_inlet + nx_conner - 1]) * lx_buff_right / lx_buff + y[j][nx_inlet + nx_conner - 1];
// x[j][i + nx_inlet + nx_conner] = (x[j][i +nx_inlet + nx_conner] -
// tmp_conner) * lx_buff_left / lx_buff + x[j][nx_inlet + nx_conner - 1];
//}
// }
for(int k = 0; k < NZ; k++){
z = k*Lz*(NPZ[my_id] - 1) / ((NZ - 1)*(nz - 1)) + NP[my_id]*Lz/(nz - 1);
for(int j = 0; j < ny; j++){
tmp_inlet = x[j][nx_inlet - 1];
for(int i = 0; i < nx_inlet; i++){
xx3d[k][j][i] = (x[j][i] - x[j][0])*(Lx_inlet - Lz*tan(sw_angle) + Lz/(nz - 1)*(k+NP[my_id])*tan(sw_angle))/Lx_inlet + x[j][0];
yy3d[k][j][i] = y[j][i];
zz3d[k][j][i] = z;
}
for(int i = nx_inlet; i < nx; i++){
xx3d[k][j][i] = xx3d[k][j][nx_inlet - 1] + x[j][i] - tmp_inlet;;
yy3d[k][j][i] = y[j][i];
zz3d[k][j][i] = z;
}
}
}
MPI_Barrier(MPI_COMM_WORLD);
if(my_id == 0) printf("Comput gridxyz is OK!\n");
}
void Wall_Orthonormalization(){
int Maxstep = 10, Jmax = 20;
double b = 3., qn, qnx, qny, s;
double *dx, *dy, *dx1, *dy1;
double (*x)[nx] = (double(*)[nx])(xx);
double (*y)[nx] = (double(*)[nx])(yy);
dx = (double *)malloc(nx * sizeof(double));
dy = (double *)malloc(nx * sizeof(double));
dx1 = (double *)malloc(nx * sizeof(double));
dy1 = (double *)malloc(nx * sizeof(double));
for(int mstep = 0; mstep < Maxstep; mstep++){
for(int j = 1; j < Jmax; j++){
dx[0] = 0.;
dy[0] = 0.;
dx[nx - 1] = 0.;
dy[nx - 1] = 0.;
for(int i = 1; i < nx - 1; i++){
qn = sqrt(pow(x[j][i + 1] - x[j][i - 1],2) + pow(y[j][i + 1] - y[j][i - 1], 2));
qnx = -(y[j][i + 1] - y[j][i - 1])/qn;
qny = (x[j][i + 1] - x[j][i - 1])/qn;
s = (x[j][i] - x[j - 1][i])*qnx + (y[j][i] - y[j - 1][i])*qny;
dx[i] = s * qnx - (x[j][i] - x[j - 1][i]);
dy[i] = s * qny - (y[j][i] - y[j - 1][i]);
}
for(int i = 1; i < nx - 1; i++){
dx1[i] = (dx[i - 1] + 2. * dx[i] + dx[i + 1])/4.;
dy1[i] = (dy[i - 1] + 2. * dy[i] + dy[i + 1])/4.;
x[j][i] = x[j][i] + exp(-b * j / Jmax)/2. * dx1[i];
y[j][i] = y[j][i] + exp(-b * j / Jmax)/2. * dy1[i];
}
}
}
free(dx);
free(dy);
free(dx1);
free(dy1);
MPI_Barrier(MPI_COMM_WORLD);
if(my_id == 0) printf("Wall_Orthonormalization is OK!\n");
}
#define FWRITE(ptr , size , num , stream){\
int _ENCODE_START = num * size;\
int _ENCODE_END = num * size;\
fwrite(&_ENCODE_START, sizeof(int), 1, stream);\
fwrite(ptr, size, num, stream);\
fwrite(&_ENCODE_END, sizeof(int), 1, stream);\
}
#define FWRITE_MPI(ptr , size , num , stream){\
int _ENCODE_START = num * size;\
int _ENCODE_END = num * size;\
MPI_File_write(stream, &_ENCODE_START, 1, MPI_INT, &status);\
MPI_File_write(stream, ptr, size, MPI_DOUBLE, &status);\
MPI_File_write(stream, &_ENCODE_END, 1, MPI_INT, &status);\
}
void output(){
int num = nx * ny;
int num_byte = nx * ny * sizeof(double);
double (*x)[nx] = (double(*)[nx])(xx);
double (*y)[nx] = (double(*)[nx])(yy);
double (*xx3d)[ny][nx] = (double (*)[ny][nx])(x3d);
double (*yy3d)[ny][nx] = (double (*)[ny][nx])(y3d);
double (*zz3d)[ny][nx] = (double (*)[ny][nx])(z3d);
if(my_id == 0){
fp = fopen("y1d.dat", "w");
for(int j = 0; j < ny; j++){
fprintf(fp, "%15.6f\n", y[j][0]);
}
fclose(fp);
if(Tec1 == 1){
fp = fopen("gridxy.dat", "w");
fprintf(fp, "variables=x,y\n");
fprintf(fp, "zone i=%d ,j=%d\n", nx, ny);
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx; i++){
fprintf(fp, "%15.6f%15.6f\n", x[j][i], y[j][i]);
}
}
fclose(fp);
}
if(Mesh2D == 1){
fp = fopen("OCFD2d-Mesh.dat", "w");
FWRITE(xx, sizeof(double), num, fp);
FWRITE(yy, sizeof(double), num, fp);
fclose(fp);
}
}
MPI_File_open(MPI_COMM_WORLD, "OCFD3d-Mesh.dat", MPI_MODE_WRONLY | MPI_MODE_CREATE, MPI_INFO_NULL, &tmp_file);
MPI_File_seek(tmp_file, 0, MPI_SEEK_SET);
if(my_id == 0) printf("Write X3d ...\n");
MPI_File_seek(tmp_file, NP[my_id]*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
for(int k = 0; k < NZ; k++){
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, x3d+num*k, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("Write Y3d ...\n");
for(int k = 0; k < NZ; k++){
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, y3d+num*k, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
MPI_File_seek(tmp_file, (nz-NZ)*(num*sizeof(double) + 2*sizeof(int)), MPI_SEEK_CUR);
if(my_id == 0) printf("Write Z3d ...\n");
for(int k = 0; k < NZ; k++){
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
MPI_File_write(tmp_file, z3d+num*k, num, MPI_DOUBLE, &status);
MPI_File_write(tmp_file, &num_byte, 1, MPI_INT, &status);
}
//output3d(nx, ny, nz, z3d);
MPI_File_close(&tmp_file);
if(Tec2 == 1){
if(my_id == 0){
fp = fopen("grid.dat", "w");
fprintf(fp, "variables=x,y,z\n");
fprintf(fp, "zone i=%d ,j=%d ,k=%d\n", nx, ny, nz);
}
for(int n = 0; n < N; n++){
if(my_id == 0){
for(int k = 0; k < NPZ[n]; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx; i++){
fprintf(fp, "%15.6f%15.6f%15.6f\n", xx3d[k][j][i], yy3d[k][j][i], zz3d[k][j][i]);
}
}
}
}
if(my_id != 0){
MPI_Send(x3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(y3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
MPI_Send(z3d, nx*ny*NPZ[my_id], MPI_DOUBLE, my_id-1, 1, MPI_COMM_WORLD);
}
if(my_id != N-1){
MPI_Recv(x3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(y3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
MPI_Recv(z3d, nx*ny*NPZ[my_id+1], MPI_DOUBLE, my_id+1, 1, MPI_COMM_WORLD, &status);
}
}
if(my_id == 0) fclose(fp);
}
}
void Finalize(){
free(xa);
free(ya);
free(xb);
free(yb);
free(xx);
free(yy);
free(x3d);
free(y3d);
free(z3d);
MPI_Finalize();
}
void output1d(int n){
fp = fopen("grid1d.dat", "w");
for(int i = 0; i < n; i++){
fprintf(fp, "%d\t%16.8f%16.8f%16.8f%16.8f\n", i, *(xa + i), *(ya + i), *(xb + i), *(yb + i));
}
fclose(fp);
}
void output2d(int nx, int ny, double *xx){
double (*x)[nx] = (double(*)[nx])(xx);
for(int j = 0; j < ny; j++){
for(int i =0; i < nx; i++){
printf("%d\t%d\t%lf\n", i, j, x[j][i]);
}
}
}
void output3d(int nx, int ny, int nz, double *xx){
double (*x)[ny][nx] = (double(*)[ny][nx])(xx);
for(int k = 0; k < nz; k++){
for(int j = 0; j < ny; j++){
for(int i = 0; i < nx; i++){
printf("%d\t%d\t%d\t%lf\n", i, j, k, x[k][j][i]);
}
}
}
}
#ifndef __OCFD_COMPUTE_JACOBIAN3D_H
#define __OCFD_COMPUTE_JACOBIAN3D_H
#include "parameters.h"
#ifdef __cplusplus
extern "C"{
#endif
void Init_Jacobian3d();
void Comput_Jacobian3d();
void comput_Jac3d();
void boundary_Jac3d_Axx();
void boundary_Jac3d_Liftbody_Ajac();
void boundary_Jac3d_kernal_y_ramp_wall(REAL seta);
void boundary_Jac3d_kernal_z_cone_wall(REAL seta1, REAL seta2);
#if ((defined __NVCC__) || (defined __HIPCC__))
#include "cuda_commen.h"
__global__ void comput_Jac3d_kernal(
cudaField xi,cudaField xj,cudaField xk,cudaField yi,cudaField yj,cudaField yk,cudaField zi,cudaField zj,cudaField zk,cudaField Akx,
cudaField Aky,cudaField Akz,cudaField Aix,cudaField Aiy,cudaField Aiz,cudaField Asx,cudaField Asy,cudaField Asz,cudaField Ajac,
cudaJobPackage job);
#endif
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
#ifndef __OCFD_IO_H
#define __OCFD_IO_H
#include "stdio.h"
#include "parameters.h"
#ifdef __cplusplus
extern "C"{
#endif
void read_file(int Iflag_av , REAL * pd , REAL * pu , REAL * pv , REAL * pw , REAL * pT);
void OCFD_save(int Iflag_av, int Istep_name , REAL * pd , REAL * pu , REAL * pv , REAL * pw , REAL * pT);
void write_3d1(MPI_File pfile, MPI_Offset offset, REAL * pU);
void read_3d1(MPI_File pfile, MPI_Offset offset, REAL * pU);
#ifdef __cplusplus
}
#endif
#endif
#ifndef __OCFD_IO_MPI_H
#define __OCFD_IO_MPI_H
#include "parameters.h"
#ifdef __cplusplus
extern "C"{
#endif
void write_2d_XY(FILE * file, int ka, int size_x, int size_y, int lap, int *pU, REAL *pU1);
void write_2d_XYa(FILE * file, int ka, REAL *pU);
void write_2d_YZa(FILE * file, int ia, REAL *pU);
void write_2d_XZa(FILE * file, int ja, REAL *pU);
void write_points(FILE * file, REAL * pU, int mpoints, int *ia, int *ja, int *ka);
void read_3d(MPI_File file, MPI_Offset offset, REAL *pU);
void write_3d(MPI_File file, MPI_Offset offset, REAL *pU);
void write_blockdata(FILE * file, REAL * pU, int ib, int ie, int jb, int je, int kb, int ke);
#ifdef __cplusplus
}
#endif
#endif
#ifndef __OCFD_NS_JACOBIAN_H
#define __OCFD_NS_JACOBIAN_H
#include "parameters.h"
#include "cuda_commen.h"
#ifdef __cplusplus
extern "C"{
#endif
void du_invis_Jacobian3d_init(cudaJobPackage job_in, cudaStream_t *stream);
void du_invis_Jacobian3d_x(cudaJobPackage job_in, cudaSoA *fp, cudaSoA *fm, cudaStream_t *stream);
//void du_invis_Jacobian3d_x(cudaJobPackage job_in, cudaSoA *fp_x, cudaSoA *fm_x, cudaSoA *fp_y, cudaSoA *fm_y, cudaSoA *fp_z, cudaSoA *fm_z, cudaStream_t *stream);
void du_invis_Jacobian3d_y(cudaJobPackage job_in, cudaSoA *fp, cudaSoA *fm, cudaStream_t *stream);
void du_invis_Jacobian3d_z(cudaJobPackage job_in, cudaSoA *fp, cudaSoA *fm, cudaStream_t *stream);
void du_viscous_Jacobian3d_init(cudaStream_t *stream);
void du_viscous_Jacobian3d_x_init(cudaStream_t *stream);
void du_viscous_Jacobian3d_x_final(cudaJobPackage job_in, cudaStream_t *stream);
void du_viscous_Jacobian3d_y_init(cudaStream_t *stream);
void du_viscous_Jacobian3d_y_final(cudaJobPackage job_in, cudaStream_t *stream);
void du_viscous_Jacobian3d_z_init(cudaStream_t *stream);
void du_viscous_Jacobian3d_z_final(cudaJobPackage job_in, cudaStream_t *stream);
void boundary_symmetry_pole_vis_y(cudaStream_t *stream);
/* ============= */
void vis_flux_ker_x_warp();
void vis_flux_ker_y_warp();
void vis_flux_ker_z_warp();
void boundary_symmetry_pole_vis_y_warp();
typedef struct vis_flux_
{
cudaField uk;
cudaField vk;
cudaField wk;
cudaField ui;
cudaField vi;
cudaField wi;
cudaField us;
cudaField vs;
cudaField ws;
cudaField Tk;
cudaField Ti;
cudaField Ts;
cudaField Amu;
cudaField u;
cudaField v;
cudaField w;
cudaField Ax;
cudaField Ay;
cudaField Az;
cudaField Ajac;
cudaField Akx;
cudaField Aky;
cudaField Akz;
cudaField Aix;
cudaField Aiy;
cudaField Aiz;
cudaField Asx;
cudaField Asy;
cudaField Asz;
cudaField Ev1;
cudaField Ev2;
cudaField Ev3;
cudaField Ev4;
} vis_flux;
/* ===================== */
/*#if ((defined __NVCC__) || (defined __HIPCC__))
__global__ void vis_flux_ker(
cudaField Akx,cudaField Aky,cudaField Akz,cudaField Ajac,
cudaField s11,cudaField s12,cudaField s13,cudaField s22,cudaField s23,cudaField s33,cudaField E1,cudaField E2,cudaField E3,
cudaField Ev1,cudaField Ev2,cudaField Ev3,cudaField Ev4,
cudaJobPackage job);
__global__ void vis_flux_init_ker(
cudaField uk,cudaField vk,cudaField wk,cudaField Tk,cudaField ui,cudaField vi,cudaField wi,cudaField Ti,cudaField us,cudaField vs,cudaField ws,cudaField Ts,
cudaField Akx,cudaField Aky,cudaField Akz,cudaField Aix,cudaField Aiy,cudaField Aiz,cudaField Asx,cudaField Asy,cudaField Asz,
cudaField Amu,
cudaField u,cudaField v,cudaField w,
cudaField s11,cudaField s22,cudaField s33,cudaField s12,cudaField s13,cudaField s23,
cudaField E1,cudaField E2,cudaField E3,
cudaJobPackage job
);
__global__ void final_flux_ker(cudaSoA du , cudaField df1 , cudaField df2 , cudaField df3 , cudaField df4 , cudaField AJac, cudaJobPackage job);
#endif
*/
#ifdef __cplusplus
}
#endif
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment