Input parameters (full list)¶
Below you will find the full list of input parameters divided into modules, i.e., the origin of its definition.
Command line support¶
Each experiment executable offers command line support. Execute with -h
argument to see available options. E.g.:
> ./photo_tr.x -h
Bifrost command-line options:
-i, --input input_file // provide alternative input file (default: mhd.in)
-v, --version // print git version of this executable and exit
-b, --bc. // print standard boundary condition options and exit
-h, --help // print usage information and exit
mhd.in
- the input file¶
The mhd.in
input file must be set up correctly in order to run the code. Below follows comments to a specific example Note also that the mhd.in
file is IDL
compliant and can be run as such (this is also true for the tabparam.in
file used by the square_gas
EOS
table).
params¶
; ************************* From params *************************
mx = 100
my = 150
mz = 100
mb = 5
nstep = 10
nstepstart = 0
debug = 0
time_lim = -1.000E+00
tstop = -1.000E+00
mx,my,mz
- number of grid points in x, y and z directions, respectively.mb
- number of ghost zones. By default mb=5 because Bifrost uses a 6th order differential operator (don't touch!).nstep
- number of steps to rundebug
- 0 off, 1 on; note module specific debug switches in the belownstepstart
- steps counted from this value, can be reset to any valuetime_lim
- run-time limit in seconds (disable iftime_lim < 0
)tstop
- stelar time (simulation time) limit in code units (value * u_t) (disable iftstop < 0
)
parallel¶
; ************************* From parallel *************************
periodic_x = 1
periodic_y = 1
periodic_z = 0
ndim = 3
reorder = 1
manual_cuts = 0
dims = [ 1, 0, 0 ]
periodic_[x,y,z]
- sets periodicity for boundary box. Most runs will be done with 1,1,0 (Bifrost is not prepared to run periodicity in the z-direction).ndim
- defines the dimensions of your problem (For 2.5D runs, use ndim=3 and my=1).reorder
- always set to.true.
. Used in MPI communication (don't touch)manual_cuts
-1
will enable manual domain decomposition which is setup from dims variabledims
-cx cy cz
, number of cuts (number of MPI processes) inx,y,z
direction. Ifcx*cy*cz != nproc
, automatic domain decomposition will be use istead
units¶
; ************************* From units *************************
u_l = 1.000E+08
u_t = 1.000E+02
u_r = 1.000E-07
u_p = 1.000E+05
u_u = 1.000E+06
u_kr = 1.000E-01
u_ee = 1.000E+12
u_e = 1.000E+05
u_te = 1.000E+11
u_tg = 9.692E+03
u_B = 1.121E+03
u_[xx]
- Multiply model values by these values to get cgs units. You can set scalling by modifying units module files in$BIFROST/UNITS/*.f90
stagger¶
; ************************* From stagger *************************
meshfile = "nomesh.dat"
dx = 1.0
dy = 1.0
dz = 1.0
meshfile
- if="nomesh.dat"
regular mesh will be created usingm[x,y,z]
fromparams
andd[x,y,z]
.dx,dy,dz
- Grid cell size, disregarded if meshfile exists.
timestep¶
; ************************* From timestep *************************
Cdt = 0.3
dt = 1e-6 ! set in params init
constdt = 0
msperupdate = 0
t = 0.0
timestepdebug = 0
Cdt
- Courant factor. Use0.3
or smaller for Hyman (Runge-Kutta not working).dt
- Code will attempt to run first timestep with thisdt
.constdt
- If1
, initial value ofdt
will not change. Simulation will be executed with constat time stepping.msperupdate
- If1
, printscore-microseconds-per-cell-update
instead ofMz/s
along with immbalance i.e.,:time_it_max_in_s/(time_it_max_in_s - time_it_min_in_s)*100.0
.t
- Code starts at timet
timestepdebug
- Detailed information on which variables/terms are constraining the timestep. Set with>0
.
mhd¶
; ************************* From mhd *************************
nu1 = 0.03
nu2 = 0.05
nu3 = 0.3
nu_r = 0.05
nu_r_mz = 0.0
nu_r_k = 0
nu_r_z = 0.0
nu_r_w = 0.068
nu_ee = 0.3
nu_ee_mz = 0.0
nu_ee_k = 0
nu_ee_z = 0.0
nu_ee_w = 0.068
symmetric_e = 1
symmetric_b = 0
grav = -2.74
eta3 = 0.3
ca_max = 0.0
mhddebug = 0
do_mhd = 1
mhdclean = -1
mhdclean_ub = 0
mhdclean_lb = 0
nu1,nu2,nu3
- wave, advection and shock hyperdiffusion, use (of order) 0.1,0.3,0.5 or smaller.nu_r
- The value of the mass diffusion in the upper atmosphere (bottom of grid).nu_r_mz
- The value of the mass diffusion in the lower atmosphere (top of the grid).nu_r_k
- The central grid-point point of the hyperbolic function that transitions between the two mass diffusion parametersnu_r
andnu_r_mz
. If set to a number greater than or equal to zero, this will overwritenu_r_z
.nu_r_z
- The height, inMm
, of the mid-point of the hyperbolic function that transitions between the two mass diffusion parametersnu_r
andnu_r_mz
. Can be overwritten bynu_r_k
.nu_r_w
- Width of the transition between the two mass diffusion values,nu_r
andnu_r_mz
.nu_ee
- The value of the energy diffusion in the upper atmosphere (bottom of grid). Use of order0.05
.nu_ee_mz
- The value of the energy diffusion in the lower atmosphere (top of the grid).nu_ee_k
- The central grid-point point of the hyperbolic function that transitions between the two energy diffusion parametersnu_ee
andnu_ee_mz
. If set to a number greater than or equal to zero, this will overwritenu_ee_z
.nu_ee_z
- The height, inMm
, of the mid-point of the hyperbolic function that transitions between the two energy diffusion parametersnu_ee
andnu_ee_mz
. Can be overwritten bynu_ee_k
.nu_ee_w
- Width of the transition between the two energy diffusion valuesnu_r
andnu_r_mz
.symmetric_e
-=1
turns on a symmetric method of calculating E. Not turned on if=0
. Need to be careful with this if using different sizedxy
andz
cells.symmetric_b
-=1
turns on a symmetric method of calculating B. Not turned on if=0
. Need to be careful with this if using different sizedxy
andz
cells.grav
- gravity in code units (-2.740, doesn’t change over the height of simulation)eta3
- scales joule heating, use0.3
or less.ca_max
- maximum value of Alfvén speed, will change Lorentz force to accomplish this,0
means no maximum value.mhddebug
- print values of many terms in MHD equationsdo_mhd
- solve magnetic hydrodynamics=1
or just hydrodynamics=0
.mhdclean
- force ∇⋅B=0 every mhdclean timesteps, no cleaning if set to-1
.mhdclean_ub
- Off if=0
, if=1
then Div B cleaning occurs on the boundary/ghost cells everynsteps
at the lower atmospheric (upper grid) boundary. This is problematic if there is flux emergence in the simulation.mhdclean_lb
- Off if=0
, if=1
then Div B cleaning occurs on the boundary/ghost cells everynsteps
at the upper atmospheric (lower grid) boundary. This is problematic if there is flux emergence in the simulation.
io¶
; ************************* From io *************************
snapname = "snapshot"
isnap = 0
large_memory = 1
nsnap = 1000000
nscr = 1000000
dtaux = 0.0
aux = " "
dtsnap = 100.0
newaux = 0
raw_aux = 0
rereadpars = 1000000
dtscr = 100.0
tsnap = 0.000
tscr = 0.000
boundarychk = 0
print_stats = 1
time_io = 0
dtsnap_precise = 0
snapname
- name root of idl, snapshot and aux files, note that an '_' will be appended to files that include a snapshot numberisnap
- current snapshot, if negative then starting from a scratch file and the absolute value is the current snapshotlarge_memory
- how much of the cube that is written per write operation. Larger value == larger memorry on process ID==0 is needed.= -1
- Parallel IO (all MPI processes try to save snap at the same time)= 0
- 0 MPI Master does all the I/O in chunks of one x column= 1
- 1 MPI Master does all the I/O in chunks of one x-y plane> 1
- MPI Master does all the I/O in chunks of the whole gridnsnap
- the number of time steps between the writing of snapshotsnscr
- the number of time steps between the writing of scratch filesaux
- which aux file variables to write to the aux filedtsnap
- time lapse between the writing of snap shotsdtaux
- if!= 0.0
, aux variables have been savedtaux
later then variables insnap
(though newaux mechanism). Ifdtaux != 0.0
&newaux > 0
,dtaux
value will be used for time step size while progressing with 1 step of simulation to fill missing aux variables. In case ofauxdt == 0.0
&newaux > 0
,dt
value for timestep will be use.newaux
- if equal to snap number which already exists, performs 1 iteration to define and save auxiliary variable fromaux
list.raw_aux
-=1
to turn off filering for negative values from numerical noise inqxxx
terms for aux variables.rereadpars
- number operation between re-reading params files.dtscr
- the number of time steps between the writing of scratch filestsnap
- time of last written snap shot, can be overwrittentscr
- time of last written scratch fileboundarychk
-=1
if ghost zones on upper and lower boundary are to be writtenprint_stats
==1
to print min/max statistics for selected MHD variables during I/O operations.time_io
-=1
to print min/max ∆t in seconds for I/O operationsdtsnap_precise
==1
adjusts dynamicallydt
to make sure that I/O will be triggered preciselly ont == tsnap+dtsnap
.
math¶
; ************************* From math *************************
max_r = 5
smooth_r = 3
div_solver = 1
div_niter = 128
div_tol = 1.0E-05
div_norm = 'max '
div_sor_niter = 1024
div_sor_tol = 1.0E-10
max_r
- size of domain for picking maximum in diffusion quantities (don't touch)smooth_r
- size of domain for picking smoothing in diffusion quantities (don't touch)div_solver
- Switch to select divB cleaner: 1) for one using FFTs for Posson solver (might be slow for big parallel runs). 2) solver which uses SOR for Poisson solver (might need tunning ofsor_niter
andsor_tol
to achive convergence)div_niter
- max number of for divB cleaner (and/or max number of outer interation ifdiv_solver == 2
)div_tol
- stop tolerance for divB cleaner (quantity subjects for test:divB / |B| + tiny()
)div_norm
-max
forabs(max)
,norm2
for euclidian norm (a.k.anorm2
)div_sor_niter
- max number of interation for Gauss-Seidel's method (active IFFdiv_solver == 2
)div_sor_tol
- global stop cryterion for Gauss-Seidel's solver (active IFFdiv_solver == 2
)
quench¶
qmax
- amplification factor for large gradients (don't touch)
eos¶
; ************************* From eos *************************
noneq = 0
expieos = 0
do_hion = 0
do_helium = 0
cs_from_table = 0
gamma = 1.667
debug_square = 0
maxlnelim = 32.300
minlnrlim = -34.000
tabinputfile = " tabparam.in "
noneq
- if1
use radiation table in chromosphere, if0
then use LTE based radiation table in the chromosphere. Can only be set to1
if the experiment provides electron densities and gas temperatures.expieos
- if turned on, exrapolates EOS quantities fore/r
above EOS table bound and/orr
below table bounds. For opacity table bounds will be used. Ifexpieos .eq. 0
EOS will stop the code ife/r
orr
are out of bounds.do_hion
- turn Hion off=0
or on=1
. Only set to1
if you run an HION or HELIUM experimentdo_helium
- turn Helium off=0
or on=1
. Only set to1
if you run an HELIUM experimentcs_from_table
- if on, speed of sound is calulated from table (if possible) though format definition:cs^s = {Dp/Dr} | s = cnst
, otheriwse (default)cs=sqrt(gamma * p/r)
.gamma
- ratio of specific heats used in computing speed of sounddebug_square
-=1
turns debug printoutsmaxlnelim
- ife
values are above this value, the ideal gas approximation will be used instead of EOS tableminlnrlim
- ifr
values are below this value, the ideal gas approximation will be used instead of EOS tabletabinputfile
- inputfile that contains information on EOS tables, must be there forsquare_gas_mpi
radiation¶
; ************************* From rad *************************
do_rad = 1
dtrad = 0.000
showinfo = 0
quadalg = 'legacy'
quadrature = 3
zrefine = 1
maxiter = 100
taustream = 1.000E-05
accuracy = 1.000E-03
strictint = 1
linear = 1
monotonic = 1
minbin = 1
maxbin = 4
dualsweep = 0
teff = 5.854E+03
do_rad
- switch for radiative transferdtrad
- timestep for the radiation: Ifdtrad > 0.0
, RT will be computed att>=trad=tprev+dtrad
only.showinfo
- if1
, info about ray geometry and dJ will be printed.guadalg
- Selector for different ways of seting quadrature. Defaultlegacy
, usequadrature
parameter and it has only one setup for 2d and 3d case. If set togauleg
(affective only for 2D case), number of rays per octant can be set viaquadrature
parameter and it can be set to any positive integer. For 3d case useset_XY
to select from predefine B.G. Carlson angle quadratures whereX in ['a','b']
andY in [ 2,4,6,8 ]
(Y is number of rays per octant).quadrature
- Ifquadalg
islegacy
this is a selector for the quadrature method for the integral over solid angle,=1
- 2 vertical rays,=2
- 8 rays, no vertical, Gauss-Legendre/Carlson quadrature with 1 ray/octant,=3
- 24 rays, no vertical Carlson quadrature with 3 rays/octant. Forguadalg = legacy
, this is a parameter to set numer of rays perPI/4
.zrefine
- The degree of z-axis refinement (1: no refinement, >1: insert up to zrefine layers)maxiter
- Maximum number of iterations to be performed before the code gives intaustream
- Mean optical depth threshold above which radiative transfer is computedaccuracy
- The convergence criterion for the solverstrictint
- Strictness of interpolation for the source function integral:=1
- Prevent overshooting interpolation,=0
- Only prevent negative source functionslinear
- Switches for linear interpolation onto the characteristics gridmonotonic
- Switches for monotonic interpolation onto the characteristics gridminbin
- The minimum opacity bin to computemaxbin
- The maximum opacity bin to computedualsweep
- Switch for dual sweep mode (compute S corrections during upsweeps and downsweeps). Only useful for strong scattering as it is more expensive.teff
- efective temperature
genrad¶
This module computes sources of heating and cooling from input data that is read from a file. Processes that can be treated include:
- optically thin emission from the corona
- absorption of coronal radiation in the chromosphere
- various recipes for cooling and heating due to neutral H I, Ca II and Mg II
- localised non-physical heating
- heating below a threshold temperature
- if
Hion
is available, extra heating through absorption of Lyman alpha radiation
; ************************* From rad *************************
do_genrad = 1
genradfile = 'radtab.dat'
debug_genrad = 0
incrad_detail = 0
incrad_quad = 3
dtincrad = 0.001
dtincrad_lya = 0.0001
debug_incrad = 0
anglequad = 'legacy'
do_genrad
- switch for this module.genradfile
- name of input filedebug_genrad
- if1
, prints info about ray geometry and convergence.incrad_detail
- sets method for computing incrad radiation. Set to 1D flux based (=0), 1D intensity based (=1, not recommended) or 3D (=3).incrad_quad
- selects the angle quadrature in caseincrad_detail=3
. It works the same asquadrature
in radiation module.dtincrad
- sets the time interval in internal units for recomputation of the radiation field. It is never bigger thandtrad
fromradiation
.dtincrad_lya
- sets the time interval in internal units for recomputation of the radiation field for Lyman Alpha.debug_incrad
- turn debugging of incrad on (=1) or off (=0)anglequad
= Selector for different ways of seting quadrature ifincrad_detail=3
. It works the same asguadalg
inradiaton
. To change number or rays forgauleg
useincrad_quad
.
timing¶
timing
- turn timing on (=1) or off (=0)
hion¶
; ************************* From hion *************************
hionhasoldpops = 1
debug_hion = 0
ltesnaps = 0
firstsnap = 0
lastsnap = 0
vdamp = 7.000E+00
adaptive_vdamp = 0
icrsw = 0
cswitch = 1.000E+00
tcrsw = 1.000E+10
HionAtomFile = "h_6.atom"
HionNeeTabFile = "opctab_helium.dat"
HionSolTol = 1.000E-04
HionSolMaxIt = 512
HionFastSolver = F
HionRateInterp = F
hionhasoldpops
- Start up a new run from a standard snapshot only (=0
) or from a previously run HION experiment with an additional HION snapshot.debug_hion
- Write error information to a file called debug.hionltesnaps
- Does nothing (=0
), computes LTE hydrogen populations using e and ρ (=1
) or computes LTE hydrogen populations using ne and Tg (=2
) from previously computed HION snap files.firstsnap
- starting snapshot for which to compute LTE population, use together with non-zero ltesnaps.lastsnap
- last snapshot for which to compute LTE population, use together with non-zero ltesnaps.vdamp
- set damping of Newton-Raphson corrections. Larger value improves stability, but increases running time.adaptive_vdamp
- if set to=1
,vdamp
will set to0.0
at first try and in case of solver failure will swtich back to default value.HionSolTol
- desired accuracy before stopping Hion N-R solverHionSolMaxIt
- Max number of iterations for Hion N-R solverHionFastSolver
- if=1
, switches-off pivoting in Hion LU solver (reduce computation cost but might cause problem with stability. Switch on, only for relaxed simulations)HionRateInterp
- if=1
, rate coeficients will be calculated from interpolation array created at the beginning of the run.icrsw
-cswitch
-tcrsw
-HionAtomFile
- input atom fileHionNeeTabFile
- input file for table containing electron densities and internal energy for elements other than hydrogen.
helium¶
; ************************* From helium *************************
HeHasOldPops = 0
HeliumAtomFile = he_3.atom
HeliumEUVFile = cemisstab_helium.dat
nsolver = 4
HeFadeIn = -1.000E+00
HeSolverMaxIt = 512
HeSolverTol = 1.000E-04
HeSolverPopThr = 1.000E-12
HeDebug = 0
HeHasOldPops
- Start up a new run from a standard snapshot (=0
) or from a previously run HION experiment with an additional HION snapshot.HeliumAtomFile
- Input atom file (file in$BIFROST/INPUT/HELIUM_TAB/
).HeliumEUVFile
- Input opacity file (file in$BIFROST/INPUT/HELIUM_TAB/
).nsolver
- Number of different solution in case of convergence error. Max number is4
but forcing1
might help in some cases.HeFadeIn
- Positive value will slowly turn on photoionization and radiative recombination. This is done by multiplying the photoionization cross section the value HeFadeIn. Set it to1e-3
and it will increase to unity over20
solar seconds. At this point the value ofHeFadeIn
will automatically switch to-1
, which means that no fading is taking place.HeSolverMaxIt
- Max number of iterations for Helium N-R solver.HeSolverTol
- Desired accuracy before stopping Helium N-R solver.HeSolverPopThr
- Threshold for remove equation from HeSolver matrix for population wchich density number is< HeSolverPopThr * TotalHeDensityNumber
.HeDebug
- For values>0
, print debug informations.
spitzer¶
; ************************* From spitzer *************************
spitzer = "impl"
debug_spitzer = 0
info_spitzer = 1
spitzer_amp = 1.000
theta_mg = 0.900
dtgerr = 1.000E-06
ntest_mg = 10
tgb0 = 5.000E+05
tgb1 = 1.000E+04
tau_tg = 5.000E-03
fix_grad_tg = 1
niter_mg = [ 2, 20, 10, 10, 30 ]
bmin = 1.000E-05
lgtmin = alog(8.0e3)
spitzer
-impl
implicit conduction,expl
explicit conduction with varying coefficient,wave
new explicit implementation,none
turns conduction offdebug_spitzer
- turn debugging on (don't use at present)info_spitzer
- on gives information on convergence in finest grid interationspitzer_amp
- mplification factor for Spitzer value κ0=1.1×10−6theta_mg
- degree of implicitness θ, use > 0.55. For "impl", theta_mg=0.95, for "wave", theta_mg=0.60.dtgerr
- limit to achieve in iteration before stopping iterations at finest gridntest_mg
- do iteration test only evey ntest_mg timestepstgb0
- temperature at upper boundary if fix_grad_tg=0tgb1
- not used at presenttau_tg
- timescale of bringing upper boundary temperature to tgb0fix_grad_tg
- dT/dz=0 at upper boundaryniter_mg
- number of V cycles (negative number, no muligrid), number of iterations at upper level, at mid levels going "down" the V, at mid levels going "up" the V, and at the level at the bottom of the V, i.e. the coarsest level.bmin
- Minimum B field value for conduction to occur, if B is below this value at a point then the heat will diffuse isotropically from that location.lgtmin
- Log10 of Tg above whichqspitz
[inexpl
orwave
solver] is added todedt
.
genohm¶
; ************************* From genohm *************************
debug_genohm = 0
do_genohm_amb = "onfly"
tstep_amb = "stsf"
eta_ambo = 1.000E+00
eta4_amb = [ 0.100, 0.100, 0.100, 0.000 ]
sts_method = "yy"
sts_n = 3
sts_max_n = 10
sts_nu = 1.850E-03
numin = 1.850E-03
numax = 2.500E-01
mts_max_n_amb = 10
gol_tabin = "gol_coltab.in"
gol_exptab = 1
do_genohm_hall = "onfly"
tstep_hall = "ntsf"
eta_hallo = 1.000E-01
eta4_hall = [ 0.100, 0.100, 0.100 ]
mts_max_n_hall = 10
debug_genohm
- switch for debugging information for the Generalized Ohm's Law module.do_genohm_amb
- '.....' chooses the method to compute the ambipolar diffusion term.onfly
calculates the whole ambipolar diffusion term inside the code.table
uses tables for the frequency of collisions to calculate eta_ambb=eta_amb/b^2.funct
is used to try specific functions that you want for eta_ambb.const
uses a constant value for eta_ambb.false
switches the ambipolar diffusion off.tstep_amb
- '....'tstep_amb(1:3)
can bents
,mts
orsts
nts
No-TimeStep improvement.mts
MiniTimeStep method.sts
SuperTimeStep method.
tstep_amb(4:4)
- fix or not the method to speed up the ambipolar diffusion term.f
fixes the previous method for each iteration.v
allows the code to choice automatically the most adequate method in each iteration.
eta_ambo
- amplification factor for the ambipolar diffusion coefficient (by default 1).eta4_amb
- [ . , . , . , . ] hyperdiffusion for the ambipolar diffusion.- Hyperdiffusion for the fast mode (by default 0.1).
- Hyperdiffusion for the advection of the magnetic field (by default 0.1).
- Hyperdiffusion for the magnetic shocks (by default 0.1).
- Hyperdiffusion in places where the current is close to zero (see Martinez-Sykora et al. 2017, ApJ 847).
sts_method
- '..' different methods to solve the STS. 'n' means "non-variable" and 'y' means "variable"yy
- D. Nobrega-Siverio recommends to use yy (default value).yn
- for testing purposes.ny
- for testing purposes.sts_n
- Value for n for the STS method.sts_max_n
- Max. value for n for the STS method.sts_nu
- Value for nu for the STS method.numin
- Min. value for nu for the STS method.numax
- Max. value for nu for the STS method.mts_max_n_amb
- Max. value for n for the MTS method in the ambipolar diffusion calculation.gol_tabin
- Name of the input file for the ambipolar diffusion (by defaultgol_coltab.in
).gol_exptab
- Expands ambipolar diffusion table (by default .false.).do_genohm_hall
- '.....' chooses the method to compute the Hall effect.onfly
calculates the whole Hall term inside the code.funct
is used to try specific functions that you want for eta_hallb.const
uses a constant value for eta_hallb.false
switches the Hall term off.tstep_hall
- "...."tstep_hall(1:3)
can bents
,mts
orsts
nts
No-TimeStep improvement.mts
MiniTimeStep method.
tstep_hall(4:4)
- fix or not the method to speed up the ambipolar diffusion term.f
fixes the previous method for each iteration.v
allows the code to choice automatically the most adequate method in each iteration.
eta_hallo
- amplification factor for the Hall coefficient (by default 1).eta4_hall
- [ . , . , . ] hyperdiffusion for the Hall term.- Hyperdiffusion for the fast mode (by default 0.1).
- Hyperdiffusion for the advection of the magnetic field (by default 0.1).
- Hyperdiffusion for the magnetic shocks (by default 0.1).
mts_max_n_hall
- Max. value for n for the MTS method in the Hall term calculation.
dampuz¶
; ************************* From dampuz *************************
damptype = "none"
tau_damp = 1.000E-04
damptype
- Controls which type of velcity damping is enabledvelnull
- iftau_damp > 0
, it will setp[x,y,z]
to0
at each iteration.dampuz
- damps contribution in the momentum and energy equation in z directiondampvel
- works likedampuz
, but damps all momentum componentstau_damp
- Strengh of damping.
pmode_damp¶
t_damp
- Damp vertical motion ift_damp
is not 0.0k_damp
- Apply moementum damping term to pde fork gt k_damp
. Ramp up damping over 20 points.
out_of_equilibrium¶
; ************************* From out_of_e *************************
do_out_of_eq = 1
steq = 0
runse = 0
write_se = 1
iel = 26
atomfl = " fe9-15-sim-12_redlvl "
do_out_of_eq
- This will turn on (1) or off the module (0).steq
- If starting from initial statistical equilibrium snapshot, this should be 1. If the initial conditions already has ooe output this should be 0. So far, this has to be done manually.runse
- This does not work. It will be removed (use write_se).write_se
- Saves the statistical equilibrium solution (1). The name of the snapshot looks like this: snapname.seq_isnap.snap. If not interested, set to 0.iel
- Number of the element in the periodic table, e.g., Si = 14, O = 8, Fe = 26, etc.atomfl
- Name of the input file. Make sure that the files has lower letters and the input name also has lower letters.
ebeam¶
; ************************* From ebeam *************************
do_ebeam = 1
verbose = 0
no_transport = 0
max_qbeam_diff = 1.000E-05
ds_out = 0.010
z_rec_ulim = -1.000E+03
z_rec_llim = 0.000E+00
krec_lim = 1.000E-04
cut_en_floor = 0.000
cut_en_roof = 1.000E+06
min_beam_en = 1.000E-02
out_dep_thresh = 0.000
min_residual = 1.000E-05
min_dep_en = 1.000E+07
min_stop_dist = 0.500
max_dist = 1.000E+02
power_law_index = 4.000
qjoule_acc_frac = 0.200
buflen = -30.0
do_ebeam
- Whether to include electron beams.verbose
- Whether to print relevant information when simulating electron beams.no_transport
- Whether to return before tracing any beams (only compute initial beam quantities).max_qbeam_diff
- Maximum estimated change in qbeam before it is recomputed [same units as dedt].ds_out
- Distance between output points along the field line [Mm].z_rec_ulim
- Smallest depth at which to detect reconnection events [Mm].z_rec_llim
- Largest depth at which to detect reconnection events [Mm].krec_lim
- Sites with reconnection factors smaller than this are excluded.cut_en_floor
- Lower cut-off energies are truncated at this lower limit [keV].cut_en_roof
- Lower cut-off energies are truncated at this upper limit [keV].min_beam_en
- Beams with initial power densities smaller than this are excluded [erg/s/cm^3].out_dep_thresh
- Maximum distance outside the acceleration region energy deposition starts for the beam [Mm].min_residual
- Beams may not be stopped until heating reaches this fraction of the initial heating.min_dep_en
- Beams may not be stopped until deposited power per distance reaches this value [erg/s/cm].min_stop_dist
- Beams travelling shorter than this are excluded [Mm].max_dist
- Maximum distance a beam can propagate before propagation is terminated [Mm].power_law_index
- If positive: fixed power law index of all electron distributions, if negative: the magnitude represents r_0/(L*R) in the acceleration model of Arnold et al. (2021), where r_0 is the characteristic island radius, L is the current sheet half-width and R is the normalized reconnection rate (reasonable values are r_0/L = 0.2 and R = 0.1)qjoule_acc_frac
- Fraction of Joule heating allotted to electron acceleration.buflen
- Determines the size to allocate for the MPI sending buffer. Increase the size of the buffer if you get segfaults relating to allocation inMPI_BSEND
. Ifbuflen == 0.0
no buffer is allocated. Ifbuflen > 0.0
, the buffer will be allocated to fitnint(buflen)
values of typeBF_REAL
. Ifbuflen < 0.0
, the buffer will be allocated to fitnint(buflen*nghost)
values, wherenghost
is the total number of ghost cells in the subdomain. (Note thatbuflen
doesn't have to be an integer.)
Boudaries setup¶
standard_boundary¶
Open boundaries in z
direction are controlled by bctypelower
& bctypeupper
strings. Each of them consist 9 characters which handle boundaries for different variables.
Position | Control |
---|---|
1 | Reserved position to control type of boundaries (e.g., m for characteristic boundary conditions) |
2 | r - density |
3 | ux or px - x component of velocity of momentum (depends on experiment) |
4 | uy or py |
5 | uz or pz |
6 | e - energy or ee - energy/density |
7 | bx - x component of magnetic field |
8 | by |
9 | bz |
Possible values for possitions 2-9
:
# : [!] do nothing
% : [!] just update
a : antisymm
c : constant
d : [!] div_free(Bx,By,INPUT)
e : extrap
f : extrap_constrained
g : symm_gradient
h : [!] hydrostatic
l : extrap_log
p : [!] potential_field(Bx,By,INPUT)
s : symmetric
v : vanishing
w : vanishing_gradient
You can extract that list of possible options using command line option -b
, e.g., ./photo_tr.x -b
For example bctypelower = ncggvcccd
in photo_tr
experiment will translate to:
Var std::bc routine
--- ---------------
rho 'c' constant # fullz
Ux 'g' symm_gradient # fullz
Uy 'g' symm_gradient # fullz
Uz 'v' vanishing # halfz
ee 'c' constant # fullz
Bx 'c' constant # fullz
By 'c' constant # fullz
Bz 'd' [!] div_free(Bx,By,INPUT) # halfz
h
- hydrostatic boundary conditions¶
h
is a special type of standard boundary condition which can be set for rho
or ee [e/r]
in photo_tr
experiment. If h
is set for density
, the density in BC will be calculated though inverted EOS lookup from ee
values and pressure values exponentially extrapolated from last layer pressure values with scale height.
If h
is set for ee
, then ee
will be interpolated though inverted EOS lookup via rho
and exponential pressure with scale height.
x
- constrained boundary conditions¶
Constrained BC can be activated by changing the first character in the string bctype{lower,upper}
to x
. When the boundary type for a given variable is set to c
(constant extrapolation), the user can specify a specific value to be applied at the boundary. This is achieved by setting the mask string to y
and providing the desired value in the bc{lower,upper}_val
list.
p
- Potential Field Extrapolation (for Boundary Conditions)¶
This boundary condition (BC) type performs a potential (force-free) field extrapolation from a selected height within the computational domain. The height is controlled by the parameters pfe_{lower,upper}_s
(*p*otential *f*ield *e*xtrapolate lower/upper *s*tart at). By default, this is set to -1
, which means the extrapolation is performed from z index = 1
for the lower BC and from z index = ze
for the upper BC.
The p
type can only be set for the Bz component of the field, i.e., the 9th
character in the bctype{lower/upper}
string. However, like the d
(div_free) boundary condition, this type of boundary will modify all three vector components (Bx, By, and Bz).
Warning: This boundary condition is computationally intensive and does not scale well with many MPI ranks due to the non-parallelized FFTs involved in the computation.
Tip
You can use this BC to perform field extrapolation throughout the entire computational domain. This can be useful for overwriting an existing field with a force-free version or to start a new simulation with a field provided only at the bottom of the domain.
This is not a standard use case, so it requires a specific approach. First, find an MPI domain decomposition without any cuts in the z-direction (see the manual_cuts
option), or run with a single MPI rank if your problem fits into the RAM of one machine.
Next, set nscr
to 1
to save *.scr
at every iteration. Then, set the 9th character in bctypelower
to p
and set pfe_lower_s
to a value equal to mz
, which is the number of grid points in the z-direction. This will overwrite the field in the entire box with the force-free extrapolated field from the bottom layer of the computational domain. Note that the extrapolation will be performed at each iteration, so one step will suffice.
After this step, modify *.scr.idl
to remove the MPI manual cuts, set nscr
to a larger value, and restore pfe_lower_s
to the default -1
. Then, restart your run from the *.scr.idl
file to continue with the extrapolated field.
Key Variables:¶
-
bctype{lower,upper}
: A character string that controls the boundary condition types for different variables. The first character determines whether the constrained BC is enabled (x
) or not. -
bc{lower,upper}_msh
: A character string specifying mesh centering for boundary conditions. -
bc{lower,upper}_msk
: A character string acting as a mask for the constrained BC.y
enables the constrained BC for a variable, whilen
ignores it. -
bc{lower,upper}_val
: An array of real values representing the specific values to be used for constrained BC when the setup type isc
(constant). -
pfe_{lower,upper}_s
: If positive integer, then it describle layer from which the potential field extrapolation is performed (only in use ifbctype{lower,upper}
forBz
is set top
). Default value is-1
, which means the extrapolation is performed fromz index = 1
(first layer at the top of the domain).
Example of Use:¶
To use this code, follow these steps:
-
Modify the
bctype{lower,upper}
string to enable the constrained BC by changing its first character to 'x'. -
Set the boundary type for the desired variable(s) to 'c' (constant).
-
If you want to apply a specific value for the constrained BC:
- Set the
mask
argument to 'y'. -
Provide the desired value in the
const_value
argument. -
Call the
standard_{lower,upper}_boundary
subroutine with appropriate arguments to apply the constrained BC to your data.
When all is set correctly Bifrost will inform you during the runtime about constrained values. Here is an example of such std output:
******************************* bc_lower *******************************
$Id: bc_lower_empty (24538657) Mon Oct 2 11:51:54 2023 by M1kol4j $
bctypelower = xcssscsss
bclower_msk = -----y---
bclower_val = [ 2.00, 0.00, 0.00, 0.00, 0.20, 0.00, 0.00, 0.00 ]
pfe_lower_s = -1
-[!]- bc_lower::bctypelower setup:
Var std::bc routine
--- ---------------
rho 'c' constant # fullz
Px 's' symmetric # fullz
Py 's' symmetric # fullz
Pz 's' symmetric # halfz
ee 'c' constant # fullz | set to -> 2.0000E-01
Bx 's' symmetric # fullz
By 's' symmetric # fullz
Bz 's' symmetric # halfz
bc_lower_magnetic¶
Note : Since 29/10/2021 bctypelower
& bctypeupper
has new format but legacy (shorter) format described below will still work. To read about new format check section std_bc
; ************************* From bc_lower_magnetic *************
bctypelower = "mfgc"
bcldebug = 0
bcllegacy = 1
pfe_lower_s = -1
tau_bcl = 1.00000000E+00
tau_ee_bcl = 1.00000000E+02
tau_d2_bcl = 1.000E+02
tau_d3_bcl = 1.000E+02
tau_d4_bcl = 1.000E+02
qjoule_amp_bcl = 1.000E+00
s0 = 1.55399361E+01
e0 = 7.00427964E-02
r0 = 1.86682008E-02
cs0 = 6.54462993E-01
p0 = 4.81020007E-03
nsmooth_bcl = 50
nclean_bcl = 50
nclean_lbl = -4
nclean_ubl = 5
nextrap_bcl = 1
naver_bcl = -1
bctypelower
- In legacy format up to 4 characters.- If any part of the 4 characters is absent, it will default to
mdgc
. - The First character is
m
ornot m
. (Usingn
is standard as an alternative) - Adjusts the equations in the ghost zones at the edges of the experiment domain using the following scheme:
- The ghost zones at the edges of the experiment are
filled
by extrapolating values from the points inside the experiment to update the ghost zone values. - The time derivative equations are applied throughout the whole domain including the ghost zones.
- If
m
is switched the first character, then special characteristic boundary conditions are applied to these zones, which overwrites the standard time-derivative equations in the ghost zones. If any other letter is present then the specific ghost zone characteristic equations are not applied.
- The ghost zones at the edges of the experiment are
- Note this is not true of ghost zones for internal subdomains, which take data from neighbouring subdomains.
- 2nd - 4th letters:
- 2nd defines extrapolation for
u_z
- 3rd defines extrapolation for
u_x
andu_y
- 4th defines extrapolation for
Bx
,By
, andBz
- 2nd defines extrapolation for
-
2nd - 4th letter options. How to extrapolate into the ghost zones:
f
→ ramps values to zeroe
→ simply extrapolatesc
→ sets a constant value using the values at the edge of the experimentd
→ constrained extrapolation - i.e. a damped extrapolation, that doesn’t allow the value of the variable to go too wild (somewhere between values given bye
andc
)a
→ antisymmetric values, antisymmetric values compared between border of experiment real part and ghost zone part (see Gaalsgaard and Nordlund)g
→ symmetric gradient of variables inside and in ghost zones (See Nordlund Gaalsgaard)
-
bcldebug
- controls verbosity of debug printous,=0
to turn off any prinouts set to={1,2,3}
increase volume of information printed during execution. bcllegacy
-=0
to run new implementation.tau_bcl
- end incoming entropy at boundary to given vaule 0 to 1; to current value at boundary one, to s0 zero.tau_ee_bcl
- not in usetau_d[2,5,6,7,8]_bcl
- damping of characteristics, leave large (>>1!!)s0
- The parameter for boundary incoming entropy talked about fortau_bcl
e0
- specifies a proxy of the Temperature that the code drives towards in the coronar0
- specifies a proxy of the Temperature that the code drives towards in the coronacs0
- speed of sound at upper boundary (there for reference)p0
- pressure at upper boundary (there for reference)nsmooth_bcl
- specifies number of steps between hydrodynamic terms being smoothed (Magnetic terms are smoothed elsewhere)naver_bcl
-=0
off,=1
smooths and averages hydrodynamic terms - avoid if possible!nclean_bcl
- Cleans B on the boundary every nclean_bcl timesteps, match withnsmoothbxy_bcl
nclean_lbl
- bottom of ncleaning region (-4 = set to bottom of ghost cells)nclean_ubl
- top of ncleaning region
bc_upper_damp¶
; ************************* From bc_upper_damp *************
bctypeupper = "dcs"
bcu_udamp = "ouz"
t_bdry = 1.00000000E+00
rbot = 2.64239990E+02
ebot = 2.90000000E+03
nclean_bcu = 50
nsmoothbxy_bcu = 0
pb_spot = 0.00000000E+00
spot_upper = 0.00000000E+00
beta_lim = 1.00000000E+02
bctypeupper
- '...'-
first letter
d
-> enter a damping regime (see routinebc_upper_late
) that changes the derivatives afterd/dt’s
have been calculated (fixing), somewhat similarly tom
inbctypelower
. Damping velocities to zero and trying to put in a pressure node or not to “d”, i.e. put in a placeholder.- No need to have
not d
, even if introducing a magnetic field at the bottom.
- No need to have
- 2nd letter is for magnetic field
B[x,y,z]
- same letters as bctypelower
- 3rd letter is for velocity
u[x,y,z]
- same letters as bctypeupper
c
-> constant extrapolation •s
-> symmetric etc
-
bcu_udamp
- t_bdry
- Timescale for driving r and e towards the parameters rbot and ebot at the convection zone boundary, and also the timescale for damping at the boundary.rbot
- Density contributions to constant entropy at the bottom of the model, if not the granules may become unstable. If nevegative, it will calculate value from inital snapshot.ebot
- Energy contributions to constant entropy at the bottom of the model, if not the granules may become unstable. If nevegative, it will calculate value from inital snapshot.nclean_bcu
- cleaning every nclean_bcu time steps, currently not in use.nsmoothbxy_bcu
-pb_spot
-spot_upper
-beta_lim
-
bc_upper_emer¶
; ************************* From bc_upper_emer *************
bx0 = 0.00000000E+00
by0 = 0.00000000E+00
bz0 = 0.00000000E+00
x0_bcu = 0.00000000E+00
x1_bcu = 1.60000000E+01
y0_bcu = 0.00000000E+00
y1_bcu = 1.60000000E+01
uz_bcu = 2.00000009E-03
strtb = "n"
bx0
- x-component of magnetic field entering boundary (form depends on value of strtb).by0
- y-component of magnetic field entering boundarybz0
- z-component of magnetic field entering boundaryx0_bcu
- x-coordinate for lower bound of flux emergence, use with x1_bcu to define a rectangular strip region of the lower boundary.x1_bcu
- x-coordinate for upper bound of flux emergence, use with x1_bcu to define a rectangular strip region of the lower boundary.y0_bcu
- x-coordinate for lower bound of flux emergence, use withx1_bcu
to define a rectangular strip region of the lower boundary.y1_bcu
- x-coordinate for upper bound of flux emergence, use withx1_bcu
to define a rectangular strip region of the lower boundary.uz_bcu
- smoothing width for border between field entering and leaving computational domain (only active if strb=c
).strtb
- Specifies the type of field entering the domain. Possible values are:n
- No flux enters.b
- When set to 'b' (b for Boris), boundary field is driven by changing the electric field in ghost zones, as opposed to the magnetic field as for casec
. The boundary is implemented in the routineefield_boundary
.f
- Functions similarly tob
, but reads the electric field from external binary files (separate file for each component).elbc_fbname
- Base name of the input field file. For example, ifelbc_fbname = test
, the field should be provided in filestest_{ex,ey,ez}.dat
. Input fields are expected to be in correct code units, vector orientation, and staggered position.elbc_fdlen
- Number ofz
layers in the provided field (default==6
, 5 guard zones + 1 bottom layer).elbc_ftlen
- Number of time slots for the external field.==1
indicates that the field is constant in time.elbc_ffadein
- If positive, the external field will be faded in over the course of time equal to the set value. Time should be provided in code units, i.e., expected time in seconds divided byu_t
.
a
- Random (Alleatory) of "nseed" number of tubes.c
- constant flux in regionr
- constant tube in regiont
- horizontal tube with twistrtb
- Tube radius (Mm)frtb
- Use 2.3, which ensures 99.9% of the magnetic flux of the tube entering the domain.qtb
- Twist of the tube (Mm^{-1})zotb
- Vertical distance with respect to the boundary of the convection zone where the center of the tube is going to be located initially. Use a value greater than frtb*rtb (Mm).xotb
- Initial horizontal position of the center of the tube (Mm).
o
- -loop with twistz
- set field to valueBz0