imake_transp_jd

PURPOSE ^

SYNOPSIS ^

function transpfaste = imake_transp_jd(dkepath,basestr,equil,external,workdir,opt_gui,select)

DESCRIPTION ^

 This function interactively builds the ohm structure

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function transpfaste = imake_transp_jd(dkepath,basestr,equil,external,workdir,opt_gui,select)
0002 %
0003 % This function interactively builds the ohm structure
0004 %
0005 transpfaste = '';
0006 %
0007 if nargin < 7,select = struct;end
0008 %
0009 if ~isfield(select,'table') || ~select.table,
0010     %
0011     Dr_model = input('Radial diffusion type: \n0 electrostatic (no v|| dependence), \n1 electromagnetic (+1: v|| dependence, -1: 1/v|| dependence) \n[0] : ');
0012     if isempty(Dr_model),
0013         Dr_model = 0;
0014     end
0015     if ~isnumeric(Dr_model) | ~any(Dr_model == [-1,0,1]),
0016         disp('-----> Invalid Radial diffusion type');
0017         return
0018     end
0019     %
0020     Vr_model = input('Radial pinch type: \n0 electrostatic (no v|| dependence), \n1 electromagnetic (+1: v|| dependence, -1: 1/v|| dependence) \n[0] : ');
0021     if isempty(Vr_model),
0022         Vr_model = 0;
0023     end
0024     if ~isnumeric(Vr_model) | ~any(Vr_model == [-1,0,1]),
0025         disp('-----> Invalid Radial pinch type');
0026         return
0027     end
0028     %
0029     vparmin = input('threshold in v|| / vT [3.5] : ');
0030     if isempty(vparmin),
0031         vparmin = 3.5;
0032     end
0033     if ~isnumeric(vparmin),
0034         disp('-----> Invalid Radial pinch type');
0035         return
0036     end
0037     %
0038     norm_ref = input('Normalization of threshold: (0) v|| / vT, (1) v|| / vT_ref [1] : ');
0039     if isempty(norm_ref),
0040         norm_ref = 1;
0041     end
0042     if ~isnumeric(norm_ref) | ~any(norm_ref == [0,1]),
0043         disp('-----> Invalid option');
0044         return
0045     end
0046     %
0047     disp('--------------------------')
0048     disp('Dr = Dr_center + i*Dr_edge ')
0049     disp('--------------------------')
0050     %
0051     Dr0 = input('Diffusion coefficient (m^2/s) [1.0]');
0052     if isempty(Dr0),
0053         Dr0 = 1.0;
0054     end
0055     if ~isnumeric(Dr0),
0056         disp('-----> Invalid Dr');
0057         return
0058     end
0059     %
0060     disp('--------------------------')
0061     disp('pDr = pDr0 + i*pDr1');
0062     disp('if pDr is real (flat or parabolic increase from center to the edge): Dr(rho) = Dr_center*(1+pDr0*rho^2)')
0063     disp('if pDr is imaginary (step size from center to the edge): Dr(rho) = (Dr_center-Dr_edge)/(1+exp((rho-pDr0)/pDr1))+Dr_edge')  
0064     disp('--------------------------')
0065     %
0066     pDr = input('Radial profile of the diffusion coefficient [0]');
0067     if isempty(pDr),
0068         pDr = 0;
0069     end
0070     if ~isnumeric(pDr),
0071         disp('-----> Invalid pDr');
0072         return
0073     end
0074     %
0075     disp('--------------------------')
0076     disp('Vr = Vr_center + i*Vr_edge')
0077     disp('--------------------------')
0078     Vr0 = input('Radial pinch coefficient (m/s) [0.0]');
0079     if isempty(Vr0),
0080         Vr0 = 0.0;
0081     end
0082     if ~isnumeric(Vr0),
0083         disp('-----> Invalid Vr');
0084         return
0085     end
0086     %
0087     disp('--------------------------')
0088     disp('pVr = pVr0 + i*pVr1');
0089     disp('if pVr is real (flat or parabolic increase from center to the edge): Vr(rho) = Vr_center*(1+pVr0*rho^2)')
0090     disp('if pVr is imaginary (step size from center to the edge): Vr(rho) = (Vr_center-Vr_edge)/(1+exp((rho-pVr0)/pVr1))+Vr_edge')  
0091     disp('--------------------------')
0092     %
0093     pVr = input('Coefficient for the radial profile of the pinch coefficient [0]');
0094     if isempty(pVr),
0095         pVr = 0;
0096     end
0097     if ~isnumeric(pVr),
0098         disp('-----> Invalid pDr');
0099         return
0100     end
0101     %
0102     transpfaste.Dr0 = Dr0;
0103     transpfaste.pDr = pDr;
0104     transpfaste.Vr0 = Vr0;
0105     transpfaste.pVr = pVr;
0106     %
0107     transpfaste.Dr_model = Dr_model;
0108     transpfaste.Vr_model = Vr_model; 
0109     transpfaste.vparmin = vparmin;%Normalized units
0110     transpfaste.norm_ref = norm_ref;
0111     %
0112     if Dr_model == 1,
0113         id_transpfaste_i = 'EM';
0114     else
0115         id_transpfaste_i = 'ES';
0116     end
0117     %
0118     id_transpfaste = input(['Please specify a name for the transpfaste structure : [',id_transpfaste_i,'] : '],'s');
0119     if isempty(id_transpfaste),
0120         id_transpfaste = id_transpfaste_i;
0121     end
0122     transpfaste.id = id_transpfaste;
0123     %
0124 else
0125     %
0126     transpfaste.Dr0 = 1;
0127     transpfaste.pDr = 0;
0128     transpfaste.Vr0 = 0;
0129     transpfaste.pVr = 0;
0130     %
0131     transpfaste.Dr_model = 0;
0132     transpfaste.Vr_model = 0; 
0133     transpfaste.vparmin = 3;%Normalized units
0134     transpfaste.norm_ref = 1;
0135     %
0136     transpfaste.id = 'ES';
0137     %
0138     transpfaste = imod_struct_jd(transpfaste,'transpfaste',1,opt_gui,struct,select.style);    
0139     %
0140 end
0141 %
0142 transpfaste.info.txt = {...
0143     ['Central radial diffusion (m^2/s) : ',num2str(transpfaste.Dr0)],...
0144     ['Central radial pinch (m/s) : ',num2str(transpfaste.Vr0)]};
0145 
0146 
0147 
0148 
0149 
0150

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