Workshop 7

Pre-Processing and PostProcessing an Acoustic
Model using Command
Objects

ANSYS Mechanical Advanced
((Using
g Command Objects)
j
)
ANSYS, Inc. Proprietary
© 2009 ANSYS, Inc. All rights reserved.

WS7-1

June 2009
Inventory #002669

Workshop 7

Introduction

Training Manual

• In this workshop, a harmonic analysis of an acoustic filter will be
performed:
– Geometry includes two chambers, half-symmetry model
– Harmonic sweep up to 200 Hz will be run
– Plane wave in inlet assumed

ANSYS, Inc. Proprietary
© 2009 ANSYS, Inc. All rights reserved.

WS7-2

June 2009
Inventory #002669

Workshop 7

Note About Acoustic Analyses

Training Manual

• In ANSYS, the linear wave equation is solved:
2
1

P
∇2P = 2 2
c ∂t

or

∇2P = −

ω2
c

2

P

• In solving the Helmholtz equation, the following assumptions are
present:
– The fluid is compressible (density variations are small but linearly related
to pressure fluctuations)
– The fluid is inviscid (no viscous dissipation)
– There is no mean flow of the fluid
– The mean density and pressure are uniform throughout the fluid

• When the above assumptions are acceptable,
acceptable the wave equation is
linear and thus can easily be solved in the time domain (transient) or
frequency domain (modal, harmonic response).
• See “Mechanical
Mechanical APDL (formerly ANSYS) > Fluids Guide >
Acoustics” for detailed information on acoustic capabilities
ANSYS, Inc. Proprietary
© 2009 ANSYS, Inc. All rights reserved.

WS7-3

June 2009
Inventory #002669

WS7-4 June 2009 Inventory #002669 . Proprietary © 2009 ANSYS. wave propagation is solved • Animation of isosurfaces of pressure in a room (acoustic source are two speakers): ANSYS. Inc. All rights reserved.Workshop 7 Note About Acoustic Analyses Training Manual • In acoustic analyses in Mechanical APDL. Inc.

Workshop 7 Workshop Objectives Training Manual • In this workshop. All rights reserved. Proprietary © 2009 ANSYS. – This applies to top-level bullet/numbered items only • APDL commands that can be typed in the Command Prompt are shown with Typewriter T pe riter (Courier) (Co rier) font. Inc. the following will be covered: – – – – Defining Acoustic elements and materials in Mechanical Referencing Named Selections in APDL commands Use of “Commands” objects for load definition and postprocessing User Defined Results for postprocessing • Informative text in this workshop is preceded by bullet point whereas steps to perform are designated with numbers numbers. WS7-5 June 2009 Inventory #002669 . Inc. font ANSYS.

Inc. Restore archive “workshop p 7a.0 > Workbench 2.zip” p • • • “File menu > Restore Archive…” Select “workshop 7a. Launch ANSYS Workbench 12. Inc. Proprietary © 2009 ANSYS. All rights reserved.0 • Windows Start menu > Programs > ANSYS 12.zip” from the location specified by your instructor Save the “filter” p project j to a directory y specified p by y your y instructor ANSYS. WS7-6 June 2009 Inventory #002669 .Workshop 7 … Review Model in Mechanical Training Manual 1.

Inc. Proprietary © 2009 ANSYS. WS7-7 June 2009 Inventory #002669 .) ANSYS. All rights reserved. (U (User D Defined fi d R Results lt are nott available il bl in i Harmonic H i Response R Analyses A l at Mechanical 12. Double-click on “Model” cell (C4) to launch Mechanical – Examine the geometry and model setup.Workshop 7 … Review Model in Mechanical Training Manual 3.0. and a modal analysis has been defined. so a modal analysis is defined instead. Note that this is a multi-body part (shared nodes at interface). Inc.

txt” from the location specified by your instructor ANSYS. Click on “Import” and select “workshop 7a-prep. All rights reserved. Inc. Expand the “Geometry” and its sub-branches. Proprietary © 2009 ANSYS. WS7-8 June 2009 Inventory #002669 . Inc. Right-click and “Insert > Commands” for the first “dished head-1” body 5.Workshop 7 … Define Acoustic Elements Training Manual 4.

shown below • Note that this element is a 8-node brick element • Also..Workshop 7 … Define Acoustic Elements Training Manual • The first line defines the FLUID30 element type: – et. Inc.MATID.1 • Details on this element can be found in the Elements Reference. All rights reserved. WS7-9 June 2009 Inventory #002669 . Proprietary © 2009 ANSYS. Inc.30. so do not use mesh methods such as hex-dominant meshing ANSYS.. there is no pyramid form.

1 which does the same action in 2 commands. All rights reserved. ANSYS. Alternatively.Workshop 7 … Define Acoustic Elements Training Manual • The 2nd keyoption determines whether this element is for vibroacoustic (KEYOPT(2)=0) or pure acoustic applications (KEYOPT(2)=1): – The command ET.. Inc. WS7-10 June 2009 Inventory #002669 .30.30 followed by KEYOPT. a user may also issue ET.MATID. Proprietary © 2009 ANSYS.1 sets KEYOPT(2)=1 (3rd argument).MATID.2.MATID. Inc.

mu .1 • The first command deletes the material p properties p (e. described later..MATID. All rights reserved. ( g . Inc.ARG1 mp. • The Elements Reference lists the supported material properties p p for each element • “Impedance” is actually for surface boundary conditions. Inc.dens.all. Proprietary © 2009 ANSYS. “Structural Steel”) assigned to that part.sonc. speed of sound.ARG2 mp. • Density.MATID mp.Workshop 7 … Define Acoustic Elements Training Manual • The material properties are defined by the following: – – – – mpdele. and impedance p are then defined.MATID.MATID.g. ANSYS. WS7-11 June 2009 Inventory #002669 .

Inc.Workshop 7 … Define Acoustic Elements Training Manual 6. Arguments defined in the Details view will be used for parameters ARG1ARG9. The second is for speed of sound 343 (m/s). enter “1” for “ARG1” and “343” for “ARG2” • The first argument will replace the value of density. In the Details view of the “Commands (ANSYS)” branch. in this case assumed to be 1 (kg/m3). WS7-12 June 2009 Inventory #002669 . This allows users to use command objects developed by others more readily ANSYS. All rights reserved. Inc. Proprietary © 2009 ANSYS.

WS7-13 June 2009 Inventory #002669 . All rights reserved. Proprietary © 2009 ANSYS. Drag-and-drop the “Commands (ANSYS)” branch to the other bodies – – This copies the “Commands (ANSYS)” branch and its contents to other bodies Please note that the copy is a static copy. the others will not automatically be updated updated. Inc. if any changes are made to 1 “Commands” branch. ANSYS.Workshop 7 … Define Acoustic Elements Training Manual 7. Inc. Hence.

Right-click ht li k on the th “Mesh” “M h” branch b h and d select l t “Generate Mesh” ANSYS.Workshop 7 … Define Acoustic Elements Training Manual 8. WS7-14 June 2009 Inventory #002669 . For this model. it is a good idea to manually specify the meshing method. To prevent p the creation of pyramid elements (such as hex-to-tet transitional pyramids). Inc. The midside nodes.) nodes ) Notice that there is already a “Patch Conforming Method” object. In the Details view. change “Advanced > Element Midside Nodes” to “Dropped” – – Recall that FLUID30 is a lower-order element (8-node hexahedral element). (Default mesh for Mechanical physics is to keep solid midside nodes. will be dropped. All rights reserved. an all-tetrahedral mesh will be g generated. therefore. Inc. Proprietary © 2009 ANSYS. 9 Ri 9. Select the “Mesh” branch.

Inc. • In this analysis. Inc.Workshop 7 … Define Acoustic Elements Training Manual • It is important to ensure that the mesh is sufficiently fine for acoustic analyses. WS7-15 June 2009 Inventory #002669 . Proprietary © 2009 ANSYS. notice that the element size is set to 50 mm. The highest frequency solved for will be 200 Hz. A general rule of thumb is to use 15-20 elements per wavelength as a minimum. the speed of sound of air is 343 m/s. i t t ANSYS. so this mesh should be reasonable to calculate the response off the th frequency f range off interest. 20 elements per wavelength results in an element size of ~85 8 mm. • In the Details view of the “Mesh” branch.715 m. This means that the wavelength is 1. All rights reserved.

Proprietary © 2009 ANSYS. t (If prompted t d that th t the th currentt contents t t off the th “Commands” “C d ” object will be overwritten.) ANSYS.Workshop 7 … Specify Harmonic Analysis Settings Training Manual 10. click on [Yes]. Inc. Inc. All rights reserved. Right-click on the “Modal (A5)” branch and “Insert > Commands” – Select the “Import” icon on the Context Toolbar and browse for the workshop 7a-solu.txt file from the location specified by your i t instructor. WS7-16 June 2009 Inventory #002669 .

Inc. enter the following values: – – – – – – ARG1: ARG2: ARG3: ARG4: ARG5: ARG6: – Note that. All rights reserved. In the Details view of the newly-added “Commands (ANSYS)” object.Workshop 7 … Specify Harmonic Analysis Settings Training Manual 11. the meaning of the various arguments is explained: • • • • • • 0.32516 1 1 343 200 100 ARG1 is the area of the inlet ARG2 is the incident pressure value ARG3 is the density of the fluid ARG4 is the speed of sound of the fluid ARG5 is the max frequency to solve ARG6 is the number of steps (# of intermediate solutions from 0 to 200 Hz) ANSYS. Proprietary © 2009 ANSYS. Inc. in the “Commands” object. WS7-17 June 2009 Inventory #002669 .

Workshop 7 … Specify Harmonic Analysis Settings Training Manual 12. This will simply be a container to collect images generated in Mechanical APDL ANSYS. Inc. All rights reserved. Proprietary © 2009 ANSYS. WS7-18 June 2009 Inventory #002669 . Inc. Right-click on the “Solution” branch and “Insert > Commands” • Do not type anything in this “Commands” object.

and change the following items in the Details view: – – – – – • “Output Controls > Calculate Stress: No” “Output Controls > Calculate Strain: No” “Analysis Data Management > Save ANSYS db: Yes” “Analysis Data Management > Solver Units: Manual” “Analysis Data Management > Solver Unit System: mks” The last three items are important. Inc. All rights reserved. if needed. Inc. Select the “Analysis Settings” branch.Workshop 7 … Specify Harmonic Analysis Settings Training Manual 13. Proprietary © 2009 ANSYS. Specifying the solver units ensures that any unitd dependent d t values l input i t in i “Commands” “C d ” objects bj t will be interpreted correctly. WS7-19 June 2009 Inventory #002669 . Saving the Mechanical APDL database allows one to postprocess in Mechanical APDL GUI. ANSYS.

Proprietary © 2009 ANSYS. please read the next few slides (informative items preceded with a regular bullet point) point). ANSYS. in the meantime. Inc.Workshop 7 … Specify Harmonic Analysis Settings Training Manual 14. Inc. All rights reserved. WS7-20 June 2009 Inventory #002669 . Click on the “Solve” icon on the Toolbar to initiate the solution • The solution may take several minutes. so.

so this node number ID is retrieved using the ndnext() function and put into parameter MY_INLET for later use. • The reason why a coupled set is used is to ensure that all pressure DOF are the same value. A known pressure value is not used because a specified pressure DOF value is total pressure. Inc.pres. to mimic a plane wave.Workshop 7 … Specify Harmonic Analysis Settings Training Manual • Notice under the “Named Selection” branch that “N_INLET” and “N_OUTLET” are defined. These Named Selections are used to apply appropriate boundary conditions in the acoustic analysis.N_INLET cp. Inc.all MY_INLET=ndnext(0) • The nodal component p (Named ( Selection)) “N_INLET” _ is selected. WS7-21 June 2009 Inventory #002669 . All rights reserved. Coupled sets use the lowest node number as the ‘master’ node.. not just incident pressure.next. and the pressure DOF of all nodes are coupled.s. • The first set of commands are as follows: – – – – /prep7 cmsel. Proprietary © 2009 ANSYS. ANSYS.

A *DO loop is used to pick 6 arbitrary nodes – After solution. • If the outlet will also be a plane wave. However. planar the 6 pressure values will differ – The diameter is about 90 cm. when the wavelength g becomes smaller than the characteristic dimensions of the geometry. All rights reserved. the outgoing wave should be planar. checking pressure values for 6 arbitrary nodes at the outlet is a way to confirm this assumption. the 6 pressure DOF values should be the same. the pressure values of the 6 nodes will be queried. ANSYS. Inc. WS7-22 June 2009 Inventory #002669 . Proprietary © 2009 ANSYS. Inc.Workshop 7 … Specify Harmonic Analysis Settings Training Manual • The second section of the “Commands” object selects the nodes in “N_OUTLET” nodal component (Named Selection). so one would expect waves to no longer be planar in the vicinity of 380 Hz (speed of 343 m/s divided by 90 cm). Since the solved frequency is 200 Hz < 380 Hz. • If the wave is no longer planar.

impd. • By specifying this ‘impedance’ boundary condition in the inlet and oulet.N_OUTLET. WS7-23 June 2009 Inventory #002669 . • Note that use of this boundary condition is only valid for plane waves.. Inc.1 • The MP.MU value of 1 specified earlier for each body gives the ratio of the characteristic impedance ροc of the fluid and the domain not modeled (e. Inc.impd. FLUID129/130 elements can be used for general cases to absorb outgoing waves.N_INLET. Proprietary © 2009 ANSYS. ANSYS.1 – sf. domain beyond the outlet).g. One of the simplest is to use the “impedance” flag: – sf. For example. All rights reserved. A value of “1” will allow plane waves to be absorbed. any reflected waves will be ‘absorbed’ in the inlet.Workshop 7 … Specify Harmonic Analysis Settings Training Manual • There are different ways to model a non-reflecting boundary condition. and the outlet will not reflect any waves.

full outres.Workshop 7 … Specify Harmonic Analysis Settings Training Manual • The next section defines solution settings for the harmonic response analysis: – – – – – – – – /solu antype. Also.1 • Although the analysis in Mechanical is “Modal”.all nsubst. only pressure DOF results are saved in the Mechanical APDL results file. the above commands redefine the analysis to be harmonic.nsol. Inc. All rights reserved. ANSYS. Proprietary © 2009 ANSYS.none outres.erase outres.harmic hropt. WS7-24 June 2009 Inventory #002669 . Inc.1 kbc.all.

note that the volumetric flow rate can be related to incident pressure using the following relationship: p = ρ o cu& F f = − Aρ o u&& u = u o e j ωt = − Aρ o u&ωj u& = uoωje jωt = − Aρ oω u&& = uoω 2 e jωt = u&ωj = − Aω ANSYS. Inc. density. Proprietary © 2009 ANSYS. Inc. – Volumetric flow rate is a product of area. and particle acceleration – For planar waves in a harmonic response analysis.Workshop 7 … Specify Harmonic Analysis Settings Training Manual • The section after the specification of harmonic analysis options defines the incident pressure wave. WS7-25 p j ρoc p j c June 2009 Inventory #002669 . All rights reserved. • A ‘volumetric flow’ load is applied with the ∂ 2u n F f = − Aρ o 2 F command on the node ID MY_INLET ∂t obtained earlier.

The actual calculated pressure DOF will include the reflected wave as well • If the incident pressure is known. WS7-26 June 2009 Inventory #002669 . Proprietary © 2009 ANSYS. The appropriate value of volumetric flow rate can be defined to create a given incident pressure for a planar wave. All rights reserved. ANSYS.. which includes both incident and reflected pressure. Inc. • As a result. the parameters such as transmission loss can be defined.Workshop 7 … Specify Harmonic Analysis Settings Training Manual • If a pressure DOF were fixed using the D command. a *DO loop is used to solve each frequency value with a corrected value of volumetric flow rate – Creating a frequency-dependent tabular load is also possible to facilitate the solution (i. use of a volumetric flow rate is preferred.e. less APDL commands). for this application. this represents total pressure. which are useful to evaluate the design of a filter • Because the volumetric flow rate is a function of frequency. Inc.

Proprietary © 2009 ANSYS. WS7-27 June 2009 Inventory #002669 .Workshop 7 … Postprocess Results Training Manual 15. Inc. Select the first “Post Output” branch – The incident pressure (PIN_I) is constant for the frequency range. The reflected (PIN_R) and total (PIN_T) pressures are shown and comapred against i t the th total t t l pressure in i the th outlet tl t (POUT_Tx). Inc. (POUT T ) ANSYS. All rights reserved.

Note that all values are the same. WS7-28 June 2009 Inventory #002669 . All rights reserved. Inc. Select “Post Output 2”. d l ANSYS. so the assumption of planar l waves is i acceptable t bl for f this thi model. Inc.Workshop 7 … Postprocess Results Training Manual 16. the plot of outlet pressures – The plot of 6 nodes in the outlet is shown in more clarity in the second plot below. Proprietary © 2009 ANSYS.

Proprietary © 2009 ANSYS. Select “Post Output 4”. the plot of transmission loss – Transmission loss. Inc. WS7-29 June 2009 Inventory #002669 .Workshop 7 … Postprocess Results Training Manual 17. the results lt att 144 H Hz and d 190 Hz will be examined in more detail ANSYS. defined as shown on the right. provides a metric on the performance of a silencer ⎛P TL = 20 log⎜⎜ incident ⎝ Poutlet ⎞ ⎟⎟ ⎠ In the next steps. Inc. All rights reserved.

enter “PRES” for “Expression” and enter “72” for “Mode” (2 Hz intervals were solved. Select the “Solution” branch and insert a “User Defined Results” from the Context Toolbar – – In the Details view. Inc. Inc. so ‘mode’ 72 is 144 Hz) Right-click and “Evaluate All Results …” Notice that pressure waves are transmitted ANSYS.Workshop 7 … Postprocess Results Training Manual 18. Proprietary © 2009 ANSYS. All rights reserved. WS7-30 June 2009 Inventory #002669 .

Inc. Inc. WS7-31 June 2009 Inventory #002669 . enter “PRES” for “Expression” and enter “95” for “Mode” (2 Hz intervals were solved. All rights reserved. so ‘mode’ 95 is 190 Hz) Right-click and “Evaluate All Results …” Notice that pressure waves get reflected b k tto th back the inlet i l t ANSYS. Select the “Solution” branch and insert a second “User Defined Results” from the Context Toolbar – – In the Details view. Proprietary © 2009 ANSYS.Workshop 7 … Postprocess Results Training Manual 19.

All rights reserved. Proprietary © 2009 ANSYS. Inc. • This concludes the present workshop ANSYS. WS7-32 June 2009 Inventory #002669 . postprocessing in Mechanical APDL is also possible by using “Transfer Data to New > Mechanical APDL” in the Workbench Project Schematic.Workshop 7 … Postprocess Results Training Manual • Since the Mechanical APDL database has been saved. Inc.