Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Mar 20, 2024
1 parent c25df0b commit b8ff976
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/allocation_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,13 @@ function add_constraints_capacity!(
return nothing
end

"""
Add capacity constraints to the outflow edge of UserDemand nodes.
The constraint indices are the UserDemand node IDs.
Constraint:
flow over UserDemand edge outflow edge <= cumulative return flow from previous priorities
"""
function add_constraints_user_source!(
problem::JuMP.Model,
p::Parameters,
Expand Down
7 changes: 7 additions & 0 deletions core/src/allocation_optim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ function adjust_capacities_basin!(
return nothing
end

"""
Set the initial capacities of the UserDemand return flow sources to 0.
"""
function set_initial_capacities_returnflow!(allocation_model::AllocationModel)::Nothing
(; problem) = allocation_model
constraints_outflow = problem[:source_user]
Expand All @@ -436,6 +439,10 @@ function set_initial_capacities_returnflow!(allocation_model::AllocationModel)::
return nothing
end

"""
Add the return flow fraction of the inflow to the UserDemand nodes
to the capacity of the outflow source.
"""
function adjust_capacities_returnflow!(
allocation_model::AllocationModel,
p::Parameters,
Expand Down

0 comments on commit b8ff976

Please sign in to comment.