Skip to content

Commit 414ae20

Browse files
committed
Subtract ᶜθ_vr from the ∇p/ρ² term in the ∂u₃ₜ/∂ρ Jacobian block
1 parent 7323dfa commit 414ae20

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/prognostic_equations/implicit/manual_sparse_jacobian.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,16 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
462462

463463
∂ᶠu₃_err_∂ᶜρ = matrix[@name(f.u₃), @name(c.ρ)]
464464
∂ᶠu₃_err_∂ᶜρe_tot = matrix[@name(f.u₃), @name(c.ρe_tot)]
465-
466465
ᶜθ_v = @. lazy(theta_v(thermo_params, ᶜts))
466+
ᶜθ_vr = @. lazy(theta_vr(thermo_params, ᶜts))
467467
ᶜΠ = @. lazy(exner_function(thermo_params, ᶜts))
468468
@. ∂ᶠu₃_err_∂ᶜρ =
469469
dtγ * (
470470
ᶠp_grad_matrix
471471
DiagonalMatrixRow(ᶜkappa_m * (T_0 * cp_d - ᶜK - ᶜΦ)) +
472-
DiagonalMatrixRow(cp_d * ᶠinterp(ᶜθ_v) * ᶠgradᵥ(ᶜΠ) / ᶠinterp(ᶜρ))
472+
DiagonalMatrixRow(
473+
cp_d * ᶠinterp(ᶜθ_v - ᶜθ_vr) * ᶠgradᵥ(ᶜΠ) / ᶠinterp(ᶜρ),
474+
)
473475
ᶠinterp_matrix()
474476
)
475477
@. ∂ᶠu₃_err_∂ᶜρe_tot = dtγ * ᶠp_grad_matrix DiagonalMatrixRow(ᶜkappa_m)

0 commit comments

Comments
 (0)