Contacts: Orso Meneghini, Tom Osborne
VARYPED is a Python workflow that makes variation of the pedestal parameters about an existing (kinetic) gEQDSK to map out the stability space (typically in terms of the pedestal pressure gradient and current density).
EFITs in varyped mode are run with fixed boundary and with both p’ and ff’ fully specified in terms of splines.
The p’ profile is determined as a variation of profile stored in MDS+ from a profiles.py run and already used for a kinetic fit. The pedestal pressure is varied keeping the collisionality (n/T**2) fixed. Core p’ is reduced with the pedestal p’ is increased to keep the plasma stored energy fixed.
A variation of the pedestal current density is also allowed and from this ff’ is computed. The current can be simply varied in the pedestal region, or it can be computed self consistently with the variation of the p’ profile based on ONETWO runs for each of the pressure profiles in the pedestal kinetic profile variation. The current is either taken from the existing kinetic fit g file or it can also be taken from ONETWO outone file used in the kinetic fit.
The boundary shape is taken from the existing kinetic fit (from which the current profile is taken) or optionally from another g file or a shape namelist file (s file).
A series of k files is generated on which EFIT is run in a sub directory varypedshot_runid_timeid. The time value used in the k,a,g files is an index through the variation of kinetic profiles and pedestal current density.
A file results_shot_runid_timeid gives the correspondence between the profile and current parameters and the file index and also gives the EFIT error value.
This module is used to:
Start from existing input files (g-file, a-file and p-file)
Set extent of the scan
Retrieval of existing VARYPED scan
Plotting of extent of g-file pressure/current variations
Snyder, P. B., et al. “Pedestal stability comparison and ITER pedestal prediction.” Nuclear Fusion 49.8 (2009): 085035.
Documentation: https://docplayer.net/30960214-Python-data-analysis-tool-kit-outline.html Official webpage (requires access): https://diii-d.gat.com/diii-d/PyD3D
SYNTAX: /f/python/linux64/bin/efit.py -x required_arg0_value required_arg1_value ... optional_arg0=value optional_arg1=value ... Where x is a switch setting run type, and one of ['s', 'r', 'R', 'K', 'V', 'F', 'w', 'j', 'f', 'k', 'g', 'a', 'p', 'A', 'L']. Arguments must be separated by space. Required argumensts must be first, in order, and without argname. Optional arguments may be listed in order without the argument name or in any order as argname=argvalue. No space is allowed around = . String argument values do not need to be in quotes. None argvalue is None When using csh or tcsh, list type arguments must be in quotes, e.g. host_types='[hp,osf]' Example: /f/python/linux64/bin/efit.py -s 98893 tstart=2000 dt=10 nt=100 snap=jt RUN CONTROL SWITCHES (For detailed help on a given run mode enter /f/python/linux64/bin/efit.py -hx ) -s : SETTING UP efit_runs TABLE TO CONTROL STANDARD, KINETIC, AND VARYPED EFIT RUNS FOR SHOT -r : RUNNING STANDARD, KINETIC, OR VARYPED EFITS FOR RANGE OF SHOTS IN efit_runs TABLE -R : RUNNING STANDARD EFITS FROM COMMAND LINE FOR SHOT -K : RUNNING KINETIC EFITS FROM COMMAND LINE FOR SHOT -V : RUNNING VARYPED EFITS FROM COMMAND LINE FOR SHOT -F : RUNNING FIXED BOUNDARY EFIT FOR SHOT -w : WRITING EFIT RESULTS TO MDSPLUS FOR SHOT -j : WRITING JET EFIT RESULTS TO D3D MDSPLUS FOR JET SHOT -f : READING SNAP EQDSK FROM MDSPLUS AND WRITING TO FILE FOR SHOT -k : READING K EQDSK FROM MDSPLUS AND WRITING TO FILE FOR SHOT -g : READING G EQDSK FROM MDSPLUS AND WRITING TO FILE FOR SHOT -a : READING A EQDSK FROM MDSPLUS AND WRITING TO FILE FOR SHOT -p : READING P EQDSK FROM MDSPLUS AND WRITING TO FILE FOR SHOT -A : READING A,G,K,P EQDSKS FROM MDSPLUST AND WRITING TO FILES FOR SHOT -L : COMPUTE THE CONNECTION LENGTH BETWEEN THE OUTER MIDPLANE AND DIVERTOR <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -V >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> vary_ped: RUNNING VARYPED EFITS FROM COMMAND LINE FOR SHOT vary_ped( # Generates a series of EFITs with pedestal pressure, current density and # other parameters varied about some initial value for use in PB stability analysis. # Although it is possible to do a variation of p' and J based only on the profiles # in an initial EFIT eqdsk, a profile set is still generally required at least to # compute the diamagnetic frequency for determining the PB-mode stability threshold. # The profile set should be specified in the paramaters pshot,ptimeid,prunid. # Pressure profile source: # 1) Pressure profile from profile data. Set shot,timeid,runid to correspond to # profile data. aeqdsk, geqdsk must exist with time=teqdsk from profile analaysis or these # will be created from efittree used in profile reconstruction. # 2) Pressure profile from EFIT (only for pure pressure variations). Set shot=shot, # timeid=teqdsk, runid=EFIT mdsplus tree (if a,geqdsks don't exist they are read from # this tree). If timeid=-1 teqdsk is inferred from the profile analysis (ptimeid,prunid). # Current profile source: # 1) Current profile from model (Sauter, XGC0, ONETWO runs) base on profiles (ptimeid,prunid). # Set jmodel=jst,jxgc,j12,..... jst and jxgc are directly computed. # 2) Current profile from EFIT, jmodel=jef. Read current from geqdsk as per pressure profile source. # 3) Current self consistent with pressure profile. Set jselfcons=1 and jmodel!=jef. This will # compute the bootstrap current for each variation in pressure profile. Note that using jmodel=j12 # in this case is not recommended since it will cause ONETWO to be run on every variation. # Converged equilibrium are stored in the directory varyped_pshot_ptimeid_prunid, non-converged # cases in bad_varyped_pshot_ptimeid_prunid. shot, # Shot number of initial equilibrium. timeid, # Timeid for profile data, if these are used to construct the pressure profiles, # or eqdsk time (ms) if pressure profile is read from EFIT eqdsk # or -1 if eqdsk time is to be inferred from profile set (pshot,ptimeid,prunid) # and pressure profile read from EFIT runid, # Runid for profile data in MDSplus, if these are used to construct the pressure profiles. # If instead runid is an EFIT tree name or RUNTAG the pressure profile is read # in from an EFIT eqdsk rather than being reconstructed from the profiles data. # In this case if the geqdsk file does not exist, it is read from MDSplus from # the EFIT mdsplus tree resolved from runid, with the eqdsk time set by timeid. pshot = None, # Get profiles from a different shot relative to kinetic EFIT. This # along with ptimeid, prunid is needed if write_pfile=1 and runid='efitxx', # i.e. we are using the EFIT pressure profile but want to print out n,T,... ptimeid = None, # Timeid for profile data, used to construct the pressure profiles. # If None then = timeid. If using the pressure profile from EFIT must be # timeid for the profile data and not None. prunid = None, # Runid for profile data in MDSplus used to construct the pressure profiles. # If None then = runid. If using the pressure profile from EFIT must be # runid for the profile data and not None. use_pfile = 0, # If 1 read profile data from a pfile instead of a profile fit # in this case the mapping data is reconstructed from EFIT=JT_TS # at timeid unless pmap is passed in jmodel = 'jef', # Model for current density profile # if 'j12' use ONETWO current # if 'jst' use Sauter expression (same as ONETWO with JHIRSH=112) # if 'jxgc' use XGC0 modification fo Sauter expression # if 'jneo' use NEO calculation for bootstrap current (not yet implemented) # if 'jef' use efit value from g eqdsk run12 = -1, # 1=run ONETWO to get jphi edge data if jmodel='j12'. # -1=read existing outone or if no outone run ONETWO jhirsh = 112, # Bootstrap current model to use in ONETWO, 96=collisional, # 89=collisionless, 110 Sauter, 111 Sauter with Sauter resistivity host12 = 'localhost', # Host to run ONETWO on. Must be logged into venus. tfixbdy = None, # Equilibrium time to use for fixed boundary mode, if None use timeid cfcoil = -1.0, # Regularization of F-coil current distribution in fixed boundary fit, # should be < 0. If smaller in magnitude then boundary is more accurately # matched but there is a larger coil to coil variation in F-coil currents. which_prof_id = None, # If not None use profile order specified in # which_prof table when running best_profiles scale_pres = [1.,0.,1], # Scale factor to apply to the pressure profile; # attempt to keep beta fixed by reducing p0 # values = scale_pres + numpy.arange(scale_pres)*scale_pres scale_w = [1.,0.,1], # Scale the total kinetic energy independent of pedestal scale_nustar = [1.,0.,1], # Scale collisionality keeping pressure fixed in ONETWO run # to get bootstrap current scale_temp = [1.,0.,1], # Scale factor to apply to Ti and Te profiles; # pressure is changed by the same amount scale_den = [1.,0.,1], # Scale factor to apply to ne profile; # pressure is changed by the same amount scale_cur = [1.,0.,1], # Scale factor to apply to ne profile; # pressure is changed by the same amount ne_shift = [0.,0.,1], # Shift in psin to apply to ne profile ne_shift_type = 1, # Type of ne shift, 0 = rigid, 1=squeeze against separatrix te_shift = [0.,0.,1], # Shift in psin to apply to Te profile te_shift_type = 1, # Type of Te shift, 0 = rigid, 1=squeeze against separatrix pe_shift = [0.,0.,1], # Shift in psin to apply to pe profile pe_shift_type = 1, # Type of pe shift, 0 = rigid, 1=squeeze against separatrix cbootin = 1.0,# Scale the bootstrap current over the entire radius by this factore pp1 = 'exp', # Pressure gradient at sep, if=None, do not constrain pprime at sep, # if 'exp' constrain to the experimental value pp0 = None, # Pressure gradient at the axis, if= None do not constrain, # if 'exp' constrain to the experimental value. pbrflat = None, # If not None, flatten current density inside psin=pbrflat tfixcur = None, # Equilibrium time to use for fixed current mode when jmodel=jef, # if None use timeid jselfcons = 0, # If 1 compute j self consistently with p profile using ONETWO nppress = 132, # Number of p' points packpoint = 0.5, # Packing of radial points in p profile, 0=more near sep, # 1=more inside pedestal sigmin = 0.02, # Minimum error bar on pressure = sigmin*sigmap*max(pressure) sigmap = 0.05, # Error bar on pressure = max ( sigmin, sigmap*pressure) ppknt = [-0.5], # pprime knots. If None or empty sequence knot locations are # automatically determined from fit of pprime profile. # If -1 < ppknt < 0 fix one of the internal knots at these locations in autoknot # If <-1 = Number of knots, use between 9 and 16,. If not set 16 are used. pptens = 2., # Tension value for p' spline, 0=cubic spline, large = strait lines calpawt = 1.e0, # Weight on p' constraint for fixed p' fwtcur = 0.0, # If 1 then use value of ff' at inner knot value to match Ip ffknt = [-0.5], # ffprime knots. If None or empty sequence knot locations are # automatically determined from fit of ffprime profile (computed from pprime and j) # If -1 < ffknt < 0 fix one of the internal knots at these locations in autoknot. # If <-1 = Number of knots, use between 9 and 16,. If not set 16 are used. # If jselfcons = 1 ffknt input is ignored and ffknt is set to ppknt. fftens = 2., # Tension value for ff' spline, 0=cubic spline, large = strait lines cgamawt = 1.e0, # Weight on ff' constraint for fixed ff' kvtor = 0, # If > 0 include toroidal rotation terms in equilibrium # If =1 include first order rotational terms, # If =2 include second order rotational terms, currently not implemented # =3 not allowed since we are using splines wwknt = , # Knot locations for toroidal rotation pressure gradient wwtens = 1., # Tension for toroidal rotation pressure gradient packptpw = 0.2, # Like packpoint but for toroidal rotation pressure sigmapw = 0.2, # Like sigmap but for toroidal rotation pressure sigminpw = 0.5, # Like sigmin but for toroidal rotation pressure comegawt = 1.e0, # Weight on pw' constraint relax = 0.3, # Relaxation parameter: decrease to improve convergence mxiter = 225, # Number of iterations allowed in efit error = 1.e-8, # EFIT finishes if error is less than this value return_profs=0, # If 1 return profiles used in calculations, default is to return none. runefit = 1, # If 1 run efit if 0 just mmake kfiles efit_type = '129d', # Flavor of Efit to run host = 'best', # Host to run efit on, can be list of hosts or 'best' n_processes = 4, # Number of efit processes, if host=best then = number of k files. dt_check = 20, # Time interval(s) form automatic checking of completion of EFITS write_pfiles = 1, # If 1 write files containing the profiles to be used with ELITE results # Storage of results shot_dir_ext = '', # Append this extension to the varyped results directory name kiter = 0, # Number of iterations adjusting p' and j' to flux geometry. 0=No readjustment quiet = 1, # If 1 don't print as much when running EFIT )
List of contributors sorted by number of lines authored:
554 Orso Meneghini 58 Fusion Bot 22 Sterling Smith
List of usernames sorted by number of module imports: wangy, knolkerm, nelsonand, wanghuiqian, wilkstm, orlov, ashourvana, chenxi, wilcoxr, chenji, lizeyu, meneghini, pankin, solomon, yfwang, akleiner, mcclenaghanj, chenjia, grierson, lig, huqiming, likai, lyonsbc, soukhan, jianx, sungc, wangqi, jgchen, kleinera, turnbull, paz-soldan, fila, tang31, victorb, chenj, haskeysr, shaskey, smithsp, zhuyiren, canalg, guowf, inyong, izacardo, kongd, thomek, zyli, abramst, baradakk, bgrierson, blyons, bortolon, cuil, drsmith, halpernf, huangjh, nazikian, saarelma, saarelmas, vlad, weisbergd