Skip to content

Commit

Permalink
Additional cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo committed Jan 24, 2025
1 parent 5200753 commit 27bed48
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 41 deletions.
9 changes: 1 addition & 8 deletions src/load_inputs/load_resources_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ function scale_vre_stor_data!(vre_stor_in::DataFrame, scale_factor::Float64)
return nothing
end


"""
scale_allamcycle_data!(allamcycle_in::DataFrame, scale_factor::Float64)
Expand Down Expand Up @@ -238,7 +237,6 @@ function scale_allamcycle_data!(allamcycle_in::DataFrame, scale_factor::Float64)
return nothing
end


"""
scale_columns!(df::DataFrame, columns_to_scale::Vector{Symbol}, scale_factor::Float64)
Expand Down Expand Up @@ -1424,13 +1422,12 @@ function add_resources_to_input_data!(inputs::Dict,
inputs["ZONES_AC_CHARGE"] = zone_id(gen[storage_ac_charge(gen)])
end


## flexible operation of CCS
# Allam Cycle with liquid oxygen (LOX) storage
inputs["ALLAM_CYCLE_LOX"] = allam_cycle_lox(gen)
inputs["WITH_LOX"] = is_with_lox(gen)

#reconstruct a dictionary to store component-wise data for Allam Cycle w/ LOX.
# reconstruct a dictionary to store component-wise data for Allam Cycle w/ LOX.
# the order must follow sCO2 turbine -> ASU -> LOX
allam_dict = Dict()
for y in inputs["ALLAM_CYCLE_LOX"]
Expand Down Expand Up @@ -1473,10 +1470,6 @@ function add_resources_to_input_data!(inputs::Dict,
return nothing
end





"""
summary(rs::Vector{<:AbstractResource})
Expand Down
2 changes: 1 addition & 1 deletion src/model/core/fuel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function fuel!(EP::Model, inputs::Dict, setup::Dict)

@expression(EP, eFuelConsumption_single[f in 1:NUM_FUEL, t in 1:T],
sum(EP[:vFuel][y, t] + EP[:eStartFuel][y, t]
for y in intersect( setdiff(resources_with_fuel(gen, fuels[f]), ALLAM_CYCLE_LOX), SINGLE_FUEL)))
for y in intersect(setdiff(resources_with_fuel(gen, fuels[f]), ALLAM_CYCLE_LOX), SINGLE_FUEL)))

@expression(EP, eFuelConsumption[f in 1:NUM_FUEL, t in 1:T],
if !isempty(MULTI_FUELS)
Expand Down
62 changes: 30 additions & 32 deletions src/write_outputs/write_allamcyclelox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,49 +75,47 @@ function write_allam_capacity(path::AbstractString, inputs::Dict, setup::Dict, E

if setup["ParameterScale"] == 1
columns_to_scale = [
:StartCap_sCO2turbine_MW_gross,
:RetCap_sCO2turbine_MW_gross,
:NewCap_sCO2turbine_MW_gross,
:EndCap_sCO2turbine_MW_gross,

:StartCap_ASU_MW_gross,
:RetCap_ASU_MW_gross,
:NewCap_ASU_MW_gross,
:EndCap_ASU_MW_gross,

:StartCap_LOX_t,
:RetCap_LOX_t,
:NewCap_LOX_t,
:EndCap_LOX_t
:StartCap_sCO2turbine_MW_gross,
:RetCap_sCO2turbine_MW_gross,
:NewCap_sCO2turbine_MW_gross,
:EndCap_sCO2turbine_MW_gross,
:StartCap_ASU_MW_gross,
:RetCap_ASU_MW_gross,
:NewCap_ASU_MW_gross,
:EndCap_ASU_MW_gross,

:StartCap_LOX_t,
:RetCap_LOX_t,
:NewCap_LOX_t,
:EndCap_LOX_t
]

scale_columns!(dfCapAllam, columns_to_scale, ModelScalingFactor)
end

total_allam = DataFrame(
Resource = "Total", Zone = "n/a",
StartCap_sCO2turbine_MW_gross = sum(dfCapAllam[!,:StartCap_sCO2turbine_MW_gross]),
RetCap_sCO2turbine_MW_gross = sum(dfCapAllam[!,:RetCap_sCO2turbine_MW_gross]),
NewCap_sCO2turbine_MW_gross = sum(dfCapAllam[!,:NewCap_sCO2turbine_MW_gross]),
EndCap_sCO2turbine_MW_gross = sum(dfCapAllam[!,:EndCap_sCO2turbine_MW_gross]),

StartCap_ASU_MW_gross = sum(dfCapAllam[!,:StartCap_ASU_MW_gross]),
RetCap_ASU_MW_gross = sum(dfCapAllam[!,:RetCap_ASU_MW_gross]),
NewCap_ASU_MW_gross = sum(dfCapAllam[!,:NewCap_ASU_MW_gross]),
EndCap_ASU_MW_gross = sum(dfCapAllam[!,:EndCap_ASU_MW_gross]),

StartCap_LOX_t = sum(dfCapAllam[!,:StartCap_LOX_t]),
RetCap_LOX_t = sum(dfCapAllam[!,:RetCap_LOX_t]),
NewCap_LOX_t = sum(dfCapAllam[!,:NewCap_LOX_t]),
EndCap_LOX_t = sum(dfCapAllam[!,:EndCap_LOX_t]),
)
Resource = "Total", Zone = "n/a",
StartCap_sCO2turbine_MW_gross = sum(dfCapAllam[!,:StartCap_sCO2turbine_MW_gross]),
RetCap_sCO2turbine_MW_gross = sum(dfCapAllam[!,:RetCap_sCO2turbine_MW_gross]),
NewCap_sCO2turbine_MW_gross = sum(dfCapAllam[!,:NewCap_sCO2turbine_MW_gross]),
EndCap_sCO2turbine_MW_gross = sum(dfCapAllam[!,:EndCap_sCO2turbine_MW_gross]),

StartCap_ASU_MW_gross = sum(dfCapAllam[!,:StartCap_ASU_MW_gross]),
RetCap_ASU_MW_gross = sum(dfCapAllam[!,:RetCap_ASU_MW_gross]),
NewCap_ASU_MW_gross = sum(dfCapAllam[!,:NewCap_ASU_MW_gross]),
EndCap_ASU_MW_gross = sum(dfCapAllam[!,:EndCap_ASU_MW_gross]),

StartCap_LOX_t = sum(dfCapAllam[!,:StartCap_LOX_t]),
RetCap_LOX_t = sum(dfCapAllam[!,:RetCap_LOX_t]),
NewCap_LOX_t = sum(dfCapAllam[!,:NewCap_LOX_t]),
EndCap_LOX_t = sum(dfCapAllam[!,:EndCap_LOX_t]),
)

dfCapAllam = vcat(dfCapAllam, total_allam)
CSV.write(joinpath(path,"capacity_allam_cycle_lox.csv"), dfCapAllam)

# also write the vOutput_AllamcycleLOX, vLOX_in, vLOX_out


end

function write_allam_output(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
Expand Down

0 comments on commit 27bed48

Please sign in to comment.