Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gyacomo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Cyril David Hoffmann
Gyacomo
Commits
c3e007f0
Commit
c3e007f0
authored
1 year ago
by
Antoine Cyril David Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
can show Ni00 mode evolution
parent
b71fd488
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/compute/mode_growth_meter.m
+16
-9
16 additions, 9 deletions
matlab/compute/mode_growth_meter.m
wk/fast_analysis.m
+16
-10
16 additions, 10 deletions
wk/fast_analysis.m
with
32 additions
and
19 deletions
matlab/compute/mode_growth_meter.m
+
16
−
9
View file @
c3e007f0
...
...
@@ -3,17 +3,24 @@ function [FIGURE, kykx, wkykx, ekykx] = mode_growth_meter(DATA,OPTIONS)
NORMALIZED
=
OPTIONS
.
NORMALIZED
;
Nma
=
OPTIONS
.
NMA
;
%Number moving average
d
=
OPTIONS
.
fftz
.
flag
;
% To add spectral evolution of z (useful for 3d zpinch)
if
numel
(
size
(
DATA
.
PHI
))
==
3
field
=
squeeze
(
DATA
.
PHI
);
switch
OPTIONS
.
FIELD
case
'Ni00'
FIELD
=
DATA
.
Ni00
;
fname
=
'N^{00}'
;
case
'phi'
FIELD
=
DATA
.
PHI
;
fname
=
'\phi'
;
end
if
numel
(
size
(
FIELD
))
==
3
field
=
squeeze
(
FIELD
);
zstrcomp
=
'z=0'
;
else
switch
OPTIONS
.
iz
case
'avg'
field
=
reshape
(
mean
(
DATA
.
PHI
,
3
),
DATA
.
grids
.
Nky
,
DATA
.
grids
.
Nkx
,
numel
(
DATA
.
Ts3D
));
field
=
reshape
(
mean
(
FIELD
,
3
),
DATA
.
grids
.
Nky
,
DATA
.
grids
.
Nkx
,
numel
(
DATA
.
Ts3D
));
zstrcomp
=
'z-avg'
;
otherwise
field
=
reshape
(
DATA
.
PHI
(:,:,
OPTIONS
.
iz
,:),
DATA
.
grids
.
Nky
,
DATA
.
grids
.
Nkx
,
numel
(
DATA
.
Ts3D
));
field
=
reshape
(
FIELD
(:,:,
OPTIONS
.
iz
,:),
DATA
.
grids
.
Nky
,
DATA
.
grids
.
Nkx
,
numel
(
DATA
.
Ts3D
));
zstrcomp
=
[
'z='
,
num2str
(
DATA
.
grids
.
z
(
OPTIONS
.
iz
))];
end
end
...
...
@@ -31,7 +38,7 @@ TW = [OPTIONS.KY_TW; OPTIONS.KX_TW];
[
~
,
ikzf
]
=
max
(
mean
(
squeeze
(
abs
(
field
(
1
,:,
FRAMES
))),
2
));
% Amplitude ratio method to measure growth rates and freq.
[
wkykx
,
ekykx
]
=
compute_growth_rates
(
DATA
.
PHI
(:,:,:,
FRAMES
),
DATA
.
Ts3D
(
FRAMES
));
[
wkykx
,
ekykx
]
=
compute_growth_rates
(
FIELD
(:,:,:,
FRAMES
),
DATA
.
Ts3D
(
FRAMES
));
kykx
=
meshgrid
(
DATA
.
grids
.
ky
,
DATA
.
grids
.
kx
)
'
;
FIGURE
.
fig
=
figure
;
%set(gcf, 'Position', [100 100 1200 700])
...
...
@@ -131,7 +138,7 @@ for i = 1:2
plot
(
t
(
it1
)
*
[
1
1
],[
1e-10
1
],
'--k'
)
plot
(
t
(
it2
)
*
[
1
1
],[
1e-10
1
],
'--k'
)
xlim
([
t
(
1
)
t
(
end
)]);
%ylim([1e-5 1])
xlabel
(
'$t c_s /R_0$'
);
ylabel
([
'$|
\phi
_{'
,
kstr
,
'}|$'
]);
xlabel
(
'$t c_s /R_0$'
);
ylabel
([
'$|
'
,
fname
,
'
_{'
,
kstr
,
'}|$'
]);
title
(
'Measure time window'
)
% subplot(2+d,3,3+3*(i-1))
...
...
@@ -174,10 +181,10 @@ end
if
d
[
~
,
ikx
]
=
min
(
abs
(
DATA
.
grids
.
kx
-
OPTIONS
.
fftz
.
kx
));
[
~
,
iky
]
=
min
(
abs
(
DATA
.
grids
.
ky
-
OPTIONS
.
fftz
.
ky
));
sz_
=
size
(
DATA
.
PHI
);
nkz
=
sz_
(
3
)/
2
;
sz_
=
size
(
FIELD
);
nkz
=
sz_
(
3
)/
2
;
k
=
[(
0
:
nkz
/
2
),
(
-
nkz
/
2
+
1
):
-
1
]/
DATA
.
grids
.
Npol
;
% Spectral treatment of z-dimension
Y
=
fft
(
DATA
.
PHI
(
iky
,
ikx
,:,:),[],
3
);
Y
=
fft
(
FIELD
(
iky
,
ikx
,:,:),[],
3
);
phi
=
squeeze
(
Y
(
1
,
1
,
2
:
2
:
end
,:));
gamma
=
zeros
(
nkz
);
...
...
This diff is collapsed.
Click to expand it.
wk/fast_analysis.m
+
16
−
10
View file @
c3e007f0
...
...
@@ -7,7 +7,7 @@ default_plots_options
% Partition of the computer where the data have to be searched
% PARTITION='/Users/ahoffmann/gyacomo/results/paper_3/';
% PARTITION='/misc/gyacomo23_outputs/paper_3/';
PARITION
=
''
;
PAR
T
ITION
=
''
;
%% Paper 3
% resdir = 'DTT_rho85/3x2x192x48x32';
% resdir = 'DTT_rho85/3x2x192x48x32_NT';
...
...
@@ -15,7 +15,8 @@ PARITION = '';
% resdir = 'DTT_rho98/3x2x192x48x32_0.25grad';
% resdir = 'LM_DIIID_rho95/5x3x512x92x32';
% resdir = 'LM_DIIID_rho95/3x2x512x92x32';
resdir
=
'../results/dev/ExB_SF'
;
% resdir = '../testcases/cyclone_example';
% resdir = '../testcases/CBC_ExBshear';
%%
J0
=
00
;
J1
=
02
;
...
...
@@ -39,10 +40,10 @@ options.RESOLUTION = 256;
plot_radial_transport_and_spacetime
(
data
,
options
);
end
if
1
if
0
%% MOVIES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Options
%
[data.PHI, data.Ts3D] = compile_results_3D(DATADIR,J0,J1,'phi');
[
data
.
PHI
,
data
.
Ts3D
]
=
compile_results_3D
(
DATADIR
,
J0
,
J1
,
'phi'
);
[
data
.
Na00
,
data
.
Ts3D
]
=
compile_results_3Da
(
DATADIR
,
J0
,
J1
,
'Na00'
);
data
.
Ni00
=
reshape
(
data
.
Na00
(
1
,:,:,:,:),
data
.
grids
.
Nky
,
data
.
grids
.
Nkx
,
data
.
grids
.
Nz
,
numel
(
data
.
Ts3D
));
options
.
INTERP
=
1
;
...
...
@@ -58,7 +59,7 @@ options.NAME = 'N_i^{00}';
% options.NAME = 'Q_x';
% options.NAME = 'n_i';
% options.NAME = 'n_i-n_e';
options
.
PLAN
=
'
x
y'
;
options
.
PLAN
=
'
kxk
y'
;
% options.NAME = 'f_i';
% options.PLAN = 'sx';
options
.
COMP
=
1
;
...
...
@@ -112,19 +113,24 @@ options.TAVG_2D_CTR= 0; %make it contour plot
fig
=
show_moments_spectrum
(
data
,
options
);
end
if
0
if
1
%% Mode evolution
[
data
.
PHI
,
data
.
Ts3D
]
=
compile_results_3D
(
DATADIR
,
J0
,
J1
,
'phi'
);
[
data
.
Na00
,
data
.
Ts3D
]
=
compile_results_3Da
(
DATADIR
,
J0
,
J1
,
'Na00'
);
data
.
Ni00
=
reshape
(
data
.
Na00
(
1
,:,:,:,:),
data
.
grids
.
Nky
,
data
.
grids
.
Nkx
,
data
.
grids
.
Nz
,
numel
(
data
.
Ts3D
));
options
.
NORMALIZED
=
0
;
options
.
TIME
=
[
000
:
9000
]
;
options
.
KX_TW
=
[
3
0
40
];
%kx Growth rate time window
options
.
KY_TW
=
[
1
0
2
0
];
%ky Growth rate time window
options
.
TIME
=
data
.
Ts3D
;
options
.
KX_TW
=
[
0
2
];
%kx Growth rate time window
options
.
KY_TW
=
[
0
2
];
%ky Growth rate time window
options
.
NMA
=
1
;
options
.
NMODES
=
800
;
options
.
iz
=
'avg'
;
% avg or index
options
.
ik
=
1
;
% sum, max or index
options
.
ik
=
'sum'
;
% sum, max or index
options
.
fftz
.
flag
=
0
;
options
.
FIELD
=
'Ni00'
;
% options.FIELD = 'phi';
options
.
GOK2
=
0
;
fig
=
mode_growth_meter
(
data
,
options
);
% save_figure(data,fig,'.png')
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment