DMC 14 Aug 2000 updated 24 Oct 2008 updated 05 Jan 2009, M. Gorelenkova(MG) *******MG The distribution function calculation is independent of the NLFBMFLR switch, and have the code accumulate two copies of the distribution function, both the particle version (FBM_PTCL) and the guiding center version (FBM) . We will still use NLFBMFLR, but only to control which copy of the distribution function is used to compute the beam-beam neutrons in ../nubeam/bbneut.for and associated routines. *******MG The fortran program `get_fbm' has been ported to unix and upgraded to allow greater flexibility of access to fast ion distributions. In particular, beam and fusion product distribution functions (now), and RF tail ion distribution functions (eventually we hope) can be accessed, at any radial or poloidal location. Averaging and integration features allow reconstruction of such quantities as the flux surface averaged total fast ion density as a function of flux surface label, or, at a particular flux surface, the poloidal variation of the fast ion density. Or the density integration can be restricted to particles within a certain energy or vpll/v range. Etc., etc. The `get_fbm' program can also write the distribution function data out to a NetCDF file, which will be a more convenient format for separately written software using this data, than the "encoded ascii" legacy format used in the .DATAn files output directly by TRANSP. ** a note on units & normalization ** `get_fbm' reads the TRANSP COMMON array fbm from an ACfile (see Heidbrink's note, below). The units of FBM are #/cm3/eV/[delta(solid-angle)/4pi] but in TRANSP & NUBEAM, "delta(solid-angle)/4pi" is equivalent to 1/[number of vpll/v bins]. ------------------------------------------------------------------------ (Discussion of delta(solid-angle) on a unit sphere in velocity space) In terms of angles on a unit sphere in velocity space: vpll/v = cos(alpha) vperp/v = sin(alpha) delta(vpll/v) = delta(cos(alpha)) For contribution to surface area on the sphare, there is a factor 2*pi*sin(alpha) = 2*pi*(vperp/v) since vperp/v is the radius of a circle on the unit sphere in 3d v-space. But the differential area on the surface of the sphere also has a factor of differential width dw: dA=dw*2*pi*sin(alpha). Corresponding to delta(cos(alpha)) this width dw of the differential band around the circle at radius 2*pi*sin(alpha) has a factor of 1/(sin(alpha)) which cancels out the factor due to the radius of the circle. You can convince yourself of this with a picture of the sphere showing the relation of dw to delta(cos(alpha))=delta(vpll/v). You get integral[(vpll/v = -1 to 1){d(vpll/v)*2pi}] = 4pi = surface area of unit sphere. The contribution of each pitch zone delta(vpll/v) is equal at delta(solid angle)/4pi = (1/nznbma) in terms of TRANSP/NUBEAM's FBM data. (End of discussion of delta(solid-angle)). ------------------------------------------------------------------------ Given the reconstructed TRANSP COMMON arrays (e.g. in get_fbm.for), the number of particles of fast specie 'js' in spatial zone 'jz', is given by: ! ! nznbma = # of vpll/v bins ! nznbmea(js) = # of energy bins ! (in general, different fast species have different energy grids) ! bmvol(iz) = volume of iz'th spatial zone ! znsum=0.0 ! sum to contain total number of particles this zone ! do ia=1,nznbma do ie=1,nznbmea(js) dE=efbmb(ie+1,js)-efbmb(ie,js) znsum=znsum+fbm(ie,ia,iz,js)*dE*bmvol(iz)/nznbma enddo enddo Questions: send email to dmccune (dmccune@pppl.gov). `get_fbm' enhancements can be requested. -------------------------------------------------------- Note by W. Heidbrink (1997) Date: Tue, 12 Aug 1997 10:27:29 -0700 (PDT) From: Subject: Beam distribution function in TRANSP To: GREENFIEL@GAV.GAT.COM, HEIDBRINK@GAV.GAT.COM, LAZARUS@GAV.GAT.COM, MURAKAMI@GAV.GAT.COM, TERPSTRA@GAV.GAT.COM, PETTY@GAV.GAT.COM, FOREST@GAV.GAT.COM, STALLARD@GAV.GAT.COM, BaylorLR@ORNL.GOV TRANSP FAST-ION DISTRIBUTION FUNCTION W.W. Heidbrink TRANSP calculates many quantities derived from the fast-ion distribution function "f" but does not ordinarily save "f" itself. Using tools originally written by McCune and at JET, Ted Terpstra and I have created programs to view "f" at DIII-D. ----------------------------------------------------------------------------- 1) Add lines to namelist. You must instruct TRANSP to dump its memory at certain selected times. This creates a so-called ACFILE in the appropriate result area. Here are the lines I inserted in 71524A01TR.DAT: ! ! Dump common block: ! !SELOUT='XXX' !list of TRANSP common symbols to output (default=all) SELAVG='FBM BMVOL BDENS2 EBA2PL EBA2PP' !quantities to average AVGTIM=0.030 !averaging time (to reduce MC noise) MTHDAVG=2 !2 for averaging after each MC timestep OUTTIM=1.875,2.150 !up to 5 times that AC files are written ------------------------------------------------------------------------ 2) Run TRANSP. If all goes well, you'll end up with files like $TRANSPROOT/result/D3D.91/71524A01.DATA1 $TRANSPROOT/result/D3D.91/71524A01.DATA2 with one file for each OUTTIM you selected. ----------------------------------------------------------------------- 3) Use your chosen method for accessing the fbm data; use get_fbm to convert the data to NetCDF format if needed. ---------------------------------------------------------------------------- 5) Physics note: the "fbm" in TRANSP actually has a complicated spatial index label that moves around radially and poloidally. There are codes that only bother to return "f" at the outer midplane. This nearly always is sufficient to reconstruct the full distribution function, because almost every orbit crosses the outer midplane. But not quite. There are some "inner" orbits (close to the x-point "pinch" orbit in phase space) that always have R