Tube
- class pypbomb.Tube
Methods for designing and determining operational limits of a detonation tube.
For a list of available materials see
Tube.available_materials
- classmethod calculate_max_initial_pressure(tube_id, tube_od, initial_temperature, species_dict, mechanism, max_pressure, elastic_modulus, density, poisson_ratio, plus_or_minus=0.1, use_dynamic_load_factor=True, unit_registry=<pint.registry.UnitRegistry object>, error_tol=0.0001, max_iterations=500, use_multiprocessing=False, max_pressure_state='reflected', return_dlf=False)
- Parameters:
tube_id (pint.Quantity or Tuple[float, str]) – Inner diameter of tube
tube_od (pint.Quantity or Tuple[float, str]) – Outer diameter of tube Internal diameter of the detonation tube
initial_temperature (pint.Quantity or Tuple[float, str]) – Mixture initial temperature
species_dict (dict) – Dictionary containing the species in the mixture as keys, with total moles or mole fractions as values
mechanism (str) – Mechanism file name for Cantera
max_pressure (pint.Quantity or Tuple[float, str]) – Maximum allowable pressure within the tube
elastic_modulus (pint.Quantity or Tuple[float, str]) – Elastic modulus of tube material
density (pint.Quantity or Tuple[float, str]) – Density of tube material
poisson_ratio (float) – Poisson ratio of tube material
plus_or_minus (float) – For dynamic load factor calculation,
plus_or_minus
defines the band about the critical velocity which is considered “approximately equal to.” The default value of 0.1 means plus or minus ten percent.use_dynamic_load_factor (bool) –
True
to use dynamic load factor,False
to ignore it.unit_registry (pint unit registry) – Unit registry for managing units to prevent conflicts with parent unit registry
error_tol (float) – Relative error tolerance below which initial pressure calculations are considered ‘good enough’
max_iterations (int) – Maximum number of loop iterations before exit, defaults to 500
use_multiprocessing (bool) –
True
to use multiprocessing. Defaults toFalse
.max_pressure_state (str) – Which state to use as the tube’s maximum pressure. Must be either
"reflected"
(closed tube) or"cj"
(open tube).return_dlf (bool) – If
True
, dynamic load factor will be returned
- Returns:
Initial mixture pressure corresponding to the tube’s maximum allowable pressure.
If return_dlf is set to
True
, this will be a list, with item 0 being the initial pressure and item 1 being DLF- Return type:
pint.Quantity or Tuple[pint.Quantity, float]
- static calculate_max_pressure(tube_id, tube_od, max_stress, safety_factor=1)
Calculates the maximum allowable pressure from the tube dimensions and stress limits using the basic longitudinal joint formula [1].
[1] E. F. Megyesy, Pressure vessel handbook, Oklahoma City, OK: PV Publishing, Inc., 2001, p. 14.
- Parameters:
tube_id (pint.Quantity or Tuple[float, str]) – Inner diameter of tube
tube_od (pint.Quantity or Tuple[float, str]) – Outer diameter of tube
max_stress (pint.Quantity or Tuple[float, str]) – Maximum allowable stress in tube material (e.g. from ASME B31.1)
safety_factor (float, optional) – Desired safety factor
- Returns:
Pressure resulting in maximum allowable stress
- Return type:
pint.Quantity
- classmethod calculate_max_stress(initial_temperature, material, welded, unit_registry=<pint.registry.UnitRegistry object>)
Finds the maximum allowable stress of a tube material at the tube’s initial temperature
- Parameters:
initial_temperature (pint.Quantity or Tuple[float, str]) –
material (str) – Pipe material (see
Tube.available_materials
)welded (bool) –
True
for welded pipe;False
for seamlessunit_registry (pint.UnitRegistry) – Unit registry for managing units to prevent conflicts with parent unit registry
- Returns:
Maximum allowable tube stress
- Return type:
pint.Quantity
- static dynamic_load_factor(tube_id, tube_od, cj_velocity, elastic_modulus, density, poisson_ratio, plus_or_minus=0.1)
Calculates the dynamic load factor (DLF) by which a detonation tube’s static analysis should be scaled in order to account for the tube’s response to transient pressures. DLF calculation is based on the work of Shepherd [1]. Since the limits of “approximately equal to” are not defined in the paper, a default value of plus or minus ten percent is assumed, thus plus_or_minus=0.1.
[1] Shepherd, J. E. (2009). Structural Response of Piping to Internal Gas Detonation. Journal of Pressure Vessel Technology, 131(3), 031204. https://doi.org/10.1115/1.3089497
- Parameters:
tube_id (pint.Quantity or Tuple[float, str]) – Inner diameter of tube
tube_od (pint.Quantity or Tuple[float, str]) – Outer diameter of tube
cj_velocity (pint.Quantity or Tuple[float, str]) – CJ velocity
elastic_modulus (pint.Quantity or Tuple[float, str]) – Elastic modulus of tube material
density (pint.Quantity or Tuple[float, str]) – Density of tube material
poisson_ratio (float) – Poisson ratio of tube material
plus_or_minus (float, optional) – Defines the band about the critical velocity which is considered “approximately equal to” – the default value of 0.1 means plus or minus ten percent
- Returns:
Factor by which the tube’s static maximum pressure should be de-rated to account for transient response to detonation waves
- Return type:
float
- static get_available_pipe_schedules(pipe_size)
Gets available pipe schedules for a given nominal size
- Parameters:
pipe_size (str) – Nominal pipe size (see
Tube.available_pipe_sizes
)- Returns:
List of available pipe schedules
- Return type:
list
- classmethod get_density(material, unit_registry=<pint.registry.UnitRegistry object>)
Gets the density for a valid tube material. For valid materials see
Tube.available_materials
.- Parameters:
material (str) – Pipe material (see
Tube.available_materials
)unit_registry (pint.UnitRegistry, optional) – Unit registry for managing units to prevent conflicts with parent unit registry
- Returns:
Density
- Return type:
pint.Quantity
- classmethod get_dimensions(pipe_size, pipe_schedule, unit_registry=<pint.registry.UnitRegistry object>)
- Parameters:
pipe_size (str) – Nominal pipe size (see
Tube.available_pipe_sizes
)pipe_schedule (str) – Pipe schedule (see
Tube.get_available_pipe_schedules
for a list of available schedules for pipe_size)unit_registry (pint.UnitRegistry, optional) – Unit registry for managing units to prevent conflicts with parent unit registry
- Returns:
Dictionary of pipe dimensions with the keys:
"inner_diameter"
"outer_diameter"
"wall_thickness"
- Return type:
dict
- classmethod get_elastic_modulus(material, unit_registry=<pint.registry.UnitRegistry object>)
Gets the elastic modulus for a valid tube material. For valid materials see
Tube.available_materials
.- Parameters:
material (str) – Pipe material (see
Tube.available_materials
)unit_registry (pint.UnitRegistry, optional) – Unit registry for managing units to prevent conflicts with parent unit registry
- Returns:
Elastic modulus
- Return type:
pint.Quantity
- classmethod get_poisson(material)
Gets the Poisson ratio for a valid tube material. For valid materials see
Tube.available_materials
.- Parameters:
material (str) – Pipe material (see
Tube.available_materials
)- Returns:
Poisson ratio (unitless)
- Return type:
float