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

Leakage Controller added, creating test in pipeflow_internals and documentation updated #115

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

ttrummel
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Aug 12, 2020

Codecov Report

Merging #115 (0bf1713) into develop (c6e90a7) will increase coverage by 0.23%.
The diff coverage is 95.65%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
...andapipes/control/controller/leakage_controller.py 95.55% <95.55%> (ø)
pandapipes/control/__init__.py 100.00% <100.00%> (ø)
pandapipes/control/run_control.py 100.00% <100.00%> (+61.53%) ⬆️
...nent_models/abstract_models/node_element_models.py 76.92% <0.00%> (-11.97%) ⬇️
pandapipes/toolbox.py 74.69% <0.00%> (-9.36%) ⬇️
...es/component_models/abstract_models/node_models.py 73.33% <0.00%> (-8.49%) ⬇️
pandapipes/plotting/generic_geodata.py 85.00% <0.00%> (-8.34%) ⬇️
pandapipes/io/io_utils.py 78.08% <0.00%> (-8.13%) ⬇️
pandapipes/io/file_io.py 82.35% <0.00%> (-3.70%) ⬇️
pandapipes/create.py 97.60% <0.00%> (-1.43%) ⬇️
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6e90a7...01861a8. Read the comment docs.

Comment on lines 82 to 84
if set_q_from_cosphi:
logger.error("Parameter set_q_from_cosphi deprecated!")
raise ValueError
Copy link
Collaborator

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)
Copy link
Collaborator

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,
Copy link
Collaborator

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.

Comment on lines 93 to 99
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please prevent loops

Comment on lines 123 to 124
self.net.sink = self.net.sink.drop(labels=self.leakage_index)
self.net.res_sink = self.net.res_sink.drop(labels=self.leakage_index)
Copy link
Collaborator

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,
Copy link
Collaborator

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.

Comment on lines 51 to 52
if element not in ["pipe", "valve", "heat_exchanger"]:
raise Exception("Only 'pipe', 'valve' or 'heat_exchanger' is allowed as element.")
Copy link
Collaborator

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.

Comment on lines 137 to 142
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"])
Copy link
Collaborator

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.

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

Successfully merging this pull request may close these issues.

None yet

3 participants