pyrokinetics.normalisation.SimulationNormalisation#

class pyrokinetics.normalisation.SimulationNormalisation(name, convention='pyrokinetics', registry=<pyrokinetics.units.PyroUnitRegistry object>, geometry=None, kinetics=None, psi_n=None)[source]#

Bases: Normalisation

Holds the normalisations for a given simulation for all the known conventions.

Has a current convention which sets what the short names refer to.

Examples

>>> norm = SimulationNormalisation("run001")
>>> norm.set_bref(local_geometry)
>>> norm.set_lref(local_geometry)
>>> norm.set_kinetic_references(kinetics)
>>> norm.lref      # Current convention's lref
1 <Unit('lref_pyrokinetics_run001')>
>>> norm.gs2.lref  # Specific convention's lref
1 <Unit('lref_gs2_run001')>
# Change the current default convention
>>> norm.default_convention = "gkdb"
>>> norm.gkdb.lref
1 <Unit('lref_gkdb_run001')>
Parameters:
__init__(name, convention='pyrokinetics', registry=<pyrokinetics.units.PyroUnitRegistry object>, geometry=None, kinetics=None, psi_n=None)[source]#
Parameters:

Methods

__init__(name[, convention, registry, ...])

add_convention_normalisation([name, ...])

type name:

define(definition[, context, units])

Defines a new units and adds it to the Context

set_all_references(pyro[, tref_electron, ...])

set_bref(local_geometry)

Set the magnetic field reference values for all the conventions from the local geometry

set_kinetic_references(kinetics, psi_n)

Set the temperature, density, and mass reference values for all the conventions

set_lref([local_geometry, minor_radius, ...])

Set the length reference values for all the conventions from the local geometry

set_ref_ratios([local_geometry, aspect_ratio])

Set the ratio of B0/Bunit and major_radius/minor_radius for normalised data

set_rhoref([local_geometry])

Set the gyroradius reference values for all the conventions from the local geometry and kinetics

Attributes

beta

The magnetic \(\beta_N\) is a dimensionless quantity defined by:

beta_ref

The magnetic \(\beta_N\) is a dimensionless quantity defined by:

default_convention

Change the current convention that the short names refer to

add_convention_normalisation(name=None, convention_dict=None)[source]#
Parameters:
  • name (str) – Name of new convention to add

  • convention_dict (dict) – Dictionary of refererence species and locations

property beta#

The magnetic \(\beta_N\) is a dimensionless quantity defined by:

\[\beta_N = \frac{2 \mu_0 n_{ref} T_{ref}}{B_{ref}^2}\]
property beta_ref#

The magnetic \(\beta_N\) is a dimensionless quantity defined by:

\[\beta_N = \frac{2 \mu_0 n_{ref} T_{ref}}{B_{ref}^2}\]
property default_convention#

Change the current convention that the short names refer to

define(definition, context=False, units=False)[source]#

Defines a new units and adds it to the Context

Parameters:

definition (str)

set_all_references(pyro, tref_electron=None, nref_electron=None, bref_B0=None, lref_minor_radius=None, lref_major_radius=None)[source]#
set_bref(local_geometry)[source]#

Set the magnetic field reference values for all the conventions from the local geometry

FIXME: Can we take just the values we want?

Parameters:

local_geometry (LocalGeometry)

set_kinetic_references(kinetics, psi_n)[source]#

Set the temperature, density, and mass reference values for all the conventions

Parameters:
set_lref(local_geometry=None, minor_radius=None, major_radius=None)[source]#

Set the length reference values for all the conventions from the local geometry

  • TODO: Input checking

  • TODO: Error handling

  • TODO: Units on inputs

Parameters:
set_ref_ratios(local_geometry=None, aspect_ratio=None)[source]#

Set the ratio of B0/Bunit and major_radius/minor_radius for normalised data

  • TODO: Input checking

  • TODO: Error handling

  • TODO: Units on inputs

Parameters:
set_rhoref(local_geometry=None)[source]#

Set the gyroradius reference values for all the conventions from the local geometry and kinetics

Parameters:

local_geometry (LocalGeometry | None)