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

Simulation with timeseries function - always initial values als result #560

Closed
Hoppe-J opened this issue Aug 24, 2023 · 5 comments
Closed

Comments

@Hoppe-J
Copy link

Hoppe-J commented Aug 24, 2023

Hello, i want to simulate a very simple heatwater net with dynamic timeseries.
The net has 4 junctions, one circulation pump with const. mass, one heatexchanger and two pipes:

grafik

I implement a loadprofile for heat demand at the heat exchanger.
When i simulate, the temperatures at the junctions are always the initial temperatur (5°C) although, the pipes external temperatures and pump output where at 35°C.
The loadprofile is written in the run_timeseries fuction correctly, i checked it.
Maybe you could help me, to find the mistake and why the temperature simulation don't work.
Thanks you. I attached some graphs and my code:

grafik

grafik

CODE:

import pandapipes as pp
import pandas as pd
import pandapower.control as control
from pandapower.timeseries import DFData
from pandapower.timeseries import OutputWriter
from pandapipes.timeseries import run_timeseries

create empty net

net = pp.create_empty_network(fluid ="water")

j_vorPumpe = pp.create_junction(net, pn_bar=3, tfluid_k=5+273.15, name="junction nachHaus",geodata=(-10,-10))
j_nachPumpe = pp.create_junction(net, pn_bar=3, tfluid_k=5+273.15, name="junction nachPumpe",geodata=(-10,10))
j_haus1_in = pp.create_junction(net, pn_bar=3, tfluid_k=5+273.15, name="junction haus1_in",geodata=(10,10))
j_haus1_out = pp.create_junction(net, pn_bar=3, tfluid_k=5+273.15, name="junction haus1_out",geodata=(10,-10))

Nahwärmenetz Pump

pp.create_circ_pump_const_mass_flow(net, return_junction=j_vorPumpe, flow_junction=j_nachPumpe, p_flow_bar=5, mdot_flow_kg_per_s=5,t_flow_k=35+273.15)

Modellierung Geb als Wärmeübetrrager

pp.create_heat_exchanger(net, from_junction=j_haus1_in, to_junction=j_haus1_out, diameter_m=200e-3, qext_w = 1000000,loss_coefficient=0,name="heat_exchanger")

Pipes zwischen Knoten vorlauf

pipe_vorlauf_haus=pp.create_pipe_from_parameters(net, from_junction=j_nachPumpe, to_junction=j_haus1_in, length_km=1,diameter_m=200e-3, k_mm=.1, alpha_w_per_m2k=10, sections = 10, text_k=35+273.15)

Pipes zwischen Knoten Rücklauf

pipe_rucklauf_haus=pp.create_pipe_from_parameters(net, from_junction=j_haus1_out, to_junction=j_vorPumpe, length_km=1,diameter_m=200e-3, k_mm=.1, alpha_w_per_m2k=10, sections = 10, text_k=35+273.15)

timesteps

profiles = pd.DataFrame()
loadprofile = r"......."
profiles["load"] = pd.read_csv(loadprofile, index_col=0)
print(profiles)
ds_heatpump = DFData(profiles)

print("elements")
print(net.heat_exchanger.index)
const_heatpump = control.ConstControl(net,element="heat_exchanger",variable="qext_w", element_index=[0],
data_source=ds_heatpump,profile_name=["load"])

time_steps=range(50000)

log_variables = [('res_junction', 'p_bar'),('res_junction', "t_k"), ('res_pipe', 'mdot_to_kg_per_s'),
('res_pipe', 'reynolds'), ('res_pipe', 'lambda'),
("heat_exchanger", "qext_w"),("res_heat_exchanger", "t_from_k"),("res_heat_exchanger", "t_to_k")]

ow = OutputWriter(net, time_steps, output_path=None, log_variables=log_variables)

run_timeseries(net, time_steps)

@dlohmeier
Copy link
Collaborator

Hi @H0ooo ,
what you would do when performing the pipeflow with heat simulation is:

pandapipes.pipeflow(net, mode="all")

I guess that the "mode" option is just missing in your call to run_timeseries. It should be passed down to the pipeflow function. Could you try that?

@Hoppe-J
Copy link
Author

Hoppe-J commented Aug 24, 2023

Hi,
thank you so much, now it's working.
I thought the "mode=all" is only for the stationary simulation., but with this in the run_timeseries every thing is fine.
Thanks for your quick response!

@Hoppe-J Hoppe-J closed this as completed Aug 24, 2023
@dlohmeier
Copy link
Collaborator

Glad that worked. Please keep in mind that you are still performing a stationary simulation, i.e. the temperature at your flow's end point at a certain time step after injecting a temperature step could be far away from reality, as it displays the steady-state value and the potentially slow propagation of fluid through your pipes is neglected.

@dlohmeier
Copy link
Collaborator

If you want to perform real transient simulations, please refer to the transient_heat_transfer branch. But be aware that this is work in progress and not stable yet (cf. #534 )

@Hoppe-J
Copy link
Author

Hoppe-J commented Aug 25, 2023

Ah okay thank you for the hint. Then I'll take a look at the branch

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

No branches or pull requests

2 participants