From 0de2227ac6361e373e8590aafdbe371d636708d5 Mon Sep 17 00:00:00 2001 From: allan <75338859+aefarrell@users.noreply.github.com> Date: Fri, 6 Jun 2025 09:36:22 -0600 Subject: [PATCH 1/3] Missing keyword arguments SLAB VerticalJet was missing keyword arguments for averaging time and max downwind distance --- src/models/slab_puff.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models/slab_puff.jl b/src/models/slab_puff.jl index d180f10..6671b6e 100644 --- a/src/models/slab_puff.jl +++ b/src/models/slab_puff.jl @@ -128,7 +128,8 @@ function puff(scenario::Scenario, ::Type{SLAB}, eqs::EquationSet=DefaultSet(); AkimaInterpolation(out.cc.betax[tperm], out.cc.t[tperm])) end -function puff(scenario::Scenario{<:AbstractSubstance,<:VerticalJet,<:Atmosphere}, ::Type{SLAB}, eqs::EquationSet=DefaultSet(); release_angle::Number=π/2, k2::Number=6.0, k3::Number=5.0) +function puff(scenario::Scenario{<:AbstractSubstance,<:VerticalJet,<:Atmosphere}, ::Type{SLAB}, eqs::EquationSet=DefaultSet(); + t_av=10, x_max=2000) c_max = 1.0 stab = _slab_stab( _stability(scenario) ) antoine = _slab_antoine(scenario) From acdd8ce664bbdcc9dd8a4d364f35be3449d095c5 Mon Sep 17 00:00:00 2001 From: allan <75338859+aefarrell@users.noreply.github.com> Date: Sat, 7 Jun 2025 12:48:45 -0600 Subject: [PATCH 2/3] Reshuffle solutions --- src/models/slab_puff.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/models/slab_puff.jl b/src/models/slab_puff.jl index 6671b6e..be7571e 100644 --- a/src/models/slab_puff.jl +++ b/src/models/slab_puff.jl @@ -168,14 +168,14 @@ function puff(scenario::Scenario{<:AbstractSubstance,<:VerticalJet,<:Atmosphere} xperm = sortperm(out.cc.x) tperm = sortperm(out.cc.t) return SLABSolution(scenario,:SLAB,inp,out,c_max, - AkimaInterpolation(out.cc.cc, out.cc.x), - AkimaInterpolation(out.cc.b, out.cc.x), - AkimaInterpolation(out.cc.betac, out.cc.x), - AkimaInterpolation(out.cc.zc, out.cc.x), - AkimaInterpolation(out.cc.sig, out.cc.x), - AkimaInterpolation(out.cc.xc, out.cc.t), - AkimaInterpolation(out.cc.bx, out.cc.t), - AkimaInterpolation(out.cc.betax, out.cc.t)) + AkimaInterpolation(out.cc.cc[xperm], out.cc.x[xperm]), + AkimaInterpolation(out.cc.b[xperm], out.cc.x[xperm]), + AkimaInterpolation(out.cc.betac[xperm], out.cc.x[xperm]), + AkimaInterpolation(out.cc.zc[xperm], out.cc.x[xperm]), + AkimaInterpolation(out.cc.sig[xperm], out.cc.x[xperm]), + AkimaInterpolation(out.cc.xc[tperm], out.cc.t[tperm]), + AkimaInterpolation(out.cc.bx[tperm], out.cc.t[tperm]), + AkimaInterpolation(out.cc.betax[tperm], out.cc.t[tperm])) end From 59fadf3e63f5d499c90a24d2c7bcdd15626c7c98 Mon Sep 17 00:00:00 2001 From: allan <75338859+aefarrell@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:16:45 -0600 Subject: [PATCH 3/3] Adding SLAB Vertical Jet unit tests Added unit test to confirm entire integration. Existing ones merely checked that the slab submodule worked, not that the interface with the rest of GasDispersion worked correctly. --- test/models/slab_tests.jl | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/test/models/slab_tests.jl b/test/models/slab_tests.jl index 541055d..dfa2d6e 100644 --- a/test/models/slab_tests.jl +++ b/test/models/slab_tests.jl @@ -273,4 +273,46 @@ end @test result ≈ out[:, 1:23] end +@testset "INPR4 Vertical Jet - z0 = 1.0" begin + # this tests against the INPR4 test problem, but with the surface _surface_roughness + # at the default value for a SimpleAtmosphere type, z0=1.0 + + s = Substance( + name="inpr4", + molar_weight=0.070906, + gas_heat_capacity=498.1, + boiling_temp=239.1, + latent_heat=287840.0, + liquid_heat_capacity=926.3, + liquid_density=1574.0, + vapor_pressure=GasDispersion.Antoine(0,1978.34,-27.01) + ) + r = VerticalJet( + fraction_liquid=0.88, + temperature=239.1, + mass_rate=3.33, + diameter=√(4*0.02/π), + duration=300.0, + height=1.0, + velocity=0.0, + pressure=101325 + ) + + a = SimpleAtmosphere( + windspeed_height=10.0, + windspeed=1.0, + temperature=276.0, + rel_humidity=30.0, + stability=ClassD + ) + tav = 1.0 + xffm = 10000.0 + + inpr4 = Scenario(s,r,a) + rls = puff(inpr4, SLAB; t_av=tav, x_max=xffm) + + @test rls.betax(17423.2) ≈ 4103.183379580039 + +end + end \ No newline at end of file