Skip to content
Snippets Groups Projects
Commit bf10d660 authored by Antonia Frank's avatar Antonia Frank
Browse files

start changing to nodes for LIUQE calls, in progress

parent 1558f619
Branches
Tags
1 merge request!137Add quantities to ids for MRE
......@@ -48,6 +48,29 @@ params_eff = params_eff_ref; params_eff.data_request='ohm_data';
ohm_gdat = gdat(params_core_sources.shot,params_eff);
params_eff = params_eff_ref; params_eff.data_request='powers';
powers_gdat = gdat(params_core_sources.shot,params_eff);
%% load liuqe data from nodes for conversions
params_eff = params_eff_ref;
% normalized sqrt poloidal flux including axis
params_eff.data_request='\tcv_shot::top.results.equil_1.results:rho';
rho_pol_norm_liu = gdat(shot,params_eff);
% <1/R^2>
params_eff.data_request='\tcv_shot::top.results.equil_1.results:gpsi0_r2_fsa';
Rm2_fs = gdat(shot,params_eff);
% Volume
params_eff.data_request='\tcv_shot::top.results.equil_1.results:vol';
vol= gdat(shot,params_eff);
% T(\psi) = R*B_tor
params_eff.data_request='\tcv_shot::top.results.equil_1.results:rbtor_rho';
T = gdat(shot,params_eff);
% Q1Q: -dpsi/dV
%mVprime = 1./LY.Q1Q; % Q1Q: -dpsi/dV
params_eff.data_request='\tcv_shot::top.results.equil_1.results:DPSI_VOL';
Vprime = gdat(shot,params_eff);
% I_tor = I_p, total plasma current
params_eff.data_request='\tcv_shot::top.results.equil_1.results:i_pl';
Ip = gdat(shot,params_eff);
%% initialize source from template
% ohm
ohm_t_grid = powers_gdat.ohm.t; ohm_n_t = numel(ohm_t_grid);
......@@ -64,13 +87,26 @@ ohm_data = ohm_gdat.ohm.ohm_data;
% load LIUQE data to convert
% \tilde{j}_// = <jdotB>/(R0<Bphi/R>) to j_//0 = <jdotB>/B0; Bphi=T(psi)/R
[L,~,LY] = liuqe(shot,ohm_t_grid,'iterq',50,'ilim',3,'icsint',true);
rho_pol_norm_liu = L.pQ; % normalized sqrt poloidal flux including axis
T = LY.TQ;
Rm2_fs = LY.Q2Q;
vol = LY.VQ;
params_eff = params_eff_ref;
% normalized sqrt poloidal flux including axis
params_eff.data_request='\tcv_shot::top.results.equil_1.results:rho';
rho_pol_norm_liu = gdat(shot,params_eff);
% <1/R^2>
params_eff.data_request='\tcv_shot::top.results.equil_1.results:gpsi0_r2_fsa';
Rm2_fs = gdat(shot,params_eff);
% Volume
params_eff.data_request='\tcv_shot::top.results.equil_1.results:vol';
vol= gdat(shot,params_eff);
% T(\psi) = R*B_tor
params_eff.data_request='\tcv_shot::top.results.equil_1.results:rbtor_rho';
T = gdat(shot,params_eff);
%rho_pol_norm_liu = L.pQ; % normalized sqrt poloidal flux including axis
%T = LY.TQ;
%Rm2_fs = LY.Q2Q;
%vol = LY.VQ;
R0 = ids_core_sources.vacuum_toroidal_field.r0;
B0 = interp1(ids_core_sources.time,ids_core_sources.vacuum_toroidal_field.b0,ohm_t_grid);
jpar_tilde_to_jpar_0 = R0*T.*Rm2_fs./B0';
jpar_tilde_to_jpar_0 = R0*T.data.*Rm2_fs.data./B0';
% map volume and conversion factor on rho_pol grid of ohm_data cd_dens
jpar_tilde_to_jpar_0_mapped = interp1(rho_pol_norm_liu,jpar_tilde_to_jpar_0,ohm_data.cd_dens.rhopol_norm');
......@@ -180,6 +216,10 @@ if ~isempty(ec_gdat.ec.data) % if EC data available, fill sources
rho_pol_norm_liu = L.pQ; % normalized sqrt poloidal flux including axis
mu0 = 4*pi*10^-7;
Rm2_fs = LY.Q2Q;
params_eff = params_eff_ref;
params_eff.data_request='\tcv_shot::top.results.equil_1.results:gpsi0_r2_fsa';
Rm2_fs = gdat(shot,params_eff);
mVprime = 1./LY.Q1Q; % Q1Q: -dpsi/dV
Ip_psi = LY.ItQ; % Ip(psi) = I_tor(psi)
T = LY.TQ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment