Problems
SawyerEliassenSolver.Problems.BackgroundFlow — Typestruct 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$
SawyerEliassenSolver.Problems.BackgroundFlow — MethodBackgroundFlow(grid::Grid{T}) -> BackgroundFlow
SawyerEliassenSolver.Problems.BackgroundFlow — MethodBackgroundFlow(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]SawyerEliassenSolver.Problems.Clock — Typemutable struct Clock{T}Current simulation time and iteration.
t::Anyiteration::Int64
SawyerEliassenSolver.Problems.Clock — MethodDefault initialiser for Clock
SawyerEliassenSolver.Problems.Problem — Typestruct Problem{T, F, G, H}A struct representing a Sawyer-Eliassen problem.
Fields
domain::Domain{T} where Tbackground::BackgroundFlowζ_forcing::Anyv_forcing::Union{NoForcing{T}, GlobalPhysicalForcing{T}, PointwisePhysicalForcing{T}} where Tb_forcing::Union{NoForcing{T}, GlobalPhysicalForcing{T}, PointwisePhysicalForcing{T}} where Tstate::Statescratch::Scratch
SawyerEliassenSolver.Problems.Scratch — Typestruct 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 flowBetween timesteps these variables are available for other purposes e.g. setting the initial conditions, computing output.
Fields
FS_tmp::FSVariableFC_tmp::FCVariableXS_tmp::XSVariableXC_tmp::XCVariableXZ_tmp::XZVariableXZ_tmp2::XZVariable
SawyerEliassenSolver.Problems.State — Typestruct State{T}State variables of the problem.
ζ::FSVariableζₜ::FSVariablev::XZVariableb::XZVariableclock::Clock
SawyerEliassenSolver.Problems.compute_ζₜ! — Methodcompute_ζₜ!(problem::Problem)
Compute and set ζₜ by projecting b onto sine space, v onto cosine space and using ζₜ = fvz - bx
SawyerEliassenSolver.Problems.get_Bx — Methodget_Bx(bg::BackgroundFlow) -> Matrix
SawyerEliassenSolver.Problems.get_Bx — Methodget_Bx(problem::Problem) -> Matrix
SawyerEliassenSolver.Problems.get_Bz — Methodget_Bz(bg::BackgroundFlow) -> Matrix
SawyerEliassenSolver.Problems.get_Bz — Methodget_Bz(problem::Problem) -> Matrix
SawyerEliassenSolver.Problems.get_Vx — Methodget_Vx(bg::BackgroundFlow) -> Matrix
SawyerEliassenSolver.Problems.get_Vx — Methodget_Vx(problem::Problem) -> Matrix
SawyerEliassenSolver.Problems.get_f — Methodget_f(bg::BackgroundFlow) -> Any
SawyerEliassenSolver.Problems.get_f — Methodget_f(problem::Problem) -> Any
SawyerEliassenSolver.Problems.get_iteration — Methodget_iteration(problem::Problem) -> Int64
SawyerEliassenSolver.Problems.get_iteration — Methodget_iteration(state::State) -> Int64
Get current iteration.
SawyerEliassenSolver.Problems.get_problem — Methodget_problem(problem::Problem) -> Problem
SawyerEliassenSolver.Problems.get_scratch — Methodget_scratch(problem::Problem) -> Scratch
SawyerEliassenSolver.Problems.get_time — Methodget_time(problem::Problem) -> Any
SawyerEliassenSolver.Problems.get_time — Methodget_time(state::State) -> Any
Get current simulation time.
SawyerEliassenSolver.Problems.get_ζ_forcing — Methodget_ζ_forcing(problem::Problem) -> Any
SawyerEliassenSolver.Problems.set_b! — Methodset_b!(problem::Problem, b)
SawyerEliassenSolver.Problems.set_b! — Methodset_b!(state::State, func::Function)
Set b from a function b(x,z).
SawyerEliassenSolver.Problems.set_b! — Methodset_b!(state::State, b::XZVariable)
Set b from a variable.
SawyerEliassenSolver.Problems.set_v! — Methodset_v!(problem::Problem, v)
SawyerEliassenSolver.Problems.set_v! — Methodset_v!(state::State, func::Function)
Set v from a function v(x,z).
SawyerEliassenSolver.Problems.set_v! — Methodset_v!(state::State, v::XZVariable)
Set v from a variable.
SawyerEliassenSolver.Problems.set_vb! — Methodset_vb!(problem::Problem; v, b)
Set v and / or b and then compute and set ζₜ
SawyerEliassenSolver.Problems.set_ζ! — Methodset_ζ!(problem::Problem, ζ) -> Any
SawyerEliassenSolver.Problems.set_ζ! — Methodset_ζ!(problem::Problem; u, w)
SawyerEliassenSolver.Problems.set_ζ! — Methodset_ζ!(state::State, ζ::FSVariable)
Set ζ from a variable in spectral space.
SawyerEliassenSolver.Problems.set_ζ! — Methodset_ζ!(state::State, func::Function)
Set ζ from a function. func should specify ζ = func(x,z) pointwise.
SawyerEliassenSolver.Problems.set_ζ! — Methodset_ζ!(state::State, ζ::XSVariable)
Set ζ from a variable in XS space.
SawyerEliassenSolver.Problems.set_ζ! — Methodset_ζ!(state::State, ζ::XZVariable)
Set ζ from a variable in physical space.
SawyerEliassenSolver.Problems.set_ζ! — Methodset_ζ!(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.