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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

APPENDIX B. PROGRAM LISTINGS 190<br />

/*<br />

Acoustics.h<br />

By Paul Dickens, 2005<br />

Listing B.1: Acoustics.h<br />

Acoustics library.<br />

*/<br />

#ifndef ACOUSTICS_H_PROTECTOR<br />

#define ACOUSTICS_H_PROTECTOR<br />

#include "Complex.h"<br />

#include "TransferMatrix.h"<br />

double saturationVapourPressureWater(double T);<br />

/*<br />

Calculates the saturation vapour pressure <strong>of</strong> water.<br />

Parameters:<br />

T: the temperature in Kelvin.<br />

Returns:<br />

The vapour pressure in Pa.<br />

*/<br />

double speedSound(double t, double p, double h, double x_c);<br />

/*<br />

Calculates the speed <strong>of</strong> sound.<br />

Based on Owen Cramer (1993) J. Acoust. Soc. Am. 93(5) p2510-2616;<br />

formula at p. 2514<br />

Parameters:<br />

t: the temperature in Celsius (between 0 <strong>and</strong> 30 degrees C).<br />

h: the relative humidity expressed as a fraction (between 0 <strong>and</strong><br />

1).<br />

x_c: the mole fraction <strong>of</strong> carbon dioxide (between 0 <strong>and</strong> 0.01).<br />

(note that the parameter ranges are not enforced)<br />

(note that Cramer gives x_c = 0.000314 for air)<br />

Returns:<br />

The speed <strong>of</strong> sound in m/s.<br />

*/<br />

double speedSoundCramer(double t, double p, double x_w, double x_c);<br />

/*<br />

Calculates the speed <strong>of</strong> sound.<br />

Based on Owen Cramer (1993) J. Acoust. Soc. Am. 93(5) p2510-2616;<br />

formula at p2514.<br />

Parameters:<br />

t: the temperature in Celsius (between 0 <strong>and</strong> 30 degrees C).<br />

p: the pressure in Pa (between 75 <strong>and</strong> 102 kPa).<br />

x_w: the mole fraction <strong>of</strong> water vapour (between 0 <strong>and</strong> 0.06).<br />

x_c: the mole fraction <strong>of</strong> carbon dioxide (between 0 <strong>and</strong> 0.01).<br />

(note that the parameter ranges are not enforced)<br />

Returns:<br />

The speed <strong>of</strong> sound in m/s.<br />

*/<br />

double densityAirIdeal(double t, double p, double h, double x_c);

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

Saved successfully!

Ooh no, something went wrong!