Skip to content

Commit

Permalink
Merge pull request #51 from aefarrell/49-add-verticaljet-to-simple-je…
Browse files Browse the repository at this point in the history
…t-model

adding VerticalJet behaviour to SimpleJet model
  • Loading branch information
aefarrell authored Oct 13, 2024
2 parents dae98c8 + ccdc8cc commit 5fd9231
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
27 changes: 27 additions & 0 deletions src/models/simple_jet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,33 @@ function plume(scenario::Scenario, ::Type{SimpleJet}, eqs::EquationSet=DefaultSe

end

function plume(scenario::Scenario{<:AbstractSubstance,<:VerticalJet,<:Atmosphere}, ::Type{SimpleJet}, eqs::EquationSet=DefaultSet(); release_angle::Number=π/2, k2::Number=6.0, k3::Number=5.0)
# Density correction
ρj = _release_density(scenario)
ρa = _atmosphere_density(scenario)
kd = (ρj/ρa)

# Initial concentration
m = _mass_rate(scenario)
d = _release_diameter(scenario)
Qt = _release_flowrate(scenario)
Qi = m/ρj
c0 = min(Qi/Qt,1.0)

return SimpleJetSolution(
scenario, #scenario::Scenario
:simple_jet, #model::Symbol
d, # diameter
_release_height(scenario), # height
-1*release_angle, # release angle
c0, # concentration
kd, # density_correction
k2,
k3
)

end

function (j::SimpleJetSolution)(x, y, z, t=0)
d = j.diameter
h = j.height
Expand Down
22 changes: 19 additions & 3 deletions test/models/simple_jet_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
dischargecoef = 0.85,
temperature = T1, # K
pressure = P1, # Pa
height = 3.5) # m, height of hole above the ground
height = 300) # m, height of hole above the ground

# known answers
a, b = 6, 5
ξ² = log(2)/b^2
x, y, z = a, (a^2*ξ²), 1
c = 0.00014697139683447435
x, y, z = a, (a^2*ξ²), 300
c = 0.011276270392345168

# horizontal jet
j = plume(scn, SimpleJet; release_angle=0, k2=a, k3=b)
Expand All @@ -38,4 +38,20 @@
@test j(x,y,z) c
@test j(-x,y,z) == 0.0

# vertical jet
v = VerticalJet(; mass_rate=scn.release.ṁ,
duration=scn.release.Δt,
diameter=scn.release.d,
velocity=scn.release.u,
height=scn.release.h,
pressure=scn.release.P,
temperature=scn.release.T,
fraction_liquid=scn.release.f_l)
scn2 = Scenario(scn.substance,v,scn.atmosphere)
j2 = plume(scn2, SimpleJet; k2=a, k3=b)
@test isa(j2, GasDispersion.SimpleJetSolution)
@test isa(j2, Plume)
@test j2(0,y,v.h+x) c
@test j2(0,y,v.h-eps(y)) == 0.0

end

0 comments on commit 5fd9231

Please sign in to comment.