Skip to content

Commit

Permalink
fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmontoya committed Aug 17, 2024
1 parent 6ca2cda commit ac667a0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions examples/elixir_moist_euler_EC_bubble.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function generate_function_of_y(dz, y0, r_t0, theta_e0,
end
end
#Create Initial atmosphere by generating a layer data set
struct AtmossphereLayers{RealT <: Real}
struct atmosphereLayers{RealT <: Real}
equations::CompressibleMoistEulerEquations2D
# structure: 1--> i-layer (z = total_height/precision *(i-1)), 2--> rho, rho_theta, rho_qv, rho_ql
LayerData::Matrix{RealT} # Contains the layer data for each height
Expand All @@ -59,10 +59,10 @@ struct AtmossphereLayers{RealT <: Real}
mixing_ratios::NTuple{2, RealT} # Constant mixing ratio. Also defines initial guess for rho_qv0 = r_v0 * rho_0.
end

function AtmossphereLayers(equations; total_height = 10010.0, preciseness = 10,
ground_state = (1.4, 100000.0),
equivalentpotential_temperature = 320,
mixing_ratios = (0.02, 0.02), RealT = Float64)
function atmosphereLayers(equations; total_height = 10010.0, preciseness = 10,
ground_state = (1.4, 100000.0),
equivalentpotential_temperature = 320,
mixing_ratios = (0.02, 0.02), RealT = Float64)
@unpack kappa, p_0, c_pd, c_vd, c_pv, c_vv, R_d, R_v, c_pl = equations
rho0, p0 = ground_state
r_t0, r_v0 = mixing_ratios
Expand Down Expand Up @@ -102,18 +102,18 @@ function AtmossphereLayers(equations; total_height = 10010.0, preciseness = 10,
LayerData[i + 1, :] = [rho, rho_theta, rho_qv, rho_ql]
end

return AtmossphereLayers{RealT}(equations, LayerData, total_height, dz, n, ground_state,
theta_e0, mixing_ratios)
return atmosphereLayers{RealT}(equations, LayerData, total_height, dz, n, ground_state,
theta_e0, mixing_ratios)
end

# Generate background state from the Layer data set by linearely interpolating the layers
function initial_condition_moist_bubble(x, t, equations::CompressibleMoistEulerEquations2D,
AtmosphereLayers::AtmossphereLayers)
AtmosphereLayers::atmosphereLayers)
@unpack LayerData, preciseness, total_height = AtmosphereLayers
dz = preciseness
z = x[2]
if (z > total_height && !(isapprox(z, total_height)))
error("The atmossphere does not match the simulation domain")
error("The atmosphere does not match the simulation domain")
end
n = convert(Int, floor(z / dz)) + 1
z_l = (n - 1) * dz
Expand Down Expand Up @@ -200,10 +200,10 @@ function PerturbMoistProfile(x, rho, rho_theta, rho_qv, rho_ql,
return SVector(rho, rho_e, rho_qv, rho_ql)
end

AtmossphereData = AtmossphereLayers(equations)
atmosphereData = atmosphereLayers(equations)

function initial_condition_moist(x, t, equations)
return initial_condition_moist_bubble(x, t, equations, AtmossphereData)
return initial_condition_moist_bubble(x, t, equations, atmosphereData)
end

initial_condition = initial_condition_moist
Expand Down
22 changes: 11 additions & 11 deletions examples/elixir_moist_euler_moist_bubble.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function generate_function_of_y(dz, y0, r_t0, theta_e0,
end
end

struct AtmossphereLayers{RealT <: Real}
struct atmosphereLayers{RealT <: Real}
equations::CompressibleMoistEulerEquations2D
# structure: 1--> i-layer (z = total_height/precision *(i-1)), 2--> rho, rho_theta, rho_qv, rho_ql
LayerData::Matrix{RealT}
Expand All @@ -58,10 +58,10 @@ struct AtmossphereLayers{RealT <: Real}
mixing_ratios::NTuple{2, RealT}
end

function AtmossphereLayers(equations; total_height = 10010.0, preciseness = 10,
ground_state = (1.4, 100000.0),
equivalentpotential_temperature = 320,
mixing_ratios = (0.02, 0.02), RealT = Float64)
function atmosphereLayers(equations; total_height = 10010.0, preciseness = 10,
ground_state = (1.4, 100000.0),
equivalentpotential_temperature = 320,
mixing_ratios = (0.02, 0.02), RealT = Float64)
@unpack kappa, p_0, c_pd, c_vd, c_pv, c_vv, R_d, R_v, c_pl = equations
rho0, p0 = ground_state
r_t0, r_v0 = mixing_ratios
Expand Down Expand Up @@ -101,21 +101,21 @@ function AtmossphereLayers(equations; total_height = 10010.0, preciseness = 10,
LayerData[i + 1, :] = [rho, rho_theta, rho_qv, rho_ql]
end

return AtmossphereLayers{RealT}(equations, LayerData, total_height, dz, n, ground_state,
theta_e0, mixing_ratios)
return atmosphereLayers{RealT}(equations, LayerData, total_height, dz, n, ground_state,
theta_e0, mixing_ratios)
end

# Moist bubble test case from paper:
# G.H. Bryan, J.M. Fritsch, A Benchmark Simulation for Moist Nonhydrostatic Numerical
# Models, MonthlyWeather Review Vol.130, 2917–2928, 2002,
# https://journals.ametsoc.org/view/journals/mwre/130/12/1520-0493_2002_130_2917_absfmn_2.0.co_2.xml.
function initial_condition_moist_bubble(x, t, equations::CompressibleMoistEulerEquations2D,
AtmosphereLayers::AtmossphereLayers)
AtmosphereLayers::atmosphereLayers)
@unpack LayerData, preciseness, total_height = AtmosphereLayers
dz = preciseness
z = x[2]
if (z > total_height && !(isapprox(z, total_height)))
error("The atmossphere does not match the simulation domain")
error("The atmosphere does not match the simulation domain")
end
n = convert(Int, floor((z + eps()) / dz)) + 1
z_l = (n - 1) * dz
Expand Down Expand Up @@ -220,11 +220,11 @@ function PerturbMoistProfile(x, rho, rho_theta, rho_qv, rho_ql,
end

# Create background atmosphere data set
AtmossphereData = AtmossphereLayers(equations)
atmosphereData = atmosphereLayers(equations)

# Create the initial condition with the initial data set
function initial_condition_moist(x, t, equations)
return initial_condition_moist_bubble(x, t, equations, AtmossphereData)
return initial_condition_moist_bubble(x, t, equations, atmosphereData)
end

initial_condition = initial_condition_moist
Expand Down

0 comments on commit ac667a0

Please sign in to comment.