Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure that no fueled generators with zero heat rate can be built #118

Merged
merged 1 commit into from
Jul 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions switchwrapper/grid_to_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def build_generation_projects_info(

# Finally, construct data frame and return
df = pd.DataFrame(index=pd.Index(all_plant_indices, name="GENERATION_PROJECT"))
# Add columns
df["gen_tech"] = (
plant.type.tolist() * 2 + [const.storage_parameters["tech"]] * num_storage
)
Expand All @@ -296,10 +297,6 @@ def build_generation_projects_info(
df["gen_load_zone"] = gen_load_zone
df["gen_connect_cost_per_mw"] = 0
df["gen_capacity_limit_mw"] = "."
df.loc[indices["expansion"], "gen_capacity_limit_mw"] = [
const.assumed_capacity_limits.get(t, const.assumed_capacity_limits["default"])
for t in plant.type.tolist()
]
df["gen_full_load_heat_rate"] = estimated_heatrate.tolist() * 2 + [0] * num_storage
df["gen_variable_om"] = nonfuel_gencost.tolist() * 2 + [0] * num_storage
df["gen_max_age"] = [
Expand All @@ -320,7 +317,6 @@ def build_generation_projects_info(
plant.type.map(const.fuel_mapping).tolist() * 2
+ [const.fuel_mapping["storage"]] * num_storage
)
df.loc[df.gen_energy_source.isin(const.non_fuels), "gen_full_load_heat_rate"] = "."
df["gen_unit_size"] = "."
df["gen_ccs_capture_efficiency"] = "."
df["gen_ccs_energy_load"] = "."
Expand All @@ -334,8 +330,25 @@ def build_generation_projects_info(
df["gen_storage_max_cycles_per_year"] = ["."] * num_gens + [
const.storage_parameters["max_cycles"]
] * num_storage
df.reset_index(inplace=True)
# Refine data
# Add generation expansion limits
df.loc[indices["expansion"], "gen_capacity_limit_mw"] = [
const.assumed_capacity_limits.get(t, const.assumed_capacity_limits["default"])
for t in plant.type.tolist()
]
# Ensure that no fueled generators with zero heat-rate can be built
df.loc[
(
df.index.isin(indices["expansion"])
& (df.gen_full_load_heat_rate == 0)
& df.gen_energy_source.isin(const.fuels)
),
"gen_capacity_limit_mw",
] = 0
# Ensure that heat rates are not written for non-fueled generators
df.loc[df.gen_energy_source.isin(const.non_fuels), "gen_full_load_heat_rate"] = "."

df.reset_index(inplace=True)
return df


Expand Down