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

sc

parent 41ec3009
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ dr = 2*pi/Lk; dz = 2*pi/Lk; ...@@ -27,7 +27,7 @@ dr = 2*pi/Lk; dz = 2*pi/Lk;
Nr = max(Nkr,Nkz); Nz = Nr; Nr = max(Nkr,Nkz); Nz = Nr;
r = dr*(-Nr/2:(Nr/2-1)); Lr = max(r)-min(r); r = dr*(-Nr/2:(Nr/2-1)); Lr = max(r)-min(r);
z = dz*(-Nz/2:(Nz/2-1)); Lz = max(z)-min(z); z = dz*(-Nz/2:(Nz/2-1)); Lz = max(z)-min(z);
[YY,XX] = meshgrid(z,r); [ZZ,RR] = meshgrid(z,r);
% Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% IFFT % IFFT
ne = zeros(Nr,Nz); ne = zeros(Nr,Nz);
...@@ -127,22 +127,7 @@ if strcmp(OUTPUTS.write_non_lin,'.true.') ...@@ -127,22 +127,7 @@ if strcmp(OUTPUTS.write_non_lin,'.true.')
end end
FMT = '.fig'; save_figure FMT = '.fig'; save_figure
%% Spectra energy if 0
% fig = figure; FIGNAME = ['Energy_kin_KZ',sprintf('_%.2d',JOBNUM)];
% semilogy(kr(floor(end/2)+1:end),E_kin_KR(floor(end/2)+1:end),'o','DisplayName','$\sum_y\langle|ik\tilde\phi_i|^2\rangle_t$')
% hold on;
% loglog(kz(floor(end/2)+1:end),E_kin_KZ(floor(end/2)+1:end),'o','DisplayName','$\sum_x\langle|ik\tilde\phi_i|^2\rangle_t$')
% grid on; xlabel('$k$'); legend('show');
% FMT = '.fig'; save_figure
%% CFL condition
fig = figure; FIGNAME = ['CFL',sprintf('_%.2d',JOBNUM)];
semilogy(Ts,dz./ExB,'-','DisplayName','$|\nabla \phi|\Delta y$');
hold on;
plot(Ts,dt*ones(1,numel(Ts)),'--k','DisplayName','$\Delta t$');
grid on; xlabel('$t$'); ylabel('$\Delta t$'); legend('show');
FMT = '.fig'; save_figure
%% Space-Time diagrams at z = 0 %% Space-Time diagrams at z = 0
plt = @(x) real(x); plt = @(x) real(x);
fig = figure; FIGNAME = ['r_space_time_diag',sprintf('_%.2d',JOBNUM)]; fig = figure; FIGNAME = ['r_space_time_diag',sprintf('_%.2d',JOBNUM)];
...@@ -157,7 +142,9 @@ subplot(223)% density ...@@ -157,7 +142,9 @@ subplot(223)% density
pclr = pcolor(TX,TY,(plt(phi_ST_r))); set(pclr, 'edgecolor','none'); colorbar; pclr = pcolor(TX,TY,(plt(phi_ST_r))); set(pclr, 'edgecolor','none'); colorbar;
xlabel('$r\,(z=0)$'); ylabel('$t$'); title('$\phi$'); xlabel('$r\,(z=0)$'); ylabel('$t$'); title('$\phi$');
FMT = '.fig'; save_figure FMT = '.fig'; save_figure
end
if 0
%% Space-Time diagrams at r = 0 %% Space-Time diagrams at r = 0
plt = @(x) real(x); plt = @(x) real(x);
fig = figure; FIGNAME = ['z_space_time_diag',sprintf('_%.2d',JOBNUM)]; fig = figure; FIGNAME = ['z_space_time_diag',sprintf('_%.2d',JOBNUM)];
...@@ -172,7 +159,9 @@ subplot(223)% density ...@@ -172,7 +159,9 @@ subplot(223)% density
pclr = pcolor(TX,TY,(plt(phi_ST_z))); set(pclr, 'edgecolor','none'); colorbar; pclr = pcolor(TX,TY,(plt(phi_ST_z))); set(pclr, 'edgecolor','none'); colorbar;
xlabel('$z\,(r=0)$'); ylabel('$t$'); title('$\phi$'); xlabel('$z\,(r=0)$'); ylabel('$t$'); title('$\phi$');
FMT = '.fig'; save_figure FMT = '.fig'; save_figure
end
if 0
%% Space-Time diagrams for max_kz(Real) %% Space-Time diagrams for max_kz(Real)
plt = @(x) (x); plt = @(x) (x);
fig = figure; FIGNAME = ['kr_space_time_diag',sprintf('_%.2d',JOBNUM)]; fig = figure; FIGNAME = ['kr_space_time_diag',sprintf('_%.2d',JOBNUM)];
...@@ -187,7 +176,9 @@ subplot(223)% density ...@@ -187,7 +176,9 @@ subplot(223)% density
pclr = pcolor(TX,TY,(plt(PH_ST_kr))); set(pclr, 'edgecolor','none'); colorbar; pclr = pcolor(TX,TY,(plt(PH_ST_kr))); set(pclr, 'edgecolor','none'); colorbar;
xlabel('$kr$'); ylabel('$t$'); title('$\max_{k_z}(\textrm{Re}(\tilde\phi$))'); xlabel('$kr$'); ylabel('$t$'); title('$\max_{k_z}(\textrm{Re}(\tilde\phi$))');
FMT = '.fig'; save_figure FMT = '.fig'; save_figure
end
if 0
%% Space-Time diagrams at max_kr(Real) %% Space-Time diagrams at max_kr(Real)
plt = @(x) (x); plt = @(x) (x);
fig = figure; FIGNAME = ['kz_space_time_diag',sprintf('_%.2d',JOBNUM)]; fig = figure; FIGNAME = ['kz_space_time_diag',sprintf('_%.2d',JOBNUM)];
...@@ -202,12 +193,28 @@ subplot(223)% density ...@@ -202,12 +193,28 @@ subplot(223)% density
pclr = pcolor(TX,TY,(plt(PH_ST_kz))); set(pclr, 'edgecolor','none'); colorbar; pclr = pcolor(TX,TY,(plt(PH_ST_kz))); set(pclr, 'edgecolor','none'); colorbar;
xlabel('$kz$'); ylabel('$t$'); title('$\max_{k_r}(\textrm{Re}(\tilde\phi))$'); xlabel('$kz$'); ylabel('$t$'); title('$\max_{k_r}(\textrm{Re}(\tilde\phi))$');
FMT = '.fig'; save_figure FMT = '.fig'; save_figure
end
if 1
%% Show frame in real space
it = min(1,numel(Ts));
fig = figure; FIGNAME = ['rz_frame',sprintf('_%.2d',JOBNUM)];
subplot(221); plt = @(x) (((x)));
pclr = pcolor((RR),(ZZ),plt(phi(:,:,it))); set(pclr, 'edgecolor','none'); colorbar;
xlabel('$r$'); ylabel('$z$'); title(sprintf('t=%.3d',Ts(it))); legend('$|\hat\phi|$');
subplot(222); plt = @(x) ((x));
pclr = pcolor((RR),(ZZ),plt(ni(:,:,it))); set(pclr, 'edgecolor','none'); colorbar;
xlabel('$r$'); ylabel('$z$'); title(sprintf('t=%.3d',Ts(it))); legend('$|\hat n_i^{00}|$');
subplot(223); plt = @(x) ((x));
pclr = pcolor((RR),(ZZ),plt(ne(:,:,it))); set(pclr, 'edgecolor','none'); colorbar;
xlabel('$r$'); ylabel('$z$'); title(sprintf('t=%.3d',Ts(it))); legend('$|\hat n_e^{00}|$');
FMT = '.fig'; save_figure
end
if 0 if 1
%% Show frame %% Show frame in kspace
it = min(250,numel(Ts)); it = min(1,numel(Ts));
fig = figure; FIGNAME = ['frame',sprintf('_%.2d',JOBNUM)]; fig = figure; FIGNAME = ['krkz_frame',sprintf('_%.2d',JOBNUM)];
subplot(221); plt = @(x) fftshift((abs(x))); subplot(221); plt = @(x) fftshift((abs(x)));
pclr = pcolor(fftshift(KR),fftshift(KZ),plt(PH(:,:,it))); set(pclr, 'edgecolor','none'); colorbar; pclr = pcolor(fftshift(KR),fftshift(KZ),plt(PH(:,:,it))); set(pclr, 'edgecolor','none'); colorbar;
xlabel('$k_r$'); ylabel('$k_z$'); title(sprintf('t=%.3d',Ts(it))); legend('$|\hat\phi|$'); xlabel('$k_r$'); ylabel('$k_z$'); title(sprintf('t=%.3d',Ts(it))); legend('$|\hat\phi|$');
...@@ -224,6 +231,7 @@ if strcmp(OUTPUTS.write_non_lin,'.true.') ...@@ -224,6 +231,7 @@ if strcmp(OUTPUTS.write_non_lin,'.true.')
end end
FMT = '.fig'; save_figure FMT = '.fig'; save_figure
end end
%% %%
DELAY = 0.07; skip_ = 10; DELAY = 0.07; skip_ = 10;
FRAMES = 1:skip_:numel(Ts); FRAMES = 1:skip_:numel(Ts);
...@@ -231,17 +239,17 @@ if 0 ...@@ -231,17 +239,17 @@ if 0
%% GIFS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% GIFS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Density electron %% Density electron
GIFNAME = ['ne',sprintf('_%.2d',JOBNUM)]; GIFNAME = ['ne',sprintf('_%.2d',JOBNUM)];
FIELD = real(ne); X = XX; Y = YY; T = Ts; FIELD = real(ne); X = RR; Y = ZZ; T = Ts;
FIELDNAME = '$n_e^{00}$'; XNAME = '$r$'; YNAME = '$z$'; FIELDNAME = '$n_e^{00}$'; XNAME = '$r$'; YNAME = '$z$';
create_gif create_gif
%% Density ion %% Density ion
GIFNAME = ['ni',sprintf('_%.2d',JOBNUM)]; GIFNAME = ['ni',sprintf('_%.2d',JOBNUM)];
FIELD = real(ni); X = XX; Y = YY; T = Ts; FIELD = real(ni); X = RR; Y = ZZ; T = Ts;
FIELDNAME = '$n_i^{00}$'; XNAME = '$r$'; YNAME = '$z$'; FIELDNAME = '$n_i^{00}$'; XNAME = '$r$'; YNAME = '$z$';
create_gif create_gif
%% Phi %% Phi
GIFNAME = ['phi',sprintf('_%.2d',JOBNUM)]; GIFNAME = ['phi',sprintf('_%.2d',JOBNUM)];
FIELD = real(phi); X = XX; Y = YY; T = Ts; FIELD = real(phi); X = RR; Y = ZZ; T = Ts;
FIELDNAME = '$\phi$'; XNAME = '$r$'; YNAME = '$z$'; FIELDNAME = '$\phi$'; XNAME = '$r$'; YNAME = '$z$';
create_gif create_gif
%% Density electron frequency %% Density electron frequency
......
&BASIC &BASIC
nrun = 100000000 nrun = 100000000
dt = 0.01 dt = 0.01
tmax = 30 tmax = 100
RESTART = .false. RESTART = .false.
/ /
&GRID &GRID
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
jmaxe = 1 jmaxe = 1
pmaxi = 0 pmaxi = 0
jmaxi = 1 jmaxi = 1
Nr = 64 Nr = 128
Lr = 150 Lr = 50
Nz = 64 Nz = 128
Lz = 150 Lz = 50
kpar = 0 kpar = 0
/ /
&OUTPUT_PAR &OUTPUT_PAR
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
write_phi = .true. write_phi = .true.
write_non_lin = .false. write_non_lin = .false.
write_doubleprecision = .true. write_doubleprecision = .true.
resfile0 = 'Turbulences_64x32_L_150_lin_P_0_J_1_nB_0.5_nN_1_nu_1e-01__mu_1e-01_' resfile0 = 'shifted_init_128x64_L_50_lin_P_0_J_1_nB_0.5_nN_1_nu_1e-01__mu_1e-01_'
rstfile0 = '../checkpoint/cp_Turbulences_64x32_L_150_lin_P_0_J_1_nB_0.5_nN_1_nu_1e-01__mu_1e-01_' rstfile0 = '../checkpoint/cp_shifted_init_128x64_L_50_lin_P_0_J_1_nB_0.5_nN_1_nu_1e-01__mu_1e-01_'
job2load = 0 job2load = 0
/ /
&MODEL_PAR &MODEL_PAR
......
...@@ -13,8 +13,8 @@ ETAT = 0.0; % Temperature gradient ...@@ -13,8 +13,8 @@ ETAT = 0.0; % Temperature gradient
MU = 1e-1; % Hyper diffusivity coefficient MU = 1e-1; % Hyper diffusivity coefficient
LAMBDAD = 0.0; LAMBDAD = 0.0;
%% GRID PARAMETERS %% GRID PARAMETERS
N = 64; % Frequency gridpoints (Nkr = N/2) N = 128; % Frequency gridpoints (Nkr = N/2)
L = 150; % Size of the squared frequency domain L = 50; % Size of the squared frequency domain
KREQ0 = 0; % put kr = 0 KREQ0 = 0; % put kr = 0
PMAXE = 00; % Highest electron Hermite polynomial degree PMAXE = 00; % Highest electron Hermite polynomial degree
JMAXE = 01; % Highest '' Laguerre '' JMAXE = 01; % Highest '' Laguerre ''
...@@ -22,13 +22,13 @@ PMAXI = 00; % Highest ion Hermite polynomial degree ...@@ -22,13 +22,13 @@ PMAXI = 00; % Highest ion Hermite polynomial degree
JMAXI = 01; % Highest '' Laguerre '' JMAXI = 01; % Highest '' Laguerre ''
KPAR = 0.0; % Parellel wave vector component KPAR = 0.0; % Parellel wave vector component
%% TIME PARAMETERS %% TIME PARAMETERS
TMAX = 30.0; % Maximal time unit TMAX = 100.0; % Maximal time unit
DT = 1e-2; % Time step DT = 1e-2; % Time step
SPS = 10; % Sampling per time unit SPS = 10; % Sampling per time unit
RESTART = 0; % To restart from last checkpoint RESTART = 0; % To restart from last checkpoint
JOB2LOAD= 0; JOB2LOAD= 0;
%% OPTIONS %% OPTIONS
SIMID = 'Turbulences'; % Name of the simulation SIMID = 'shifted_init'; % Name of the simulation
NON_LIN = 0 *(1-KREQ0); % activate non-linearity (is cancelled if KREQ0 = 1) NON_LIN = 0 *(1-KREQ0); % activate non-linearity (is cancelled if KREQ0 = 1)
CO = -2; % Collision operator (0 : L.Bernstein, -1 : Full Coulomb, -2 : Dougherty) CO = -2; % Collision operator (0 : L.Bernstein, -1 : Full Coulomb, -2 : Dougherty)
DK = 0; % Drift kinetic model (put every kernel to 1) DK = 0; % Drift kinetic model (put every kernel to 1)
......
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