-
Notifications
You must be signed in to change notification settings - Fork 63
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
Leakage Controller added, creating test in pipeflow_internals and documentation updated #115
base: develop
Are you sure you want to change the base?
Conversation
-> suitable for pipe, valve and heat exchanger
Codecov Report
@@ Coverage Diff @@
## develop #115 +/- ##
===========================================
+ Coverage 91.22% 91.45% +0.23%
===========================================
Files 62 61 -1
Lines 3303 3346 +43
===========================================
+ Hits 3013 3060 +47
+ Misses 290 286 -4
Continue to review full report at Codecov.
|
if set_q_from_cosphi: | ||
logger.error("Parameter set_q_from_cosphi deprecated!") | ||
raise ValueError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have reactive power in pandapipes
First calculation of a pipeflow without leakage. \n | ||
Then define the initial values and create the sinks representing the leaks. | ||
""" | ||
pp.pipeflow(self.net, self.kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do a pipeflow in intialize_control, use the flag initial_run instead
|
||
def __init__(self, net, element, element_index, output_area_m2, profile_name=None, | ||
scale_factor=1.0, in_service=True, recycle=True, order=0, level=0, | ||
drop_same_existing_ctrl=False, set_q_from_cosphi=False, matching_params=None, initial_pipeflow=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intial_run instead of initial_pipeflow. Please update pandapipes.
for i in range(len(self.element_index)): | ||
self.init_values(self.element_index[i]) | ||
|
||
index = pp.create_sink(self.net, self.net[self.element].loc[self.element_index[i], "to_junction"], | ||
mdot_kg_per_s=0, name="leakage"+str(i)) | ||
self.leakage_index.append(index) | ||
self.mass_flow_kg_per_s_init.append(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please prevent loops
self.net.sink = self.net.sink.drop(labels=self.leakage_index) | ||
self.net.res_sink = self.net.res_sink.drop(labels=self.leakage_index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should happen in finalize_control
|
||
""" | ||
|
||
def __init__(self, net, element, element_index, output_area_m2, profile_name=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also be able to use something like kg_per_m_s meaning mass per meter and second.
if element not in ["pipe", "valve", "heat_exchanger"]: | ||
raise Exception("Only 'pipe', 'valve' or 'heat_exchanger' is allowed as element.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice it we extend it also for junctions.
for i in range(len(self.element_index)): | ||
self.init_values(self.element_index[i]) | ||
|
||
self.net.sink.loc[self.leakage_index[i], "mdot_kg_per_s"] = self.rho_kg_per_m3[i] * self.v_m_per_s[i] * \ | ||
self.output_area_m2[i] | ||
self.mass_flow_kg_per_s.append(self.net.sink.loc[self.leakage_index[i], "mdot_kg_per_s"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prevent loops due to performance issues.
… be called - corrections made
- a leakage at a junction can now be defined - with the restriction that the junction leak is not only connected to a pump - more tests created
No description provided.