business.gravity.stretching package

Submodules

business.gravity.stretching.crawl module

Implement the ‘crawl’ algorithm for the Subtrunk.

class business.gravity.stretching.crawl.CrawlSolverStretchMixin

Bases: object

Algorithms to return sequences of commercial pipes.

Functionality: return sequences of commercial pipes while performing systematic search of the hydraulic grade line inside a Subtrunk.

Notes

These sequences are used when performing systematic search of the various possible hydrauli grade lines.

business.gravity.stretching.linear module

Implement the ‘simplex’ algorithm for the Subtrunk.

class business.gravity.stretching.linear.SwapStretchMixin

Bases: object

Algorithms used to optimize the trunk stretch running the simplex just once.

Functionality: perform systematic search of the hydraulic grade line inside a Subtrunk.

attempt_simplex()

Return the optimal solution if this entails pressure compliance of the energy line

swap_piped_segments()

Swap in-place the order of the trunk stretch’s piped segments

attempt_simplex(message) → List[business.helpers.definitions.PipedSegmentDesign]
property swap_piped_segments

Swap in-place the order of the trunk stretch’s piped segments.

business.gravity.stretching.pressure module

Provide pressure calculations for the Subtrunk.

class business.gravity.stretching.pressure.PressureStretchMixin

Bases: object

A mixin gathering methods that deal with hydraulic pressure.

Functionality: analyse the hydraulic pressure while performing systematic search of the hydraulic grade line inside a Subtrunk.

property hgl_is_pressure_compliant

Return True if the hydraulic grade line is pressure compliant. False otherwise.

The check is run considering the current status of the Subtrunk, namely: * its piped segments * its hydraulic energy at ‘tail’ and ‘head’ ends * its water flow

property hgl_lies_above_elevation_profile

Check if the hydraulic energy line is ‘always above’ the soil.

Returns

  • True – if the hydraulic grade line lies above the elevation profile for the whole extent of the Subtrunk.

  • False – otherwise.

  • Remarks

  • ——-

  • The inheritor *AtmosphericSubtrunk overrides it.*

business.gravity.stretching.setters module

Provide mutators for the Subtrunk.

class business.gravity.stretching.setters.SettersStretchMixin

Bases: object

The mixin gathering setters of Subtrunk.

property pipes_in_pair
property segments_in_pair

Get or set the a sequence of exactly two piped segments.

Setting the two piped segments will reconfigure the energy line and evaluate the swivel point, i.e.: the point where the energy line changes its slope due to water flowing from the first to the second piped segment.

The most economical pipes (i.e.: the optimal solution) for a Subtrunk is composed by two piped segments (ref.: Dantzig theorem). Setting this couple of piped segments sets the inner variables _tail_side_segment and _head_side_segment.

Once this setter completes, the energy line will change and it is a priori not known whether it is pressure compliant. Several algorithms in the code check and take action if there is no compliance.