Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jialinl6 authored Dec 18, 2023
2 parents f7827a7 + eb22944 commit 86cf8e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/wet_deposition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ function WetDeposition(cloudFrac, qrain, ρ_air, Δz)
wInParticle = 1.0 # in-cloud scavanging ratio
wInOther = 1.4 # in-cloud scavanging ratio

# precalculated constant combinations
# precalculated constant combinations
AE = A_wd * E
wSubSO2VdrPerρwater = wSubSO2 * Vdr / ρwater
wSubOtherVdrPerρwater = wSubOther * Vdr / ρwater
wInSO2VdrPerρwater = wInSO2 * Vdr / ρwater
wInParticleVdrPerρwater = wInParticle * Vdr / ρwater
wInOtherVdrPerρwater = wInOther * Vdr / ρwater

# wdParticle (subcloud) = A * P / Vdr * E; P = QRAIN * Vdr * ρgas => wdParticle = A * QRAIN * ρgas * E
# wdParticle (subcloud) = A * P / Vdr * E; P = QRAIN * Vdr * ρgas => wdParticle = A * QRAIN * ρgas * E
# wdGas (subcloud) = wSub * P / Δz / ρwater = wSub * QRAIN * Vdr * ρgas / Δz / ρwater
# wd (in-cloud) = wIn * P / Δz / ρwater = wIn * QRAIN * Vdr * ρgas / Δz / ρwater

wdParticle = qrain * ρ_air * (AE + cloudFrac * (wInParticleVdrPerρwater / Δz))
wdParticle = qrain * ρ_air * (AE + cloudFrac * (wInParticleVdrPerρwater / Δz))
wdSO2 = (wSubSO2VdrPerρwater + cloudFrac*wSubSO2VdrPerρwater) * qrain * ρ_air / Δz
wdOtherGas = (wSubOtherVdrPerρwater + cloudFrac*wSubOtherVdrPerρwater) * qrain * ρ_air / Δz

Expand Down Expand Up @@ -78,4 +78,4 @@ struct Wetdeposition <: EarthSciMLODESystem

new(ODESystem(eqs, t, [SO2, O3], [cloudFrac, qrain, ρ_air, Δz]; name=:Wetdeposition))

Check warning on line 79 in src/wet_deposition.jl

View check run for this annotation

Codecov / codecov/patch

src/wet_deposition.jl#L79

Added line #L79 was not covered by tests
end
end
end
3 changes: 1 addition & 2 deletions test/wetdep_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ using Test,Unitful, ModelingToolkit
@test ModelingToolkit.get_unit(WetDeposition(cloudFrac, qrain, ρ_air, Δz)[1]) == u"s^-1"
@test ModelingToolkit.get_unit(WetDeposition(cloudFrac, qrain, ρ_air, Δz)[2]) == u"s^-1"
@test ModelingToolkit.get_unit(WetDeposition(cloudFrac, qrain, ρ_air, Δz)[3]) == u"s^-1"
end

end

0 comments on commit 86cf8e8

Please sign in to comment.