From a10d6a08b5647a1ee4faa8c8da2f07b874753591 Mon Sep 17 00:00:00 2001 From: Cameron Irmas Date: Mon, 26 Feb 2024 10:17:38 -0800 Subject: [PATCH] Add inflation input; remove extraneous cost code (ammonia) --- .../technologies/ammonia/ammonia.py | 187 ++---------------- 1 file changed, 19 insertions(+), 168 deletions(-) diff --git a/greenheart/simulation/technologies/ammonia/ammonia.py b/greenheart/simulation/technologies/ammonia/ammonia.py index 89e00d466..0f32e43ca 100644 --- a/greenheart/simulation/technologies/ammonia/ammonia.py +++ b/greenheart/simulation/technologies/ammonia/ammonia.py @@ -303,6 +303,7 @@ class AmmoniaFinanceModelConfig: empty dict but should be populated with relevant values. install_years (int): Number of years over which the plant is installed and ramped up to full production, default is 3 years. + gen_inflation (float): General inflation rate, default is 0.0. """ plant_life: int @@ -313,6 +314,7 @@ class AmmoniaFinanceModelConfig: costs: Union[AmmoniaCosts, AmmoniaCostModelOutputs] financial_assumptions: Dict[str, float] = Factory(dict) install_years: int = 3 + gen_inflation: float = 0.0 @define @@ -337,7 +339,6 @@ class AmmoniaFinanceModelOutputs: sol: dict summary: dict price_breakdown: pd.DataFrame - ammonia_price_breakdown: dict def run_ammonia_finance_model( @@ -379,20 +380,19 @@ def run_ammonia_finance_model( analysis_start = int(list(config.grid_prices.keys())[0]) - config.install_years # Fill these in - can have most of them as 0 also - gen_inflation = 0.00 pf.set_params( "commodity", { "name": "Ammonia", "unit": "kg", "initial price": 1000, - "escalation": gen_inflation, + "escalation": config.gen_inflation, }, ) pf.set_params("capacity", config.plant_capacity_kgpy / 365) # units/day pf.set_params( "maintenance", - {"value": 0, "escalation": gen_inflation}, + {"value": 0, "escalation": config.gen_inflation}, ) pf.set_params("analysis start year", analysis_start) pf.set_params("operating life", config.plant_life) @@ -409,19 +409,21 @@ def run_ammonia_finance_model( pf.set_params("non depr assets", costs.land_cost) pf.set_params( "end of proj sale non depr assets", - costs.land_cost * (1 + gen_inflation) ** config.plant_life, + costs.land_cost * (1 + config.gen_inflation) ** config.plant_life, ) pf.set_params("demand rampup", 0) pf.set_params("long term utilization", config.plant_capacity_factor) pf.set_params("credit card fees", 0) pf.set_params("sales tax", 0) - pf.set_params("license and permit", {"value": 00, "escalation": gen_inflation}) - pf.set_params("rent", {"value": 0, "escalation": gen_inflation}) + pf.set_params( + "license and permit", {"value": 00, "escalation": config.gen_inflation} + ) + pf.set_params("rent", {"value": 0, "escalation": config.gen_inflation}) pf.set_params("property tax and insurance", 0) pf.set_params("admin expense", 0) pf.set_params("sell undepreciated cap", True) pf.set_params("tax losses monetized", True) - pf.set_params("general inflation rate", gen_inflation) + pf.set_params("general inflation rate", config.gen_inflation) pf.set_params("debt type", "Revolving debt") pf.set_params("cash onhand", 1) @@ -468,21 +470,21 @@ def run_ammonia_finance_model( usage=1, unit="$/year", cost=costs.labor_cost, - escalation=gen_inflation, + escalation=config.gen_inflation, ) pf.add_fixed_cost( name="Maintenance Cost", usage=1, unit="$/year", cost=costs.maintenance_cost, - escalation=gen_inflation, + escalation=config.gen_inflation, ) pf.add_fixed_cost( name="Administrative Expense", usage=1, unit="$/year", cost=costs.general_administration_cost, - escalation=gen_inflation, + escalation=config.gen_inflation, ) pf.add_fixed_cost( name="Property tax and insurance", @@ -498,7 +500,7 @@ def run_ammonia_finance_model( usage=feedstocks.hydrogen_consumption, unit="kilogram of hydrogen per kilogram of ammonia", cost=feedstocks.hydrogen_cost, - escalation=gen_inflation, + escalation=config.gen_inflation, ) pf.add_feedstock( @@ -506,189 +508,38 @@ def run_ammonia_finance_model( usage=feedstocks.electricity_consumption, unit="MWh per kilogram of ammonia", cost=config.grid_prices, - escalation=gen_inflation, + escalation=config.gen_inflation, ) pf.add_feedstock( name="Cooling water", usage=feedstocks.cooling_water_consumption, unit="Gallon per kilogram of ammonia", cost=feedstocks.cooling_water_cost, - escalation=gen_inflation, + escalation=config.gen_inflation, ) pf.add_feedstock( name="Iron based catalyst", usage=feedstocks.iron_based_catalyst_consumption, unit="kilogram of catalyst per kilogram of ammonia", cost=feedstocks.iron_based_catalyst_cost, - escalation=gen_inflation, + escalation=config.gen_inflation, ) pf.add_coproduct( name="Oxygen byproduct", usage=feedstocks.oxygen_byproduct, unit="kilogram of oxygen per kilogram of ammonia", cost=feedstocks.oxygen_cost, - escalation=gen_inflation, + escalation=config.gen_inflation, ) - # ------------------------------ Sovle for breakeven price --------------------------- + # ------------------------------ Set up outputs --------------------------- sol = pf.solve_price() - summary = pf.get_summary_vals() - price_breakdown = pf.get_cost_breakdown() - price_breakdown_air_separation_by_cryogenic = price_breakdown.loc[ - price_breakdown["Name"] == "Air Separation by Cryogenic", "NPV" - ].tolist()[0] - price_breakdown_Haber_Bosch = price_breakdown.loc[ - price_breakdown["Name"] == "Haber Bosch", "NPV" - ].tolist()[0] - price_breakdown_boiler_and_steam_turbine = price_breakdown.loc[ - price_breakdown["Name"] == "Boiler and Steam Turbine", "NPV" - ].tolist()[0] - price_breakdown_cooling_tower = price_breakdown.loc[ - price_breakdown["Name"] == "Cooling Tower", "NPV" - ].tolist()[0] - price_breakdown_depreciable_nonequipment = price_breakdown.loc[ - price_breakdown["Name"] == "Depreciable Nonequipment", "NPV" - ].tolist()[0] - price_breakdown_installation = price_breakdown.loc[ - price_breakdown["Name"] == "Installation cost", "NPV" - ].tolist()[0] - - price_breakdown_labor_cost_annual = price_breakdown.loc[ - price_breakdown["Name"] == "Labor Cost", "NPV" - ].tolist()[0] - price_breakdown_maintenance_cost = price_breakdown.loc[ - price_breakdown["Name"] == "Maintenance Cost", "NPV" - ].tolist()[0] - price_breakdown_administrative_expense = price_breakdown.loc[ - price_breakdown["Name"] == "Administrative Expense", "NPV" - ].tolist()[0] - price_breakdown_property_tax_and_insurance = price_breakdown.loc[ - price_breakdown["Name"] == "Property tax and insurance", "NPV" - ].tolist()[0] - - if feedstocks.hydrogen_cost < 0: - price_breakdown_hydrogen = ( - -1 - * price_breakdown.loc[ - price_breakdown["Name"] == "Hydrogen", "NPV" - ].tolist()[0] - ) - else: - price_breakdown_hydrogen = price_breakdown.loc[ - price_breakdown["Name"] == "Hydrogen", "NPV" - ].tolist()[0] - price_breakdown_electricity = price_breakdown.loc[ - price_breakdown["Name"] == "Electricity", "NPV" - ].tolist()[0] - price_breakdown_cooling_water = price_breakdown.loc[ - price_breakdown["Name"] == "Cooling water", "NPV" - ].tolist()[0] - price_breakdown_iron_based_catalyst = price_breakdown.loc[ - price_breakdown["Name"] == "Iron based catalyst", "NPV" - ].tolist()[0] - price_breakdown_oxygen_byproduct = -price_breakdown.loc[ - price_breakdown["Name"] == "Oxygen byproduct", "NPV" - ].tolist()[0] - - price_breakdown_taxes = ( - price_breakdown.loc[ - price_breakdown["Name"] == "Income taxes payable", "NPV" - ].tolist()[0] - - price_breakdown.loc[ - price_breakdown["Name"] == "Monetized tax losses", "NPV" - ].tolist()[0] - ) - if gen_inflation > 0: - price_breakdown_taxes = ( - price_breakdown_taxes - + price_breakdown.loc[ - price_breakdown["Name"] == "Capital gains taxes payable", "NPV" - ].tolist()[0] - ) - # Calculate financial expense associated with equipment - price_breakdown_financial_equipment = ( - price_breakdown.loc[ - price_breakdown["Name"] == "Repayment of debt", "NPV" - ].tolist()[0] - + price_breakdown.loc[ - price_breakdown["Name"] == "Interest expense", "NPV" - ].tolist()[0] - + price_breakdown.loc[ - price_breakdown["Name"] == "Dividends paid", "NPV" - ].tolist()[0] - - price_breakdown.loc[ - price_breakdown["Name"] == "Inflow of debt", "NPV" - ].tolist()[0] - - price_breakdown.loc[ - price_breakdown["Name"] == "Inflow of equity", "NPV" - ].tolist()[0] - ) - # Calculate remaining financial expenses - price_breakdown_financial_remaining = ( - price_breakdown.loc[ - price_breakdown["Name"] == "Non-depreciable assets", "NPV" - ].tolist()[0] - + price_breakdown.loc[ - price_breakdown["Name"] == "Cash on hand reserve", "NPV" - ].tolist()[0] - + price_breakdown.loc[ - price_breakdown["Name"] == "Property tax and insurance", "NPV" - ].tolist()[0] - - price_breakdown.loc[ - price_breakdown["Name"] == "Sale of non-depreciable assets", "NPV" - ].tolist()[0] - - price_breakdown.loc[ - price_breakdown["Name"] == "Cash on hand recovery", "NPV" - ].tolist()[0] - ) - price_check = ( - price_breakdown_air_separation_by_cryogenic - + price_breakdown_Haber_Bosch - + price_breakdown_boiler_and_steam_turbine - + price_breakdown_cooling_tower - + price_breakdown_depreciable_nonequipment - + price_breakdown_installation - + price_breakdown_labor_cost_annual - + price_breakdown_maintenance_cost - + price_breakdown_administrative_expense - + price_breakdown_hydrogen - + price_breakdown_electricity - + price_breakdown_cooling_water - + price_breakdown_iron_based_catalyst - - price_breakdown_oxygen_byproduct - + price_breakdown_taxes - + price_breakdown_financial_equipment - + price_breakdown_financial_remaining - ) - ammonia_price_breakdown = { - "Ammonia price: Air Separation by Cryogenic ($/kg)": price_breakdown_air_separation_by_cryogenic, - "Ammonia price: Haber Bosch ($/kg)": price_breakdown_Haber_Bosch, - "Ammonia price: Boiler and Steam Turbine ($/kg)": price_breakdown_boiler_and_steam_turbine, - "Ammonia price: Cooling Tower ($/kg)": price_breakdown_cooling_tower, - "Ammonia price: Depreciable Nonequipment ($/kg)": price_breakdown_depreciable_nonequipment, - "Ammonia price: Labor Cost ($/kg)": price_breakdown_labor_cost_annual, - "Ammonia price: Maintenance Cost ($/kg)": price_breakdown_maintenance_cost, - "Ammonia price: Administrative Expense ($/kg)": price_breakdown_administrative_expense, - "Ammonia price: Hydrogen ($/kg)": price_breakdown_hydrogen, - "Ammonia price: Electricity ($/kg)": price_breakdown_electricity, - "Ammonia price: Cooling water ($/kg)": price_breakdown_cooling_water, - "Ammonia price: Iron based catalyst ($/kg)": price_breakdown_iron_based_catalyst, - "Ammonia price: Oxygen byproduct ($/kg)": price_breakdown_oxygen_byproduct, - "Ammonia price: Taxes ($/kg)": price_breakdown_taxes, - "Ammonia price: Equipment Financing ($/kg)": price_breakdown_financial_equipment, - "Ammonia price: Remaining Financial ($/kg)": price_breakdown_financial_remaining, - "Ammonia price: Total ($/kg)": price_check, - } - - price_breakdown = price_breakdown.drop(columns=["Amount"]) - return AmmoniaFinanceModelOutputs( sol=sol, summary=summary, price_breakdown=price_breakdown, - ammonia_price_breakdown=ammonia_price_breakdown, )