-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Dry deposition * Finish Unit Tests * Modify Project.toml * Modifying Project.toml * remove ModelingToolkit dependency * Add package for test files * Add wet deposition * Change Unit Test
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ using StaticArrays | |
|
||
include("wesley1989.jl") | ||
include("dry_deposition.jl") | ||
include("wet_deposition.jl") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
export WetDeposition | ||
|
||
""" | ||
Calculate wet deposition based on formulas at | ||
www.emep.int/UniDoc/node12.html. | ||
Inputs are fraction of grid cell covered by clouds (cloudFrac), | ||
rain mixing ratio (qrain), air density (ρ_air [kg/m3]), | ||
and fall distance (Δz [m]). | ||
Outputs are wet deposition rates for PM2.5, SO2, and other gases | ||
(wdParticle, wdSO2, and wdOtherGas [1/s]). | ||
""" | ||
function WetDeposition(cloudFrac, qrain, ρ_air, Δz) | ||
A = 5.2u"m^3/kg/s" # m3 kg-1 s-1; Empirical coefficient | ||
E = 0.1 # size-dependent collection efficiency of aerosols by the raindrops | ||
wSubSO2 = 0.15 # sub-cloud scavanging ratio | ||
wSubOther = 0.5 # sub-cloud scavanging ratio | ||
wInSO2 = 0.3 # in-cloud scavanging ratio | ||
wInParticle = 1.0 # in-cloud scavanging ratio | ||
wInOther = 1.4 # in-cloud scavanging ratio | ||
ρwater = 1000.0u"kg*m^-3" # kg/m3 | ||
Vdr = 5.0u"m/s" # raindrop fall speed, m/s | ||
|
||
# precalculated constant combinations | ||
AE = A * 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 | ||
# 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)) | ||
wdSO2 = (wSubSO2VdrPerρwater + cloudFrac*wSubSO2VdrPerρwater) * qrain * ρ_air / Δz | ||
wdOtherGas = (wSubOtherVdrPerρwater + cloudFrac*wSubOtherVdrPerρwater) * qrain * ρ_air / Δz | ||
|
||
return wdParticle, wdSO2, wdOtherGas | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using DepositionMTK | ||
using Test,Unitful | ||
|
||
@testset "unit" begin | ||
@test unit(WetDeposition(0.5,0.5,1.204u"kg*m^-3",1u"m")[1]) == u"s^-1" | ||
@test unit(WetDeposition(0.5,0.5,1.204u"kg*m^-3",1u"m")[2]) == u"s^-1" | ||
@test unit(WetDeposition(0.5,0.5,1.204u"kg*m^-3",1u"m")[3]) == u"s^-1" | ||
end |