Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WENO support for upwinding #107

Merged
merged 13 commits into from
Nov 27, 2024
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Jutul"
uuid = "2b460a1a-8a2b-45b2-b125-b5c536396eb9"
authors = ["Olav Møyner <olav.moyner@gmail.com>"]
version = "0.3.0"
version = "0.3.1"

[deps]
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
Expand Down
3 changes: 3 additions & 0 deletions src/Jutul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ module Jutul
# Nonlinear finite-volume discretizations
include("NFVM/NFVM.jl")

# Weighted essentially non-oscillatory (WENO) schemes
include("WENO/WENO.jl")

# LBFGS suitable for PDE optimization
include("LBFGS/LBFGS.jl")
using .LBFGS
Expand Down
12 changes: 12 additions & 0 deletions src/NFVM/decomposition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ function NFVMLinearDiscretization(decomp; left, right)
return NFVMLinearDiscretization(left, right, t_l, t_r, t_mpfa)
end

function Jutul.discretization_stencil(d::NFVMLinearDiscretization, ::Cells)
(; left, right, T_left, T_right) = d
t_mpfa = d.mpfa

cells = Int[left, right]
for (c, trans) in t_mpfa
push!(cells, c)
end
unique!(cells)
return cells
end

function Jutul.subdiscretization(d::NFVMLinearDiscretization, subg, mapper::Jutul.FiniteVolumeGlobalMap, face)
(; left, right, T_left, T_right) = d
t_mpfa = d.mpfa
Expand Down
6 changes: 6 additions & 0 deletions src/NFVM/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ end
Jutul.cell_pair(x::NFVMNonLinearDiscretization) = Jutul.cell_pair(x.ft_left)
Jutul.cell_pair(x::NFVMLinearDiscretization) = (x.left, x.right)

function Jutul.discretization_stencil(d::NFVMNonLinearDiscretization, e)
l = Jutul.discretization_stencil(d.ft_left, e)
r = Jutul.discretization_stencil(d.ft_right, e)
return unique!(vcat(l, r))
end

function Base.show(io::IO, ft::NFVMNonLinearDiscretization{T}) where T
l, r = cell_pair(ft)
print(io, "NFVMNonLinearDiscretization{$T} $(l)→$(r)")
Expand Down
Loading
Loading