convert units using Froude and Reynolds similitude
Project description
scaling
Convert quantities between model and prototype scale using Froude and Reynolds similitude.
Installation
pip install scaling
Usage
>>> from scaling import FroudeConverter
>>> froude = FroudeConverter()
>>> # Convert model value of 200 mm to prototype value (m) with scale of 10
>>> froude.model_to_proto(200, length_scale=10, input_unit='mm', target_unit='m')
2.0
>>> # Get Froude scaling exponent for quantities of time
>>>Â froude.scaling_exponent('s')
0.5
>>> # Get length, mass and time dimensions for quantities of energy
>>>Â froude.dimensions('kJ')
'L^2Â M^1Â T^-2'
Dataframes are also accepted, and specific units can be specified for the values in the index.
>>> T = 2
>>> H = 100
>>> # Generate regular waves with height=100mm, and period=2s
>>> t = np.arange(0, 10.1, 0.1)
>>> eta = 0.5 * H * np.sin(t * 2 * np.pi / T)
>>> df_model = pd.DataFrame(index=t, data=eta)
>>> df_model.columns = ['$\eta$ (mm)']
>>> df_model.index.name = 'Time (s)'
>>> df_model.plot()
>>> # Convert to prototype dimensions, with length scale=25
>>> df_proto = froude.model_to_proto(
df_model,
length_scale=25,
input_unit='mm',
target_unit='m',
index_input_unit='s',
index_target_unit='s')
>>> df_proto.columns = ['$\eta$ (m)']
>>> df_proto.plot()
scaling uses pint for unit and dimension conversions. pint is able to interpret a wide range of different input units.
>>> # Convert water head model value (mm) to prototype pressure value (kPa)
>>> froude.model_to_proto(10, length_scale=100, 'mm.H20', 'kPa')
9.80665
>>> # Demonstrate different ways of specifying units of newtons
>>>Â froude.dimensions('N')
'L^1Â M^1Â T^-2'
>>>Â froude.dimensions('newton')
'L^1Â M^1Â T^-2'
>>>Â froude.dimensions('kg.m/s/s')
'L^1Â M^1Â T^-2'
>>>Â froude.dimensions('kilogram.metre/second^2')
'L^1Â M^1Â T^-2'
Froude scaling reference
| Quantity | Dimensions | Scaling exponent |
|---|---|---|
| Length | L^1 | λ^1 |
| Mass | M^1 | λ^3 |
| Time | T^1 | λ^0.5 |
| Velocity | L^1 T^-1 | λ^0.5 |
| Acceleration | L^1 T^-2 | λ^0 |
| Force | L^1 M^1 T^-2 | λ^3 |
| Pressure | L^-1 M^1 T^-2 | λ^1 |
| Overtopping | L^2 T^-1 | λ^1.5 |
Reynolds scaling reference
| Quantity | Dimensions | Scaling exponent |
|---|---|---|
| Length | L^1 | λ^1 |
| Mass | M^1 | λ^3 |
| Time | T^1 | λ^2 |
| Velocity | L^1 T^-1 | λ^-1 |
| Acceleration | L^1 T^-2 | λ^-3 |
| Force | L^1 M^1 T^-2 | λ^0 |
| Pressure | L^-1 M^1 T^-2 | λ^-2 |
| Overtopping | L^2 T^-1 | λ^0 |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scaling-0.2.3.tar.gz.
File metadata
- Download URL: scaling-0.2.3.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
987af0e25637ab0bd708326fa251e19a97e3b4224119fbb02cf7f81d082ef144
|
|
| MD5 |
4dad3bdaeefa51958f2045fcf2090199
|
|
| BLAKE2b-256 |
7d2b592a67406a94c56ef39989a3158bb96c72416f54413deecb6f2a17f15f34
|
File details
Details for the file scaling-0.2.3-py3-none-any.whl.
File metadata
- Download URL: scaling-0.2.3-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4657132a0f12a1fdcb0df3ed19a37cae104e56dce817c4b3f81a252d545db6c6
|
|
| MD5 |
49450cdfe0c19660aa153873db679788
|
|
| BLAKE2b-256 |
d521d480aae4ef69eb5057a2365106abe5792e740a1b72d21a9219041faa0cc7
|