Zephyr Scientific Library (zscilib)
|
Gas functions. More...
Files | |
file | gases.h |
API header file for gases in zscilib. | |
Functions | |
int | zsl_phy_gas_av_vel (zsl_real_t m, zsl_real_t n, zsl_real_t t, zsl_real_t *v) |
Calculates the average velocity of a gas molecule based on the mass of gas (m), its temperature (t) and the number of moles of gas (n). More... | |
int | zsl_phy_gas_press (zsl_real_t v, zsl_real_t n, zsl_real_t t, zsl_real_t *p) |
Calculates the pressure of an ideal gas based on the number of moles, the temperature and the volume of gas. More... | |
int | zsl_phy_gas_boyle (zsl_real_t pi, zsl_real_t vi, zsl_real_t pf, zsl_real_t *vf) |
Given the initial and final pressure, and the initial volume of an ideal gas, this function calculates the final volume of the gas supposing the temperature hasn't changed through the process. More... | |
int | zsl_phy_gas_charles_lussac (zsl_real_t ti, zsl_real_t vi, zsl_real_t tf, zsl_real_t *vf) |
Given the initial and final temperature, and the initial volume of an ideal gas, this function calculates the final volume of the gas supposing its pressure hasn't changed through the process. More... | |
Gas functions.
int zsl_phy_gas_av_vel | ( | zsl_real_t | m, |
zsl_real_t | n, | ||
zsl_real_t | t, | ||
zsl_real_t * | v | ||
) |
Calculates the average velocity of a gas molecule based on the mass of gas (m), its temperature (t) and the number of moles of gas (n).
m | Mass of gas in kilograms. |
n | Number of moles of gas. |
t | Temperature in kelvins. |
v | Pointer to the calculated velocity in meters per second. Will be set to NAN if the temperature, mass or moles of gas are negative, or if m = 0. |
int zsl_phy_gas_boyle | ( | zsl_real_t | pi, |
zsl_real_t | vi, | ||
zsl_real_t | pf, | ||
zsl_real_t * | vf | ||
) |
Given the initial and final pressure, and the initial volume of an ideal gas, this function calculates the final volume of the gas supposing the temperature hasn't changed through the process.
pi | Initial pressure in pascals. |
vi | Initial volume in meters cubed. |
pf | Final pressure in pascals. |
vf | Pointer to the output final volume in meters cubed. Will be set to NAN if any of the input values are negative or if pf = 0. |
int zsl_phy_gas_charles_lussac | ( | zsl_real_t | ti, |
zsl_real_t | vi, | ||
zsl_real_t | tf, | ||
zsl_real_t * | vf | ||
) |
Given the initial and final temperature, and the initial volume of an ideal gas, this function calculates the final volume of the gas supposing its pressure hasn't changed through the process.
ti | Initial temperature in kelvins. |
vi | Initial volume in meters cubed. |
tf | Final temperature in kelvins. |
vf | Pointer to the output final volume in meters cubed. Will be set to NAN if any of the input values are negative or if ti = 0. |
int zsl_phy_gas_press | ( | zsl_real_t | v, |
zsl_real_t | n, | ||
zsl_real_t | t, | ||
zsl_real_t * | p | ||
) |
Calculates the pressure of an ideal gas based on the number of moles, the temperature and the volume of gas.
v | Volume of gas in meters cubed. |
n | Number of moles of gas. |
t | Temperature in kelvins. |
p | Pointer to the placeholder for calculated pressure in pascals. Will be set to NAN if the temperature, volume or moles of gas are negative, or if v = 0. |