synchrotron_dke_jd

PURPOSE ^

SYNOPSIS ^

function [ZXXD_s,ZXXF_s,ZXXD_s_tp,ZXXF_s_tp] = synchrotron_dke_jd(dkeparam,display,equilDKE,mksa,gridDKE,Zmomcoef,Zbouncecoef)

DESCRIPTION ^

 Calculate matrix coefficient for the synchrotron reaction force in LUKE

 by J. DECKER (joan.decke@cea.fr) and Y. PEYSSON (yves.peysson@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ZXXD_s,ZXXF_s,ZXXD_s_tp,ZXXF_s_tp] = synchrotron_dke_jd(dkeparam,display,equilDKE,mksa,gridDKE,Zmomcoef,Zbouncecoef)
0002 %
0003 % Calculate matrix coefficient for the synchrotron reaction force in LUKE
0004 %
0005 % by J. DECKER (joan.decke@cea.fr) and Y. PEYSSON (yves.peysson@cea.fr)
0006 %
0007 display_mode = display.display_mode;
0008 dke_mode = dkeparam.dke_mode;
0009 synchro_mode = dkeparam.synchro_mode;
0010 %
0011 etime_synchro = 0;
0012 time0 = clock;
0013 %
0014 xB0 = equilDKE.xB0;
0015 Xmhup = gridDKE.Xmhup;
0016 Xmhum = gridDKE.Xmhum;
0017 X1mmhu2 = gridDKE.X1mmhu2;
0018 X1mmhu2p = gridDKE.X1mmhu2p;
0019 X1mmhu2m = gridDKE.X1mmhu2m;
0020 Xpn = gridDKE.Xpn;
0021 Xpnp = gridDKE.Xpnp;
0022 Xpnm = gridDKE.Xpnm;
0023 %
0024 rdke =gridDKE.rdke;
0025 npn = gridDKE.npn;%Size of the momentum grids for the distribution function (half grid)
0026 nmhu = gridDKE.nmhu;
0027 nr = gridDKE.nr;%Size of the radial grid for the distribution function (half grid)
0028 nr_dke =gridDKE.nr_dke;%Size of the effective radial grid for the drift kinetic equation (nr_dke = nr for FPE equation only)
0029 %
0030 Xgamma = Zmomcoef.Xgamma;
0031 Xgammap = Zmomcoef.Xgammap;
0032 Xgammam = Zmomcoef.Xgammam;
0033 %
0034 taur_ref = mksa.taur_ref;
0035 %
0036 XXRlambda_p0p3 = Zbouncecoef.XXRlambda_p0p3;
0037 XXRlambda_p2p2_m = Zbouncecoef.XXRlambda_p2p2_m;
0038 XXRlambda_p2p2_p = Zbouncecoef.XXRlambda_p2p2_p;
0039 %
0040 % Output files initialization
0041 %
0042 % Terms from Sp at l+1/2 (Notations: _imj -> (i,j+1+2);_ipj -> (i+1,j+1/2)
0043 %
0044 ZXXD_s.pp_ipj = zeros(npn,nmhu,nr);%momentum dynamics only
0045 ZXXD_s.pp_imj = zeros(npn,nmhu,nr);%momentum dynamics only
0046 ZXXD_s.pm_ipj = zeros(npn,nmhu,nr);%momentum dynamics only
0047 ZXXD_s.pm_imj = zeros(npn,nmhu,nr);%momentum dynamics only
0048 ZXXD_s.pr_ipj = zeros(npn,nmhu,nr);
0049 ZXXD_s.pr_imj = zeros(npn,nmhu,nr);
0050 %
0051 ZXXF_s.p_ipj = zeros(npn,nmhu,nr);%momentum dynamics only
0052 ZXXF_s.p_imj = zeros(npn,nmhu,nr);%momentum dynamics only
0053 %
0054 % Terms from Sksi at l+1/2 (Notations: _ijp -> (i+1/2,j+1);_ijm -> (i+1/2,j)
0055 %
0056 ZXXD_s.mm_ijp = zeros(npn,nmhu,nr);%momentum dynamics only
0057 ZXXD_s.mm_ijm = zeros(npn,nmhu,nr);%momentum dynamics only
0058 ZXXD_s.mp_ijp = zeros(npn,nmhu,nr);%momentum dynamics only
0059 ZXXD_s.mp_ijm = zeros(npn,nmhu,nr);%momentum dynamics only
0060 ZXXD_s.mr_ijp = zeros(npn,nmhu,nr);
0061 ZXXD_s.mr_ijm = zeros(npn,nmhu,nr);
0062 %
0063 ZXXF_s.m_ijp = zeros(npn,nmhu,nr);%momentum dynamics only
0064 ZXXF_s.m_ijm = zeros(npn,nmhu,nr);%momentum dynamics only
0065 %
0066 % Terms from Spsi at (i+1/2,j+1/2) (Notations: _lm -> (l);_lp -> (l+1);
0067 %
0068 ZXXD_s.rr_lm = zeros(npn,nmhu,nr);%radial dynamics only
0069 ZXXD_s.rr_lp = zeros(npn,nmhu,nr);%radial dynamics only
0070 ZXXD_s.rp_lm = zeros(npn,nmhu,nr);
0071 ZXXD_s.rp_lp = zeros(npn,nmhu,nr);
0072 ZXXD_s.rm_lm = zeros(npn,nmhu,nr);
0073 ZXXD_s.rm_lp = zeros(npn,nmhu,nr);
0074 %
0075 ZXXF_s.r_lm = zeros(npn,nmhu,nr);%radial dynamics only
0076 ZXXF_s.r_lp = zeros(npn,nmhu,nr);%radial dynamics only
0077 %
0078 % Terms used by the old scheme only for momentum cross-derivatives (M.
0079 % Shoucri and I. Shkarofsky,Comp. Phys. Comm., 82 (1994) 287)
0080 %
0081 ZXXD_s.pp_ij = zeros(npn,nmhu,nr);
0082 ZXXD_s.pm_ij = zeros(npn,nmhu,nr);
0083 ZXXD_s.mp_ij = zeros(npn,nmhu,nr);
0084 ZXXF_s.p_ij = zeros(npn,nmhu,nr);
0085 %
0086 if dke_mode == 1
0087     %
0088     ZXXD_s_tp.pp_ippj = zeros(npn,nmhu,nr_dke);
0089     ZXXD_s_tp.pp_ipj = zeros(npn,nmhu,nr_dke);
0090     ZXXD_s_tp.pp_ij = zeros(npn,nmhu,nr_dke);
0091     ZXXD_s_tp.pp_imj = zeros(npn,nmhu,nr_dke);
0092     ZXXD_s_tp.pp_immj = zeros(npn,nmhu,nr_dke);
0093     ZXXD_s_tp.pm_ipj = zeros(npn,nmhu,nr_dke);
0094     ZXXD_s_tp.pm_ij = zeros(npn,nmhu,nr_dke);
0095     ZXXD_s_tp.pm_imj = zeros(npn,nmhu,nr_dke);
0096     ZXXD_s_tp.mp_ijp = zeros(npn,nmhu,nr_dke);
0097     ZXXD_s_tp.mp_ij = zeros(npn,nmhu,nr_dke);
0098     ZXXD_s_tp.mp_ijm = zeros(npn,nmhu,nr_dke);
0099     ZXXD_s_tp.mm_ijp = zeros(npn,nmhu,nr_dke);
0100     ZXXD_s_tp.mm_ijm = zeros(npn,nmhu,nr_dke);
0101     %
0102     ZXXF_s_tp.p_ippj = zeros(npn,nmhu,nr_dke);
0103     ZXXF_s_tp.p_ipj = zeros(npn,nmhu,nr_dke);
0104     ZXXF_s_tp.p_ij = zeros(npn,nmhu,nr_dke);
0105     ZXXF_s_tp.p_imj = zeros(npn,nmhu,nr_dke);
0106     ZXXF_s_tp.p_immj = zeros(npn,nmhu,nr_dke);
0107     ZXXF_s_tp.m_ijp = zeros(npn,nmhu,nr_dke);
0108     ZXXF_s_tp.m_ijm = zeros(npn,nmhu,nr_dke);
0109     %
0110 else
0111     %
0112     ZXXD_s_tp = NaN;
0113     ZXXF_s_tp = NaN;
0114     %
0115 end
0116 %
0117 if synchro_mode == 1,
0118     %
0119     for ir = 1:nr,
0120         %
0121         % Synchrotron reaction flux coefficients calculations for f0 and g
0122         %
0123         ZXXF_s.p_ipj(:,:,ir) = -Xgammap.*Xpnp.*X1mmhu2.*XXRlambda_p0p3(:,:,ir)*(xB0(ir)/xB0(1))^2/taur_ref;
0124         ZXXF_s.p_ij(:,:,ir) = -Xgamma.*Xpn.*X1mmhu2.*XXRlambda_p0p3(:,:,ir)*(xB0(ir)/xB0(1))^2/taur_ref;
0125         ZXXF_s.p_imj(:,:,ir) = -Xgammam.*Xpnm.*X1mmhu2.*XXRlambda_p0p3(:,:,ir)*(xB0(ir)/xB0(1))^2/taur_ref;
0126         ZXXF_s.m_ijp(:,:,ir) = -(Xpn.*Xmhup.*sqrt(X1mmhu2p).*XXRlambda_p2p2_p(:,:,ir)./Xgamma)*(xB0(ir)/xB0(1))^2/taur_ref;
0127         ZXXF_s.m_ijm(:,:,ir) = -(Xpn.*Xmhum.*sqrt(X1mmhu2m).*XXRlambda_p2p2_m(:,:,ir)./Xgamma)*(xB0(ir)/xB0(1))^2/taur_ref;
0128         %
0129         % Synchrotron reaction flux coefficients calculations for ftp
0130         %
0131         if dke_mode == 1
0132             %
0133             ir_dke = find(ir == rdke);
0134             if isempty(ir_dke)
0135                 continue
0136             end
0137             %
0138             %%TODO
0139             %
0140         end
0141     end
0142     %
0143 end
0144 %
0145 etime_synchro = etime_synchro + etime(clock,time0);
0146 if display_mode >= 1,
0147     info_dke_yp(2,['Synchrotron reaction flux coefficients calculations done in ',num2str(etime_synchro),' (s)']);
0148 end    
0149 %

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.