### Install from Source using setup.py Source: https://aurora-fusion.readthedocs.io/en/latest/install.html Use this command to install the latest version of the code directly from the git repository. ```bash python setup.py install ``` -------------------------------- ### Example Usage for ADF15 Line Identification Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Demonstrates how to load ADF15 files, calculate fractional abundances, and identify spectral lines using example parameters for temperature, density, and ion. ```python pec_files = ['mypecs1','mypecs2','mypecs3'] Te_eV=500; ne_cm3=5e13; ion='Ar' # examples atom_data = aurora.atomic.get_atom_data(ion,['scd','acd']) _Te, fz = aurora.atomic.get_frac_abundances(atom_data, ne_cm3, Te_eV, plot=False) mult = [fz[0,10], fz[0,11], fz[0,12]] # to select charge states 11+, 12+ and 13+, for example aurora.adf15_line_identification(pec_files, Te_eV=Te_eV, ne_cm3=ne_cm3, mult=mult) ``` -------------------------------- ### Install via PyPI Source: https://aurora-fusion.readthedocs.io/en/latest/install.html Install the latest release of Aurora Fusion from the Python Package Index using pip. ```bash pip install aurorafusion ``` -------------------------------- ### Aurora Simulation Setup Source: https://aurora-fusion.readthedocs.io/en/latest/_modules/aurora/core.html Initializes the aurora_sim class with namelist and g-file dictionaries to set up simulation parameters, grids, and atomic rates. ```python """This module includes the core class to set up simulations with :py:mod:`aurora`. The :py:class:`~aurora.core.aurora_sim` takes as input a namelist dictionary and a g-file dictionary (and possibly other optional argument) and allows creation of grids, interpolation of atomic rates and other steps before running the forward model. """ # MIT License # # Copyright (c) 2021 Francesco Sciortino # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ``` -------------------------------- ### Julia Installation Link Source: https://aurora-fusion.readthedocs.io/en/latest/aurora_req.html Provides the official link to download and install Julia, which is required for the Julia version of the Aurora code. ```text https://julialang.org/downloads/ ``` -------------------------------- ### Set Impurity Source Rate Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Configure the impurity source rate. This example sets a constant source starting at t=0 with a rate of 1e24 particles/second. ```python namelist['source_type'] = 'const' namelist['source_rate'] = 1e24 ``` -------------------------------- ### Load GACode Input Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Loads kinetic profiles from a sample input.gacode file for ionization equilibrium calculations. Ensure the 'example.input.gacode' file is available in the 'examples' directory. ```python import omfit_gapy inputgacode = omfit_gapy.OMFITgacode('example.input.gacode') ``` -------------------------------- ### Get ADAS File Location and Identify Lines Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Example of retrieving an ADAS file path and identifying spectral lines based on plasma conditions. ```python >>> Te_eV=500; ne_cm3=5e13 # eV and cm^{-3} >>> filepath = aurora.get_adas_file_loc('pec96#he_pju#he0.dat', filetype='adf15') >>> aurora.adf15_line_identification(filepath, Te_eV=Te_eV, ne_cm3=ne_cm3) ``` -------------------------------- ### setup_grids Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Sets up the radial and temporal grids for the simulation based on namelist inputs. ```APIDOC ## setup_grids() ### Description Method to set up radial and temporal grids given namelist inputs. ### Method [Not specified in source] ``` -------------------------------- ### Setup Radial and Temporal Grids Source: https://aurora-fusion.readthedocs.io/en/latest/_modules/aurora/core.html Initializes the radial and temporal grids for the simulation based on namelist parameters or an equilibrium description (geqdsk). It determines the separatrix location and sets up grids for volume-enclosed flux and time steps. ```python def setup_grids(self): """Method to set up radial and temporal grids given namelist inputs.""" if self.geqdsk is not None: # Get r_V to rho_pol mapping rho_pol, _rvol = grids_utils.get_rhopol_rvol_mapping(self.geqdsk) rvol_lcfs = interp1d(rho_pol, _rvol)(1.0) self.rvol_lcfs = self.namelist["rvol_lcfs"] = np.round( rvol_lcfs, 3, ) # set limit on accuracy elif "rvol_lcfs" in self.namelist: # separatrix location explicitly given by user self.rvol_lcfs = self.namelist["rvol_lcfs"] else: raise ValueError( "Could not identify rvol_lcfs. Either provide this in the namelist or provide a geqdsk equilibrium" ) # create radial grid grid_params = grids_utils.create_radial_grid(self.namelist, plot=False) self.rvol_grid, self.pro_grid, self.qpr_grid, self.prox_param = grid_params if self.geqdsk is not None: # get rho_poloidal grid corresponding to aurora internal (rvol) grid self.rhop_grid = interp1d(_rvol, rho_pol, fill_value="extrapolate")( self.rvol_grid ) self.rhop_grid[0] = 0.0 # enforce on axis else: # use rho_vol = rvol/rvol_lcfs self.rhop_grid = self.rvol_grid / self.rvol_lcfs # ---------------- # define time grid ('timing' must be in namelist) self.time_grid, self.save_time = grids_utils.create_time_grid( timing=self.namelist["timing"], plot=False, ) self.time_out = self.time_grid[self.save_time] # create array of 0's of length equal to self.time_grid, with 1's where sawteeth must be triggered self.saw_on = np.zeros_like(self.time_grid) input_saw_times = self.namelist["saw_model"]["times"] self.saw_times = np.array(input_saw_times)[input_saw_times < self.time_grid[-1]] if self.namelist["saw_model"]["saw_flag"] and len(self.saw_times) > 0: self.saw_on[self.time_grid.searchsorted(self.saw_times)] = 1 ``` -------------------------------- ### Setup Kinetic Profiles and Dependencies Source: https://aurora-fusion.readthedocs.io/en/latest/_modules/aurora/core.html Initializes kinetic background profiles (electron/ion density and temperature) and time-dependent atomic rates. It handles profile interpolation and sets up source functions, including arbitrary 2D sources. ```python def setup_kin_profs_depts(self): """Method to set up Aurora inputs related to the kinetic background from namelist inputs.""" # get kinetic profiles on the radial and (internal) temporal grids self._ne, self._Te, self._Ti, self._n0 = self.get_aurora_kin_profs() # store also kinetic profiles on output time grid if len(self._ne) > 1: # all have the same shape now save_time = self.save_time else: save_time = [0] self.ne = self._ne[save_time, :] self.Te = self._Te[save_time, :] self.Ti = self._Ti[save_time, :] self.n0 = self._n0[save_time, :] # Get time-dependent parallel loss rate self.par_loss_rate = self.get_par_loss_rate() metastables = self.namelist.get("metastable_flag", False) superstages = self.namelist.get("superstages", []) # Obtain atomic rates on the computational time and radial grids self.set_time_dept_atomic_rates( superstages=superstages, metastables=metastables, ) Sne0 = self.Sne_rates[:, 0, :] # get radial profile of source function if len(save_time) == 1: # if time averaged profiles were used Sne0 = Sne0[:, [0]] # 0th charge state (neutral) if self.namelist["source_type"] == "arbitrary_2d_source": # interpolate explicit source values on time and rhop grids of simulation # NB: explicit_source_vals should be in units of particles/s/cm^3 <-- ionization rate srho = self.namelist["explicit_source_rhop"] stime = self.namelist["explicit_source_time"] source = np.array(self.namelist["explicit_source_vals"]).T spl = RectBivariateSpline(srho, stime, source, kx=1, ky=1) # extrapolate by the nearest values self.source_rad_prof = spl( np.clip(self.rhop_grid, min(srho), max(srho)), ``` -------------------------------- ### Get ADAS File Location and Read ADF15 Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Demonstrates how to get the location of an ADAS file and read its contents into a pandas DataFrame. This is a common first step for radiation calculations. ```python filepath = aurora.get_adas_file_loc(‘pec96#h_pju#h0.dat’, filetype=’adf15’) trs = aurora.read_adf15(filepath) ``` -------------------------------- ### Initialize Aurora Simulation Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Sets up the input dictionary for an Aurora ion transport simulation using a namelist and an optional EFIT g-file. ```python aurora_sim(namelist, geqdsk=None) ``` -------------------------------- ### Get Line Style Cycle Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Retrieve an iterable of line styles for use in plotting. ```python aurora.plot_tools.get_line_cycle() ``` -------------------------------- ### Get Aurora Kinetic Profiles Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Retrieves kinetic profiles on radial and time grids. ```python get_aurora_kin_profs(min_T=1.01, min_ne=10000000000.0) ``` -------------------------------- ### Run and Post-process OEDGE Simulation Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Sets up, runs, and post-processes an OEDGE simulation using Aurora. This example demonstrates loading input files, modifying parameters, running the simulation, and evaluating atomic spectra contributions. ```python import aurora import matplotlib.pyplot as plt plt.ion() shot = 38996 time_s = 3.5 label = "osm_test" casename = f"oedge_AUG_{shot}_{int(time_s*1e3)}_{label}" # set up an OEDGE case # Assuming t0 and t1 are defined elsewhere in the context # For demonstration, let's assume t0=0 and t1=1 t0 = 0 t1 = 1 osm = aurora.oedge_case(shot, (t0 + t1) / 2.0, label=label) # load a specific input file osm.load_input_file(filepath="/path/to/my/file.d6i") # possibly modify specific parts of the input file: osm.inputs["+P01"]["data"] = 22 # update input file osm.write_input_file(filepath="/path/to/my/file.d6i") # now run simulation osm.run(grid_loc="/path/to/my/grid/file.sno") # once simulation is run, load the output osm.load_output() # now, initialize emission calculation am = aurora.h_am_pecs() # extract relevant fields from the OEDGE run ne_m3 = osm.output.read_data_2d("KNBS") Te_eV = osm.output.read_data_2d("KTEBS") Ti_eV = osm.output.read_data_2d("KTIBS") n_H2_m3 = osm.output.read_data_2d("PINMOL") n_H_m3 = osm.output.read_data_2d("PINATO") # load all contributions predicted by AMJUEL cH, cHp, cH2, cH2p, cH2m = am.load_pec( ne_m3, Te_eV, ne_m3, # ni=ne n_H_m3, n_H2_m3, series="balmer", choice="alpha", plot=False, ) fig, axs = plt.subplots(1, 5, figsize=(25, 6), sharex=True) osm.output.plot_2d(cH, ax=axs[0]) axs[0].set_title("cH") osm.output.plot_2d(cHp, ax=axs[1]) axs[1].set_title("cHp") osm.output.plot_2d(cH2, ax=axs[2]) axs[2].set_title("cH2") osm.output.plot_2d(cH2p, ax=axs[3]) axs[3].set_title("cH2p") osm.output.plot_2d(cH2m, ax=axs[4]) axs[4].set_title("cH2m") plt.tight_layout() ``` -------------------------------- ### Initialize and Load ehr5_file Class Source: https://aurora-fusion.readthedocs.io/en/latest/_modules/aurora/neutrals.html Initializes the ehr5_file class, optionally specifying a file path. If no path is given, it attempts to download the ehr5.dat file. It then loads the atomic data. ```python class ehr5_file: """Read ehr5.dat file from DEGAS2. Returns a dictionary containing - Ionization rate Seff in :math:`cm^3 s^{-1}` - Recombination rate Reff in :math:`cm^3 s^{-1}` - Neutral electron losses :math:`E_{loss}^{(i)}` in :math:`erg s^{-1}` - Continuum electron losses :math:`E_{loss}^{(ii)}` in :math:`erg s^{-1}` - Neutral “n=2 / n=1”, :math:`N_2^{(i)}/N_1` - Continuum “n=2 / n=1”, :math:`N_2^{(ii)}/N_11 - Neutral “n=3 / n=1”, :math:`N_3^{(i)}/N_1` - Continuum “n=3 / n=1”, :math:`N_3^{(ii)}/N_1` ... and similarly for n=4 to 9. Refer to the DEGAS2 manual for details. """ def __init__(self, filepath=None): """Load ehr5.dat file, either from the indicated path or by downloading it locally. Keyword Args: filepath : str, optional Path of ehr5.dat file to use. If left to None, the file is downloaded from the web and saved locally. Results for each of the fields in the `fields` attribute will be available in the `res` attribute in the form of a dictionary. Refer to the DEGAS2 manual for a description of these fields. """ if filepath is None: if not os.path.exists(atomic_data_dir + "/ehr5.dat"): # if ehr5.dat file is not available, download it download_ehr5_file() self.filepath = atomic_data_dir + "/ehr5.dat" else: self.filepath = filepath self.ne = 10 ** np.array( [10 + (jn - 1.0) / 2.0 for jn in np.arange(1, 16)] ) # cm^{-3} self.Te = 10 ** np.array( [-1.2 + (jt - 1.0) / 10.0 for jt in np.arange(1, 61)] ) # eV self.fields = [ "Seff", "Reff", "Ei_loss", "Eii_loss", "n3i_n1", "n3ii_n1", "n2i_n1", "n2ii_n1", "n4i_n1", "n4ii_n1", "n5i_n1", "n5ii_n1", "n6i_n1", "n6ii_n1", "n7i_n1", "n7ii_n1", "n8i_n1", "n8ii_n1", "n9i_n1", "n9ii_n1", ] # get data self.load() def load(self): self.res = {} with open(self.filepath) as f: for field in self.fields: data = np.zeros((15, 60)) # read header header = f.readline() for jn in np.arange(15): # loop over 15 densities _jn_index = f.readline() arr = [] for jt_row in np.arange(10): # 10 rows of 6 values each for Te elems = [ val for val in f.readline().strip().split(" ") if val != "" ] line = [float(val) for val in elems] data[jn, jt_row * 6 : (jt_row + 1) * 6] = np.array(line) _dum = f.readline() # empty line at the end self.res[field] = copy.deepcopy(data) ``` -------------------------------- ### Get Aurora Simulation State Dictionary Source: https://aurora-fusion.readthedocs.io/en/latest/_modules/aurora/core.html Returns the current state of the aurora_sim object as a dictionary. ```python def save_dict(self): return self.__dict__ ``` -------------------------------- ### plot_resolutions() Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html A convenience function to display the time and spatial resolution settings of an Aurora simulation setup. ```APIDOC ## plot_resolutions() ### Description Convenience function to show time and spatial resolution in Aurora simulation setup. ``` -------------------------------- ### setup_kin_profs_depts Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Sets up Aurora inputs related to the kinetic background from namelist inputs. ```APIDOC ## setup_kin_profs_depts() ### Description Method to set up Aurora inputs related to the kinetic background from namelist inputs. ### Method [Not specified in source] ``` -------------------------------- ### Initialize Aurora Simulation Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Create an aurora_sim object, which initializes the simulation environment with the specified namelist and equilibrium data. This object holds all necessary inputs for the forward model. ```python asim = aurora.aurora_sim(namelist, geqdsk=geqdsk) ``` -------------------------------- ### Get B2 Grid Patches Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Retrieves polygons that describe the B2 grid, returned as a mp.collections.PatchCollection object. ```python get_b2_patches() ``` -------------------------------- ### Initialize Plotting Tools Source: https://aurora-fusion.readthedocs.io/en/latest/_modules/aurora/plot_tools.html Initializes the plotting tools with a map image and sets up the colormap cycle based on available Matplotlib colormaps. ```python self.mapimage = mapimage self.press = None self.cycle = sorted( [i for i in dir(plt.cm) if hasattr(getattr(plt.cm, i), "N")] ) self.index = self.cycle.index(ScalarMappable.get_cmap(cbar).name) ``` -------------------------------- ### Get Main Ion Density Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Estimates the main ion density from the electron density and a list of ions. ```python ni_cm3 = aurora.get_main_ion_dens(ne_cm3, ions) ``` -------------------------------- ### Plot Simulation Resolutions Source: https://aurora-fusion.readthedocs.io/en/latest/_modules/aurora/core.html A convenience function to display the time and spatial resolution of an Aurora simulation setup. ```python def plot_resolutions(self): """Convenience function to show time and spatial resolution in Aurora simulation setup.""" # display radial resolution _ = grids_utils.create_radial_grid(self.namelist, plot=True) # display time resolution _ = grids_utils.create_time_grid(timing=self.namelist["timing"], plot=True) ``` -------------------------------- ### Create Time Grid for Simulations (Legacy) Source: https://aurora-fusion.readthedocs.io/en/latest/_modules/aurora/grids_utils.html Generates a computational time grid for simulations using a Fortran routine. This is a legacy function; the Python-based `create_time_grid` is recommended. It takes a timing dictionary defining time steps and dt values. ```python time : array Computational time grid corresponding to `timing` input. save : array ``` -------------------------------- ### Get ADF04 Files Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Collects a set of trusted ADAS ADF04 files. This function is planned for expansion in ColRadPy. ```python aurora.radiation.adf04_files() ``` -------------------------------- ### Load AMJUEL/HYDHEL Reactions Database Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Initializes the reactions database from AMJUEL and HYDHEL formats. This is used for processing atomic and molecular rates. ```python import os, copy import numpy as np import matplotlib.pylab as plt plt.ion() import sys # Make sure that package home is added to sys.path sys.path.append("../") import aurora rdb = aurora.amdata.reactions_database() ``` -------------------------------- ### Build from Source using Makefile Source: https://aurora-fusion.readthedocs.io/en/latest/install.html Modify the Makefile to control compiler usage and then run this command to clean and build the project. ```bash make clean; make ``` -------------------------------- ### Get Atomic Relaxation Time Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Visualizes the atomic relaxation time as a function of electron temperature. Requires pre-loaded atomic data. ```python import numpy as np import aurora atom_data = aurora.atomic.get_atom_data('N', ['scd', 'acd']) aurora.atomic.get_atomic_relax_time(atom_data, [1e14], Te_eV=np.linspace(0.1, 200, 1000), plot=True) ``` -------------------------------- ### aurora_sim Class Initialization Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Initializes the aurora_sim class to set up input for an Aurora ion transport simulation. It takes a namelist dictionary and an optional GEQDSK file. ```APIDOC ## aurora_sim Class ### Description Sets up the input dictionary for an Aurora ion transport simulation from the given namelist. ### Parameters * **namelist** (_dict_) – Dictionary containing aurora inputs. Users should modify this based on default_nml.py for their runs. * **geqdsk** (_dict_, optional) – EFIT gfile. If None, minor and major radius must be in the namelist. ``` -------------------------------- ### Set Up Time-Independent Kinetic Profiles Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Configure time-independent kinetic profiles for electron density (ne) and temperature (Te) within the namelist. Ensure profiles are on the rhop grid and units are correctly converted to CGS. ```python kp = namelist['kin_profs'] kp['Te']['rhop'] = kp['ne']['rhop'] = np.sqrt(inputgacode['polflux']/inputgacode['polflux'][-1]) kp['ne']['vals'] = inputgacode['ne']*1e13 # 1e19 m^-3 --> cm^-3 kp['Te']['vals'] = inputgacode['Te']*1e3 # keV --> eV ``` -------------------------------- ### Load Default Namelist Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Load the default namelist configuration. This function is typically used as a starting point for setting up simulation parameters. ```python aurora.default_nml.load_default_namelist() ``` -------------------------------- ### Get Color Cycle for Plotting Source: https://aurora-fusion.readthedocs.io/en/latest/aurora.html Retrieve an iterable of colors from a specified colormap, useful for cycling through colors in a plot. The number of colors can be specified. ```python aurora.plot_tools.get_color_cycle(_num =None_, _map ='plasma'_) ``` -------------------------------- ### Load SOLPS-ITER Case from Files Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Loads a SOLPS-ITER case from specified file paths on disk. Use this when SOLPS results are stored locally. ```python import aurora # alternatively, one may want to load SOLPS results from files on disk: so2 = aurora.solps_case( b2fstate_path="/afs/ipp/home/s/sciof/SOLPS/141349/b2fstate", b2fgmtry_path="/afs/ipp/home/s/sciof/SOLPS/141349/b2fgmtry", ) ``` -------------------------------- ### Read Kinetic Profiles Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Read kinetic profile data from an example GACode input file. This provides electron density and temperature profiles. ```python inputgacode = omfit_gapy.OMFITgacode('example.input.gacode') ``` -------------------------------- ### Initialize Transport Coefficients and Call FACIT Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Initializes arrays for transport coefficients and magnetic geometry, then calls the FACIT model in a loop for each charge state of the impurity species. Ensure input densities are in [m-3] and output coefficients are converted to [cm2/s] and [cm/s]. ```python # note that to be able to give charge-dependent Dz and Vz, # one has to give also time dependence (see documentation of aurora.core.run_aurora()) times_DV = np.array([0]) # note that to be able to give charge-dependent Dz and Vz, # one has to give also time dependence (see documentation of aurora.core.run_aurora()), # so a dummy time dimension with only one element is introduced here nz_init = np.zeros((asim.rvol_grid.size, asim.Z_imp+1)) D_z = np.zeros((asim.rvol_grid.size, times_DV.size, asim.Z_imp+1)) # space, time, nZ V_z = np.zeros(D_z.shape) # flux surface contours (when rotation_model = 2) RV, ZV = aurora.rhoTheta2RZ(geqdsk, rhop, theta, coord_in='rhop', n_line=201) RV, ZV = RV.T, ZV.T # call to FACIT for each charge state for j, tj in enumerate(times_DV): for i, zi in enumerate(range(asim.Z_imp + 1)): if zi != 0: Nz = nz_init[:idxsep+1,i]*1e6 # in 1/m**3 gradNz = np.gradient(Nz, roa*amin) fct = aurora.FACIT(roa, zi, asim.A_imp, asim.main_ion_Z, asim.main_ion_A, Ti, Ni, Nz, Machi, Zeff, gradTi, gradNi, gradNz, amin/R0, B0, R0, qmag, rotation_model = rotation_model, Te_Ti = TeovTi, RV = RV, ZV = ZV) D_z[:idxsep+1,j,i] = fct.Dz*100**2 # convert to cm**2/s V_z[:idxsep+1,j,i] = fct.Vconv*100 # convert to cm/s ``` -------------------------------- ### Read Equilibrium Data Source: https://aurora-fusion.readthedocs.io/en/latest/tutorial.html Read magnetic equilibrium data from an example EFIT gfile. This is essential for setting up the simulation's spatial grid. ```python geqdsk = omfit_eqdsk.OMFITgeqdsk('example.gfile') ``` -------------------------------- ### Define Radial Grid Parameters Source: https://aurora-fusion.readthedocs.io/en/latest/params.html Sets up a dictionary with parameters for creating a radial grid. Includes spacing at the center and edge, LCFS, boundary separation, and limiter separation. ```python namelist={} namelist['K'] = 6. namelist['dr_0'] = 1.0 # 1 cm spacing near axis namelist['dr_1'] = 0.1 # 0.1 cm spacing at the edge namelist['rvol_lcfs'] = 50.0 # 50cm minor radius (in rvol units) namelist['bound_sep'] = 5.0 # distance between LCFS and wall boundary namelist['lim_sep'] = 3.0 # distance between LCFS and limiter # now create grid and plot it rvol_grid, pro_grid, qpr_grid, prox_param = create_radial_grid(namelist,plot=True) ``` -------------------------------- ### Reload Namelist Configuration Source: https://aurora-fusion.readthedocs.io/en/latest/_modules/aurora/core.html Updates simulation parameters by reloading the namelist. This method is useful for applying changes to simulation settings after initial setup. ```python def reload_namelist(self, namelist=None): """(Re-)load namelist to update scalar variables.""" if namelist is not None: self.namelist = namelist # Extract other inputs from namelist: self.mixing_radius = self.namelist["saw_model"]["rmix"] self.decay_length_boundary = self.namelist["SOL_decay"] # cm self.wall_recycling = self.namelist["wall_recycling"] self.tau_div_SOL_ms = self.namelist["tau_div_SOL_ms"] self.tau_pump_ms = self.namelist["tau_pump_ms"] self.tau_rcl_ret_ms = self.namelist["tau_rcl_ret_ms"] # if recycling flag is set to False, avoid any divertor return flows # To include divertor return flows but no recycling, set wall_recycling=0 if not self.namelist["recycling_flag"]: ```