electron_fluid_equations
moment_kinetics.electron_fluid_equations.calculate_Epar_from_electron_force_balance!
— Methodsolve the electron force balance (parallel momentum) equation for the parallel electric field, Epar: Epar = -dphi/dz = (2/ne) * (-dppare/dz + frictionforce + ne * me * nn * Ren * (un - ue)) NB: in 1D only Epar is needed for update of ion pdf, so boundary phi is irrelevant inputs: dense = electron density dppardz = zed derivative of electron parallel pressure nuei = electron-ion collision frequency friction = electron-ion parallel friction force nneutralspecies = number of evolved neutral species chargeexchange = electron-neutral charge exchange frequency meovermi = electron-ion mass ratio densn = neutral density uparn = neutral parallel flow upare = electron parallel flow output: Epar = parallel electric field
moment_kinetics.electron_fluid_equations.calculate_electron_density!
— Methoduse quasineutrality to obtain the electron density from the initial densities of the various ion species: sumi densi = dense inputs: dense = electron density at previous time level updated = flag indicating if the electron density is updated densi = updated ion density output: dense = updated electron density updated = flag indicating that the electron density has been updated
moment_kinetics.electron_fluid_equations.calculate_electron_parallel_friction_force!
— Methodmoment_kinetics.electron_fluid_equations.calculate_electron_qpar!
— Methodcalculate the parallel component of the electron heat flux. there are currently two supported options for the parallel heat flux: Braginskii collisional closure - qpare = -3.16*ppare/(me*nuei)dT/dz - 0.71ppare*(upari-upare) collisionless closure - d(qpare)/dz = 0 ==> qpare = constant inputs: qpare = parallel electron heat flux at the previous time level qparupdated = flag indicating whether qpar is updated already pdf = electron pdf ppare = electron parallel pressure upare = electron parallel flow vthe = electron thermal speed dTedz = zed derivative of electron temperature upari = ion parallel flow nuei = electron-ion collision frequency meovermi = electron-to-ion mass ratio electronmodel = choice of model for electron physics vpa = struct containing information about the vpa coordinate output: qpare = updated parallel electron heat flux qparupdated = flag indicating that the parallel electron heat flux is updated
moment_kinetics.electron_fluid_equations.calculate_electron_qpar_from_pdf!
— Methodcalculate the parallel component of the electron heat flux, defined as qpar = 2 * ppar * vth * int dwpa (pdf * wpa^3)
moment_kinetics.electron_fluid_equations.calculate_electron_qpar_from_pdf_no_r!
— MethodCalculate the parallel component of the electron heat flux, defined as qpar = 2 * ppar * vth * int dwpa (pdf * wpa^3). This version of the function does not loop over r
. pdf
should have no r-dimension, while the moment variables are indexed at ir
.
moment_kinetics.electron_fluid_equations.calculate_electron_upar_from_charge_conservation!
— Methoduse charge conservation equation to solve for the electron parallel flow density: d/dz(sumi ni upari - ne upare) = 0 ==> {sumi ni upari}(z) - {sumi ni upari}(zbound) = {ne upare}(z) - {ne upare}(zbound) inputs: upare = should contain updated electron parallel flow at boundaries in zed updated = flag indicating whether the electron parallel flow is already updated dense = electron particle density upari = ion parallel flow density densi = ion particle density output: upare = contains the updated electron parallel flow
moment_kinetics.electron_fluid_equations.electron_braginskii_conduction!
— MethodAdd just the braginskii conduction contribution to the electron pressure, and assume that we have to calculate qpar and dqpar_dz from ppar within this function (they are not pre-calculated).
moment_kinetics.electron_fluid_equations.electron_energy_equation!
— Methoduse the electron energy or temperature equation to evolve the electron temperature via an explicit time advance. NB: so far, this is only set up for 1D problem, where we can assume an isotropic distribution in fe so that pe = ne Te = ppar_e
moment_kinetics.electron_fluid_equations.electron_energy_residual!
— Methodelectron_energy_residual!(residual, electron_ppar_out, electron_ppar, in,
fvec_in, moments, collisions, composition,
external_source_settings, num_diss_params, z, dt, ir)
The residual is a function whose input is electron_ppar
, so that when it's output residual
is zero, electronppar is the result of a backward-Euler timestep: (fout - fin) / dt = RHS(fout) ⇒ (fout - fin) - dt*RHS(f_out) = 0
This function assumes any needed moment derivatives are already calculated using electron_ppar_out
and stored in moments.electron
.
Note that this function operates on a single point in r
, given by ir
, and residual
, electron_ppar_out
, and electron_ppar_in
should have no r-dimension.
moment_kinetics.electron_fluid_equations.electron_fluid_qpar_boundary_condition!
— Methodelectron_fluid_qpar_boundary_condition!(electron_moments, z)
Impose fluid approximation to electron sheath boundary condition on the parallel heat flux. See Stangeby textbook, equations (2.89) and (2.90).