11.07.2014 Views

Flute acoustics: measurement, modelling and design - School of ...

Flute acoustics: measurement, modelling and design - School of ...

Flute acoustics: measurement, modelling and design - School of ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

APPENDIX B. PROGRAM LISTINGS 196<br />

1.0,<br />

t,<br />

pow(t, 2),<br />

x_w,<br />

t * x_w,<br />

pow(t, 2) * x_w,<br />

p,<br />

t * p,<br />

pow(t,2) * p,<br />

x_c,<br />

t * x_c,<br />

pow(t, 2) * x_c,<br />

pow(x_w, 2),<br />

pow(p, 2),<br />

pow(x_c, 2),<br />

x_w * p * x_c<br />

};<br />

for (i = 0; i < 16; i++)<br />

c += a[i] * coeff[i];<br />

return c;<br />

}<br />

double densityAirIdeal(double t, double p, double h, double x_c) {<br />

/* temperature in Kelvin */<br />

double T = 273.15 + t;<br />

/* gas constant for dry air in J/kg.K */<br />

double R_a = 287.05;<br />

/* gas constant for water vapour in J/kg.K */<br />

double R_w = 461.5;<br />

/* gas constant for carbon dioxide in J/kg.K */<br />

double R_c = 189;<br />

/* partial pressures <strong>of</strong> dry air, water vapour <strong>and</strong> CO2 */<br />

double p_a, p_w, p_c;<br />

p_w = h*saturationVapourPressureWater(T);<br />

p_c = x_c * p;<br />

p_a = p - p_w - p_c;<br />

}<br />

return p_a / (R_a * T) + p_w / (R_w * T) + p_c / (R_c * T);<br />

double densityAirGiacomo(double t, double p, double h, double x_c) {<br />

double T = 273.15 + t;<br />

double R = 8.314472;<br />

double M_w = 18.015e-3;<br />

double M_a, f, p_sv, x_w, Z;<br />

M_a = (28.9635 + 12.011 * (x_c - 0.0004)) * 1e-3;<br />

/* Calculate mole fraction <strong>of</strong> water vapour using equation in Cramer<br />

Appendix (p. 2515) */<br />

f = 1.00062 + 3.14e-8*p + 5.6e-7*pow(t,2);<br />

p_sv = saturationVapourPressureWater(T);<br />

x_w = h*f*p_sv/p;<br />

Z = compressibilityAir(t, p, x_w);<br />

return p * M_a * (1 - x_w * (1 - M_w / M_a)) / (Z * R * T);<br />

}<br />

double compressibilityAir(double t, double p, double x_w) {

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!