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

Add chemicals industry (old) #348

Conversation

tud-mchen6
Copy link

@tud-mchen6 tud-mchen6 commented Apr 11, 2024

Fixes #311 .

Adding chemicals industry in the industry module.

Checklist

Any checks which are not relevant to the PR can be pre-checked by the PR creator. All others should be checked by the reviewer. You can add extra checklist items here if required by the PR.

  • CHANGELOG updated
  • Minimal workflow tests pass
  • Tests added to cover contribution (not relevant)
  • Documentation updated (not relevant)
  • Configuration schema updated (not relevant)

@tud-mchen6 tud-mchen6 self-assigned this Apr 11, 2024
Copy link
Member

@brynpickering brynpickering left a comment

Choose a reason for hiding this comment

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

Moved comments over from #355.

One of the main things to note here: the energy consumption is being grouped into just a few carriers. This is a strong assumption that I made as to how the chemicals industry will decarbonise (via electrification and synthetic methanol). In future, we would probably want to keep the output of this file in terms of mass of different chemicals and then have an additional step that allows for it to be reformulated to a common hydrocarbon that could be met by carbon-neutral means. As it currently stands, an # ASSUME: ... comment is necessary to explain the process.

Comment on lines +96 to +139
h2_demand = { # t/t
"Ethylene": 0,
"Propylene": 0,
"BTX": 0,
"Ammonia": 0.178,
"Methanol": 0.189,
}
methanol_demand = {
"Ethylene": 2.83,
"Propylene": 2.83,
"BTX": 4.3,
"Ammonia": 0,
"Methanol": 1,
}
co2_demand = { # tCO2/t
"Ethylene": 0,
"Propylene": 0,
"BTX": 0,
"Ammonia": 0.112, # inc. 0.35t_urea/t_ammonia
"Methanol": 1.373,
}

energy_demand = { # MWh/t
"Ethylene": 1.4, # MTO process
"Propylene": 1.4, # MTO process
"BTX": 1.4, # MTA process
"Ammonia": 2.05, # inc. 0.35t_urea/t_ammonia
"Methanol": 1.5, # auxiliary demand, could just be assumed as already included in existing electricity demand
}

mass = { # Bazzanella and Ausfelder, 2017
"Ethylene": 21.7,
"Propylene": 17,
"BTX": 15.7,
"Ammonia": 17,
"Methanol": 2,
}
molar_mass = {
"Ethylene": 28.05,
"Propylene": 42.08,
"BTX": 93,
"Ammonia": 17.01,
"Methanol": 32.04,
}
Copy link
Member

Choose a reason for hiding this comment

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

This should probably all be in the configuration

Comment on lines +8 to +10
H2_LHV_KTOE = 2.863 # 0.0333 TWh/kt LHV -> 2.863ktoe/kt
MWH_PER_T_TO_KTOE_PER_KT = 0.08598 # 1 MWh/t -> 1 GWh/kt -> 0.08598 ktoe/kt
METHANOL_LHV_KTOE = 0.476 # 19.915 MJ/kg LHV -> 19915000MJ/kt -> 0.476ktoe/kt
Copy link
Member

Choose a reason for hiding this comment

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

Move to config

Copy link
Member

Choose a reason for hiding this comment

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

(except the MWH_PER_T_TO_KTOE_PER_KT one)

path_jrc_production: str,
path_output: Optional[str] = None,
):
# -------------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

Missing docstring

Comment on lines +25 to +26
# Prepare data files
# -------------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

Split out these commented steps into separate functions

return filled_consumption_df


def process_chemicals_energy_consumption(electrical_consumption, prod_df, demand):
Copy link
Member

Choose a reason for hiding this comment

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

Missing type hints and docstring explain the input args

@irm-codebase irm-codebase self-assigned this Apr 16, 2024
@irm-codebase irm-codebase added the Industry Industrial energy demand label Apr 23, 2024
@brynpickering
Copy link
Member

@irm-codebase ready to rebase onto develop now that #340 is merged in!

@tud-mchen6 tud-mchen6 changed the title Ivachen/add chemical industry add chemical industry Jul 25, 2024
@tud-mchen6 tud-mchen6 mentioned this pull request Jul 25, 2024
5 tasks
@tud-mchen6 tud-mchen6 changed the title add chemical industry Add chemicals industry (old) Jul 25, 2024
@timtroendle timtroendle marked this pull request as draft July 30, 2024 16:18
@irm-codebase
Copy link
Contributor

Closed since a new version of this feature was created by @tud-mchen6

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

Successfully merging this pull request may close these issues.

Update chemical industry demand
3 participants