Skip to content

Commit

Permalink
non-product upwinding
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Jul 18, 2023
1 parent 0e7a5f9 commit 4e59637
Show file tree
Hide file tree
Showing 23 changed files with 1,388 additions and 1,082 deletions.
16 changes: 8 additions & 8 deletions docs/src/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ InterpolateC2F
InterpolateF2C
WeightedInterpolateC2F
WeightedInterpolateF2C
UpwindBiasedProductC2F
Upwind3rdOrderBiasedProductC2F
LeftBiased1stOrderC2F
RightBiased1stOrderC2F
LeftBiased3rdOrderC2F
RightBiased3rdOrderC2F
Upwind1stOrderC2F
Upwind3rdOrderC2F
FCTBorisBook
FCTZalesak
LeftBiasedC2F
RightBiasedC2F
LeftBiasedF2C
RightBiasedF2C
```

### Derivative operators
Expand All @@ -91,8 +91,6 @@ CurlC2F

```@docs
SetBoundaryOperator
FirstOrderOneSided
ThirdOrderOneSided
```

## Finite difference boundary conditions
Expand All @@ -103,6 +101,8 @@ SetValue
SetGradient
SetDivergence
Extrapolate
OneSided1stOrder
OneSided3rdOrder
```

## Internal APIs
Expand Down
8 changes: 4 additions & 4 deletions examples/column/bb_fct_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ function tendency!(yₜ, y, parameters, t)
top = Operators.Extrapolate(),
)
upwind3 = Operators.Upwind3rdOrderBiasedProductC2F(
bottom = Operators.ThirdOrderOneSided(),
top = Operators.ThirdOrderOneSided(),
bottom = Operators.OneSided3rdOrder(),
top = Operators.OneSided3rdOrder(),
)
FCTBorisBook = Operators.FCTBorisBook(
bottom = Operators.FirstOrderOneSided(),
top = Operators.FirstOrderOneSided(),
bottom = Operators.OneSided1stOrder(),
top = Operators.OneSided1stOrder(),
)
@. yₜ.q =
-divf2c(
Expand Down
4 changes: 2 additions & 2 deletions examples/column/fct_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ function f!(dydt, y, parameters, t)
top = Operators.Extrapolate(),
)
third_order_fluxᶠ = Operators.Upwind3rdOrderBiasedProductC2F(
bottom = Operators.ThirdOrderOneSided(),
top = Operators.ThirdOrderOneSided(),
bottom = Operators.OneSided3rdOrder(),
top = Operators.OneSided3rdOrder(),
)
divf2c = Operators.DivergenceF2C(
bottom = Operators.SetValue(Geometry.WVector(FT(0.0))),
Expand Down
8 changes: 4 additions & 4 deletions examples/column/zalesak_fct_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ function tendency!(yₜ, y, parameters, t)
top = Operators.Extrapolate(),
)
upwind3 = Operators.Upwind3rdOrderBiasedProductC2F(
bottom = Operators.ThirdOrderOneSided(),
top = Operators.ThirdOrderOneSided(),
bottom = Operators.OneSided3rdOrder(),
top = Operators.OneSided3rdOrder(),
)
FCTZalesak = Operators.FCTZalesak(
bottom = Operators.FirstOrderOneSided(),
top = Operators.FirstOrderOneSided(),
bottom = Operators.OneSided1stOrder(),
top = Operators.OneSided1stOrder(),
)
@. yₜ.q =
-divf2c(
Expand Down
4 changes: 2 additions & 2 deletions examples/hybrid/box/limiters_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ function vertical_tendency!(yₜ, y, cache, t)
bottom = Operators.SetValue(Geometry.Contravariant3Vector(FT(0))),
)
upwind3 = Operators.Upwind3rdOrderBiasedProductC2F(
bottom = Operators.ThirdOrderOneSided(),
top = Operators.ThirdOrderOneSided(),
bottom = Operators.OneSided3rdOrder(),
top = Operators.OneSided3rdOrder(),
)
ax12 = (Geometry.Covariant12Axis(),)
ax3 = (Geometry.Covariant3Axis(),)
Expand Down
4 changes: 2 additions & 2 deletions examples/hybrid/plane/bubble_2d_invariant_rhoe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ function rhs_invariant!(dY, Y, _, t)
)
# 1.c) vertical upwinding
third_order_upwind_c2f = Operators.Upwind3rdOrderBiasedProductC2F(
bottom = Operators.ThirdOrderOneSided(),
top = Operators.ThirdOrderOneSided(),
bottom = Operators.OneSided3rdOrder(),
top = Operators.OneSided3rdOrder(),
)
# we want the total u³ at the boundary to be zero: we can either constrain
# both to be zero, or allow one to be non-zero and set the other to be its
Expand Down
4 changes: 2 additions & 2 deletions examples/hybrid/plane/topo_schar_nh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ function rhs_invariant!(dY, Y, _, t)

f_upwind_product1 = Operators.UpwindBiasedProductC2F()
f_upwind_product3 = Operators.Upwind3rdOrderBiasedProductC2F(
bottom = Operators.FirstOrderOneSided(),
top = Operators.FirstOrderOneSided(),
bottom = Operators.OneSided1stOrder(),
top = Operators.OneSided1stOrder(),
)

dρ .= 0 .*
Expand Down
12 changes: 6 additions & 6 deletions examples/hybrid/sphere/deformation_flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ const upwind1 = Operators.UpwindBiasedProductC2F(
top = Operators.Extrapolate(),
)
const upwind3 = Operators.Upwind3rdOrderBiasedProductC2F(
bottom = Operators.ThirdOrderOneSided(),
top = Operators.ThirdOrderOneSided(),
bottom = Operators.OneSided3rdOrder(),
top = Operators.OneSided3rdOrder(),
)
const FCTZalesak = Operators.FCTZalesak(
bottom = Operators.FirstOrderOneSided(),
top = Operators.FirstOrderOneSided(),
bottom = Operators.OneSided1stOrder(),
top = Operators.OneSided1stOrder(),
)
const FCTBorisBook = Operators.FCTBorisBook(
bottom = Operators.FirstOrderOneSided(),
top = Operators.FirstOrderOneSided(),
bottom = Operators.OneSided1stOrder(),
top = Operators.OneSided1stOrder(),
)

# Reference pressure and density
Expand Down
8 changes: 4 additions & 4 deletions examples/hybrid/sphere/hadley_circulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ function tendency!(yₜ, y, parameters, t)
top = Operators.Extrapolate(),
)
upwind3 = Operators.Upwind3rdOrderBiasedProductC2F(
bottom = Operators.ThirdOrderOneSided(),
top = Operators.ThirdOrderOneSided(),
bottom = Operators.OneSided3rdOrder(),
top = Operators.OneSided3rdOrder(),
)
FCTZalesak = Operators.FCTZalesak(
bottom = Operators.FirstOrderOneSided(),
top = Operators.FirstOrderOneSided(),
bottom = Operators.OneSided1stOrder(),
top = Operators.OneSided1stOrder(),
)
hdiv = Operators.Divergence()
hwdiv = Operators.WeakDivergence()
Expand Down
4 changes: 2 additions & 2 deletions examples/hybrid/staggered_nonhydrostatic_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const ᶜFC = Operators.FluxCorrectionC2C(
)
const ᶠupwind_product1 = Operators.UpwindBiasedProductC2F()
const ᶠupwind_product3 = Operators.Upwind3rdOrderBiasedProductC2F(
bottom = Operators.ThirdOrderOneSided(),
top = Operators.ThirdOrderOneSided(),
bottom = Operators.OneSided3rdOrder(),
top = Operators.OneSided3rdOrder(),
)

const ᶜinterp_stencil = Operators.Operator2Stencil(ᶜinterp)
Expand Down
4 changes: 3 additions & 1 deletion src/Operators/Operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ using ..RecursiveApply
include("common.jl")
include("spectralelement.jl")
include("numericalflux.jl")
include("finitedifference.jl")
include("finitedifference/finitedifference.jl")
include("finitedifference/upwinding.jl")
include("finitedifference/deprecated.jl")
include("stencilcoefs.jl")
include("operator2stencil.jl")
include("pointwisestencil.jl")
Expand Down
Loading

0 comments on commit 4e59637

Please sign in to comment.