Skip to content

Commit

Permalink
Merge branch 'main' into pa-melting
Browse files Browse the repository at this point in the history
  • Loading branch information
aelligp committed Aug 22, 2024
2 parents 0ac7a36 + 3d5df73 commit d1b8aca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JustRelax"
uuid = "34418575-392d-4e26-8c6d-96b0910afa06"
authors = ["Albert De Montserrat <[email protected]>, Pascal Aellig <[email protected]>"]
version = "0.3.0"
version = "0.3.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
16 changes: 12 additions & 4 deletions src/Interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@ end

@parallel_indices (i, j) function interp_Vx∂ρ∂x_on_Vy!(Vx_on_Vy, Vx, ρg, _dx)
nx, ny = size(ρg)
ii = clamp(i, 1, nx)
ii1 = clamp(i + 1, 1, nx)
jj = clamp(j, 1, ny)

iW = clamp(i - 1, 1, nx)
iE = clamp(i + 1, 1, nx)
jS = clamp(j - 1, 1, ny)
jN = clamp(j, 1, ny)

# OPTION 1
ρg_L = 0.25 * (ρg[iW, jS] + ρg[i, jS] + ρg[iW, jN] + ρg[i, jN])
ρg_R = 0.25 * (ρg[iE, jS] + ρg[i, jS] + ρg[iE, jN] + ρg[i, jN])

Vx_on_Vy[i + 1, j] =
(0.25 * (Vx[i, j] + Vx[i + 1, j] + Vx[i, j + 1] + Vx[i + 1, j + 1])) *
(ρg[ii1, jj] - ρg[ii, jj]) *
(ρg_R - ρg_L) *
_dx

return nothing
end

Expand Down

0 comments on commit d1b8aca

Please sign in to comment.