Skip to content

Commit

Permalink
Update Fuels
Browse files Browse the repository at this point in the history
Change to use HBRV-Fuels from HB-Model
  • Loading branch information
ed-p-may committed Nov 22, 2024
1 parent ef14c2a commit def2cd8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
44 changes: 26 additions & 18 deletions ph_adorb/from_HBJSON/create_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,31 @@ def get_PhAdorbEquipment_from_hb_model(_hb_model: Model) -> PhAdorbEquipmentColl
return equipment_collection_


def get_PhAdorbFuels_from_hb_model(_hb_model: Model) -> tuple[PhAdorbFuel, PhAdorbFuel]:
"""Get the Electric and Natural-Gas Fuels from the HB-Model."""

model_props: ModelReviveProperties = getattr(_hb_model.properties, "revive")
hbrv_elec = model_props.fuels.get_fuel("ELECTRICITY")
hb_nat_gas = model_props.fuels.get_fuel("NATURAL_GAS")

electricity = PhAdorbFuel(
fuel_type=PhAdorbFuelType.ELECTRICITY,
purchase_price_per_kwh=hbrv_elec.purchase_price_per_kwh,
sale_price_per_kwh=hbrv_elec.sale_price_per_kwh,
annual_base_price=hbrv_elec.annual_base_price,
used=True,
)
gas = PhAdorbFuel(
fuel_type=PhAdorbFuelType.NATURAL_GAS,
purchase_price_per_kwh=hb_nat_gas.purchase_price_per_kwh,
sale_price_per_kwh=hb_nat_gas.sale_price_per_kwh,
annual_base_price=hb_nat_gas.annual_base_price,
used=True,
)

return electricity, gas


def get_PhAdorbVariant_from_hb_model(_hb_model: Model, _results_sql_file_path: Path) -> PhAdorbVariant:
"""Convert the HB-Model to a new ReviveVariant object.
Expand All @@ -218,27 +243,10 @@ def get_PhAdorbVariant_from_hb_model(_hb_model: Model, _results_sql_file_path: P
# -- Load in the EnergyPlus Simulation Result .SQL data file
ep_results_sql = DataFileSQL(source_file_path=_results_sql_file_path)

# -----------------------------------------------------------------------------------
# -- Setup the Variant's Fuel Types and Costs
# TODO: Make this user-inputs
electricity = PhAdorbFuel(
fuel_type=PhAdorbFuelType.ELECTRICITY,
purchase_price_per_kwh=0.17984,
sale_price_per_kwh=0.132,
annual_base_price=200.0,
used=True,
)
gas = PhAdorbFuel(
fuel_type=PhAdorbFuelType.NATURAL_GAS,
purchase_price_per_kwh=0.0471,
sale_price_per_kwh=0.0,
annual_base_price=200.0,
used=True,
)

# -----------------------------------------------------------------------------------
# -- Create the actual Variant
hb_model_properties: ModelReviveProperties = getattr(_hb_model.properties, "revive")
electricity, gas = get_PhAdorbFuels_from_hb_model(_hb_model)

try:
revive_variant = PhAdorbVariant(
Expand Down
1 change: 0 additions & 1 deletion ph_adorb/run/generate_ADORB_cost_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def resolve_paths(_args: list[str]) -> Filepaths:
df = pd.read_csv(file_paths.csv)

# -------------------------------------------------------------------------
# TODO:...
fig = go.Figure()
fig.update_layout(title="test")
# Add each category as a trace
Expand Down

0 comments on commit def2cd8

Please sign in to comment.