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

make chp fuel flexible #1392

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

make chp fuel flexible #1392

wants to merge 5 commits into from

Conversation

p-glaum
Copy link
Contributor

@p-glaum p-glaum commented Oct 24, 2024

Changes proposed in this Pull Request

Allows you to define multiple fuels in config for which chps are added

Checklist

  • I tested my contribution locally and it works as intended.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in config/config.default.yaml.
  • Changes in configuration options are documented in doc/configtables/*.csv.
  • Sources of newly added data are documented in doc/data_sources.rst.
  • A release note doc/release_notes.rst is added.

@p-glaum p-glaum changed the title make chp flexible make chp fuel flexible Nov 1, 2024
Copy link
Member

@fneum fneum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposed change makes sense. Some code style, documentation to be improved and a bug to be addressed before merging.

efficiency3=costs.at["gas", "CO2 intensity"],
lifetime=costs.at["central gas CHP", "lifetime"],
)
fuel_type = options["chp"]["fuel_type"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be added to config.default.yaml and documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have added this PR as draft. Just wanted to put it there that it is still on my to do.
But now I already addressed your comments.

Comment on lines 2300 to 2301
if not isinstance(fuel_type, list):
fuel_type = [fuel_type]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not isinstance(fuel_type, list):
fuel_type = [fuel_type]
fuel_type = np.atleast_1d(fuel_type)

this is a nice shorthand for such things

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

if not isinstance(fuel_type, list):
fuel_type = [fuel_type]
for fuel in fuel_type:
fuel_nodes = eval(f"spatial.{fuel}.df")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The eval() is a bit extravagant. Let's use something like getattr(spatial, fuel).df.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

bus3="co2 atmosphere",
carrier="urban central CHP",
p_nom_extendable=True,
capital_cost=costs.at["central gas CHP", "fixed"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release note and documentation of the config setting for the fuel types should state that the same costs as for gas CHP are used for all fuels! This might be a strong assumption, which is fine for now but we might want to revisit this later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

)
n.madd(
"Link",
nodes + " urban central gas CHP CC",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nodes + " urban central gas CHP CC",
nodes + f" urban central {fuel} CHP CC",

Bug! Gas CHP CC is added multiple times.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

prepare_sector_network: adress Fabians comments
docs: add new config settings to doc
@p-glaum
Copy link
Contributor Author

p-glaum commented Nov 4, 2024

one thing we should still add is to check if all urban central heat buses exist. similar to #1407

Edit: not needed here, because nodes in CHPs only contain buses which have urban central heat

Copy link
Contributor

github-actions bot commented Nov 4, 2024

Validator Report

I am the Validator. Download all artifacts here.
I'll be back and edit this comment for each new commit.

❗ Run failed!

Download 'logs' artifact to see more details.

  • master passed! ✅
  • feature/make_chp_flexible failed in: prepare_sector_network, prepare_sector_network, prepare_sector_network

Model Metrics

Benchmarks Image not available Image not available Image not available

Comparing feature/make_chp_flexible (6e9eeda) with master (acf089f).
Branch is 5 commits ahead and 0 commits behind.
Last updated on 2024-11-04 16:31:59 CET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants