pg_utils.pg_model.base_utils.assemble_background

pg_utils.pg_model.base_utils.assemble_background(B0, Psi0=None, mode='PG')[source]

Assemble background fields

Parameters:
  • B0 (array-like) – indexable background magnetic field in cylindrical coordinates

  • Psi0 (sympy.Function) – the background stream function Because velocity cannot in general be converted to Psi, if one wants to specify the stream function this has to be done separately. Note that when the nonlinear term is absent from the vorticity equation, Psi0 will in general not be involved in any of these equations. Background velocity in all induction equations uses U instead of Psi

  • mode (str) – the mode, what kind of background fields to assemble. Supports Plesio-Geostrophy “PG”, or conjugate variables “CG”. Default is PG.

Returns:

collection of background PG fields / conjugate fields

Return type:

base.CollectionPG or base.CollectionConjugate

Note

The components of B0 and the field Psi0 need to be “directly evaluable”, i.e. they should all be sympy.Expr containing no derivative of undefined functions. Otherwise, substitution will return incorrect results. The background field at the boundary are not immediately evaluated at \(z=\pm H\), since their z-derivatives are present in the induction equations. One has to evaluate after substitution and simplification.