You are on page 1of 32

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

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

Workshop 7

Note About Acoustic Analyses

Training Manual

In acoustic analyses in Mechanical APDL, wave propagation is solved


Animation of isosurfaces of pressure in a room (acoustic source are
two speakers):

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-4

June 2009
Inventory #002669

Workshop 7

Workshop Objectives

Training Manual

In this workshop, 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.
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.
font
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.

WS7-5

June 2009
Inventory #002669

Workshop 7

Review Model in Mechanical

Training Manual

1. Launch ANSYS Workbench 12.0

Windows Start menu > Programs > ANSYS 12.0 > Workbench

2. Restore archive workshop


p 7a.zip
p

File menu > Restore Archive


Select workshop 7a.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, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-6

June 2009
Inventory #002669

Workshop 7

Review Model in Mechanical

Training Manual

3. Double-click on Model cell (C4) to launch Mechanical

Examine the geometry and model setup. Note that this is a multi-body
part (shared nodes at interface), and a modal analysis has been defined.
(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.0, so a modal analysis is defined instead.)

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-7

June 2009
Inventory #002669

Workshop 7

Define Acoustic Elements

Training Manual

4. Expand the Geometry and its sub-branches. Right-click and


Insert > Commands for the first dished head-1 body
5. Click on Import and select workshop 7a-prep.txt from the
location specified by your instructor

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-8

June 2009
Inventory #002669

Workshop 7

Define Acoustic Elements

Training Manual

The first line defines the FLUID30 element type:


et,MATID,30,,1

Details on this element can be found in the Elements Reference,,


shown below

Note that this element


is a 8-node brick element
Also, there is no pyramid
form, so do not use
mesh methods such as
hex-dominant meshing
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.

WS7-9

June 2009
Inventory #002669

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,MATID,30,,1 sets KEYOPT(2)=1 (3rd argument).
Alternatively, a user may also issue ET,MATID,30 followed by
KEYOPT,MATID,2,1 which does the same action in 2 commands.

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-10

June 2009
Inventory #002669

Workshop 7

Define Acoustic Elements

Training Manual

The material properties are defined by the following:

mpdele,all,MATID
mp,dens,MATID,ARG1
mp,sonc,MATID,ARG2
mp,mu ,MATID,1

The first command deletes the material p


properties
p
(e.g.,
( g , Structural
Steel) assigned to that part.
Density, speed of sound, and
impedance
p
are then defined.
The Elements Reference
lists the supported material
properties
p
p
for each element
Impedance is actually for
surface boundary conditions,
described later.

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-11

June 2009
Inventory #002669

Workshop 7

Define Acoustic Elements

Training Manual

6. In the Details view of the Commands (ANSYS) branch, enter 1


for ARG1 and 343 for ARG2

The first argument will replace the value of density, in this case
assumed to be 1 (kg/m3). The second is for speed of sound 343 (m/s).

Arguments defined
in the Details view
will be used for
parameters ARG1ARG9.
This allows users to
use command
objects developed by
others more readily

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-12

June 2009
Inventory #002669

Workshop 7

Define Acoustic Elements

Training Manual

7. 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. Hence, if
any changes are made to 1 Commands branch, the
others will not automatically be updated
updated.

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-13

June 2009
Inventory #002669

Workshop 7

Define Acoustic Elements

Training Manual

8. Select the Mesh branch. In the Details view,


change Advanced > Element Midside Nodes to
Dropped

Recall that FLUID30 is a lower-order element (8-node


hexahedral element). The midside nodes, therefore,
will be dropped. (Default mesh for Mechanical
physics is to keep solid midside nodes.)
nodes )
Notice that there is already a Patch Conforming
Method object. For this model, an all-tetrahedral
mesh will be g
generated. To prevent
p
the creation of
pyramid elements (such as hex-to-tet transitional
pyramids), it is a good idea to manually specify the
meshing method.

9 Ri
9.
Right-click
ht li k on the
th Mesh
M h branch
b
h and
d select
l t
Generate Mesh

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-14

June 2009
Inventory #002669

Workshop 7

Define Acoustic Elements

Training Manual

It is important to ensure that the mesh is sufficiently fine for acoustic


analyses. A general rule of thumb is to use 15-20 elements per
wavelength as a minimum.
In this analysis, the speed of sound of air is 343 m/s. The highest
frequency solved for will be 200 Hz. This means that the wavelength
is 1.715 m. 20 elements per wavelength results in an element size of
~85
8 mm.
In the Details view of the Mesh branch, notice that the element size
is set to 50 mm, so this mesh should be reasonable to calculate the
response off the
th frequency
f
range off interest.
i t
t

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-15

June 2009
Inventory #002669

Workshop 7

Specify Harmonic Analysis Settings

Training Manual

10. 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.
t
(If prompted
t d that
th t the
th currentt contents
t t off the
th Commands
C
d
object will be overwritten, click on [Yes].)

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-16

June 2009
Inventory #002669

Workshop 7

Specify Harmonic Analysis Settings

Training Manual

11. In the Details view of the newly-added Commands (ANSYS)


object, enter the following values:

ARG1:
ARG2:
ARG3:
ARG4:
ARG5:
ARG6:

Note that, in the Commands object, 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, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-17

June 2009
Inventory #002669

Workshop 7

Specify Harmonic Analysis Settings

Training Manual

12. Right-click on the Solution branch and Insert > Commands

Do not type anything in this Commands object. This will simply be a


container to collect images generated in Mechanical APDL

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-18

June 2009
Inventory #002669

Workshop 7

Specify Harmonic Analysis Settings

Training Manual

13. Select the Analysis Settings branch, 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. Saving the


Mechanical APDL database allows one to
postprocess in Mechanical APDL GUI, if needed.
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.

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-19

June 2009
Inventory #002669

Workshop 7

Specify Harmonic Analysis Settings

Training Manual

14. Click on the Solve icon on the Toolbar to initiate the solution

The solution may take several minutes, so, in the meantime, please
read the next few slides (informative items preceded with a regular
bullet point)
point).

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-20

June 2009
Inventory #002669

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.
The first set of commands are as follows:

/prep7
cmsel,s,N_INLET
cp,next,pres,all
MY_INLET=ndnext(0)

The nodal component


p
(Named
(
Selection)) N_INLET
_
is selected,, and
the pressure DOF of all nodes are coupled. Coupled sets use the
lowest node number as the master node, 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, to mimic a plane wave. A known pressure
value is not used because a specified pressure DOF value is total
pressure, not just incident pressure.
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.

WS7-21

June 2009
Inventory #002669

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). A *DO loop is
used to pick 6 arbitrary nodes
After solution, the pressure values of the 6 nodes will be queried.
If the outlet will also be a plane wave, the 6 pressure DOF values should be the
same.
If the wave is no longer planar,
planar the 6 pressure values will differ

The diameter is about 90 cm, 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), when
the wavelength
g becomes smaller than the characteristic dimensions of
the geometry. Since the solved frequency is 200 Hz < 380 Hz, the
outgoing wave should be planar. However, checking pressure values for
6 arbitrary nodes at the outlet is a way to confirm this assumption.

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-22

June 2009
Inventory #002669

Workshop 7

Specify Harmonic Analysis Settings

Training Manual

There are different ways to model a non-reflecting boundary


condition. One of the simplest is to use the impedance flag:
sf,N_OUTLET,impd,1
sf,N_INLET,impd,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.g., domain beyond the outlet). A value of 1 will allow
plane waves to be absorbed.
By specifying this impedance boundary condition in the inlet and
oulet, any reflected waves will be absorbed in the inlet, and the
outlet will not reflect any waves.
Note that use of this boundary condition is only valid for plane
waves. For example, FLUID129/130 elements can be used for
general cases to absorb outgoing waves.

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-23

June 2009
Inventory #002669

Workshop 7

Specify Harmonic Analysis Settings

Training Manual

The next section defines solution settings for the harmonic response
analysis:

/solu
antype,harmic
hropt,full
outres,erase
outres,all,none
outres,nsol,all
nsubst,1
kbc,1

Although the analysis in Mechanical is Modal, the above


commands redefine the analysis to be harmonic. Also, only pressure
DOF results are saved in the Mechanical APDL results file.

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-24

June 2009
Inventory #002669

Workshop 7

Specify Harmonic Analysis Settings

Training Manual

The section after the specification of harmonic analysis options


defines the incident pressure wave.
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.
Volumetric flow rate is a product of area, density, and particle
acceleration
For planar waves in a harmonic response analysis, 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& = uoje jt

= A o

u&& = uo 2 e jt = u&j

= A
ANSYS, Inc. Proprietary
2009 ANSYS, Inc. All rights reserved.

WS7-25

p
j
oc

p
j
c
June 2009
Inventory #002669

Workshop 7

Specify Harmonic Analysis Settings

Training Manual

If a pressure DOF were fixed using the D command, this represents


total pressure, which includes both incident and reflected pressure.
As a result, for this application, use of a volumetric flow rate is
preferred. The appropriate value of volumetric flow rate can be
defined to create a given incident pressure for a planar wave. The
actual calculated pressure DOF will include the reflected wave as well
If the incident pressure is known, the parameters such as
transmission loss can be defined, which are useful to evaluate the
design of a filter
Because the volumetric flow rate is a function of frequency, 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.e., less APDL commands).

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-26

June 2009
Inventory #002669

Workshop 7

Postprocess Results

Training Manual

15. 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).
(POUT T )

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-27

June 2009
Inventory #002669

Workshop 7

Postprocess Results

Training Manual

16. Select Post Output 2, the plot of outlet pressures

The plot of 6 nodes in the outlet is shown in more clarity in the second
plot below. Note that all values are the same, so the assumption of
planar
l
waves is
i acceptable
t bl for
f this
thi model.
d l

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-28

June 2009
Inventory #002669

Workshop 7

Postprocess Results

Training Manual

17. Select Post Output 4, the plot of transmission loss

Transmission loss, 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, the


results
lt att 144 H
Hz and
d
190 Hz will be
examined in more
detail

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-29

June 2009
Inventory #002669

Workshop 7

Postprocess Results

Training Manual

18. Select the Solution branch and insert a User Defined Results
from the Context Toolbar

In the Details view, enter PRES for Expression and enter 72 for
Mode (2 Hz intervals were solved, so mode 72 is 144 Hz)
Right-click and Evaluate All Results

Notice that pressure


waves are transmitted

ANSYS, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-30

June 2009
Inventory #002669

Workshop 7

Postprocess Results

Training Manual

19. Select the Solution branch and insert a second User Defined
Results from the Context Toolbar

In the Details view, enter PRES for Expression and enter 95 for
Mode (2 Hz intervals were solved, 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, Inc. Proprietary


2009 ANSYS, Inc. All rights reserved.

WS7-31

June 2009
Inventory #002669

Workshop 7

Postprocess Results

Training Manual

Since the Mechanical APDL database has been saved,


postprocessing in Mechanical APDL is also possible by using
Transfer Data to New > Mechanical APDL in the Workbench Project
Schematic.

This concludes the present workshop


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

WS7-32

June 2009
Inventory #002669

You might also like