Replies: 3 comments
-
Dear @dad616610 , that is an interesting issue, but I think I would need to have a look at the model you would like to implement (i.e. the network) to give you really helpful advise. A few notes here:
If I understand you correctly, you really want a fixed pressure and the mass flow should be set accordingly. In that case, an ext_grid is the way to go. If you need help finding the right setup, please provide some code that helps to understand the problem. |
Beta Was this translation helpful? Give feedback.
-
Hello, @dlohmeier, Thank you for your reply. Sorry it took me so long to reply! I was a bit misleading when I said that the solution
Actually, it was not the solution, but the Colebrook-White algorithm. I had very smooth pipes ( I'm afraid I can't share the model, but I tried to make a minimal non-working example, but failed - the example worked :) I'm sharing the example for the sake of discussion completeness Minimal working example
Pipe 3-4 is vertical The example works with both pandapipes 0.9.0 and 0.10.0 import pandapipes as pp
def main():
net = pp.create_empty_network("net", fluid="lgas")
pp.create_junctions(net, 5, 1, 300)
pp.create_ext_grid(net, junction=0, p_bar=5)
pp.create_pipe_from_parameters(net, from_junction=0, to_junction=1, length_km=0.1, k_mm=1e-15, diameter_m=0.2)
pp.create_pipe_from_parameters(net, from_junction=1, to_junction=2, length_km=0.1, k_mm=1e-15, diameter_m=0.2)
pp.create_pipe_from_parameters(net, from_junction=1, to_junction=3, length_km=0.1, k_mm=1e-15, diameter_m=0.2)
pp.create_pipe_from_parameters(net, from_junction=3, to_junction=4, length_km=0.1, k_mm=1e-15, diameter_m=0.2)
pp.create_sink(net, junction=2, mdot_kg_per_s=6)
pp.create_ext_grid(net, junction=4, p_bar=1)
pp.pipeflow(
net,
mode="hydraulics",
friction_model="colebrook",
iter=10000,
)
print(net.res_junction)
print(net.res_pipe)
return net
if __name__ == "__main__":
net = main() Is the information provided enough to hint me on how to investigate further? If not, I will try to make a non-working example (or find a way to fix my model), but I will only have time for that only in 2 weeks |
Beta Was this translation helpful? Give feedback.
-
Hi @dad616610 , thanks for the example, this always helps. You said that this example works, so I cannot say for sure that any of the following notes could help with the non-working example. What strikes me:
I really hope that you can identify what is not working. Otherwise, don't hesitate to provide more insights so that we can help in finding a solution for your problem. |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm trying to set pressure as initial condition for sink (here by sink I mean network output) instead of mass flow. The desired sink pressure is 1 bar (might need to set a different pressure as well, but 1 bar will be sufficient for now)
I've tried using External Grid (because I can specify pressure as an initial condition here), but the solution doesn't converge. I've also seen this question: #410. I tried the example provided as is, but I get the following error:
So, how do I specify the pressure for a sink?
Beta Was this translation helpful? Give feedback.
All reactions