Skip to content

Commit

Permalink
fix flowing_fraction and volume calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
JoostBuitink committed Oct 29, 2024
1 parent d05f673 commit 2dfa845
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ function update(sf::SurfaceFlowLand, network, frac_toriver)
flowing_fraction = 1.0
else
flowing_fraction = (pond_volume_pot - threshold_volume) / pot_inflow
flowing_fraction = min(flowing_fraction, 1.0)
end

sf.q[v] = kinematic_wave(
Expand Down Expand Up @@ -297,7 +298,7 @@ function update(sf::SurfaceFlowLand, network, frac_toriver)
sf.q_av ./= its
sf.h_av ./= its
sf.to_river ./= its
sf.volume .= sf.dl .* sf.width .* sf.h
sf.volume .= sf.dl .* sf.width .* (sf.h .+ sf.pond_height)
end

function update(sf::SurfaceFlowRiver, network, doy)
Expand Down

0 comments on commit 2dfa845

Please sign in to comment.