business.manufacturers.components package¶
Collection of the models of hydraulic hardware (such as pipes, pumps…)
The hydraulic hardware taken in consideration is that typical of rural water supply schemes.
Modules¶
- progressives:
models positive dispacement pumps run by a shaft through the borehole
- engines:
models diesel engines
- pipes:
models polyethilene and galvanised pipes
- submersibles:
models electric submersible pumps
Submodules¶
business.manufacturers.components.engines module¶
Define the internal combustion engine installed in an ‘electricless’ station.
-
class
business.manufacturers.components.engines.
Clutch
(_pulley_diameter: int)¶ Bases:
business.commons.loggers.InitLoggerMixin
,business.manufacturers.utils.MonostateMixin
A class to represent a centrifugal clutch keyed to the engine crankshaft.
-
rpm
¶ return the currrent rotation speed of the clutch pulley
- Type
Quantity(“revolutions_per_minute”)
-
absorbed_power
¶ return the mechanical power absorbed by the clutch at the currrent rotation speed
- Type
Quantity(“power”)
-
property
absorbed_power
¶ Return the mechanical power absorbed by the clutch.
- Returns
At present it returns a mock zero value.
- Return type
Quantity(“power”)
-
-
class
business.manufacturers.components.engines.
Engine
(_natural_key_as_string: str, _standard_clutch_pulley_diameter: float, _rating_data: List[Dict])¶ Bases:
business.manufacturers.components.engines.EngineRatingMixin
,business.commons.loggers.InitLoggerMixin
,business.manufacturers.utils.MonostateMixin
A class to represent an internal combution engine.
- Parameters
name (string) – the make of the engine.
_guessed_unit_price (decimal) – the shelf price of the engine.
-
class
business.manufacturers.components.engines.
EngineCheck
(_natural_key_as_string: str, _standard_clutch_pulley_diameter: float, _rating_data: List[Dict])¶ Bases:
business.manufacturers.components.engines.Engine
Functionality: expose the methods needed in the resolution of the ‘hydarulic check problem’
-
property
hourly_diesel_consumption
¶ Return the diesel consumption per hour at the current woring conditions.
-
property
load
¶ Load is evaluated once the rpm is set.
-
property
rpm_range
¶ Return a sequence of equidistant operating speeds of the crankshaft.
- Returns
an array of dimensional values (Quantity(“revolutions_per_minute”)) with np.int16 magnitudes
- Return type
np.array
-
property
working_conditions
¶
-
property
-
class
business.manufacturers.components.engines.
EngineDesign
(_natural_key_as_string: str, _standard_clutch_pulley_diameter: float, _rating_data: List[Dict])¶ Bases:
business.manufacturers.components.engines.Engine
Model of a internal combustion engine during the hydraulic check problem.
Functionality: expose the methods needed in the resolution of the ‘hydarulic design problem’
In an hydraulic check problem, the goal is to find the engine that best suits the required mechanical power demanded by the pump. The pump has been identified in a previous step of the hydraulic check problem.
The state of the engine is defined by the required power.
The outcome is DEVO RESITUIRE SPEED O COSA? CREDO BASTO LA SPEED
-
property
get_optimal_duty
¶ Find the optimal revving speed to output the required power.
Performs linear interpolation between sample points.
Note
The optimal speed corresponds to minimal diesel consumption. Each speed implies a load and a diesel consumption; this method therefore evaluates the consumption along the power band and identifies its minimum.
-
property
required_power
¶
-
property
required_power_is_suitable
¶
-
property
-
class
business.manufacturers.components.engines.
EngineRatingMixin
¶ Bases:
object
A class to represent the engine rating and associated calculations.
Functionality: infer the engine behaviour based from the plate data provided by the engine manufacturer.
-
rpm_range
¶ Return a sequence of equidistant operating speeds of the crankshaft
-
dispatch_np_type
¶ stores the numerical types to be used with power output, diesel consumption and crankshaft rpm
-
dispatch_units
¶ stores the dimensional units to be used with power output, diesel consumption and crankshaft rpm
-
required_power_is_suitable
(power: Quantity(‘power’))¶ boolean test whether the required power lies within advisable load limits
-
get_optimal_duty
(power: Quantity(‘power’))¶ Find the optimal revving speed to output the required power
-
Point
¶ alias of
EngineRatingPoint
-
dispatch_np_type
= {'delivered_power': <class 'numpy.float64'>, 'rpm': <class 'numpy.int16'>, 'specific_diesel_consumption': <class 'numpy.float64'>}¶
-
dispatch_units
= {'delivered_power': <Unit('kilowatt')>, 'rpm': <Unit('revolutions_per_minute')>, 'specific_diesel_consumption': <Unit('gram / kilowatt_hour')>}¶
-
business.manufacturers.components.mixins module¶
business.manufacturers.components.pipes module¶
Define the commercial pipes.
-
business.manufacturers.components.pipes.
FUTURE_round_the_water_flow
(function: Callable) → Callable¶
-
class
business.manufacturers.components.pipes.
Pipe
(_natural_key_as_string: str, _material_name: str, _pressure_limit: int, _internal_diameter: float, _standard_unit_length: int, _external_diameter: float)¶ Bases:
business.manufacturers.utils.MonostateMixin
A class to represent a commercial pipe.
Pipes vary in length from 3-6 m and longer by special order. Polyethylene coils are an exception. They come in lengths of 30 and 150 m with longer lengths available.
-
water_flow
(Quantity("volume/time"))¶ Get or set the water flowing inside the pipe
-
flow_speed
¶ return the velocity of the water flow inside the pipe
-
friction_per_unit_pathlength
¶ Return the hydraulic energy loss per unit of length of the pipe
-
property
friction_per_unit_pathlength
¶ Return the hydraulic energy loss per unit of length of the pipe.
The calculation is evaluated at the current water flow. This method dispatches the actual calculation to three different methods, depending on the pipe material (polyethylene pipes, PVC pipes and steel pipes). These are the three materials adopted in rural water supply systems.
- Returns
the hydraulic energy loss per unit of pipe length. It is adimensional since hydraulic energy has the dimensions of a length.
- Return type
Quantity(“dimensionless”)
-
get_headloss_per_meter_at_sample_flow
(sample_water_flow: pint.quantity.build_quantity_class.<locals>.Quantity) → pint.quantity.build_quantity_class.<locals>.Quantity¶ Return the hydraulic energy loss along 1 meter at a given water flow.
Functionality: allows to skip the water_flow setter, which is computationally heavier.
Notes
Pipes dataclasses are implemented with state and the state is the
water_flow
(such attribute has a setter and a getter). This function is used to evaluate the ‘hydraulic energy loss’ (due to water friction) due to a generic water flow, not the one set in the dataclass state.
-
property
non_fractional_friction_per_unit_pathlength
¶
-
-
class
business.manufacturers.components.pipes.
PipeCheck
(_natural_key_as_string: str, _material_name: str, _pressure_limit: int, _internal_diameter: float, _standard_unit_length: int, _external_diameter: float)¶
-
class
business.manufacturers.components.pipes.
PipeDesign
(_natural_key_as_string: str, _material_name: str, _pressure_limit: int, _internal_diameter: float, _standard_unit_length: int, _external_diameter: float)¶ Bases:
business.manufacturers.components.pipes.Pipe
-
property
flow_speed
¶
-
property
water_flow
¶
-
property
-
class
business.manufacturers.components.pipes.
RiserPipe
(_natural_key_as_string: str, _material_name: str, _pressure_limit: int, _internal_diameter: float, _standard_unit_length: int, _external_diameter: float)¶
-
class
business.manufacturers.components.pipes.
RiserPipeCheck
(_natural_key_as_string: str, _material_name: str, _pressure_limit: int, _internal_diameter: float, _standard_unit_length: int, _external_diameter: float)¶ Bases:
business.manufacturers.components.pipes.RiserPipe
,business.manufacturers.components.pipes.PipeCheck
-
class
business.manufacturers.components.pipes.
RiserPipeDesign
(_natural_key_as_string: str, _material_name: str, _pressure_limit: int, _internal_diameter: float, _standard_unit_length: int, _external_diameter: float)¶ Bases:
business.manufacturers.components.pipes.RiserPipe
,business.manufacturers.components.pipes.PipeDesign
-
business.manufacturers.components.pipes.
round_the_water_flow
(function: Callable) → Callable¶
business.manufacturers.components.progressives module¶
Define the ‘electricless progressive cavity pump’ installed in a borehole.
- Nomenclature:
Body
:the pumping element installed in the borehole
Drivehead
:the gear element at the top of the borehole
Shaft
:the shaft transmitting movement to the Body
Column
:the combination of borehole pipe and the shaft inside it
Combination
:the composite of Body, Column and Drivehead
Notes
The wording “deep progressive cavity” means that the pump is a ‘composition’ of three mechanical elements:
a pump body: installed down the borehole
a riser assembly, rising in the borehole (made of water pipe and shaft inside it)
a drivehead, installed at the wellhead
Each of these mechanical elements has a separate collection.
-
class
business.manufacturers.components.progressives.
Body
(_natural_key_as_string: str, _flow_rating_data: List, _power_rating_data: List)¶ Bases:
business.manufacturers.components.progressives.BodyHydraulicRatingMixin
,business.manufacturers.components.progressives.BodyMechanicalRatingMixin
,business.manufacturers.components.progressives.PlotsMixin
,business.commons.loggers.InitLoggerMixin
,business.manufacturers.utils.MonostateMixin
A class used to represent the pump body.
-
rpm
()¶ get and set the pump rotational speed
-
resistive_curve
()¶ return the pump characteristic curve HAESTADT water flow versus hydraulic energy
-
-
class
business.manufacturers.components.progressives.
BodyCheck
(_natural_key_as_string: str, _flow_rating_data: List, _power_rating_data: List)¶ Bases:
business.manufacturers.components.progressives.Body
write
-
property
absorbed_mechanical_power
¶ Same logic holds as that in water_flow.
-
property
resistive_curve
¶
-
property
rpm
¶
-
property
water_flow
¶ Water flow is read only since you cannot impose a flow to a pump. You may only impose a rotational speed, if the engine is powerful enough. The water flow will physically update accordingly to the new rotational speed.
-
property
-
class
business.manufacturers.components.progressives.
BodyDesign
(_natural_key_as_string: str, _flow_rating_data: List, _power_rating_data: List)¶ Bases:
business.manufacturers.components.progressives.Body
CREDO QUESTA CLASSE FUNZIONI COSI’: 1 - RICEVE UN DUTY BEFORE COLUMN E CALCOLA LA RPM 2 - RICEVE UN DUTY AFTER COLUMN E IL MUTATOR CAMBIA LA RPM E ALLORA INNESCO GET_DUTY_POWER IN TTOTAL HA SOLO 3 METODI
-
property
absorbed_mechanical_power
¶
-
property
coverage
¶ HAESTADT
-
property
duty_after_column_friction
¶
-
property
get_duty_rpm
¶ Return the rpm at which the pump delivers the requested water flow and energy.
Performs linear interpolation between sample points.
- Parameters
flow_vs_energy_point – the (water flow, hydraulic energy) tuple the pump is required to deliver
-
property
rpm
¶
-
property
-
class
business.manufacturers.components.progressives.
BodyHydraulicRatingMixin
¶ Bases:
object
A mixin collecting methods to analyse data of the pump rated water flow.
-
RatedPoint
¶ a 3-d point in water flow, hydraulic energy, rpm coordinates
-
dispatch_np_type
¶ stores the numerical types to be used with water flow, hydraulic energy, rpm
-
dispatch_units
¶ stores the dimensional units to be used with water flow, hydraulic energy, rpm
-
coverage_as_matplotlib
()¶ matplotlib coordinates of the pump coverage HAESTADT
-
coverage
()¶ HAESTADT
-
get_duty_rpm
()¶ return the rpm for which the pump attains a given (water flow, energy) duty
-
RatedPoint
¶ alias of
PumpFlowRatingPoint
-
dispatch_np_type
= {'hydraulic_energy': <class 'numpy.int16'>, 'rpm': <class 'numpy.int16'>, 'water_flow': <class 'numpy.float64'>}¶
-
dispatch_units
= {'hydraulic_energy': <Unit('meter')>, 'rpm': <Unit('revolutions_per_minute')>, 'water_flow': <Unit('liter / second')>}¶
-
-
class
business.manufacturers.components.progressives.
BodyMechanicalRatingMixin
¶ Bases:
object
A mixin collecting methods to analyse data of the pump rated mechanical power.
-
RatedPoint
¶ a 3-d point in mechanical power, hydraulic energy, rpm coordinates
-
_get_absorbed_mechanical_power
(duty_rpm, duty_head)¶ return the mechanical power required by the pump at given rpm and energy
-
Point__doc__
= '\n Represent a point in the 2-d plane whose coordinates are mechanical power, hydraulic energy and rpm.\n '¶
-
RatedPoint
¶ alias of
PumpPowerRatingPoint
-
-
class
business.manufacturers.components.progressives.
Column
(_column_unit_length: int, _natural_key_as_string: str, _max_allowed_pump_depth: int, _rating_data: str)¶ Bases:
business.manufacturers.components.progressives.ColumnRatingMixin
,business.commons.loggers.InitLoggerMixin
,business.manufacturers.utils.MonostateMixin
A class used to represent the composite of the borehole pipe and the shaft rotating inside it.
-
get_duty_point
()¶ return the hydraulic energy burned off by the pipe&shaft assembly
-
working_conditions
()¶ set the requested duty point represented by a 2-tuple (water flow, pump depth)
-
property
adopt
¶ Return a copy of the dataclass instance.
Overrides the monostate becasue of the ‘foreign-key’ relations with the shaft and the pipe.
-
property
get_duty_point
¶ Return the hydraulic energy loss through the riser at the current water flow.
- Returns
2-tuple (energy, water flow) with dimensional values (Quantity(“length”), Quantity(“volume / time”))
- Return type
-
property
working_conditions
¶
-
-
class
business.manufacturers.components.progressives.
ColumnCheck
(_column_unit_length: int, _natural_key_as_string: str, _max_allowed_pump_depth: int, _rating_data: str, _shaft: business.manufacturers.components.progressives.ShaftCheck, _pipe: business.manufacturers.components.pipes.PipeCheck)¶ Bases:
business.manufacturers.components.progressives.Column
-
property
pump_depth
¶
-
property
rpm
¶
-
property
-
class
business.manufacturers.components.progressives.
ColumnDesign
(_column_unit_length: int, _natural_key_as_string: str, _max_allowed_pump_depth: int, _rating_data: str, _shaft: business.manufacturers.components.progressives.ShaftDesign, _pipe: business.manufacturers.components.pipes.PipeDesign)¶ Bases:
business.manufacturers.components.progressives.Column
-
class
business.manufacturers.components.progressives.
ColumnRatingMixin
¶ Bases:
object
A mixin collecting methods to evaluate the hydraulic friction.
-
_get_friction_per_unit_pathlength
()¶ Return the hydraulic friction in the assembly per meter
-
RatedPoint
¶ alias of
RiserFrictionPoint
-
-
class
business.manufacturers.components.progressives.
Combination
(_natural_key_as_string: str)¶ Bases:
business.manufacturers.utils.MonostateMixin
A class used to represent the composite of body, drivehead and riser assembly.
-
hydraulic_design_constraint
(targeted_duty_excluding_riser, pump_depth)¶ sets the targeted design constraints in the Column instance associated to the Combination instance.
-
property
absorbed_mechanical_power
¶
-
-
class
business.manufacturers.components.progressives.
CombinationCheck
(_natural_key_as_string: str, _body: business.manufacturers.components.progressives.BodyCheck, _drivehead: business.manufacturers.components.progressives.DriveheadCheck, _column: business.manufacturers.components.progressives.ColumnCheck)¶ Bases:
business.manufacturers.components.progressives.Combination
-
property
adopt
¶ Return a copy of the dataclass instance.
Overrides the monostate becasue of the ‘foreign-key’ relations with the drivehead, the body and the column.
-
property
pump_depth
¶
-
property
rpm
¶
-
property
-
class
business.manufacturers.components.progressives.
CombinationDesign
(_natural_key_as_string: str, _body: business.manufacturers.components.progressives.BodyDesign, _column: business.manufacturers.components.progressives.ColumnDesign, _drivehead: business.manufacturers.components.progressives.DriveheadDesign)¶ Bases:
business.manufacturers.components.progressives.Combination
-
property
rpm
¶
-
property
-
class
business.manufacturers.components.progressives.
Drivehead
(_natural_key_as_string: str, _max_transmittable_power: float, _absorbed_power_per_rpm: float)¶ Bases:
business.commons.loggers.InitLoggerMixin
,business.manufacturers.utils.MonostateMixin
A class used to represent a drivehead.
The drivehead is the mechanical element that connects the top of the pump shaft with the prime mover. This connection here is done via belts.
-
absorbed_power
()¶ return the mechanical absorbed mechanical power
-
property
absorbed_mechanical_power
¶ Return the drivehead’s mechanical absorbed mechanical power at the current rpm speed.
- Returns
mechanical mechanical power
- Return type
Quantity(“mechanical power”)
-
-
class
business.manufacturers.components.progressives.
DriveheadCheck
(_natural_key_as_string: str, _max_transmittable_power: float, _absorbed_power_per_rpm: float)¶ Bases:
business.manufacturers.components.progressives.Drivehead
-
class
business.manufacturers.components.progressives.
DriveheadDesign
(_natural_key_as_string: str, _max_transmittable_power: float, _absorbed_power_per_rpm: float)¶ Bases:
business.manufacturers.components.progressives.Drivehead
-
class
business.manufacturers.components.progressives.
PlotsMixin
¶ Bases:
object
A mixin collecting methods to adapt data to matplotlib interface.
-
coverage_as_matplotlib
()¶ matplotlib coordinates of the pump coverage HAESTADT
-
property
coverage_as_matplotlib
¶ Return the coverage adimensional coordinates, as a 2-tuple of lists.
Selecting the pump can be an intimidating process n, given the number of pump modls available. This method returns a ‘pump coverage chart’ for choosing the pump model: it provides the boundary of working conditions on a hydraulic energy vs water flow 2-D chart.
shapely’s method boundary returns a LineString and then xy method extracts the coordinates as a 2-tuple of tuples of floats. These coordinates comply with matplotlib’s plot interface.
-
-
class
business.manufacturers.components.progressives.
Shaft
(_natural_key_as_string: str, _absorbed_power_per_rpm_and_length: float, _standard_unit_length: int)¶ Bases:
business.commons.loggers.InitLoggerMixin
,business.manufacturers.utils.MonostateMixin
A class used to represent a shaft inserted inside the borehole pipe.
-
absorbed_power
()¶ return the mechanical absorbed mechanical power
-
-
class
business.manufacturers.components.progressives.
ShaftCheck
(_natural_key_as_string: str, _absorbed_power_per_rpm_and_length: float, _standard_unit_length: int)¶
-
class
business.manufacturers.components.progressives.
ShaftDesign
(_natural_key_as_string: str, _absorbed_power_per_rpm_and_length: float, _standard_unit_length: int)¶
business.manufacturers.components.submersibles module¶
Define the ‘electric submersible pump’ installed in a borehole.
-
class
business.manufacturers.components.submersibles.
SubmersiblePump
(_natural_key_as_string: str, _rating_data: List[Dict])¶ Bases:
business.commons.loggers.InitLoggerMixin
,business.manufacturers.utils.MonostateMixin
A class to represent an electric submersible pump, togetehr with its electric motor.
Energy needs to be added to a hydraulic system to overcome elevation differences and friction losses. A pump is a device to which mechanical energy is applied and transferred to the water as total head. The relationship between pump head and pump discharge is given in the form of a head versus discharge curve.
-
water_flow
¶ Get or set the water flow through the pump
-
is_suitable_for_given_flow
¶ boolean test checking whether the pump may be deliver the water_flow
-
_min_rated_flow
¶ Return the smallest water flow found in the discrete rating points
-
_max_rated_flow
¶ Return the largest water flow found in the discrete rating points
-
get_duty_at_current_water_flow
¶ Return the pump performance (delivered flow, power requirements) interpolated at the water_flow set
-
get_characteristic_curve
¶ Return the curve (delivered flow vs required mechanical energy) of the pump
-
RatingPoint
¶ a 3-d point in flow, head, rpm coordinates
-
dispatch_np_type
¶ stores the numerical types to be used with flow, head, brake and input power
-
dispatch_units
¶ stores the numerical types to be used with flow, head, brake and input power
-
RatingPoint
¶ alias of
SubmersiblePumpRatingPoint
-
dispatch_np_type
= {'electric_power': <class 'numpy.float64'>, 'hydraulic_energy': <class 'numpy.int16'>, 'mechanical_power': <class 'numpy.float64'>, 'water_flow': <class 'numpy.float64'>}¶
-
dispatch_units
= {'electric_power': <Unit('kilowatt')>, 'hydraulic_energy': <Unit('meter')>, 'mechanical_power': <Unit('kilowatt')>, 'water_flow': <Unit('liter / second')>}¶
-
property
get_characteristic_curve
¶ Return the (flow, water energy) curve characteristic of the pump.
- Returns
the typed sequence whose elements are the points of the curve
- Return type
-
property
get_duty_at_current_water_flow
¶ Return the rating data inferred from linear interpolation over the delivered water_flow.
Performs linear interpolation between sample points.
-
property
water_flow
¶
-
-
class
business.manufacturers.components.submersibles.
SubmersiblePumpCheck
(_natural_key_as_string: str, _rating_data: List[Dict])¶ Bases:
business.manufacturers.components.submersibles.SubmersiblePump
-
class
business.manufacturers.components.submersibles.
SubmersiblePumpDesign
(_natural_key_as_string: str, _rating_data: List[Dict])¶ Bases:
business.manufacturers.components.submersibles.SubmersiblePump
-
get_duty
()¶
-
property
get_electric_power
¶
-
property
get_hydraulic_energy
¶
-
property
is_suitable_for_given_flow
¶ Return True if the pump may be deliver the water_flow. False otherwise.
-
property
water_flow
¶
-