Skip to content
Snippets Groups Projects
Commit 76b3fe85 authored by Antoine Cyril David Hoffmann's avatar Antoine Cyril David Hoffmann
Browse files

Wrote two benchmarks scripts, data for benchmark should be uploaded

parent d29af00a
No related branches found
No related tags found
No related merge requests found
addpath(genpath('../matlab')) % ... add
default_plots_options
%% KINETIC ELECTRON TEST
% Run HeLaZ
cd ..
system('make');
cd wk
SIMDIR = '../results/benchmarks/shearless_molix_Kin_e/';
system(['cd ',SIMDIR,';',' ./../../../bin/helaz 0; cd ../../../wk'])
% Run molix
% cd ../../molix
% system('make');
% system('./bin/molix > out.txt');
% cd ../HeLaZ/wk
% Compare the results with molix at a given time
time_2_plot = 5.0;
[Y_,X_]=molix_plot_phi([SIMDIR,'molix_phi.h5'],time_2_plot);
[ PHI, Ts3D, dt3D] = load_3D_data([SIMDIR,'outputs_00.h5'], 'phi');
[Pe, Je, Pi, Ji, kx, ky, z] = load_grid_data(filename);
plot_phi_ballooning; hold on
plot(X_/pi,real(Y_),'ob');
plot(X_/pi,imag(Y_),'or');
plot(X_/pi,abs(Y_) ,'ok');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ADIABATIC ELECTRON TEST
% Run HeLaZ
cd ..
system('make');
cd wk
SIMDIR = '../results/benchmarks/shearless_molix_Adiab_e/';
system(['cd ',SIMDIR,';',' ./../../../bin/helaz 0; cd ../../../wk'])
% Run molix
% cd ../../molix
% system('make');
% system('./bin/molix > out.txt');
% cd ../HeLaZ/wk
% Compare the results with molix at a given time
time_2_plot = 5.0;
[Y_,X_]=molix_plot_phi([SIMDIR,'molix_phi.h5'],time_2_plot);
[ PHI, Ts3D, dt3D] = load_3D_data([SIMDIR,'outputs_00.h5'], 'phi');
[Pe, Je, Pi, Ji, kx, ky, z] = load_grid_data([SIMDIR,'outputs_00.h5']);
plot_phi_ballooning; hold on
plot(X_/pi,real(Y_),'ob');
plot(X_/pi,imag(Y_),'or');
plot(X_/pi,abs(Y_) ,'ok');
addpath(genpath('../matlab')) % ... add
default_plots_options
SIMDIR = '../results/benchmarks/1D_linear_entropy_mode/';
% Compile HeLaZ
cd ..
system('make');
cd wk
% Run HeLaZ
system(['cd ',SIMDIR,';',' ./../../../bin/helaz 0; cd ../../../wk'])
%compute growth rate
%%
filename = [SIMDIR,'/outputs_00.h5'];
[ PHI, Ts3D, dt3D] = load_3D_data(filename, 'phi');
[Pe, Je, Pi, Ji, kx, ky, z] = load_grid_data(filename);
gamma_phi = kx;
for ikx = 2:size(kx)
tend = max(Ts3D(abs(PHI(ikx,1,1,:))~=0));
tstart = 0.6*tend;
[~,itstart] = min(abs(Ts3D-tstart));
[~,itend] = min(abs(Ts3D-tend));
trange = itstart:itend;
% exp fit on phi
X_ = Ts3D(trange); Y_ = squeeze(abs(PHI(ikx,1,1,trange)));
gamma_phi (ikx) = LinearFit_s(X_,Y_);
end
%% Plot
SCALE = 1;%sqrt(2);
openfig([SIMDIR,'/benchmark_data.fig']); hold on;
plot(kx,gamma_phi,'-x','DisplayName','new results');
hold on;
legend('show');
%%
cd ..
system('make');
cd wk
shearless_linear_fluxtube
cd ../../molix
system('make');
system('./bin/molix');
cd ../HeLaZ/wk
%%
time_2_plot = 5.0;
[Y_,X_]=molix_plot_phi('../../molix/field.dat.h5',time_2_plot);
plot_phi_ballooning; hold on
plot(X_/pi,real(Y_),'ob');
plot(X_/pi,imag(Y_),'or');
plot(X_/pi,abs(Y_) ,'ok');
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment