File quasineutral.hxx

Defines

QUASINEUTRAL
struct Quasineutral : public Component
#include <quasineutral.hxx>

Calculate density from sum of other species densities * charge to ensure that net charge = 0

This is useful in simulations where multiple species are being evolved. Note that only one species’ density can be calculated this way, and it should be calculated last once all other densities are known.

Saves the density to the output (dump) files as N<name>

Public Functions

Quasineutral(std::string name, Options &alloptions, Solver *solver)

Inputs

Parameters:
  • name – Short name for species e.g. “e”

  • alloptionsComponent configuration options

    • <name>

      • charge Required to have a particle charge

      • AA Atomic mass

virtual void transform(Options &state) override

Sets in state

  • species

    • <name>

      • density

      • charge

      • AA

virtual void finally(const Options &state) override

Get the final density for output including any boundary conditions applied

virtual void outputVars(Options &state) override

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

Private Members

std::string name

Name of this species.

BoutReal charge

The charge of this species.

BoutReal AA

Atomic mass.

Field3D density

The density (for writing to output)