Skip to content

Commit

Permalink
Update write_net_revenue.jl
Browse files Browse the repository at this point in the history
include the cost or credits associated with CO2 sequestration to the write_net_revenue.jl
  • Loading branch information
fc4uk committed Nov 21, 2023
1 parent bf93caa commit b2ec02c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/write_outputs/write_net_revenue.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ function write_net_revenue(path::AbstractString, inputs::Dict, setup::Dict, EP::
dfNetRevenue.Charge_cost = dfChargingcost[1:G,:AnnualSum] # Unit is confirmed to be US$
end

# Add CO2 releated sequestration cost or credit (e.g. 45 Q) to the dataframe
dfNetRevenue.CO2SequestrationCost = zeros(nrow(dfNetRevenue))
if any(dfGen.CO2_Capture_Fraction .!= 0)
dfNetRevenue.CO2SequestrationCost .= value.(EP[:ePlantCCO2Sequestration])
end
if setup["ParameterScale"] == 1
dfNetRevenue.CO2SequestrationCost *= ModelScalingFactor^2 # converting Million US$ to US$
end

# Add energy and subsidy revenue to the dataframe
dfNetRevenue.EnergyRevenue = zeros(nrow(dfNetRevenue))
dfNetRevenue.SubsidyRevenue = zeros(nrow(dfNetRevenue))
Expand Down Expand Up @@ -169,7 +178,7 @@ function write_net_revenue(path::AbstractString, inputs::Dict, setup::Dict, EP::
end

dfNetRevenue.Revenue = dfNetRevenue.EnergyRevenue .+ dfNetRevenue.SubsidyRevenue .+ dfNetRevenue.ReserveMarginRevenue .+ dfNetRevenue.ESRRevenue .+ dfNetRevenue.RegSubsidyRevenue
dfNetRevenue.Cost = dfNetRevenue.Inv_cost_MW .+ dfNetRevenue.Inv_cost_MWh .+ dfNetRevenue.Fixed_OM_cost_MW .+ dfNetRevenue.Fixed_OM_cost_MWh .+ dfNetRevenue.Var_OM_cost_out .+ dfNetRevenue.Var_OM_cost_in .+ dfNetRevenue.Fuel_cost .+ dfNetRevenue.Charge_cost .+ dfNetRevenue.EmissionsCost .+ dfNetRevenue.StartCost
dfNetRevenue.Cost = dfNetRevenue.Inv_cost_MW .+ dfNetRevenue.Inv_cost_MWh .+ dfNetRevenue.Fixed_OM_cost_MW .+ dfNetRevenue.Fixed_OM_cost_MWh .+ dfNetRevenue.Var_OM_cost_out .+ dfNetRevenue.Var_OM_cost_in .+ dfNetRevenue.Fuel_cost .+ dfNetRevenue.Charge_cost .+ dfNetRevenue.EmissionsCost .+ dfNetRevenue.StartCost +dfNetRevenue.CO2SequestrationCost
dfNetRevenue.Profit = dfNetRevenue.Revenue .- dfNetRevenue.Cost

CSV.write(joinpath(path, "NetRevenue.csv"), dfNetRevenue)
Expand Down

0 comments on commit b2ec02c

Please sign in to comment.