Kingery-Bulmash Blast Wave Characteristics Calculator
Python implementation of the Simplified Kingery Airblast Formulas and Coefficients from:
Simplified Kingery Airblast Calculations
Swisdak, Jr, Michael M.
NAVAL SURFACE WARFARE CENTER INDIAN HEAD DIV MD
1994 Aug 01
Accession Number: ADA526744
Security Classification: UNCLASSIFIED
Applicable for TNT equivalent NEQ (Net Explosive Quantity) and hemispherical surface bursts.
Installation
Using pip to install from PyPI:
pip install kingery-bulmash
Usage
import kingery_bulmash as kb
Use prefix kb. to import all required objects. An example for a TNT eqivalent NEQ of 10,000 kg at 500 m:
import kingery_bulmash as kb
# for metric units: 10000kg at 500m
res = kb.Blast_Parameters(unit_system=kb.Units.METRIC,
neq=10000,
distance=500)
print(res)
Expand to see console output
Blast Parameters (Kingery-Bulmash)
NEQ: 10000 kg
Distance: 500 m
Time of Arrival: 1276.1650108864796 ms
Incident Pressure: 5.0549639655028455 kPa
Reflected Pressure: 10.244621193146642 kPa
Positive Phase Duration: 133.23344980362697 ms
Incident Impulse: 295.87689480141484 kPa-ms
Reflected Impulse: 1063.0270073779907 kPa-ms
Shock Front Velocity: 347.3295095310771 m/s
kb.Units
The kb.Units Enum is how we select the units for the calculation, it needs to be passed to kb.Blast_Parameters as either kb.Units.METRIC or kb.Units.IMPERIAL.
kb.Units.METRICfor neq in kg and distance in m.
kb.Units.IMPERIALfor neq in lb and distance in ft.
[!IMPORTANT] The library does not convert between units. Rather, it uses the metric and imperial parameters from the paper directly, therefore there might be slight differences between the results.
kb.Blast_Parameters
class kb.Blast_Parameters(unit_system, neq, distance, safe=True)
The Blast_Parameters dataclass calculates all the Kingery-Bulmash parameters from the paper.
Attributes:
-
unit_system : kb.Units.METRIC or kb.Units.IMPERIAL
Defines the unit system of the imput and calculated results. See
kb.Unitssection here. -
neq: float
TNT equivalent net explosive quantity. kg or lb based on unit_system.
-
distance: float
Distance from the explosive. m or ft based on unit_system.
-
safe: bool, optional
When
True(default),kb.Blast_Parameterswill raise aValueErrorif any attribute is out of range. WhenFalseany attribute out of range will be set toNonewithout raising aValueError, this allows to significantly expand the range of values for less sensitive attributes. Default isTrue.
[!TIP]
Blast_Parameterscan raiseExceptionandValueError, it is recommended to usetryandexceptto handle this this behaviour. Python Errors Tutorial.
__post_init__ attributes:
- time_of_arrival: float, None
Time of arrival in ms.
- incident_pressure: float, None
Incident pressure in kPa or psi based on unit_system.
- reflected_pressure: float, None
Reflected pressure in kPa or psi based on unit_system.
- positive_phase_duration: float, None
Positive phase duration in ms.
- incident_impulse: float, None
Incident inpulse in kPa-ms or psi-ms based on unit_system.
- reflected_impulse: float, None
Reflected impulse in kPa-ms or psi-ms based on unit_system.
- shock_front_velocity: float, None
Shock front velocity in m/s or ft/s based on unit_system.
- all_units: dict
Dictionary containing key: value pairs where the key is the attribute name as a
strand the value is the unit asstr.
Methods:
- to_dict()
Returns a
dictrepresentation of the dataclass - __repr__()
Inherits the default dataclass behaviour
- __str__()
"Pretty" representation of the data as
str
Examples:
Example 1: Single Attribute
import kingery_bulmash as kb
res = kb.Blast_Parameters(unit_system=kb.Units.METRIC,
neq=10000,
distance=500,
safe=True)
#getting only incident pressure
pr = res.incident_pressure
#getting the units of incident pressure
pr_u = res.all_units['incident_pressure']
print(pr, pr_u)
Expand to see console output
5.0549639655028455 kPa
Example 2: Loop Over Range (safe=False)
In this example we set safe=False as the range of scaled distances allowed by incident_impulse is larger than shock_front_velocity which would cause a ValueError sooner if safe=True. Try and except used to handle when distance is 0.
import kingery_bulmash as kb
NEQ = 5000
for dist in range(0, 10000, 1000):
try:
RES = kb.Blast_Parameters(unit_system=kb.Units.IMPERIAL,
neq=NEQ,
distance=dist,
safe=False)
i_imp = RES.incident_impulse
i_imp_u = RES.all_units["incident_impulse"]
print(f'{dist} ft: {i_imp} {i_imp_u}')
except ValueError as err:
print(f'{dist} ft: {err}')
Expand to see console output
0 ft: 'distance' must be > 0.
1000 ft: 26.167261959845302 psi-ms
2000 ft: 12.835212556333252 psi-ms
3000 ft: 8.344381432625331 psi-ms
4000 ft: 6.147651070542891 psi-ms
5000 ft: 4.8505476573514335 psi-ms
6000 ft: 3.99668842429768 psi-ms
7000 ft: None psi-ms
8000 ft: None psi-ms
9000 ft: None psi-ms
Build/Install/Test From Source
The build-system is Hatch.
To build and install from source, clone the repository and in the root folder run:
hatch build
To install with pip, also from the root folder, run:
pip install dist\kingery_bulmash-X.X.X-py3-none-any.whl
Adjust the file name/path accordingly.
To run tests:
hatch test
Release files for kingery-bulmash 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kingery_bulmash-1.0.1.tar.gz | 12.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kingery_bulmash-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.2 kB
Release files / kingery_bulmash-1.0.1.tar.gz
| Download URL | kingery_bulmash-1.0.1.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6d0a682e3aa227aa23544c5b2d62d12f51e0aeaaa08515c94929b4de8e7833f
|
|
BLAKE2b-256 checksum How to use checksums |
e4732006ebcb3ed4c05d86b18e23f8d71f32a7894020f3a5b697f42d9ccbcef5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.2
|
Release files / kingery_bulmash-1.0.1-py3-none-any.whl
| Download URL | kingery_bulmash-1.0.1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4862bb39db1ddcbe6dc5bd0f53bbeb6a6431f2cfc6c7c0fe5c6c78bf53f027dd
|
|
BLAKE2b-256 checksum How to use checksums |
50b080c94e339a28ac65ed05886e8cc2621000d20d7565781336b7d4f7b98047
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.2
|