Skip to content

Commit

Permalink
move depth linearisation into divergence
Browse files Browse the repository at this point in the history
  • Loading branch information
tommbendall committed Oct 2, 2024
1 parent d45b093 commit 7f31fda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gusto/equations/common_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def linear_continuity_form(test, qbar, ubar):
:class:`LabelledForm`: a labelled transport form.
"""

L = qbar*test*div(ubar)*dx
L = test*div(qbar*ubar)*dx
form = transporting_velocity(L, ubar)

return transport(form, TransportEquationType.conservative)
Expand All @@ -153,7 +153,7 @@ def linear_continuity_form_1d(test, qbar, ubar):
:class:`LabelledForm`: a labelled transport form.
"""

L = qbar*test*ubar.dx(0)*dx
L = qbar*test*ubar.dx(0)*dx + qbar.dx(0)*test*ubar*dx
form = transporting_velocity(L, ubar)

return transport(form, TransportEquationType.conservative)
Expand Down
4 changes: 2 additions & 2 deletions gusto/solvers/linear_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def _setup_solver(self):
- beta_u * 0.5 * bbar * div(w*(D-Dbar)) * dx
+ beta_u * 0.5 * jump((D-Dbar)*w, n) * avg(bbar) * dS
+ inner(phi, (D - D_in)) * dx
+ beta_d * phi * Dbar * div(u) * dx
+ beta_d * phi * div(Dbar*u) * dx
)

if 'coriolis' in equation.prescribed_fields._field_names:
Expand Down Expand Up @@ -876,7 +876,7 @@ def _setup_solver(self):
inner(w, (u - u_in)) * dx
- beta_u * (D - Dbar) * div(w*g) * dx
+ inner(phi, (D - D_in)) * dx
+ beta_d * phi * Dbar * div(u) * dx
+ beta_d * phi * div(Dbar*u) * dx
)

if 'coriolis' in equation.prescribed_fields._field_names:
Expand Down

0 comments on commit 7f31fda

Please sign in to comment.