GaPFlow.models.sound#
Equation of state (sound speed).
Sound speed-density relations for the implemented models.
Functions
|
Computes the isothermal speed of sound using the Bayada-Chupin cavitation model. |
|
Computes the speed of sound using the Benedict–Webb–Rubin (BWR) equation of state. |
|
Computes the speed of sound from a cubic polynomial pressure law. |
|
Computes the isothermal speed of sound using the Dowson-Higginson equation of state. |
|
Wrapper around all implemented equation of state models. |
|
Computes the speed of sound from the Murnaghan-Tait equation of state. |
|
Computes the isothermal speed of sound using a power-law equation of state. |
|
Computes the speed of sound using the Van der Waals equation of state. |
- GaPFlow.models.sound.bayada_chupin(rho, rho_l, rho_v, c_l, c_v)#
Computes the isothermal speed of sound using the Bayada-Chupin cavitation model.
- Parameters:
rho (float or np.ndarray) – Density.
rho_l (float) – Liquid density.
rho_v (float) – Vapor density.
c_l (float) – Speed of sound in liquid.
c_v (float) – Speed of sound in vapor.
- Returns:
Speed of sound.
- Return type:
float or np.ndarray
- GaPFlow.models.sound.bwr(rho, T, gamma=3.0)#
Computes the speed of sound using the Benedict–Webb–Rubin (BWR) equation of state.
- Parameters:
rho (float or np.ndarray) – Density.
T (float) – Temperature.
gamma (float, optional) – Exponential decay parameter (default is 3.0).
- Returns:
Speed of sound.
- Return type:
float or np.ndarray
- GaPFlow.models.sound.cubic(dens, a=15.2, b=-9.6, c=3.35, d=-0.07)#
Computes the speed of sound from a cubic polynomial pressure law.
\[c = \sqrt{\frac{dp}{d\rho}} = \sqrt{3a \rho^2 + 2b \rho + c}\]- Parameters:
dens (float or np.ndarray) – Density.
a (float) – Polynomial coefficients.
b (float) – Polynomial coefficients.
c (float) – Polynomial coefficients.
d (float) – Polynomial coefficients.
- Returns:
Speed of sound.
- Return type:
float or np.ndarray
- GaPFlow.models.sound.dowson_higginson(dens, rho0=877.7007, P0=101325.0, C1=350000000.0, C2=1.23)#
Computes the isothermal speed of sound using the Dowson-Higginson equation of state.
\[c = \sqrt{\frac{dp}{d\rho}} = \sqrt{\frac{C_1 \rho_0 (C_2 - 1)}{\rho^2 (C_2 \rho_0 / \rho - 1)^2}}\]- Parameters:
dens (float or np.ndarray) – Current density.
rho0 (float) – Reference density.
P0 (float) – Reference pressure.
C1 (float) – Empirical constant.
C2 (float) – Empirical constant.
- Returns:
Speed of sound.
- Return type:
float or np.ndarray
- GaPFlow.models.sound.eos_sound_velocity(density, prop)#
Wrapper around all implemented equation of state models.
Computes the local speed of sound for a given density field.
\[c = \sqrt{\frac{dp}{d\rho}}\]- Parameters:
density (np.ndarray) – The mass density field
prop (dict) – Material properties
- Returns:
Sound speed field for the corresponding density field
- Return type:
np.ndarray
- GaPFlow.models.sound.murnaghan_tait(dens, rho0=700, P0=101000.0, K=557000000.0, n=7.33)#
Computes the speed of sound from the Murnaghan-Tait equation of state.
\[c = \sqrt{\frac{dp}{d\rho}} = \sqrt{\frac{K}{\rho_0^n} \rho^{n - 1}}\]- Parameters:
dens (float or np.ndarray) – Current density.
rho0 (float) – Reference density.
P0 (float) – Reference pressure.
K (float) – Bulk modulus.
n (float) – Murnaghan exponent.
- Returns:
Speed of sound.
- Return type:
float or np.ndarray
- GaPFlow.models.sound.power_law(dens, rho0=1.1853, P0=101325.0, alpha=0.0)#
Computes the isothermal speed of sound using a power-law equation of state.
\[c = \sqrt{\frac{dp}{d\rho}} = \sqrt{\frac{-2 P_0}{(\alpha - 2) \rho} \left(\frac{\rho}{\rho_0}\right)^{-2 / (\alpha - 2)}}\]- Parameters:
dens (float or np.ndarray) – Density.
rho0 (float) – Reference density.
P0 (float) – Reference pressure.
alpha (float) – Power-law exponent.
- Returns:
Speed of sound.
- Return type:
float or np.ndarray
- GaPFlow.models.sound.van_der_waals(dens, M=39.948, T=100.0, a=1.355, b=0.03201)#
Computes the speed of sound using the Van der Waals equation of state.
\[c = \sqrt{\frac{dp}{d\rho}} = \sqrt{\frac{RTM}{(M - b\rho)^2} - \frac{2a\rho}{M^2}}\]- Parameters:
dens (float or np.ndarray) – Mass density (kg/m³).
M (float) – Molar mass (g/mol).
T (float) – Temperature (K).
a (float) – Attraction parameter (L^2 bar/mol^2).
b (float) – Repulsion parameter (L/mol).
- Returns:
Speed of sound.
- Return type:
float or np.ndarray