File upstream_density_feedback.hxx#

Defines

UPSTREAM_DENSITY_FEEDBACK_H#
struct UpstreamDensityFeedback : public Component#
#include <upstream_density_feedback.hxx>

Adds a time-varying density source, depending on the difference between the upstream density at y=0 and the specified value

Public Functions

inline UpstreamDensityFeedback(std::string name, Options &alloptions, Solver*)#

Inputs

  • <name> (e.g. “d+”)

    • density_upstream Upstream density (y=0) in m^-3

    • density_controller_p Feedback proportional to error

    • density_controller_i Feedback proportional to error integral

    • density_integral_positive Force integral term to be positive? (default: false)

    • density_source_positive Force density source to be positive? (default: true)

    • diagnose Output diagnostic information?

  • N<name> (e.g. “Nd+”)

    • source_shape The initial source that is scaled by a time-varying factor

virtual void transform(Options &state) override#

Inputs

  • <name>

    • density

Outputs

  • <name>

    • density_source

inline virtual void outputVars(Options &state) override#

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

inline virtual void restartVars(Options &state) override#

Add extra fields to restart files.

Private Members

std::string name#

The species name.

BoutReal density_upstream#

Normalised upstream density.

BoutReal density_controller_p#
BoutReal density_controller_i#

PI controller parameters.

BoutReal error#
BoutReal density_error_integral = {0.0}#

Time integral of the error.

bool density_integral_positive#

Force integral term to be positive?

bool density_source_positive#

Force source to be positive?

BoutReal density_error_lasttime = {-1.0}#
BoutReal density_error_last = {0.0}#
Field3D density_source_shape#

This shape source is scaled up and down.

BoutReal source_multiplier#

Factor to multiply source.

BoutReal proportional_term#
BoutReal integral_term#

Components of resulting source for diagnostics.

bool diagnose#

Output diagnostic information?