Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
(Minor typographical errors)
  • Loading branch information
Arpit-Babbar authored Jul 17, 2024
1 parent 1aebf65 commit 84baaf5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions examples/elixir_moist_euler_dry_bubble.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ function initial_condition_warm_bubble(x, t, equations::CompressibleMoistEulerEq
Δθ = 2 * cospi(0.5 * r / rc)^2
end

#Perturbed state:
# Perturbed state:
θ = θ_ref + Δθ # potential temperature
# π_exner = 1 - g / (c_pd * θ) * x[2] # exner pressure
# rho = p_0 / (R_d * θ) * (π_exner)^(c_vd / R_d) # density

# calculate background pressure with assumption hydrostatic and neutral
p = p_0 * (1 - kappa * g * x[2] / (R_d * θ_ref))^(c_pd / R_d)

#calculate rho and T with p and theta (now perturbed) rho = p / R_d T, T = θ / π
# calculate rho and T with p and theta (now perturbed) rho = p / R_d T, T = θ / π
rho = p / ((p / p_0)^kappa * R_d * θ)
T = p / (R_d * rho)

v1 = 20.0
#v1 = 0.0
# v1 = 0.0
v2 = 0.0
rho_v1 = rho * v1
rho_v2 = rho * v2
Expand Down
18 changes: 9 additions & 9 deletions src/equations/compressible_moist_euler_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,12 @@ import Trixi: varnames, flux_chandrashekar, boundary_condition_slip_wall,
dE = E * rho_x + rho * mu * dT
dp = xi * (T * rho_x + rho * dT)

#Calculate Error in Sources with exact solution and u
# Calculate Error in Sources with exact solution and u
u_exact = SVector(rho, rho, rho, rho * E, rho * qv, rho * ql)

du1, du2, du3, du4, du5, du6 = (source_terms_moist_bubble(u, x, t, equations) -
source_terms_moist_bubble(u_exact, x, t, equations))
#du1, du2, du3, du4, du5, du6 = zeros(Float64, 6)
# du1, du2, du3, du4, du5, du6 = zeros(Float64, 6)
# Note that d/dt rho = -d/dx rho = -d/dy rho.

du1 += rho_x
Expand Down Expand Up @@ -351,9 +351,9 @@ import Trixi: varnames, flux_chandrashekar, boundary_condition_slip_wall,
end

# Raylight damping sponge source term form A. Sridhar et al.,
#Large-eddy simulations with ClimateMachine: a new open-sourcecode for
#atmospheric simulations on GPUs and CPUs, 2 Oct 2021, doi: 10.5194/gmd-15-6259-2022,
#https://arxiv.org/abs/2110.00853 [physics.ao-ph] .
# Large-eddy simulations with ClimateMachine: a new open-sourcecode for
# atmospheric simulations on GPUs and CPUs, 2 Oct 2021, doi: 10.5194/gmd-15-6259-2022,
# https://arxiv.org/abs/2110.00853 [physics.ao-ph] .
@inline function source_terms_nonhydrostatic_raylight_sponge(u, x, t,
equations::CompressibleMoistEulerEquations2D)
rho, rho_v1, rho_v2, rho_e, rho_qv, rho_ql = u
Expand All @@ -369,7 +369,7 @@ import Trixi: varnames, flux_chandrashekar, boundary_condition_slip_wall,
z_top = 16000.0
# positive even power with default value 2
gamma = 2.0
#relaxation coefficient > 0
# relaxation coefficient > 0
alpha = 0.5

tau_s = zero(eltype(u))
Expand Down Expand Up @@ -528,7 +528,7 @@ import Trixi: varnames, flux_chandrashekar, boundary_condition_slip_wall,
v_square = v1^2 + v2^2
rho_qd = rho - rho_qv - rho_ql

# Work around if an individual density is zero
# Workaround if an individual density is zero
# Thermodynamic entropy
s_d = 0
s_v = 0
Expand Down Expand Up @@ -826,7 +826,7 @@ import Trixi: varnames, flux_chandrashekar, boundary_condition_slip_wall,
L_v = L_00 + (c_pv - c_pl) * T
c_p = c_pd + r_t * c_pl

#equivalentpotential temperature
# equivalent potential temperature
aeq_pot = (T * (p_0 / p_d)^(R_d / c_p) * H^(-r_v * R_v / c_p) *
exp(L_v * r_v * inv(c_p * T)))

Expand All @@ -852,7 +852,7 @@ import Trixi: varnames, flux_chandrashekar, boundary_condition_slip_wall,
L_v = L_00 + (c_pv - c_pl) * T
c_p = c_pd + r_t * c_pl

#equivalentpotential temperature
# equivalent potential temperature
aeq_pot = (T * (p_0 / p_d)^(R_d / c_p) * H^(-r_v * R_v / c_p) *
exp(L_v * r_v * inv(c_p * T)))

Expand Down

0 comments on commit 84baaf5

Please sign in to comment.