From 28253f98ebd819984428b0009281733d0b99fea0 Mon Sep 17 00:00:00 2001 From: akshaysridhar Date: Tue, 17 Dec 2024 15:10:13 -0800 Subject: [PATCH] modified: config/default_configs/default_config.yml modified: config/model_configs/sphere_baroclinic_wave_rhoe_equilmoist.yml modified: examples/Manifest.toml modified: src/prognostic_equations/implicit/implicit_tendency.jl modified: src/utils/abbreviations.jl modified: NEWS.md Fixes Make default Fixes --- NEWS.md | 6 ++++++ config/default_configs/default_config.yml | 8 ++++---- .../implicit/implicit_tendency.jl | 11 +++++++++++ src/utils/abbreviations.jl | 5 +++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 75add12f58..0b54101004 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,12 @@ v0.28.1 ------- ### Features +### Add van Leer class operator + +Added a new vertical transport option `vanleer_limiter` (for tracer and energy variables) +which uses methods described in Lin et al. (1994) to apply slope-limited upwinding. Adds +operator + ### Read initial conditions from NetCDF files Added functionality to allow initial conditions to be overwritten by diff --git a/config/default_configs/default_config.yml b/config/default_configs/default_config.yml index 6ae4a62206..345ae8b7b6 100644 --- a/config/default_configs/default_config.yml +++ b/config/default_configs/default_config.yml @@ -206,11 +206,11 @@ viscous_sponge: help: "Viscous sponge [`true`, `false` (default)]" value: false tracer_upwinding: - help: "Tracer upwinding mode [`none` (default), `first_order` , `third_order`, `boris_book`, `zalesak`]" - value: none + help: "Tracer upwinding mode [`none` (default), `first_order` , `third_order`, `boris_book`, `zalesak`, `vanleer_limiter`]" + value: vanleer_limiter energy_upwinding: - help: "Energy upwinding mode [`none` (default), `first_order` , `third_order`, `boris_book`, `zalesak`]" - value: none + help: "Energy upwinding mode [`none` (default), `first_order` , `third_order`, `boris_book`, `zalesak`, `vanleer_limiter`]" + value: vanleer_limiter orographic_gravity_wave: help: "Orographic drag on horizontal mean flow [`nothing` (default), `gfdl_restart`, `raw_topo`]" value: ~ diff --git a/src/prognostic_equations/implicit/implicit_tendency.jl b/src/prognostic_equations/implicit/implicit_tendency.jl index 2eddfea985..189df5c4f9 100644 --- a/src/prognostic_equations/implicit/implicit_tendency.jl +++ b/src/prognostic_equations/implicit/implicit_tendency.jl @@ -73,6 +73,17 @@ vertical_transport!( ::Val{:first_order}, ᶜdivᵥ, ) = @. ᶜρχₜ += -coeff * (ᶜdivᵥ(ᶠwinterp(ᶜJ, ᶜρ) * ᶠupwind1(ᶠu³, ᶜχ))) +vertical_transport!( + coeff, + ᶜρχₜ, + ᶜJ, + ᶜρ, + ᶠu³, + ᶜχ, + dt, + ::Val{:vanleer_limiter}, + ᶜdivᵥ, +) = @. ᶜρχₜ += -coeff * (ᶜdivᵥ(ᶠwinterp(ᶜJ, ᶜρ) * ᶠlin_vanleer(ᶠu³, ᶜχ, dt))) vertical_transport!( coeff, ᶜρχₜ, diff --git a/src/utils/abbreviations.jl b/src/utils/abbreviations.jl index 8b686bc2e9..7f9442cb97 100644 --- a/src/utils/abbreviations.jl +++ b/src/utils/abbreviations.jl @@ -85,6 +85,11 @@ const ᶠfct_zalesak = Operators.FCTZalesak( bottom = Operators.FirstOrderOneSided(), top = Operators.FirstOrderOneSided(), ) +const ᶠlin_vanleer = Operators.LinVanLeerC2F( + bottom = Operators.FirstOrderOneSided(), + top = Operators.FirstOrderOneSided(), + constraint = Operators.MonotoneLocalExtrema(), # (Mono5) +) const ᶜinterp_matrix = MatrixFields.operator_matrix(ᶜinterp) const ᶜleft_bias_matrix = MatrixFields.operator_matrix(ᶜleft_bias)