File evolve_density.hxx

Defines

EVOLVE_DENSITY_H
struct EvolveDensity : public Component
#include <evolve_density.hxx>

Evolve species density in time

Mesh inputs

N<name>_src A source of particles, per cubic meter per second. This can be over-ridden by the source option setting.

Public Functions

EvolveDensity(std::string name, Options &options, Solver *solver)

Inputs

  • <name>

    • charge Particle charge e.g. hydrogen = 1

    • AA Atomic mass number e.g. hydrogen = 1

    • bndry_flux Allow flow through radial boundaries? Default is true.

    • poloidal_flows Include poloidal ExB flows? Default is true.

    • density_floor Minimum density floor. Default is 1e-5 normalised units

    • low_n_diffuse Enhance parallel diffusion at low density? Default false

    • hyper_z Hyper-diffusion in Z. Default off.

    • evolve_log Evolve logarithm of density? Default false.

    • diagnose Output additional diagnostics?

  • N<name> e.g. “Ne”, “Nd+”

    • source Source of particles [/m^3/s] NOTE: This overrides mesh input N<name>_src

    • source_only_in_core Zero the source outside the closed field-line region?

    • neumann_boundary_average_z Apply Neumann boundaries with Z average?

virtual void transform(Options &state) override

This sets in the state

  • species

    • <name>

      • AA

      • charge

      • density

virtual void finally(const Options &state) override

Calculate ddt(N).

Requires state components

  • species

    • <name>

      • density

Optional components

  • species

    • <name>

      • velocity If included, requires sound_speed or temperature

      • density_source

  • fields

    • phi If included, ExB drift is calculated

virtual void outputVars(Options &state) override

Add extra fields for output, or set attributes e.g docstrings.

Private Functions

void updateSource(BoutReal time)

Modifies the source member variable.

Private Members

std::string name

Short name of species e.g “e”.

BoutReal charge

Species charge e.g. electron = -1.

BoutReal AA

Atomic mass e.g. proton = 1.

Field3D N

Species density (normalised, evolving)

bool bndry_flux

Allow flows through boundaries?

bool poloidal_flows

Include ExB flow in Y direction?

bool neumann_boundary_average_z

Apply neumann boundary with Z average?

BoutReal density_floor
bool low_n_diffuse

Parallel diffusion at low density.

bool low_n_diffuse_perp

Perpendicular diffusion at low density.

BoutReal pressure_floor

When non-zero pressure is needed.

bool low_p_diffuse_perp

Add artificial cross-field diffusion at low pressure?

BoutReal hyper_z

Hyper-diffusion in Z.

bool evolve_log

Evolve logarithm of density?

Field3D logN

Logarithm of density (if evolving)

Field3D source
Field3D final_source

External input source.

Field3D Sn

Total density source.

bool source_only_in_core

Zero source where Y is non-periodic?

bool source_time_dependent

Is the input source time dependent?

BoutReal source_normalisation

Normalisation factor [m^-3/s].

BoutReal time_normalisation

Normalisation factor [s].

FieldGeneratorPtr source_prefactor_function
bool diagnose

Output additional diagnostics?

Field3D flow_xlow
Field3D flow_ylow

Particle flow diagnostics.