学习中心

Course:

Modeling Speaker Performance in a Room

Modeling Acoustic Ray Tracing: Release from Exterior Field Calculation


The first point ray source method we are using define loudspeaker reflectivity is the Release from Exterior Field Calculation direct coupling feature. It requires that a full-wave FEM sub-model using the Pressure Acoustics, Frequency Domain interface is built in the same model and is solved first to compute the far-field radiation pattern of the source speaker. For brevity, we will refer to this full-wave FEM sub-model as the source model.

ℹ️

The article "Modeling Acoustic Ray Tracing in a Room" provides context for this article.

The source model usually has the setup of a speaker placed on an infinite baffle or a boxed speaker radiating to open space, and the acoustic pressure distribution in the near-field (e.g., in the first few wavelengths surrounding a speaker) is computed. An Exterior Field Calculation node should be included in the FEM model, and Far-field integral approximation for r→∞ (that computes the pressure in the far-field limit) be selected from the Type of integral option list. There you specify a name for the exterior field variable, and use it directly to define the source directivity in the ray acoustics model which is set up in a different component within the same model.

The Source Model

The source model for extracting the speaker's directivity can be either a detailed electro-vibroacoustic analysis of the driver (as discussed early in the "Modeling Speaker Drivers in COMSOL Multiphysics®" course ), or a lumped representation of the driver coupled to a FEM acoustic domain (as discussed in "Modeling Speaker Drivers – Lumped Methods"). In this example, we choose to use the latter with the same circuit model that is adopted in the FEM room acoustics analysis from the first part of this course. The geometry has the setup of a boxed speaker enclosed in an air bubble, as shown below. Only half of the speaker is modeled by taking advantage of the symmetry condition at the y=0 plane. 

Half of a hollow gray sphere surrounds the gray cross section of the loudspeaker geometry. Half of a hollow gray sphere surrounds the gray cross section of the loudspeaker geometry. The geometry used in the source model for extracting the speaker's directivity for defining a point ray source.

In the pressure acoustics model, the surface of the bubble is modeled using the Perfectly Matched Boundary feature to emulate the boxed speaker radiating into open space. The lumped circuit model representing the driver is connected to the acoustic domain through an Interior Lumped Speaker Boundary feature applied at the speaker's diaphragm. All other surfaces of the box enclosure are modeled as sound hard walls using the Interior Sound Hard Boundary condition.

The final step in setting up the pressure acoustics model is to apply an Exterior Field Calculation feature to the air bubble surfaces, as shown below. This is an important and necessary step in setting up the pressure acoustics physics in order to use the Release from Exterior Field Calculation feature in the subsequent ray acoustics analysis. The Type of integral should be set to Far-field integral approximation for r→∞ in order to obtain the radiation pattern in the far field limit. The symmetry condition used at the y=0 plane should also be specified in order to have the exterior field calculated correctly. Here we name the exterior field variable pext_far.

The settings for the Exterior Field Calculation node are shown next to the blue hemispherical boundary. The settings for the Exterior Field Calculation node are shown next to the blue hemispherical boundary. The settings of the Exterior Field Calculation node in the pressure acoustics model for extracting the speaker's far-field radiation pattern.

In the electrical circuit set up, make sure Voltage from lumped speaker boundary (acpr/ilsb1) is selected for Electric potential in the External Device section of the External I vs. U 1 node. This converts the axial pressure force calculated by the Interior Lumped Speaker Boundary feature in the Pressure Acoustics, Frequency Domain interface into a voltage source within the electrical circuit.

The node connections and external device are shown in the settings window for an External I vs. U node. The node connections and external device are shown in the settings window for an External I vs. U node. The acoustic load on the speaker diaphragm is coupled back to the lumped speaker model by an External I vs. U feature.

The source model is solved in the frequency domain from 125 Hz to 4000 Hz in 1/3 octave intervals. The results shown below are the radiation pattern in the far field limit in the xy-plane for the selected frequencies (left) and in 3D for 2500 Hz (right). Please note that the radiation characteristics are described in terms of the center of the sphere, which is considered the source location where the rays are released in the ray acoustics model.

Various colored lines are plotted in 2D on the left and a sphere is colored in 3D on the right. Various colored lines are plotted in 2D on the left and a sphere is colored in 3D on the right. Results showing the speaker's far field radiation pattern in the xy-plane (left) and in 3D (right).

The figure below illustrates the speaker's total radiated power into the open space as a function of frequency, calculated by the Interior Lumped Speaker Boundary node and stored in the variable named acpr.ilsb1.P_front.

A blue line is plots the radiated power against the frequency. A blue line is plots the radiated power against the frequency. The total radiated power from the speaker into the open space as a function of frequency.

The Ray Acoustics Model Using Release from Exterior Field Calculation

To use the Release from Exterior Field Calculation feature, set up the ray acoustics model in a separate component within the same model where the source model is located and solved. In this case, we need a new 3D component which can be added by either right-clicking the root node and selecting 3D from the Add Component menu or by selecting 3D from the Add Component list in the Home toolbar. Then, add the Ray Acoustics interface to the new component, labeled as Component 2, as seen below. The geometry for this release option is displayed in the Graphics window. Note that the speaker box is removed from the original room setup in this case of using a point source to represent its output. The suspended ceiling and the air cavity behind it are also removed, with their effects modeled through a boundary condition in the ray acoustics analysis. The small receiver sphere, with a radius of 0.1 m and located at coordinates (0.7 m, 1.5 m, 1 m), is retained as it is essential for utilizing the physics-based Receiver feature., a functionality available in versions 6.2 and up in the Ray Acoustics interface, for more efficient computation of the impulse response. In versions prior to 6.2, receivers can only be specified through defining receiver datasets after the model is solved, so there is no need to include receiver spheres in the geometry. This option, which remains available in newer versions as an alternative approach, requires more time to analyze an impulse response.

A Ray Acoustics settings window shows the material properties of exterior and unmeshed domains. A Ray Acoustics settings window shows the material properties of exterior and unmeshed domains. The ray acoustics model for using the Release from Exterior Field Calculation feature is set up in a separate component within the same model where the source model is located.

Note also that the Ray Acoustics interface does not include any domain in its selection. This is allowed when acoustic rays propagate in a constant medium, as is the case here. This way, domains do not need to be meshed. Instead, a boundary mesh is defined on the surfaces where a boundary condition is applied. The required acoustic properties in all unselected domains, i.e., the speed of sound, density and the sound attenuation coefficient, are specified in the Material Properties of Exterior and Unmeshed Domains section. Here we simply use the default values for lossless air, as shown above.

To add a Release from Exterior Field Calculation node, either ray intensity or power must be computed. It's important to note that ray power is required for impulse response analysis. Therefore, ensure that either Compute power or Compute intensity and power is selected from the Intensity Computation list in the Intensity Computation section. Additionally, verify that Count Reflections is enabled in the Additional Variables section, as this option is also necessary for impulse response analysis. Note that starting from version 6.3, Compute power and Count Reflections are selected by default. However, in earlier versions, you will need to manually enable these options. In this example, we choose to calculate both the intensity and power. The relevant settings are illustrated below.

A Ray Acoustics settings window shows the intensity computation settings. A Ray Acoustics settings window shows the intensity computation settings. The Intensity Computation and Additional Variables settings.

The first three default nodes within the Ray Acoustics interface are applicable only when domains are selected in the main physics node. Since no domains are selected in this case, these nodes can be ignored. In the fourth default node, Ray Properties 1, set the Ray frequency to f0, a global parameter defined beforehand as the band center frequency. You can skip this step when using the Release from Exterior Field Calculation direct FEM-Ray coupling feature, since the ray frequency is automatically set based on the value specified in the study node. However, when using the other manual ray release method, it is necessary to set the ray frequency explicitly to f0. For consistency, we will go ahead and update this setting now.

The Ray Properties settings window shows the parameter that defines the ray frequency. The Ray Properties settings window shows the parameter that defines the ray frequency. A predefined global parameter for frequency is used to specify the ray frequency in the Ray Properties node.

Point Ray Source Setup

Let's now add a Release from Exterior Field Calculation node to the ray model, as shown below. In the Exterior Field Variable Name section, type pext_far, t he far-field limit exterior field pressure variable defined in the source model, in the Exterior field variable name text field. In the Initial Coordinates section, specify the point source location (indicated as a red dot in the geometry) . Note again that the coordinates entered here should reflect the center position of the spherical radiation pattern used to describe the speaker directivity. Imagine where the center of the sphere would fall if it were brought into the ray model along with the speaker from the source model. In this application, the source is located at the coordinates (4.45 m, 1 m, 0.6 m).

The settings window and graphics window show the configuration of the Release from Exterior Field Calculation node. The settings window and graphics window show the configuration of the Release from Exterior Field Calculation node. The Release from Exterior Field Calculation feature allows a direct coupling from FEM to ray tracing to set up the source directivity.

Next, in the Ray Direction Vector settings, select Spherical for Ray direction vector, and enter Nrays—a predefined global parameter for number of rays to be released—to define the Number of rays in wave vector space. In this example, Nrays is set to 20,000.

Lastly, adjust the settings in the Source Orientation section to orient the ray source. This enables you to release rays from a speaker facing many different directions, while solving for the exterior field only once. The orientation is determined by entering the Euler angles (Z-X-Z). The labels Z-X-Z indicate the execution sequence of rotation around different axes . First, the local coordinate system of the exterior field is rotated around its Z-axis by the angle α. Then it is rotated around its new X-axis (which is now at an angle α to the global x-axis) by the angle β. Finally, the coordinate system is rotated around its new Z-axis by the angle γ. All three angle inputs are plane angles (SI unit: rad) with default values of 0. The rotation axes and angles are illustrated below, where the resulting rotated system axes are labeled as X, Y, and Z. In this case we need to give a value of 180 degrees to α because the speaker is facing in the negative x direction in the ray tracing model while in the positive x direction in the source model.

A representation showing the difference between a set of axis in red and light blue. A representation showing the difference between a set of axis in red and light blue.

3D Euler angles in a rotated coordinate system.

Wall Condition Setup

We need to assign boundary conditions to all surfaces that reflect and/or absorb rays. Here, we want to adopt the same surface properties as those used in the FEM room acoustics model in Part 1. These properties are configured by assigning various wall conditions. Note that in versions up to 6.3, all wall condition options are available within the Wall feature. In version 6.4, this feature has been simplified to include only the most common conditions: Specular Reflection, Freeze, and Mixed diffuse and specular reflection (the default). For wall conditions beyond these three, use the General Wall feature, which provides the full set of options for defining more general wall behaviors.

For convenience, we begin with a Wall node encompassing all boundaries, then add additional Wall nodes beneath it to override the settings for surfaces requiring different conditions. Note that the surfaces of the receiver sphere are also included, and their condition will be overridden by the Receiver feature.

The Walls, TV and Table Surfaces

These are specified in the first added Wall node, using the Specular reflection wall condition with a constant absorption coefficient of 0.1. A Sound Pressure Level Calculation subnode is used to compute the sound pressure level on those surfaces. This subfeature of the Wall condition is available when ray power is being solved, as is the case here.

The surfaces of the walls, tv, and table are highlighted in the graphics window. The surfaces of the walls, tv, and table are highlighted in the graphics window. Walls and surfaces of the TV and tables are modeled as specularly reflecting walls with a constant absorption coefficient.

The Couch Surfaces

The couch surfaces have also the specular reflection condition but they are modeled as absorbers based on their frequency dependent characteristic impedance. The complex impedance data is imported in the same way as described in Part 1: the real part of the impedance is stored in the function realZ, and the imaginary part is saved in the function imagZ. Note that this data represents the relative acoustic impedance with respect to the impedance of air. Consequently, the input field for impedance requires the product of the relative acoustic impedance and the impedance of air . A Sound Pressure Level Calculation subnode is also added to the couch surfaces to compute the sound pressure level there.

A  2D plot of the interpolated impedance of the couch vs the frequency. A 2D plot of the interpolated impedance of the couch vs the frequency.
The surfaces of the couch are highlighted in blue and surrounded by a wireframe view of the room. The surfaces of the couch are highlighted in blue and surrounded by a wireframe view of the room.

An interpolation function of the couch impedance is shown on the left and the couch surfaces are show modeled as absorbers with frequency-dependent impedance on the right.

The Ceiling

The ceiling's absorption is modeled using frequency- and angle-dependent absorption coefficients. These coefficients are calculated using the Acoustic Treatment Boundary Calculator app, a tool providing the absorption coefficient and surface impedance of sound absorbers under both normal and random incidences. Absorbers can be configured as porous or solid materials and may include backing options such as an air cavity, a porous cavity, or a rigid surface. The thickness and depth of each layer can be customized as required.

The settings for calculating the ceiling's absorption coefficient are shown below. The structure consists of a porous layer backed by an air cavity, with the thickness of each layer and the porous flow resistivity matching the values used in the FEM model in Part 1.

A 2D plot uses a rainbow color gradient to show the absorption coefficient at various incidence angles and frequencies for an air cavity. A 2D plot uses a rainbow color gradient to show the absorption coefficient at various incidence angles and frequencies for an air cavity. The settings used in the Acoustic Treatment Boundary Calculator app for calculating the absorption coefficient of the suspended ceiling.

The angle- and frequency-dependent absorption data is exported to a text file and imported into the the ray acoustics model through an interpolation function, alpha_ceiling, which is then applied in a Wall node to define the ceiling's surface properties. Note that the angle of incidence for each ray encountering a wall is stored in a variable named rac.wall#.thetai, where # corresponds to the tag number of the specific wall. In this case, the ceiling is the fourth wall in the model tree, so the incident angle is identified as rac.wall4.thetai. Sound pressure level is also calculated there.

The Carpet

The carpet's absorption is modeled in a manner similar to the ceiling, with its frequency- and angle-dependent absorption coefficients calculated using the Acoustic Treatment Boundary Calculator app. In this case, the absorber comprises a porous layer backed by a rigid wall. The configuration for calculating the carpet's absorption coefficients is detailed below, with the porous layer thickness and flow resistivity aligning with the values used in the FEM model in Part 1.

A 2D plot uses a rainbow color gradient to show the absorption coefficient at various incidence angles and frequencies for a rigid cavity. A 2D plot uses a rainbow color gradient to show the absorption coefficient at various incidence angles and frequencies for a rigid cavity. The settings used in the Acoustic Treatment Boundary Calculator app for calculating the absorption coefficient of the carpet.

The data is exported from the app and imported the the ray acoustics model using an interpolation function, alpha_carpet, which is then assigned to a new Wall node to define the carpet's surface properties. The incident angle is identified as rac.wall5.thetai.

The Speaker Placement Surface

Finally, the surface on which the speaker is placed is modeled using a Disappear wall condition. This condition removes rays traveling towards the supporting table, accounting for the sound shadowing caused by the table. This effect is not included in the source radiation pattern, since the speaker is configured to radiate into open space in the source model.

Note that in version 6.4 you need to add a General Wall node here to apply the Disappear wall condition.

The surface where the speaker is placed is highlighted in blue and the room is shown as a wireframe. The surface where the speaker is placed is highlighted in blue and the room is shown as a wireframe. The Disappear wall condition is applied at the speaker placement surface to account for sound shadowing caused by the table.

Receiver Setup

We mentioned earlier that in versions 6.2 and up, you can use the physics-based Receiver feature for faster impulse response calculation. Defined within the physics, it is a boundary condition applied to the surfaces of the receiver sphere to collect the arrival time and power of intersecting rays during the simulation. The data is then used to compute the impulse response during the results analysis. Note that the receiver is transparent to rays and is only used for detection.

The settings for the receiver is shown below. In this case, we use the default Omnidirectional option in the Directivity type setting. When applicable, there are two user defined options for you to enter an expression to specify the spatial directivity of the receiver. The user defined expression can be either an analytical expression or based on an interpolation function, and it can utilize the built-in polar angle variables that are defined in relation to the coordinate system selected in the Coordinate System Selection section.

A spherical receiver is highlighted in blue and the room is shown as a wireframe. A spherical receiver is highlighted in blue and the room is shown as a wireframe. The Receiver feature is applied to the boundaries of the receiver sphere for faster impulse response calculation.

Ray Termination Setup

When conducting ray tracing studies, it is a good practice to use the Ray Termination feature to remove rays from the model when they exit the geometry or to eliminate rays with sufficiently low intensity or power. For simplicity and consistency, in this case and all subsequent ray tracing studies using other release options, we only set the Spatial extents of ray propagation to Bounding box, from geometry in the Termination Criteria settings. Please refer to the Small Concert Hall Acoustics tutorial for a demonstration on how to specify a threshold intensity or power in the Additional termination criteria settings to remove rays once their intensity or power drops below the threshold. This can speed up computations by eliminating rays that no longer make a significant contribution.

The settings for the ray termination criteria are set to none in the settings window. The settings for the ray termination criteria are set to none in the settings window. Ray termination setup.

Meshing Considerations

In this case we only need to mesh the surfaces. The mesh can be coarse for flat surfaces because it does not introduce any discretization error in representing their shape. However, it needs to be fine enough to resolve curved boundaries in order to accurately model their interaction with rays, such as determining the precise time and location at which a ray interacts with a boundary. In this example, only the receiver surfaces are curved and should be meshed adequately. A mesh size of Rr/3 is typically a good choice for resolving a spherical shape, where Rr is the radius of the sphere. The other surfaces are meshed with the predefined Normal size settings.

The spherical receiver is shown highlighted in blue with mesh elements on the surface. The spherical receiver is shown highlighted in blue with mesh elements on the surface. A coarse mesh is sufficient for flat surfaces while a finer mesh is necessary to resolve the spherical shape of the receiver.

Study Settings

The ray acoustics model is solved using the Ray Tracing study, a special case of the Time Dependent study type dedicated to computing ray trajectories. To conduct the study across all 16 frequencies examined in Study 1 and access the corresponding solution for each frequency, we need to do the following steps:

1) Define two parameters under Global Definitions>Parameters for the band center frequency, f0, and the solution index, Ns.

The parameters for the ray tracing study are shown. The parameters for the ray tracing study are shown. Two parameters are defined for setting up the ray tracing study.

2) Add a Ray Tracing study to the model builder and select only Ray Acoustics (rac) in the Physics and Variables Selection section. In the Output times edit area of the Study Settings section, enter 0 and 1000 (with the default time unit of millisecond) for the start and final simulation times. Make sure that the final time is at least slightly larger than the estimated reverberation time. In the Values of Dependent Variables section of the Ray Tracing study node, set the Values of variables not solved for to use the solution from Study 1 . Select User controlled for Settings , Solution for Method , Study 1- Loudspeaker FEM, Frequency Domain for Study , Current (Solution 1 (sol1)) or Solution 1 (sol1) (both are the same in this case) for Solution , and Manual for Parameter value . Lastly, in the Index input field, enter Ns . There are 16 solutions from Study 1 and this setting points to the Ns-th solution among them.

The physics and variable selections are shown in the settings window for the ray tracing study step. The physics and variable selections are shown in the settings window for the ray tracing study step. The Ray Tracing study settings for using the Release from Exterior Field Calculation feature.

3) Right-click Study 2 node and add a Parametric Sweep study. In the Study Settings section, first add the parameter Ns and specify its value list using range(1,1,16), and then add the parameter f0 and specify its value list to match exactly the 16 frequencies conducted in Study 1 (simply copy the frequencies from there and paste them here). Make sure the Sweep type uses the Specified combinations option (the default). This way, we have 14 combinations of values, each with a one-to-one correspondence between index and frequency. When ray tracing is solved at a specific f0, the corresponding Ns-th solution from Study 1 is used to define the source directivity.

The parameter names and values are shown for the parametric sweep study step. The parameter names and values are shown for the parametric sweep study step. The Parametric Sweep study settings to specify study frequencies and establish one-to-one correspondence between index and frequency.

Results Analysis

The images below show the ray trajectory at 10 ms (left), and the the sound pressure level on surfaces at 1000 ms (right).

Colored particles are show in a room on the left and the surfaces of the room are colored on the right. Colored particles are show in a room on the left and the surfaces of the room are colored on the right. Ray trajectories (left) and SPL plots (right) showing the ray tracing solutions for using Release from Exterior Field Calculation.

Another important result produced by this type of ray acoustics simulation is the impulse response. It is evaluated using an Impulse Response plot with a Receiver dataset. In versions 6.3 and later, this dataset is generated automatically. In versions up to 6.2, however, you must create it manually from the Ray dataset that is automatically generated after the model is solved. By default, the ray dataset, named Ray1 in this case, stores the information of all propagating rays for all parameters, i.e., all frequencies. Note that Ray1 is also the dataset used for plotting ray trajectories. To create a receiver dataset, right click the Datasets node under Results and select Receiver 3D from the More 3D Datasets options. Then in its Settings window, select Ray1 for Dataset, All for Parameter selection and Time selection, and Receiver(rac/rec1) for Receiver. Receiver 1 (rac/rec1) refers to the receiver defined in the physics. The receiver dataset such defined allows for broad band analysis.

Pointing the receiver dataset to a particular receiver feature in the physics setup will facilitate efficient evaluation and analysis of the impulse response in the Impulse Response plot. Note again that this is a feature available in versions 6.2 and up. Another option, called Local, allows you to define a receiver by specifying its location and size after the model is solved. This second option, which was the only choice before version 6.2, can be quite time-consuming for models with numerous rays but offers the advantage of not requiring a fixed receiver in the geometry.

To compute the impulse response at the receiver, first add a 1D Plot Group under Results, and then right-click the plot group node and select Impulse Response from the More Plots option list. The images below show the plot settings in order to obtain the desired impulse response signal. In the Data section of the plot settings, set Source to Dataset (the default), Dataset to Receiver 3D 1 and Frequency interpretation to 1/3 octave. This selection coincides with the frequency interpretation used in describing the surface properties of the couch. In the Expressions section, use the default settings for all variables required to reconstruct the impulse response. Finally in the x-Axis Data section, set Transformation to None (the default) to show the time domain signal (1), or Discrete Fourier transform to show its Frequency spectrum (2).

Further Learning

To learn more on how to set up ray acoustics models, download the documentation and MPH-files from the Application Gallery: - Small Concert Hall Acoustics - Chamber Music Hall


请提交与此页面相关的反馈,或点击此处联系技术支持