Skip to content

Commit 0252ad5

Browse files
committed
Subtract ᶜθ_vr from ∇p/ρ² term in ∂u₃ₜ/∂ρ Jacobian block, subtract ᶜΦ_r from other term
1 parent 7323dfa commit 0252ad5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/prognostic_equations/implicit/manual_sparse_jacobian.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,17 @@ 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-
465+
ᶜΦ_r = @. lazy(phi_r(thermo_params, ᶜts))
466466
ᶜθ_v = @. lazy(theta_v(thermo_params, ᶜts))
467+
ᶜθ_vr = @. lazy(theta_vr(thermo_params, ᶜts))
467468
ᶜΠ = @. lazy(exner_function(thermo_params, ᶜts))
468469
@. ∂ᶠu₃_err_∂ᶜρ =
469470
dtγ * (
470471
ᶠp_grad_matrix
471-
DiagonalMatrixRow(ᶜkappa_m * (T_0 * cp_d - ᶜK - ᶜΦ)) +
472-
DiagonalMatrixRow(cp_d * ᶠinterp(ᶜθ_v) * ᶠgradᵥ(ᶜΠ) / ᶠinterp(ᶜρ))
472+
DiagonalMatrixRow(ᶜkappa_m * (T_0 * cp_d - ᶜK - (ᶜΦ - ᶜΦ_r))) +
473+
DiagonalMatrixRow(
474+
cp_d * ᶠinterp(ᶜθ_v - ᶜθ_vr) * ᶠgradᵥ(ᶜΠ) / ᶠinterp(ᶜρ),
475+
)
473476
ᶠinterp_matrix()
474477
)
475478
@. ∂ᶠu₃_err_∂ᶜρe_tot = dtγ * ᶠp_grad_matrix DiagonalMatrixRow(ᶜkappa_m)

0 commit comments

Comments
 (0)