Difference between revisions of "Contrib potentialWaveFoam"

From OpenFOAMWiki
m (Test case: small corrections)
m (Overview: another correction)
Line 29: Line 29:
  
 
With substituting Eqs. (2) and (3), we obtain a convection equation of
 
With substituting Eqs. (2) and (3), we obtain a convection equation of
phi
+
<math>\phi</math>
  
 
(4) <math>\frac{\partial \phi}{\partial t} + V_n \frac{\partial \phi}{\partial n} = 0</math>
 
(4) <math>\frac{\partial \phi}{\partial t} + V_n \frac{\partial \phi}{\partial n} = 0</math>

Revision as of 07:36, 17 February 2009

Valid versions: OF version 14.png OF version 141.png OF version 15.png

1 Short description

A one-line solver that solves a wave equation, fvm::d2dt2(phi) == c * c *fvc::laplacian(phi).

2 Overview

potentialWaveFoam solves a linear wave equation

(1) \frac{\partial^2 \phi}{\partial t^2} = c^2  \nabla^2 \phi

where \phi is a scalar variable, t is time and c is the speed of wave propagation (group velocity). If we take \phi so that sound pressure p and acoustic particle velocity U satisfy

(2) p = \frac{1}{\rho} \frac{\partial \phi}{\partial t},

(3) U = -\nabla \phi,

where \rho is the medium density, the wave equation is considered to represent a linear sound propagation.

A boundary condition frequently used in linear acoustics is a normal acousic impedance boundary condition. The normal acoustic impedance Z_n is represented by sound pressure and the normal component of acoustic particle velocity U_n as

Z_n = \frac{p}{U_n}.

With substituting Eqs. (2) and (3), we obtain a convection equation of \phi

(4) \frac{\partial \phi}{\partial t} + V_n \frac{\partial \phi}{\partial n} = 0

with the convective velocity V_n represented by

V_n = \frac{Z_n}{\rho}.

For more detailed discussions, please have a look at reference [1].

3 Prerequisites

Python and funkySetFields are required to run the test case.

4 Package description and installation

4.1 Manifest

The package contains the following subdirectories:

potentialWaveFoam-YYYYMMDD/
    convectiveOutlet-YYYYMMDD/  a convection BC code
    potentialWaveFoam/          the main solver
    probeToAudio/               a postprocessing utility
    reverberationRoom/          a test case

4.2 Installation

Unpack the package under any suitable place under $WM_PROJECT_USER_DIR, e.g. $WM_PROJECT_USER_DIR/applications, go into the package directory and type ./Allrun.

cd $WM_PROJECT_USER_DIR/applications
tar -zxf potentialWaveFoam-YYYYMMDD.tar.gz
cd potentialWaveFoam-YYYYMMDD
./Allrun

These steps will install a library under $FOAM_USER_LIBBIN:

  • libconvectiveOutlet.so - a BC code that calculates Eq. (4). For detailed usage, please see README under convectiveOutlet-YYYYMMDD in the package. The BC code can also be used as a nonreflective outlet BC for incompressible CFDs. Please also consult the reference [2] and a discussion at a forum thread if you intend to do so.

and applications under $FOAM_USER_APPBIN:

  • potentialWaveFoam - the main solver that solves Eq. (1).
  • probeToAudio - a postprocessing utility that converts probed sound pressure at a point to 16-bit PCM .wav audio format. For detailed usage, please have a look at the utility page.

and finally, a test case will be run.

5 Test case

The test case provided under the reverberationRoom subdirectory is a propagation problem of an acoustic impulse given in a room that has an open window (represented by Z_n = \rho c). The walls other than the opening are assigned an acoustic impedance of 136791.7 kg/(m2 s) which is equivalent to the acoustic absorption factor \alpha = 0.01, given the relationship

\alpha = 1 - \left|\frac{Z_n/(\rho c) - 1}{Z_n/(\rho c) + 1}\right|^2.

The speed of sound c and the medium density \rho are assumed to be 343.7 m/s and 1.205 kg/m3 respectively.

The solver will be run twice, with all the settings except endTime are identical. A first run is for visualization of the initial propagation of the acoustic pulse until t = 0.03 s, whose result can be viewed by paraFoam as usual. Another run is for auralization of the impulse response until t = 3 s recorded at a point in the room. After the second run you will have an audible impulse response as p_1.wav under the case directory, which should be heard as a gradually decaying reverberation.

6 Cleanup

To cleanup the library/application build directories and the case directory, type

./Allclean

at the package directory.

7 Download

For now, the package can be downloaded either via Subversion

svn co https://foac.svn.sourceforge.net/svnroot/foac/trunk/survey/OpenFOAM/potentialWaveFoam

or as a snapshot tarball from our SourceForge repository.

8 References

[1] T. Oshima et al., Proceedings of Inter-Noise 2008, No. 287, 2008

[2] J. H. Ferziger and M. Peric. Computational Methods for Fluid Dynamics. Springer-Verlag (Berlin), 1996

9 History

7islands 08:22, 17 February 2009 (CET) (Takuya OSHIMA): Created this page.