Open charleskawczynski opened 3 years ago
When first pulling apart the implicit solver, I wrote this brief summary:
N_a terms = 1 (diffusion)
N_diagonal terms = 6 (unsteady+upwind_advection+2diffusion+entr_detr+dissipation)
N_c terms = 2 (diffusion+upwind_advection)
∂_t ρa*tke ✓ unsteady
+ ∂_z(ρaw*tke) = ✓ advection
+ ρaK*(∂²_z(u)+∂²_z(v)+∂²_z(w̄))
+ ρawΣᵢ(εᵢ(wⱼ-w₀)²-δ₀*tke) ✓ entr_detr
+ ∂_z(ρa₀K ∂_z(tke)) ✓ diffusion
+ ρa₀*w̅₀b̅₀
- a₀(u⋅∇p)
+ ρa₀D ✓ dissipation
The advection and diffusion term can be approximated as
∂_z(ρaw*tke) = ∂_z(ρaw^{n}*tke^{n+1})
∂_z(ρa₀K ∂_z(tke)) = ∂_z(ρa₀K^{n}∂_z(tke)^{n+1})
superscripts indicate time, then this will give you a tridiagonal matrix about tke^{n+1}
The source term is a diagonal matrix ?
Some useful lines:
cc @Zhengyu-Huang
The advection and diffusion term can be approximated as
∂_z(ρaw*tke) = ∂_z(ρaw^{n}*tke^{n+1})
∂_z(ρa₀K ∂_z(tke)) = ∂_z(ρa₀K^{n}∂_z(tke)^{n+1})
This is indeed what we did in SCAMPy, but be mindful that K
is a. function of tke
so that you are mixing time steps (it worked reasonably well). The same is true for the buoyancy gradient and shear sources where K
is used
Over the course of our development, we've moved to fully explicit time stepping in order to
The relavent PRs (and their slow downs, pending) are:
486
485
484
343
115
111
We should now effectively revert this PRs, by using OrdinaryDiffEq.jl and treating specific terms (or all terms) implicitly in time.