Skip to content

Commit 17bbd93

Browse files
committed
Ignore the derivative of ∇ᵥp in the ∂u₃ₜ/∂ρ Jacobian block
1 parent 7323dfa commit 17bbd93

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/prognostic_equations/implicit/manual_sparse_jacobian.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,15 +463,15 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
463463
∂ᶠu₃_err_∂ᶜρ = matrix[@name(f.u₃), @name(c.ρ)]
464464
∂ᶠu₃_err_∂ᶜρe_tot = matrix[@name(f.u₃), @name(c.ρe_tot)]
465465

466+
ᶜΦ_r = @. lazy(phi_r(thermo_params, ᶜts))
466467
ᶜθ_v = @. lazy(theta_v(thermo_params, ᶜts))
468+
ᶜθ_vr = @. lazy(theta_vr(thermo_params, ᶜts))
467469
ᶜΠ = @. lazy(exner_function(thermo_params, ᶜts))
468470
@. ∂ᶠu₃_err_∂ᶜρ =
469-
dtγ * (
470-
ᶠp_grad_matrix
471-
DiagonalMatrixRow(ᶜkappa_m * (T_0 * cp_d - ᶜK - ᶜΦ)) +
472-
DiagonalMatrixRow(cp_d * ᶠinterp(ᶜθ_v) * ᶠgradᵥ(ᶜΠ) / ᶠinterp(ᶜρ))
473-
ᶠinterp_matrix()
474-
)
471+
dtγ * DiagonalMatrixRow(
472+
(cp_d * ᶠinterp(ᶜθ_v - ᶜθ_vr) * ᶠgradᵥ(ᶜΠ) - ᶠgradᵥ(ᶜΦ_r)) /
473+
ᶠinterp(ᶜρ),
474+
) ᶠinterp_matrix()
475475
@. ∂ᶠu₃_err_∂ᶜρe_tot = dtγ * ᶠp_grad_matrix DiagonalMatrixRow(ᶜkappa_m)
476476
ᶜe_tot = @. lazy(specific(Y.c.ρe_tot, Y.c.ρ))
477477
if MatrixFields.has_field(Y, @name(c.ρq_tot))

0 commit comments

Comments
 (0)