Problems

SawyerEliassenSolver.Problems.BackgroundFlowType
struct BackgroundFlow{T}

The balanced background gradients. The background flow is in thermal wind balance and therefore assumed to be steady.

Fields

  • f::Any: Coriolis frequency $f$

  • Vx::Matrix: Lateral shear $\partial V/\partial x$

  • Bx::Matrix: Horizontal buoyancy gradient $\partial B/\partial x = f\partial V/\partial z$

  • Bz::Matrix: Vertical buoyancy gradient $\partial B/\partial z$

source
SawyerEliassenSolver.Problems.BackgroundFlowMethod
BackgroundFlow(grid::Grid{T}, f) -> BackgroundFlow

Create a new BackgroundFlow given a Grid and Coriolis frequency $f$ which defaults to 1. Background gradients are initialised to 0.

Examples

grid = Grid(256,128,2000.0,1.0)
bg = BackgroundFlow(grid)

# output
BackgroundFlow:
  ├─── f: 1
  ├── Vx: 256×128 Matrix{Float64}
  │       [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0]
  ├── Bx: 256×128 Matrix{Float64}
  │       [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0]
  └── Bz: 256×128 Matrix{Float64}
          [0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … 0.0 0.0]
source
SawyerEliassenSolver.Problems.ProblemType
struct Problem{T, F, G, H}

A struct representing a Sawyer-Eliassen problem.

Fields

  • domain::Domain{T} where T

  • background::BackgroundFlow

  • ζ_forcing::Any

  • v_forcing::Union{NoForcing{T}, GlobalPhysicalForcing{T}, PointwisePhysicalForcing{T}} where T

  • b_forcing::Union{NoForcing{T}, GlobalPhysicalForcing{T}, PointwisePhysicalForcing{T}} where T

  • state::State

  • scratch::Scratch

source
SawyerEliassenSolver.Problems.ScratchType
struct Scratch{T}

Scratch space for temporary variables used in the Sawyer-Eliassen problem. These variables have two primary uses in the code:

1) intermediate terms in the computation of the Sawyer-Eliassen operator 𝓛
2) intermediate terms in the advection of the background flow

Between timesteps these variables are available for other purposes e.g. setting the initial conditions, computing output.

Fields

  • FS_tmp::FSVariable

  • FC_tmp::FCVariable

  • XS_tmp::XSVariable

  • XC_tmp::XCVariable

  • XZ_tmp::XZVariable

  • XZ_tmp2::XZVariable

source
SawyerEliassenSolver.Problems.set_ζ!Method
set_ζ!(state::State; u, w)

Set ζ from u and w. u and w may be a XZVariable, XCVariable/ XSVariable, FCVariable / FSVariable or a function specifying u(x,z) / w(x,z) pointwise. If not specified u and w default to 0.

source