# Difference between revisions of "OpenPSTD v1.0 settings"

Line 4: | Line 4: | ||

===Grid spacing | Max freq=== | ===Grid spacing | Max freq=== | ||

− | The '''Grid spacing''' in metres corresponds to the spacing of the grid points, and is equal in horizontal and vertical direction. The '''Grid spacing''' determines the maximum resolved frequency in openPSTD | + | The '''Grid spacing''' in metres corresponds to the spacing of the grid points, and is equal in horizontal and vertical direction. The '''Grid spacing''' determines the maximum resolved frequency in openPSTD, i.e. '''Max freq''' <math>f_{max}</math> as follows |

:<math> f_{max}= \frac{c}{2\Delta} </math> | :<math> f_{max}= \frac{c}{2\Delta} </math> | ||

Line 17: | Line 17: | ||

</math> | </math> | ||

− | with ''p'' the pressure value at a certain receiver position at a frequency corresponding to 2.5 points per wavelength and ''p''<sub>ana</sub> the analytical pressure value at this frequency. An ε value of 50 dB corresponds to a level difference error of 0.03 dB. Note that the accuracy of openPSTD | + | with ''p'' the pressure value at a certain receiver position at a frequency corresponding to 2.5 points per wavelength and ''p''<sub>ana</sub> the analytical pressure value at this frequency. An ε value of 50 dB corresponds to a level difference error of 0.03 dB. Note that the accuracy of openPSTD calculations is not only affected by the window error, but also by the initial source function, the time iteration scheme and the PML layer, see [[Hornikx et al., journal paper submitted]]. As the error is determined by the maximum error, increasing the window length does not imply that the error is reduced per se. '''Patch error''' automatically changes by increasing the '''Window size''', and vice versa. |

===Render time=== | ===Render time=== | ||

− | The simulation length of a calculation in openPSTD | + | The simulation length of a calculation in openPSTD is denoted by '''Render time''' in s. The calculation is terminated after this time. A calculation can also be stopped manually before this time by pressing '''Stop the current openPSTD simulation'''. |

===Absorption=== | ===Absorption=== | ||

− | When an edge of the constructed geometry is selected, see [[Getting started with OpenPSTD]] how to do this, the acoustic absorption coefficient can be assigned to this edge by setting the '''Absorption''' to a value between 0 and 1. When an edge is selected, the actual value of the absorption coefficient of this edge is written in parenthesis behind the '''Absorption''' setting. In [[openPSTD v1.0 overview]], it is explained how reflections from boundaries are computed in openPSTD | + | When an edge of the constructed geometry is selected, see [[Getting started with OpenPSTD]] how to do this, the acoustic absorption coefficient can be assigned to this edge by setting the '''Absorption''' to a value between 0 and 1. When an edge is selected, the actual value of the absorption coefficient of this edge is written in parenthesis behind the '''Absorption''' setting. In [[openPSTD v1.0 overview]], it is explained how reflections from boundaries are computed in openPSTD. |

===Local=== | ===Local=== | ||

Line 41: | Line 41: | ||

===Density=== | ===Density=== | ||

− | The '''Density''' in kg/m<sup>3</sup> is the density of the propagation medium in the drawn subdomains. In openPSTD | + | The '''Density''' in kg/m<sup>3</sup> is the density of the propagation medium in the drawn subdomains. In openPSTD, the density is constant throughout the propagation medium. |

===Sound speed=== | ===Sound speed=== | ||

− | The adiabatic speed of sound of the propagation medium is denoted by '''Sound speed''' in m/s. Like the density, the adiabatic speed of sound is constant throughout the propagation medium in openPSTD | + | The adiabatic speed of sound of the propagation medium is denoted by '''Sound speed''' in m/s. Like the density, the adiabatic speed of sound is constant throughout the propagation medium in openPSTD. |

===CFL number RK-scheme=== | ===CFL number RK-scheme=== | ||

− | The stability of the Fourier PSTD method is determined by the stability criteria arising from the used Runge-Kutta method, and is controlled by the '''CFL number RK-scheme'''. The default value of this number for the 2D calculations in openPSTD | + | The stability of the Fourier PSTD method is determined by the stability criteria arising from the used Runge-Kutta method, and is controlled by the '''CFL number RK-scheme'''. The default value of this number for the 2D calculations in openPSTD is 0.5. The sample frequency of the time-domain calculations thereby becomes |

:<math> f_{s}= CFL \frac{c}{2 \Delta x} </math> | :<math> f_{s}= CFL \frac{c}{2 \Delta x} </math> | ||

Line 57: | Line 57: | ||

===Save every nth=== | ===Save every nth=== | ||

− | '''Save every nth''' sets the interval of discrete time steps used for the visualisation of the 2D results in openPSTD | + | '''Save every nth''' sets the interval of discrete time steps used for the visualisation of the 2D results in openPSTD. |

===Visualization subsampling=== | ===Visualization subsampling=== | ||

− | '''Visualization subsampling''' sets the interval of discrete spatial steps used for the visualisation of the 2D results in openPSTD | + | '''Visualization subsampling''' sets the interval of discrete spatial steps used for the visualisation of the 2D results in openPSTD. |

===Run simulation=== | ===Run simulation=== | ||

− | The simulation in openPSTD | + | The simulation in openPSTD is initiated by pressing the '''simulate with openPSTD''' button. Before a new run, current results can be cleared by pressing '''Clear simulation data'''. During a simulation, the simulation can be termined before the '''Render time''' has expired by '''Stop the current openPSTD simulation'''. |

===Bake openPSTD simulation=== | ===Bake openPSTD simulation=== |

## Revision as of 22:12, 22 July 2015

The settings described here correspond to the buttons of the openPSTD v1.0 (with additional features for the v1.1 version) add-on in Blender.

## Contents |

## General settings

### Grid spacing | Max freq

The **Grid spacing** in metres corresponds to the spacing of the grid points, and is equal in horizontal and vertical direction. The **Grid spacing** determines the maximum resolved frequency in openPSTD, i.e. **Max freq** as follows

with Δ the **Grid spacing** in metres and *c* the adiabatic speed of sound. When changing **Grid spacing**, **Max freq** automatically changes according to the above equation, and vice versa.

### Window size | Patch error

To compute the spatial derivative of the acoustic variables within a subdomain of the drawn geometry, three subdomains are needed, see openPSTD v1.0 overview. The values of the outer subdomains are windowed by a Gaussian window, see Hornikx *et al.* 2012. The window length applied to the outer subdomains is equal to **Window size**. This number determines the minimum number of grid points of the subdomains. The window affects the accuracy of the calculation, with the accuracy increasing with the window length. The error introduced by the window is called the **Patch error** ε in dB, and is defined as:

with *p* the pressure value at a certain receiver position at a frequency corresponding to 2.5 points per wavelength and *p*_{ana} the analytical pressure value at this frequency. An ε value of 50 dB corresponds to a level difference error of 0.03 dB. Note that the accuracy of openPSTD calculations is not only affected by the window error, but also by the initial source function, the time iteration scheme and the PML layer, see Hornikx et al., journal paper submitted. As the error is determined by the maximum error, increasing the window length does not imply that the error is reduced per se. **Patch error** automatically changes by increasing the **Window size**, and vice versa.

### Render time

The simulation length of a calculation in openPSTD is denoted by **Render time** in s. The calculation is terminated after this time. A calculation can also be stopped manually before this time by pressing **Stop the current openPSTD simulation**.

### Absorption

When an edge of the constructed geometry is selected, see Getting started with OpenPSTD how to do this, the acoustic absorption coefficient can be assigned to this edge by setting the **Absorption** to a value between 0 and 1. When an edge is selected, the actual value of the absorption coefficient of this edge is written in parenthesis behind the **Absorption** setting. In openPSTD v1.0 overview, it is explained how reflections from boundaries are computed in openPSTD.

### Local

The setting **Local** relates to the absorption coefficient. It the **Local** box is ticked, the boundary is in approximation treated as a locally reacting boundary. When a reflection free boundary is aimed for, this box should not be ticked.

## Advanced settings

### Pressure level visualisation scale

The **Pressure level visualisation scale** in dB sets the dynamic range of the relative sound pressure level in the 2D visual animation. This dynamic range is visible in the drawing section of Blender.

### Number of PML cells | Attenuation of PML cels

The **Number of PML cells** sets the number of grid points in the boundary media that are affected by the perfectly matched layer (PML). The **Attenuation of PML cells** corresponds to the number α in

with σ the PML damping coefficient, *x-x*_{PML} the position of the grid point in the PML layer and D the thickness of the PML layer, see Hornikx *et al.* 2010. The default value of **Attenuation of PML cells** is 20000. A larger number of PML cells reduces the error introduced by the PML.

### Density

The **Density** in kg/m^{3} is the density of the propagation medium in the drawn subdomains. In openPSTD, the density is constant throughout the propagation medium.

### Sound speed

The adiabatic speed of sound of the propagation medium is denoted by **Sound speed** in m/s. Like the density, the adiabatic speed of sound is constant throughout the propagation medium in openPSTD.

### CFL number RK-scheme

The stability of the Fourier PSTD method is determined by the stability criteria arising from the used Runge-Kutta method, and is controlled by the **CFL number RK-scheme**. The default value of this number for the 2D calculations in openPSTD is 0.5. The sample frequency of the time-domain calculations thereby becomes

### Enable GPU Acceleration

OpenPSTD v1.1 features GPU acceleration using CUDA or OpenCL. If the **Enable GPU Acceleration** box is checked, the openPSTD kernel will attempt to import PyCUDA. If this fails, it will attempt to import PyOpenCL. If neither is available, the simulation will not complete. GPU acceleration requires additional Python modules and a Python 2.7 path to be set in the config file. For more information, refer to section **Enabling GPU Acceleration**.

### Use 32 bit

If **Enable GPU Acceleration** is active, **Use 32 bit** can be selected to use 32-bit floats in the GPU computations. Not all GPUs and GPU drivers support 64-bit computation, so this option may be required. Enabling this option will greatly speed up computation at the expense of a very slight loss of accuracy.

### Save every nth

**Save every nth** sets the interval of discrete time steps used for the visualisation of the 2D results in openPSTD.

### Visualization subsampling

**Visualization subsampling** sets the interval of discrete spatial steps used for the visualisation of the 2D results in openPSTD.

### Run simulation

The simulation in openPSTD is initiated by pressing the **simulate with openPSTD** button. Before a new run, current results can be cleared by pressing **Clear simulation data**. During a simulation, the simulation can be termined before the **Render time** has expired by **Stop the current openPSTD simulation**.

### Bake openPSTD simulation

The computed time dependent 2D sound field can be exported as a movie. The **Bake openPSTD simulation** command turns the calculations into a movie.