From e4e4534cf2924697b2be5131b64ffa80a40efa1b Mon Sep 17 00:00:00 2001 From: Antoine Hoffmann <antoine.hoffmann@epfl.ch> Date: Thu, 13 Apr 2023 10:10:55 +0200 Subject: [PATCH] saving scripts --- matlab/plot/show_moments_spectrum.m | 10 +- .../Dimits_2000_fig3_bdiam.txt | 4 + .../Dimits_2000_fig3_full_no_GF.txt | 21 ++++ .../Dimits_2000_fig3_plus.txt | 5 + .../Dimits_2000_fig3_stars.txt | 5 + .../Dimits_2000_fig3_wdiam.txt | 8 ++ .../Ivanov_2020_fig2_kT_0.26_chi_0.1.txt | 17 +++ .../Ivanov_2020_fig2_kT_1_chi_0.1.txt | 24 ++++ .../Lin_1999_fig2.txt | 5 + .../old/Ajay_scan_CH4_lin_ITG.m | 0 .../old/CBC_P_J_scan.m | 0 .../old/CBC_hypcoll_PJ_scan.m | 0 .../old/CBC_kT_PJ_scan.m | 0 .../old/CBC_kT_nu_scan.m | 0 .../old/CBC_nu_PJ_scan.m | 0 .../old/lin_3D_Zpinch.m | 0 .../old/lin_ETPY.m | 0 .../old/lin_ITG.m | 0 .../old/lin_KBM.m | 0 .../old/lin_MTM.m | 0 .../old/lin_RHT.m | 0 .../old/lin_TEM.m | 0 wk/fast_analysis.m | 41 +++++-- wk/lin_Ivanov.m | 15 ++- wk/local_run.m | 10 +- wk/multiple_kTscan_p2_analysis.m | 81 +++++++++++++ wk/multiple_low_res_heat_flux_p2_analysis.m | 112 ++++++++++++++++++ wk/multiple_sim_analysis.m | 23 ++-- 28 files changed, 348 insertions(+), 33 deletions(-) create mode 100644 wk/benchmark_and_scan_scripts/Dimits_2000_fig3_bdiam.txt create mode 100644 wk/benchmark_and_scan_scripts/Dimits_2000_fig3_full_no_GF.txt create mode 100644 wk/benchmark_and_scan_scripts/Dimits_2000_fig3_plus.txt create mode 100644 wk/benchmark_and_scan_scripts/Dimits_2000_fig3_stars.txt create mode 100644 wk/benchmark_and_scan_scripts/Dimits_2000_fig3_wdiam.txt create mode 100644 wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_0.26_chi_0.1.txt create mode 100644 wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_1_chi_0.1.txt create mode 100644 wk/benchmark_and_scan_scripts/Lin_1999_fig2.txt rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/Ajay_scan_CH4_lin_ITG.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/CBC_P_J_scan.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/CBC_hypcoll_PJ_scan.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/CBC_kT_PJ_scan.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/CBC_kT_nu_scan.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/CBC_nu_PJ_scan.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/lin_3D_Zpinch.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/lin_ETPY.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/lin_ITG.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/lin_KBM.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/lin_MTM.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/lin_RHT.m (100%) rename wk/{benchmark and scan scripts => benchmark_and_scan_scripts}/old/lin_TEM.m (100%) create mode 100644 wk/multiple_kTscan_p2_analysis.m create mode 100644 wk/multiple_low_res_heat_flux_p2_analysis.m diff --git a/matlab/plot/show_moments_spectrum.m b/matlab/plot/show_moments_spectrum.m index ba4f4008..3dcba78b 100644 --- a/matlab/plot/show_moments_spectrum.m +++ b/matlab/plot/show_moments_spectrum.m @@ -11,12 +11,12 @@ if OPTIONS.ST == 0 end if OPTIONS.LOGSCALE logname = 'log'; - compress = @(x,ia) (log(sum(abs(x(ia,:,:,:,:)),4))); -% compress = @(x,ia) log(sum(abs(squeeze(x(:,:,:,:))),3)); +% compress = @(x,ia) (log(sum(abs(x(ia,:,:,:,:)),4))); + compress = @(x,ia) log(sum(abs(squeeze(x(:,:,:,:))),3)); else logname = ''; - compress = @(x,ia) (sum(abs(x(ia,:,:,:,:)),4)); -% compress = @(x,ia) sum(abs(squeeze(x(:,:,:,:))),3); +% compress = @(x,ia) (sum(abs(x(ia,:,:,:,:)),4)); + compress = @(x,ia) sum(abs(squeeze(x(:,:,:,:))),3); end for ia = 1:DATA.inputs.Na Napjz = compress(DATA.Napjz,ia); @@ -93,7 +93,7 @@ for ia = 1:DATA.inputs.Na else colors_ = jet(numel(p2j)); for i = 1:numel(p2j) - semilogy(Time_,plt(Na_ST,i),... + semilogy(Time_,squeeze(Na_ST(i,:)),... 'DisplayName',ticks_labels{i},... 'color',colors_(i,:)); hold on; end diff --git a/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_bdiam.txt b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_bdiam.txt new file mode 100644 index 00000000..246d5536 --- /dev/null +++ b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_bdiam.txt @@ -0,0 +1,4 @@ +4.8577910035102665 0.04185796983220058 +5.293932081264581 1.4979414607290185 +6.914240590898222 5.026669586865535 +8.950235390800971 7.510684512028741 diff --git a/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_full_no_GF.txt b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_full_no_GF.txt new file mode 100644 index 00000000..055da52c --- /dev/null +++ b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_full_no_GF.txt @@ -0,0 +1,21 @@ +5.297267537770027 -0.051044540400214444 +4.754512410510305 0.004436559014473929 +5.089866441088001 0.2660247587319642 +5.451261144141954 0.43432466047664775 +5.709658557756645 0.4345657778143899 +6.046499478583758 0.005642145703188106 +5.2693381128147845 0.9193804088144457 +5.914809225953066 1.1625954673959136 +6.948639997749572 1.0515850450989888 +6.327280618385599 1.6108808217278856 +6.791552052209941 2.003226953703461 +6.894710086541032 2.0966358103451412 +6.9714657723892515 2.4512953024314665 +9.039247874651133 2.1732870120136702 +9.036515211490045 3.4423357840231628 +8.905066076197096 4.487314214067991 +8.955620344677234 5.00991193189239 +12.023959026127072 8.073428266587367 +13.934050389504964 9.026999113893783 +16.026145156655943 9.458189248979773 +17.988719727215916 10.038558680927418 diff --git a/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_plus.txt b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_plus.txt new file mode 100644 index 00000000..e645a286 --- /dev/null +++ b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_plus.txt @@ -0,0 +1,5 @@ +3.970760504176352 3.9788218605015633 +4.795381799257761 5.024692424696041 +5.310006570447452 6.032948684202595 +6.907810795225073 8.012666697476105 +8.994400049830917 11.000616858522392 diff --git a/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_stars.txt b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_stars.txt new file mode 100644 index 00000000..893e0483 --- /dev/null +++ b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_stars.txt @@ -0,0 +1,5 @@ +5.632139333672237 0.43449344261306777 +6.018087818953028 1.2000168782136402 +6.456519511415902 1.5923388984554414 +6.8173114211254955 2.040576029319867 +8.956745558920035 4.487362437535539 diff --git a/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_wdiam.txt b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_wdiam.txt new file mode 100644 index 00000000..699af2ae --- /dev/null +++ b/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_wdiam.txt @@ -0,0 +1,8 @@ +18.014599654800342 10.019920310719876 +15.974304929041178 9.532790953277487 +14.01160979981233 9.008408967153791 +11.998239843434474 8.017416709029643 +8.981419899815746 5.028598525567479 +6.919906848335184 2.395259633139972 +6.020740109668202 -0.03170692991321822 +5.348866648047048 -0.013671353050034085 diff --git a/wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_0.26_chi_0.1.txt b/wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_0.26_chi_0.1.txt new file mode 100644 index 00000000..e0589532 --- /dev/null +++ b/wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_0.26_chi_0.1.txt @@ -0,0 +1,17 @@ +0.008976747562244425, 0.0014453128150531125 +0.08988845604781148, 0.036094106640212176 +0.20214216006516805, 0.06215490333663998 +0.33239775137716054, 0.09975239339608177 +0.4581044786953472, 0.12583254696056823 +0.6152499858856171, 0.16059102970472705 +0.8486131610572079, 0.1925814803164847 +1.0414962859009413, 0.20293095243856207 +1.3060320840088075, 0.19611733488188277 +1.4359650608531542, 0.17616040391331333 +1.6107575794236493, 0.15914571688967383 +1.8078588884318518, 0.12201924395299502 +1.9197899779815628, 0.09052561962141181 +2.0541266423092743, 0.05618653568519272 +2.206344213506254, 0.011801237226483186 +2.2869171768007934, -0.013982111027769029 +2.3674901400953328, -0.039765459282021576 diff --git a/wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_1_chi_0.1.txt b/wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_1_chi_0.1.txt new file mode 100644 index 00000000..56811acc --- /dev/null +++ b/wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_1_chi_0.1.txt @@ -0,0 +1,24 @@ +-0.009000943647317738, -0.005774798970859973 +0.05857872196278646, 0.05043754587174454 +0.12164985038754061, 0.10232685684789511 +0.18925371208271835, 0.16285578326760064 +0.2523571019542371, 0.2205005363465523 +0.35577116955809895, 0.2695701968754787 +0.463766362602531, 0.33591263600216137 +0.5402259914345857, 0.3763104196407687 +0.6435674707832273, 0.4124303354383926 +0.764830183809593, 0.4456983393420277 +0.9576971779299444, 0.45317009041270445 +1.1234968182148128, 0.43182591723325825 +1.2622774968343455, 0.39029898295789067 +1.3920007742747225, 0.33293167832111425 +1.4679684160436175, 0.2855589698920047 +1.5483881374660247, 0.23243727164944694 +1.5974819940800244, 0.19078129158702117 +1.6599643511013256, 0.13763378418705174 +1.695508400074201, 0.0786921209481638 +1.7445780606031278, 0.032719559308637125 +1.7890988571382487, -0.024770338825844784 +1.8515812141595493, -0.07791784622581399 +1.940945421697436, -0.13534322146676703 +2.0304386750223813, -0.169746828296515 diff --git a/wk/benchmark_and_scan_scripts/Lin_1999_fig2.txt b/wk/benchmark_and_scan_scripts/Lin_1999_fig2.txt new file mode 100644 index 00000000..964d1f9a --- /dev/null +++ b/wk/benchmark_and_scan_scripts/Lin_1999_fig2.txt @@ -0,0 +1,5 @@ +0, 0.022113821138211365 +0.04541040549724383, 0.17300813008130078 +0.08992977422034283, 0.2809756097560976 +0.1803843539983388, 0.45788617886178873 +0.3613101261043571, 0.783089430894309 diff --git a/wk/benchmark and scan scripts/old/Ajay_scan_CH4_lin_ITG.m b/wk/benchmark_and_scan_scripts/old/Ajay_scan_CH4_lin_ITG.m similarity index 100% rename from wk/benchmark and scan scripts/old/Ajay_scan_CH4_lin_ITG.m rename to wk/benchmark_and_scan_scripts/old/Ajay_scan_CH4_lin_ITG.m diff --git a/wk/benchmark and scan scripts/old/CBC_P_J_scan.m b/wk/benchmark_and_scan_scripts/old/CBC_P_J_scan.m similarity index 100% rename from wk/benchmark and scan scripts/old/CBC_P_J_scan.m rename to wk/benchmark_and_scan_scripts/old/CBC_P_J_scan.m diff --git a/wk/benchmark and scan scripts/old/CBC_hypcoll_PJ_scan.m b/wk/benchmark_and_scan_scripts/old/CBC_hypcoll_PJ_scan.m similarity index 100% rename from wk/benchmark and scan scripts/old/CBC_hypcoll_PJ_scan.m rename to wk/benchmark_and_scan_scripts/old/CBC_hypcoll_PJ_scan.m diff --git a/wk/benchmark and scan scripts/old/CBC_kT_PJ_scan.m b/wk/benchmark_and_scan_scripts/old/CBC_kT_PJ_scan.m similarity index 100% rename from wk/benchmark and scan scripts/old/CBC_kT_PJ_scan.m rename to wk/benchmark_and_scan_scripts/old/CBC_kT_PJ_scan.m diff --git a/wk/benchmark and scan scripts/old/CBC_kT_nu_scan.m b/wk/benchmark_and_scan_scripts/old/CBC_kT_nu_scan.m similarity index 100% rename from wk/benchmark and scan scripts/old/CBC_kT_nu_scan.m rename to wk/benchmark_and_scan_scripts/old/CBC_kT_nu_scan.m diff --git a/wk/benchmark and scan scripts/old/CBC_nu_PJ_scan.m b/wk/benchmark_and_scan_scripts/old/CBC_nu_PJ_scan.m similarity index 100% rename from wk/benchmark and scan scripts/old/CBC_nu_PJ_scan.m rename to wk/benchmark_and_scan_scripts/old/CBC_nu_PJ_scan.m diff --git a/wk/benchmark and scan scripts/old/lin_3D_Zpinch.m b/wk/benchmark_and_scan_scripts/old/lin_3D_Zpinch.m similarity index 100% rename from wk/benchmark and scan scripts/old/lin_3D_Zpinch.m rename to wk/benchmark_and_scan_scripts/old/lin_3D_Zpinch.m diff --git a/wk/benchmark and scan scripts/old/lin_ETPY.m b/wk/benchmark_and_scan_scripts/old/lin_ETPY.m similarity index 100% rename from wk/benchmark and scan scripts/old/lin_ETPY.m rename to wk/benchmark_and_scan_scripts/old/lin_ETPY.m diff --git a/wk/benchmark and scan scripts/old/lin_ITG.m b/wk/benchmark_and_scan_scripts/old/lin_ITG.m similarity index 100% rename from wk/benchmark and scan scripts/old/lin_ITG.m rename to wk/benchmark_and_scan_scripts/old/lin_ITG.m diff --git a/wk/benchmark and scan scripts/old/lin_KBM.m b/wk/benchmark_and_scan_scripts/old/lin_KBM.m similarity index 100% rename from wk/benchmark and scan scripts/old/lin_KBM.m rename to wk/benchmark_and_scan_scripts/old/lin_KBM.m diff --git a/wk/benchmark and scan scripts/old/lin_MTM.m b/wk/benchmark_and_scan_scripts/old/lin_MTM.m similarity index 100% rename from wk/benchmark and scan scripts/old/lin_MTM.m rename to wk/benchmark_and_scan_scripts/old/lin_MTM.m diff --git a/wk/benchmark and scan scripts/old/lin_RHT.m b/wk/benchmark_and_scan_scripts/old/lin_RHT.m similarity index 100% rename from wk/benchmark and scan scripts/old/lin_RHT.m rename to wk/benchmark_and_scan_scripts/old/lin_RHT.m diff --git a/wk/benchmark and scan scripts/old/lin_TEM.m b/wk/benchmark_and_scan_scripts/old/lin_TEM.m similarity index 100% rename from wk/benchmark and scan scripts/old/lin_TEM.m rename to wk/benchmark_and_scan_scripts/old/lin_TEM.m diff --git a/wk/fast_analysis.m b/wk/fast_analysis.m index 4789ce44..ec4d127e 100644 --- a/wk/fast_analysis.m +++ b/wk/fast_analysis.m @@ -1,13 +1,15 @@ % Directory of the code "mypathtogyacomo/gyacomo/" % Partition of the computer where the data have to be searched % PARTITION = '/misc/gyacomo23_outputs/'; -% PARTITION = gyacomodir; PARTITION = '/home/ahoffman/gyacomo/'; %% CBC -% resdir = 'paper_2_GYAC23/CBC/7x4x192x96x32_nu_0.05_muxy_0.5_muz_0.2'; -% resdir = 'paper_2_GYAC23/CBC/7x4x192x96x32_nu_0.05_muxy_1.0_muz_1.0'; -% resdir = 'paper_2_GYAC23/CBC/7x4x192x96x32_nu_0.05_muxy_1.0_muz_2.0'; -% resdir = 'paper_2_GYAC23/CBC/Full_NL_7x4x192x96x32_nu_0.05_muxy_1.0_muz_2.0'; +% resdir = 'paper_2_GYAC23/CBC/5x3x128x64x24_dp'; +% resdir = 'paper_2_GYAC23/CBC/7x4x128x64x24_dp'; +% resdir = 'paper_2_GYAC23/CBC/9x5x128x64x24_dp'; +% resdir = 'paper_2_GYAC23/CBC/9x5x192x96x32_dp'; +% resdir = 'paper_2_GYAC23/CBC/11x6x128x64x24_dp'; +% resdir = 'paper_2_GYAC23/CBC/11x6x128x64x24_dp'; +% resdir = 'paper_2_GYAC23/CBC/21x11x128x64x24_dp'; %% tests single vs double precision % resdir = 'paper_2_GYAC23/precision_study/5x3x128x64x24'; @@ -32,12 +34,19 @@ PARTITION = '/home/ahoffman/gyacomo/'; % resdir = 'paper_2_GYAC23/collisionless/CBC/11x6x128x64x24_dp'; % resdir = 'paper_2_GYAC23/collisionless/CBC/9x5x192x96x32_dp'; +% resdir = 'paper_2_GYAC23/collisionless/kT_scan_nu_1e-3/5x3x128x64x24_dp'; +% resdir = 'paper_2_GYAC23/collisionless/kT_scan_nu_1e-3/7x4x128x64x24_dp'; +% resdir = 'paper_2_GYAC23/collisionless/kT_scan_nu_1e-3/9x5x128x64x24_dp'; + +% resdir = 'paper_2_GYAC23/collision_study/nuDGGK_scan_kT_5.3/5x3x128x64x24_dp'; +% resdir = 'paper_2_GYAC23/collision_study/nuDGGK_scan_kT_5.3/9x5x128x64x24_dp'; + %% low precision 3D ITG % resdir = 'results/paper_2_GYAC23/3x2x64x48x16/CBC_3x2x64x48x16_CLOS_1'; % resdir = 'results/paper_2_GYAC23/3x2x64x48x16/kT_0.0'; % resdir = 'results/paper_2_GYAC23/3x2x64x48x16/kT_3.0'; % resdir = 'results/paper_2_GYAC23/3x2x64x48x16/kT_3.5'; -resdir = 'results/paper_2_GYAC23/3x2x64x48x16/kT_4.0'; +% resdir = 'results/paper_2_GYAC23/3x2x64x48x16/kT_4.0'; % resdir = 'results/paper_2_GYAC23/3x2x64x48x16/kT_4.5'; % resdir = 'results/paper_2_GYAC23/3x2x64x48x16/kT_5.3'; % resdir = 'results/paper_2_GYAC23/3x2x64x48x16/CBC'; @@ -54,6 +63,16 @@ resdir = 'results/paper_2_GYAC23/3x2x64x48x16/kT_4.0'; % resdir = 'results/paper_2_GYAC23/9x2x64x48x16/kT_5.3'; % resdir = 'results/paper_2_GYAC23/9x2x64x48x16/CBC'; +% resdir = 'results/paper_2_GYAC23/11x2x64x48x16/kT_3.5'; +% resdir = 'results/paper_2_GYAC23/11x2x64x48x16/kT_4.0'; +% resdir = 'results/paper_2_GYAC23/11x2x64x48x16/kT_4.5'; +% resdir = 'results/paper_2_GYAC23/11x2x64x48x16/kT_5.3'; +% resdir = 'results/paper_2_GYAC23/11x2x64x48x16/CBC'; + +%% Box size effect on CBC +% resdir = 'results/paper_2_GYAC23/7x4x128x64x24/CBC_L120'; +resdir = 'results/paper_2_GYAC23/7x4x128x64x24/CBC_L180'; + %% testcases % resdir = 'testcases/ITG_zpinch'; % resdir = 'testcases/zpinch_example/results_trunc'; @@ -64,7 +83,7 @@ resdir = 'results/paper_2_GYAC23/3x2x64x48x16/kT_4.0'; % resdir = 'testcases/cyclone_example'; %% -J0 = 00; J1 = 01; +J0 = 00; J1 = 10; % Load basic info (grids and time traces) DATADIR = [PARTITION,resdir,'/']; @@ -138,12 +157,12 @@ end if 0 %% Hermite-Laguerre spectrum -[data.Napjz, data.Ts3D] = compile_results_3Da(DATADIR,J0,J1,'Napjz'); -% [data.Napjz, data.Ts3D] = compile_results_3D(DATADIR,J0,J1,'Nipjz'); -options.ST = 1; +% [data.Napjz, data.Ts3D] = compile_results_3Da(DATADIR,J0,J1,'Napjz'); +[data.Napjz, data.Ts3D] = compile_results_3D(DATADIR,J0,J1,'Nipjz'); +options.ST = 0; options.NORMALIZED = 0; options.LOGSCALE = 1; -options.FILTER = 1; %filter the 50% time-average of the spectrum from +options.FILTER = 0; %filter the 50% time-average of the spectrum from fig = show_moments_spectrum(data,options); end diff --git a/wk/lin_Ivanov.m b/wk/lin_Ivanov.m index a6050c3f..ec997fc0 100644 --- a/wk/lin_Ivanov.m +++ b/wk/lin_Ivanov.m @@ -20,12 +20,12 @@ default_plots_options EXECNAME = 'gyacomo23_sp'; % single precision %% Set up physical parameters CLUSTER.TIME = '99:00:00'; % Allocation time hh:mm:ss -TAU = 1e-3; % e/i temperature ratio -NU = 0.01/TAU; % Collision frequency +TAU = 1e-2; % e/i temperature ratio +NU = 0.05/TAU; % Collision frequency K_Ne = 0*2.22; % ele Density K_Te = 0*6.96; % ele Temperature K_Ni = 0*2.22; % ion Density gradient drive -K_Ti = 1.0*2/TAU; % ion Temperature +K_Ti = 0.36*2/TAU; % ion Temperature SIGMA_E = 0.0233380; % mass ratio sqrt(m_a/m_i) (correct = 0.0233380) NA = 1; % number of kinetic species ADIAB_E = (NA==1); % adiabatic electron model @@ -68,7 +68,7 @@ JOB2LOAD = -1; % Start a new simulation serie %% OPTIONS LINEARITY = 'linear'; % activate non-linearity (is cancelled if KXEQ0 = 1) CO = 'DG'; % Collision operator (LB:L.Bernstein, DG:Dougherty, SG:Sugama, LR: Lorentz, LD: Landau) -GKCO = 0; % Gyrokinetic operator +GKCO = 1; % Gyrokinetic operator ABCO = 1; % INTERSPECIES collisions INIT_ZF = 0; % Initialize zero-field quantities % HRCY_CLOS = 'max_degree'; % Closure model for higher order moments @@ -169,5 +169,10 @@ options.FILTER = 0; %filter the 50% time-average of the spectrum from fig = show_moments_spectrum(data,options); end - +% filename = '/home/ahoffman/gyacomo/wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_0.26_chi_0.1.txt'; +% % filename = '/home/ahoffman/gyacomo/wk/benchmark_and_scan_scripts/Ivanov_2020_fig2_kT_1_chi_0.1.txt'; +% dIV = load(filename); +% +% figure +% plot(dIV(:,1),2*dIV(:,2)) diff --git a/wk/local_run.m b/wk/local_run.m index 765e0d30..36969a57 100644 --- a/wk/local_run.m +++ b/wk/local_run.m @@ -31,14 +31,14 @@ NA = 1; % number of kinetic species ADIAB_E = (NA==1); % adiabatic electron model BETA = 0.0; % electron plasma beta %% Set up grid parameters -P = 10; -J = 1;%P/2; +P = 6; +J = 2;%P/2; PMAX = P; % Hermite basis size JMAX = J; % Laguerre basis size -NX = 32; % real space x-gridpoints -NY = 10; % real space y-gridpoints +NX = 16; % real space x-gridpoints +NY = 8; % real space y-gridpoints LX = 2*pi/0.1; % Size of the squared frequency domain in x direction -LY = 2*pi/0.1; % Size of the squared frequency domain in y direction +LY = 2*pi/0.2; % Size of the squared frequency domain in y direction NZ = 16; % number of perpendicular planes (parallel grid) SG = 0; % Staggered z grids option NEXC = 0; % To extend Lx if needed (Lx = Nexc/(kymin*shear)) diff --git a/wk/multiple_kTscan_p2_analysis.m b/wk/multiple_kTscan_p2_analysis.m new file mode 100644 index 00000000..4f557fbd --- /dev/null +++ b/wk/multiple_kTscan_p2_analysis.m @@ -0,0 +1,81 @@ +clrs_ = lines(10); +kN=2.22; + +scantype = 'nuscan'; +% scantype = 'kTscan'; + +switch scantype + case 'kTscan' +% resdir = 'paper_2_GYAC23/collisionless/kT_scan_nu_1e-3/5x3x128x64x24_dp'; clr_ = clrs_(1,:); xname = '$\kappa_T (\kappa_N=2.22)$'; +% resdir = 'paper_2_GYAC23/collisionless/kT_scan_nu_1e-3/7x4x128x64x24_dp'; clr_ = clrs_(2,:); xname = '$\kappa_T (\kappa_N=2.22)$'; + resdir = 'paper_2_GYAC23/collisionless/kT_scan_nu_1e-3/9x5x128x64x24_dp'; clr_ = clrs_(3,:); xname = '$\kappa_T (\kappa_N=2.22)$'; + case 'nuscan' +% resdir = 'paper_2_GYAC23/collision_study/nuDGGK_scan_kT_5.3/5x3x128x64x24_dp'; clr_ = clrs_(1,:); xname = '$\nu (\kappa_T=5.3,\kappa_N=2.22)$'; +% resdir = 'paper_2_GYAC23/collision_study/nuDGGK_scan_kT_5.3/9x5x128x64x24_dp'; clr_ = clrs_(3,:); xname = '$\nu (\kappa_T=5.3,\kappa_N=2.22)$'; + +% resdir = 'paper_2_GYAC23/collision_study/nuSGGK_scan_kT_5.3/5x3x128x64x24_dp'; clr_ = clrs_(1,:); xname = '$\nu (\kappa_T=5.3,\kappa_N=2.22)$'; + resdir = 'paper_2_GYAC23/collision_study/nuSGGK_scan_kT_5.3/9x5x128x64x24_dp'; clr_ = clrs_(3,:); xname = '$\nu (\kappa_T=5.3,\kappa_N=2.22)$'; +end + +Njobs = 4; + +x = 0*(1:Njobs); +Qx_avg = 0*(1:Njobs); +Qx_std = 0*(1:Njobs); +Chi_avg = 0*(1:Njobs); +Chi_std = 0*(1:Njobs); +figure +datadir = ['/misc/gyacomo23_outputs/',resdir,'/']; +for i = 1:Njobs+1 + J0 = i-1; J1 = i-1; + + Nseg = 5; + + data = compile_results_low_mem(data,datadir,J0,J1); + Trange = data.Ts0D(end)*[0.3 1.0]; + % + [~,it0] = min(abs(Trange(1) -data.Ts0D)); + [~,it1] = min(abs(Trange(end)-data.Ts0D)); + % + if 0 + Qx = data.HFLUX_X(it0:it1); + Qxa_ = 0*(1:Nseg); + for n = 1:Nseg + ntseg = floor((it1-it0)/n); + for m = 1:n + Qxa_(n) = Qxa_(n) + mean(Qx((1:ntseg)+(m-1)*ntseg)); + end + Qxa_(n) = Qxa_(n)/n; + end + Qx_avg(i) = mean(Qxa_); + Qx_std(i) = std(Qxa_); + else + Qx_avg(i) = mean(data.HFLUX_X(it0:it1)); + Qx_std(i) = std(data.HFLUX_X(it0:it1)); + end + Chi_avg(i) = Qx_avg(i)./data.inputs.K_T/data.inputs.K_N; + Chi_std(i) = Qx_std(i)./data.inputs.K_T/data.inputs.K_N; + switch scantype + case 'nuscan' + x(i) = data.inputs.NU; + case 'kTscan' + x(i) = data.inputs.K_T; + end +end + +% plot; +errorbar(x,Chi_avg,Chi_std,'DisplayName',data.paramshort,'color',clr_); hold on; +switch scantype + case 'nuscan' + Lin1999 = load('/home/ahoffman/gyacomo/wk/benchmark_and_scan_scripts/Lin_1999_fig2.txt'); + plot(Lin1999(:,1),Lin1999(:,2),'--ok','DisplayName','Lin1999'); + case 'kTscan' + Dim2000 = load('/home/ahoffman/gyacomo/wk/benchmark_and_scan_scripts/Dimits_2000_fig3_full_no_GF.txt'); + plot(Dim2000(:,1),Dim2000(:,2),'ok','DisplayName','Dimits 2000'); +end +% plot(ITG_threshold*[1 1],[0 20],'-.','DisplayName','$\kappa_T^{crit}$',... +% 'color',clr_); +ylabel('$\chi$'); +xlabel(xname); +ylim([0,5]); +legend('show'); diff --git a/wk/multiple_low_res_heat_flux_p2_analysis.m b/wk/multiple_low_res_heat_flux_p2_analysis.m new file mode 100644 index 00000000..f4a07b2e --- /dev/null +++ b/wk/multiple_low_res_heat_flux_p2_analysis.m @@ -0,0 +1,112 @@ +clrs_ = lines(10); +folder = '/misc/gyacomo23_outputs/paper_2_GYAC23/local_runs/'; +kN=2.22; +figure +for i = 1:4 +if i==1 +prefix = [folder,'3x2x64x48x16/']; +resdirs = {... + 'CBC';... + 'kT_5.3';... + 'kT_4.5';... + 'kT_4.0';... + 'kT_3.5';... + 'kT_3.0';... + }; +pname = '3x2x64x48x16'; clr_ = clrs_(1,:); +ITG_threshold = 3.2; +end + +if i==2 +prefix = [folder,'5x2x64x48x16/']; +resdirs = {... + 'CBC';... + 'kT_5.3';... + 'kT_4.5';... + 'kT_4.0';... + 'kT_3.5';... + 'kT_3.0';... + }; +pname = '5x2x64x48x16'; clr_ = clrs_(2,:); +ITG_threshold = 3.7; +end + +if i==3 +prefix = [folder,'9x2x64x48x16/']; +resdirs = {... + 'CBC';... + 'kT_5.3';... + 'kT_4.5';... + 'kT_4.0';... + 'kT_3.5';... + 'kT_3.0';... + }; +pname = '9x2x64x48x16'; clr_ = clrs_(3,:); +ITG_threshold = 4.2; +end + +if i==4 +prefix = [folder,'11x2x64x48x16/']; +resdirs = {... + 'CBC';... + 'kT_5.3';... + 'kT_4.5';... + 'kT_4.0';... + 'kT_3.5';... + 'kT_3.0';... + }; +pname = '11x2x64x48x16'; clr_ = clrs_(4,:); +ITG_threshold = 4.2; +end + +x = [... + 6.96,... + 5.3,... + 4.5,... + 4.0,... + 3.5,... + 3.0... + ]; + +J0 = 00; J1 = 10; + +Nseg = 5; + +Qx_avg = 0*(1:numel(resdirs)); +Qx_std = 0*(1:numel(resdirs)); + +for i = 1:numel(resdirs) + data = compile_results_low_mem(data,[prefix,resdirs{i},'/'],J0,J1); + Trange = data.Ts0D(end)*[0.3 1.0]; + % + [~,it0] = min(abs(Trange(1) -data.Ts0D)); + [~,it1] = min(abs(Trange(end)-data.Ts0D)); + % + if 0 + Qx = data.HFLUX_X(it0:it1); + Qxa_ = 0*(1:Nseg); + for n = 1:Nseg + ntseg = floor((it1-it0)/n); + for m = 1:n + Qxa_(n) = Qxa_(n) + mean(Qx((1:ntseg)+(m-1)*ntseg)); + end + Qxa_(n) = Qxa_(n)/n; + end + Qx_avg(i) = mean(Qxa_); + Qx_std(i) = std(Qxa_); + else + Qx_avg(i) = mean(data.HFLUX_X(it0:it1)); + Qx_std(i) = std(data.HFLUX_X(it0:it1)); + end +end +Chi_avg = Qx_avg./x/kN; +Chi_std = Qx_std./x/kN; +% plot; +errorbar(x,Chi_avg,Chi_std,'DisplayName',pname,'color',clr_); hold on; +plot(ITG_threshold*[1 1],[0 20],'-.','DisplayName','$\kappa_T^{crit}$',... + 'color',clr_); +end +ylabel('$\chi$'); +xlabel('$\kappa_T (\kappa_N=2.22)$'); +ylim([0,10]); +legend('show'); diff --git a/wk/multiple_sim_analysis.m b/wk/multiple_sim_analysis.m index f2f82b19..92ad9186 100644 --- a/wk/multiple_sim_analysis.m +++ b/wk/multiple_sim_analysis.m @@ -1,7 +1,7 @@ clrs_ = lines(10); kN=2.22; figure -for i = 1:3 +for i = 1:4 if i==1 prefix = '/home/ahoffman/gyacomo/results/paper_2_GYAC23/3x2x64x48x16/'; resdirs = {... @@ -10,7 +10,7 @@ resdirs = {... 'kT_4.5';... 'kT_4.0';... 'kT_3.5';... - 'kT_3.0';... +% 'kT_3.0';... }; pname = '3x2x64x48x16'; clr_ = clrs_(1,:); ITG_threshold = 3.2; @@ -24,7 +24,7 @@ resdirs = {... 'kT_4.5';... 'kT_4.0';... 'kT_3.5';... - 'kT_3.0';... +% 'kT_3.0';... }; pname = '5x2x64x48x16'; clr_ = clrs_(2,:); ITG_threshold = 3.7; @@ -38,15 +38,24 @@ resdirs = {... 'kT_4.5';... 'kT_4.0';... 'kT_3.5';... - 'kT_3.0';... +% 'kT_3.0';... }; pname = '9x2x64x48x16'; clr_ = clrs_(3,:); ITG_threshold = 4.2; end if i==4 - -ITG_threshold > 3.6; +prefix = '/home/ahoffman/gyacomo/results/paper_2_GYAC23/11x2x64x48x16/'; +resdirs = {... + 'CBC';... + 'kT_5.3';... + 'kT_4.5';... + 'kT_4.0';... + 'kT_3.5';... +% 'kT_3.0';... + }; +pname = '11x2x64x48x16'; clr_ = clrs_(4,:); +ITG_threshold = 4.2; end x = [... @@ -55,7 +64,7 @@ x = [... 4.5,... 4.0,... 3.5,... - 3.0... +% 3.0... ]; J0 = 00; J1 = 10; -- GitLab