update formate and resistance calculation
This commit is contained in:
parent
b05cddae77
commit
bc70819aef
@ -540,7 +540,6 @@ def estimate_renewable_capacities(n, tech_map=None):
|
|||||||
n.generators.loc[tech_i, 'p_nom_min'] = n.generators.loc[tech_i, 'p_nom']
|
n.generators.loc[tech_i, 'p_nom_min'] = n.generators.loc[tech_i, 'p_nom']
|
||||||
|
|
||||||
def attach_line_rating(n):
|
def attach_line_rating(n):
|
||||||
if snakemake.config["lines"]["line_rating"]:
|
|
||||||
s_max=xr.open_dataarray(snakemake.input.line_rating).to_pandas().transpose()
|
s_max=xr.open_dataarray(snakemake.input.line_rating).to_pandas().transpose()
|
||||||
n.lines_t.s_max_pu=s_max/n.lines.loc[s_max.columns,:]['s_nom'] #only considers overhead lines
|
n.lines_t.s_max_pu=s_max/n.lines.loc[s_max.columns,:]['s_nom'] #only considers overhead lines
|
||||||
|
|
||||||
@ -583,6 +582,7 @@ if __name__ == "__main__":
|
|||||||
estimate_renewable_capacities(n)
|
estimate_renewable_capacities(n)
|
||||||
attach_OPSD_renewables(n)
|
attach_OPSD_renewables(n)
|
||||||
update_p_nom_max(n)
|
update_p_nom_max(n)
|
||||||
|
if snakemake.config["lines"]["line_rating"]:
|
||||||
attach_line_rating(n)
|
attach_line_rating(n)
|
||||||
|
|
||||||
add_nice_carrier_names(n)
|
add_nice_carrier_names(n)
|
||||||
|
8
scripts/build_line_rating.py
Normal file → Executable file
8
scripts/build_line_rating.py
Normal file → Executable file
@ -79,7 +79,7 @@ def calculate_resistance(T, R_ref, T_ref=20, alpha=0.00403):
|
|||||||
-------
|
-------
|
||||||
Resistance of at given temperature.
|
Resistance of at given temperature.
|
||||||
"""
|
"""
|
||||||
R=R_ref+(1+alpha*(T-T_ref))
|
R=R_ref*(1+alpha*(T-T_ref))
|
||||||
return R
|
return R
|
||||||
|
|
||||||
def calculate_line_rating(n):
|
def calculate_line_rating(n):
|
||||||
@ -111,8 +111,8 @@ def calculate_line_rating(n):
|
|||||||
R*=relevant_lines["n_bundle"]
|
R*=relevant_lines["n_bundle"]
|
||||||
R=calculate_resistance(T=353, R_ref=R)
|
R=calculate_resistance(T=353, R_ref=R)
|
||||||
Imax=cutout.line_rating(shapes, R, D=0.0218 ,Ts=353 , epsilon=0.8, alpha=0.8)
|
Imax=cutout.line_rating(shapes, R, D=0.0218 ,Ts=353 , epsilon=0.8, alpha=0.8)
|
||||||
line_factor= relevant_lines.eval("v_nom * n_bundle * num_parallel")/1e3
|
line_factor= relevant_lines.eval("v_nom * n_bundle * num_parallel")/1e3 #in mW
|
||||||
da = xr.DataArray(data=np.sqrt(3) * Imax * line_factor.values.reshape(-1,1), #in mW
|
da = xr.DataArray(data=np.sqrt(3) * Imax * line_factor.values.reshape(-1,1),
|
||||||
attrs=dict(description="Maximal possible power in MW for given line considering line rating"))
|
attrs=dict(description="Maximal possible power in MW for given line considering line rating"))
|
||||||
return da
|
return da
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ if __name__ == "__main__":
|
|||||||
if 'snakemake' not in globals():
|
if 'snakemake' not in globals():
|
||||||
from _helpers import mock_snakemake
|
from _helpers import mock_snakemake
|
||||||
snakemake = mock_snakemake('build_line_rating', network='elec', simpl='',
|
snakemake = mock_snakemake('build_line_rating', network='elec', simpl='',
|
||||||
clusters='6', ll='copt', opts='Co2L-24H')
|
clusters='40', ll='copt', opts='Co2L-4H')
|
||||||
configure_logging(snakemake)
|
configure_logging(snakemake)
|
||||||
|
|
||||||
n = pypsa.Network(snakemake.input.base_network)
|
n = pypsa.Network(snakemake.input.base_network)
|
||||||
|
Loading…
Reference in New Issue
Block a user