species_dke_yp

PURPOSE ^

SYNOPSIS ^

function [pzni] = species_dke_yp(pne,pZeff,zZi,fi)

DESCRIPTION ^

   Calculates the ion densities from the simple one fully stripped light impurity like Carbon, and the charge neutrality
   from the knowledge of the electron density and effective charge profiles.

   By J. Decker <jodecker@mit.edu> and Y. Peysson <yves.peysson@cea.fr>

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [pzni] = species_dke_yp(pne,pZeff,zZi,fi)
0002 %
0003 %   Calculates the ion densities from the simple one fully stripped light impurity like Carbon, and the charge neutrality
0004 %   from the knowledge of the electron density and effective charge profiles.
0005 %
0006 %   By J. Decker <jodecker@mit.edu> and Y. Peysson <yves.peysson@cea.fr>
0007 %
0008 if nargin < 4,error('Not enough arguments');end
0009 %
0010 nz = length(zZi);
0011 %
0012 if size(pne,1) == 1,%pt format
0013     npsi = length(pne);
0014     pzni = zeros(nz,npsi);
0015     N = 1;
0016 else
0017     pzni = repmat(zeros(size(pne)),[nz,1]);% Same temperature for all ion species
0018     N = size(pne,1);
0019 end
0020 %
0021 if length(pZeff) == 1, pZeff = pZeff*ones(size(pne));end
0022 %
0023 if sum(zZi>1) > 1%More than one impurity species
0024      error('need each species density from impurity transport code')
0025 elseif sum(zZi>1) == 1%One impurity species
0026      Zimp = max(zZi);
0027      pnhyd = pne.*(Zimp - pZeff)/(Zimp - 1);  
0028      pnimp = pne.*(pZeff - 1)/(Zimp - 1)/Zimp;
0029      pzni((nz-1)*N+1:nz*N,:) = pnimp;
0030 else %No Impurity
0031      pnhyd = pne;
0032      pnimp = 0*pne;
0033 end
0034 %
0035 if sum(fi) == 1,
0036      for iz = 1:3,
0037          pzni((iz-1)*N+1:iz*N,:) = fi(iz)*pnhyd;
0038      end
0039 else
0040      error('Hydrogen isotopic fractions do not add to 1')
0041 end   
0042 clear fi       
0043

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