Notice: please open this README.md file in Jupyter, or open the README.ipynb file on github to see a correct formatting of the LaTeX math formulas!
This interactive Jupyter-Notebook (Python 3) determines the dimensionless parameters for a given set of physical variables in accordance with the Buckingham
- numpy
- pandas
- sympy
Enter a single string with symbols of physical variables (separated by spaces). Choose the symbols from a collection of available variables here: physical-variables.tsv. The code determines the dimensional matrix and the number
variables = 'F_D u eta rho D'
$ \Pi_1 = \frac{F_D \rho}{\eta^2}\ \Pi_2 = \frac{D \rho u}{\eta} $
In this example the symbols represent following physical variables
Symbol | Description | SI unit |
---|---|---|
F_D | Drag force | N |
u | Flow velocity | m / s |
eta | Dynamic viscosity of fluid | Pa s |
rho | Density of fluid | kg / m^3 |
D | Diameter of sphere | m |
In most cases you should be able to run the whole Notebook at once
In some special cases, however, the user is prompted either to rearrange the symbols in the input string or to delete a row from the dimensional matrix. However, the user is guided in doing so!
The file physical-variables.tsv contains a table of physical variables and their asscociated dimensions. The dimensions are given as exponents to the base quantities:
Excerpt:
Symbol | Quantity | L | M | T | I | Theta | N | J | SI unit |
---|---|---|---|---|---|---|---|---|---|
l | Length | 1 | 0 | 0 | 0 | 0 | 0 | 0 | m |
m | Mass | 0 | 1 | 0 | 0 | 0 | 0 | 0 | kg |
t | Time | 0 | 0 | 1 | 0 | 0 | 0 | 0 | s |
I | Electric current | 0 | 0 | 0 | 1 | 0 | 0 | 0 | A |
T | Temperature | 0 | 0 | 0 | 0 | 1 | 0 | 0 | K |
n | Amount of substance | 0 | 0 | 0 | 0 | 0 | 1 | 0 | mol |
I_v | Luminous intensity | 0 | 0 | 0 | 0 | 0 | 0 | 1 | cd |
D | Diameter | 1 | 0 | 0 | 0 | 0 | 0 | 0 | m |
c | Speed of light | 1 | 0 | -1 | 0 | 0 | 0 | 0 | m / s |
g | Gravitational acceleration | 1 | 0 | -2 | 0 | 0 | 0 | 0 | m / s^2 |
nu | Kinematic viscosity | 2 | 0 | -1 | 0 | 0 | 0 | 0 | m^2 / s |
P | Power | 2 | 1 | -3 | 0 | 0 | 0 | 0 | W |
rho | Density | -3 | 1 | 0 | 0 | 0 | 0 | 0 | kg / m^3 |
p | Pressure | -1 | 1 | -2 | 0 | 0 | 0 | 0 | Pa |
m_dot | Mass flow rate | 0 | 1 | -1 | 0 | 0 | 0 | 0 | kg / s |
k_th | Thermal conductivity | 1 | 1 | -3 | 0 | -1 | 0 | 0 | W / (m K) |
c_p | Specific heat capacity | 2 | 0 | -2 | 0 | -1 | 0 | 0 | J / (kg K) |
q_dot | Heat flux | 0 | 1 | -3 | 0 | 0 | 0 | 0 | W / m^2 |
h | Heat transfer coefficient | 0 | 1 | -3 | 0 | -1 | 0 | 0 | W / (m^2 K) |
a_th | Thermal diffusivity | 2 | 0 | -1 | 0 | 0 | 0 | 0 | m^2 / s |
The table is unsorted and incomplete, but will be extended from time to time. The values are tab-separated. Thus, on github the table should be nicely rendered and searchable. Some variables have symbols as they are commonly used in Germany (for my own convenience). A unique symbol must be chosen, when a new physical variable is added! Or, of course, you could alter the table or make an entirely new table with your own symbols.
The code looks up the dimensions of the entered symbols in the table above and builds the corresponding dimensional matrix. For the given example, the dimensional matrix is:
Symbol | F_D | u | eta | rho | D |
---|---|---|---|---|---|
L | 1 | 1 | -1 | -3 | 1 |
M | 1 | 0 | 1 | 1 | 0 |
T | -2 | -1 | -1 | 0 | 0 |
From the rank of the dimensional matrix (here:
In most cases the rank of the dimensional matrix will be the number of involved base quantities (here:
The Buckingham
the problem can be simplified and rewritten in terms of a set of
where
$ \begin{align} & \Pi_1 = p_1^{k_{(1)1}} \cdot p_2^{k_{(1)2}} \cdot p_3^{k_{(1)3}} \cdot ; ... ; \cdot p_n^{k_{(1)n}}\ & \Pi_2 = p_1^{k_{(2)1}} \cdot p_2^{k_{(2)2}} \cdot p_3^{k_{(2)3}} \cdot ; ... ; \cdot p_n^{k_{(2)n}}\ & ... \ & \Pi_d = p_1^{k_{(d)1}} \cdot p_2^{k_{(d)2}} \cdot p_3^{k_{(d)3}} \cdot ; ... ; \cdot p_n^{k_{(d)n}} \end{align} $
This Jupyter-Notebook can find solutions for these
For a detailed description of this procedure please referre to "Dimensional Analysis for Engineers" by Simon, Weigand and Gomaa
When more than one dimensionless parameter is expected (i.e.
A rule of thumb is that the dependent variable should be placed in the leftmost position and the independent variables in the rightmost position. In the example above the drag force
This has the advantage that the dependent variable, when placed in the leftmost position, appears in only one of the dimensionless parameters and can thus be conveniently isolated.
In fact, the
The procedure solves a linear system of equations by means of matrix inversion. The matrix in question (the rightmost rectangular submatrix of the dimensional matrix) must not be singular, i.e. its determinant must not be zero!
If this is not the case (i.e. the submatrix is singular), then the symbols in the input-string must be rearanged before we can proceed!
For a detailed instruction on how the variables should be ordered, please referre to "Applied Dimensional Analysis and Modeling" by Szirtes and Rózsa, which I highly recommend.
Here the string contains the same variables as the example above. However, in the sequential order the positions of u and eta are switched.
variables = 'F_D eta u rho D'
$ {\Pi_1}^* = \frac{F_D}{D^2 \rho u^2}\ {\Pi_2}^* = \frac{\eta}{D \rho u} $
The
Both resulting sets of dimensionless parameter are equally valid. However, in the second set we recognize that ${\Pi_1}^$ represents (except for a constant) the commonly used drag coefficient $c_D$. In the first example we directly obtained the Reynolds number ($\Pi_2 = Re$), whereas in the second example we obtained the reciprocal of the Reynolds number (${\Pi_2}^ = \frac{1}{Re}$).
If we went with the first sequential order, all hope is not lost. We could still arrive at the form of the commonly used drag coefficient. Since the square of a dimensionless parameter is still dimensionless and also the product of two dimensionless parameters is still dimensionless, we can combine the parameters to obtain a new (equally valid) parameter:
$ \Pi_1 \cdot \frac{1}{{\Pi_2}^2} = \frac{F_D \rho}{\eta^2} \cdot \frac{\eta^2}{D^2 \rho^2 u^2} = \frac{F_D}{D^2 \rho u^2} = {\Pi_1}^* $
We are interessted in the heat transfer coefficient
variables = 'h u c_p rho eta k_th D'
$ \Pi_1 = \frac{D h}{k_{th}}\ \Pi_2 = \frac{D \rho u}{\eta}\ \Pi_3 = \frac{c_p \eta}{k_{th}} $
Just by looking at the involved variables and their corresponding dimensions, we were able fo find three famous dimensionless numbers: The Nusselt number (
This project is licensed under the terms of the MIT license, see LICENSE.md.