Skip to content

Commit

Permalink
Finished industry heat demand profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias157 committed Sep 23, 2024
1 parent 3dddcc0 commit 05340f9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
30 changes: 22 additions & 8 deletions src/Modules/exo_heat_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,16 @@ def create_INDIVUSERS_DH(incfile, new_dataset: xr.Dataset):

## 2.3.2 INDUSTRY_DH_VAR_T.inc
@create_incfile
def create_INDUSTRY_DH_VAR_T(incfile):
incfile.body = f"""* Assume that heat demand profile of industry correlates exactly to electricity demand profile
DH_VAR_T(AAA,'IND-PHH',SSS,TTT)$(SUM((S,T), DE_VAR_T(RRR,'PII',SSS,TTT))) = DE_VAR_T(RRR,'PII',SSS,TTT);
DH_VAR_T(AAA,'IND-PHM',SSS,TTT)$(SUM((S,T), DE_VAR_T(RRR,'PII',SSS,TTT))) = DE_VAR_T(RRR,'PII',SSS,TTT);
DH_VAR_T(AAA,'IND-PHL',SSS,TTT)$(SUM((S,T), DE_VAR_T(RRR,'PII',SSS,TTT))) = DE_VAR_T(RRR,'PII',SSS,TTT);
"""
def create_INDUSTRY_DH_VAR_T(incfile, el_new_dataset: xr.Dataset):
incfile.body = (
transform_xrdata(el_new_dataset,
'electricity_demand_mwh')
.to_dataframe()
.reset_index()
)
incfile.body.loc[:, 'A'] = incfile.body.loc[:, 'A'].values + '_IND-HT-NODH'
incfile.body_prepare(['S', 'T'],
['A', 'DHUSER'], values='electricity_demand_mwh')

#%% ------------------------------- ###
### 3. Main ###
Expand Down Expand Up @@ -291,8 +295,18 @@ def main(show_difference: bool = False):
""")

## 1.3 Make Heat Variation Profiles
create_INDUSTRY_DH_VAR_T(name='INDUSTRY_DH_VAR_T', path=out_path,
prefix='', suffix='')
create_INDUSTRY_DH_VAR_T(el_new_dataset=el_new_dataset,
name='INDUSTRY_DH_VAR_T',
path=out_path,
prefix="""TABLE DH_VAR_T_IND(SSS,TTT,AAA,DHUSER)\n""",
suffix="""\n;\n* Collect series to other heat series, if there is a industry heat series
DH_VAR_T(AAA,DHUSER,SSS,TTT)$(SUM((S,T), DH_VAR_T_IND(S,T,AAA,DHUSER))) = DH_VAR_T_IND(SSS,TTT,AAA,DHUSER);
DH_VAR_T_IND(SSS,TTT,AAA,DHUSER)=0;
* Assume that other temperature processes follow the same pattern, if there is a profile
DH_VAR_T(AAA,'IND-PHM',SSS,TTT)$(SUM((S,T), DH_VAR_T(AAA,'IND-PHH',SSS,TTT))) = DH_VAR_T(AAA,'IND-PHH',SSS,TTT);
DH_VAR_T(AAA,'IND-PHL',SSS,TTT)$(SUM((S,T), DH_VAR_T(AAA,'IND-PHH',SSS,TTT))) = DH_VAR_T(AAA,'IND-PHH',SSS,TTT);
""")



Expand Down
6 changes: 2 additions & 4 deletions src/snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ rule exo_heat_demand:
[f'{out_path}DH.inc', f'{out_path}DH_VAR_T.inc',
f'{out_path}INDUSTRY_DH.inc', f'{out_path}INDUSTRY_DH_VAR_T.inc',
f'{out_path}INDIVUSERS_DH.inc', f'{out_path}INDIVUSERS_DH_VAR_T.inc']
shell:
"""
python Modules/exo_heat_demand.py
"""
script:
f"{modules_path}exo_heat_demand.py"

# 4. Transport Demand
rule format_dkstat_transport_data:
Expand Down

0 comments on commit 05340f9

Please sign in to comment.