Ijsrp p1928
Ijsrp p1928
Ijsrp p1928
EXAMINATION COMMITTEE
Prof.dr.ir. T.H. van der Meer (chair)
Ir. J.P. Oosterhuis (member)
Dipl.-Ing. S. Bühler (member)
Dr. A.R. Thornton (external member)
AUGUSTUS 2013
Time-Domain Impedance Boundary Conditions in
Computational Fluid Dynamics for use in Thermoacoustic
Modeling
August, 2013
Abstract
Thermoacoustic devices convert heat to work or vice versa using acoustic waves, and consist
of several parts that partially reflect acoustic waves. These reflections can be represented by
an acoustic impedance, which is a complex quantity that takes into account a phase difference
between the pressure and velocity oscillation. Usually one is only interested in a single part
of the thermoacoustic device, but to correctly numerically predict these wave phenomena the
whole device should be modeled. As solving acoustics using Computational Fluid Dynamics
(CFD) requires comparatively high computational resources, using the complete computational
domain of the whole device is unattractive. The reduction of the computational domain might
be possible with a so-called Time-Domain Impedance Boundary Condition (TD-IBC), which
relates the inward traveling acoustic wave to the outward traveling acoustic wave. Standard
commercial CFD software does not feature such a boundary condition as of yet. This master
thesis discusses the feasibility, theory and implementation of both a non-reflective boundary
condition (NRBC) and a TD-IBC. The NRBC and TD-IBC are implemented in ANSYS CFX
CFD software using FORTRAN subroutines. The results showed that for a complex reflection
coefficient of R = 0.5 + 0.5i, and an excitation frequency of f = 100Hz, the measured absolute
reflection coefficient |R| was off 1.05%, and the phase differed φ = 0.0334rad. From the work
done it can be concluded that it is indeed possible to implement a TD-IBC for application in
thermoacoustics.
Preface
The start of this master thesis was characterized by uncertainty, as the exact topic was not
known yet. What was known, was that it would be a numerical assignment in the field of
thermoacoustics. After some preliminary research, and input from Joris and Simon, the topic
of the assignment became clear. Joris and Simon guided me throughout the whole thesis, and
despite often being busy, have always found time to discuss matters. Later in the project, a
weekly progress meeting with everybody related to the thermoacoustics project started. This
meeting provided me with invaluable feedback.
As Joris and Simon were the most prominent contributors to the succes of this thesis, I
would like to thank them first. I also would like to thank Theo for helping me choose a master
thesis assignment, assigning me to the project, and guiding me throughout the project.
A special note for my colleagues in room N248. Although the ubiquitous presence of my
fellow graduation students in room N248 have impaired my work efficiency from time to time,
their unique characters have supplied me with plentiful laughter that prevented me from falling
into utter despair at numerous stages of my research. During my stay we became accustomed
to various avocations, such as “klaverjassen” at 12 o’clock, and “blik-time” at 3 o’clock in the
afternoon. While the rudimentary knowledge of some “klaverjassen” players jeopardized the
efficacy of the teams during play, their assiduous efforts and lavish endeavors were often eulo-
gized. Thus I would like to thank Daan, Johan, Frans, Sjoerd, Gerald, Maarten, and Sam for
creating a collegial and comfortable atmosphere.
2
Contents
1 Introduction 5
1.1 Thermoacoustics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Thermoacoustics in computational fluid dynamics . . . . . . . . . . . . . . . . . . 12
1.3 Thesis outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2 Theory 14
2.1 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Governing equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3 Navier-Stokes Characteristic Boundary Conditions . . . . . . . . . . . . . . . . . 18
2.3.1 Characteristic analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.3.2 Determination of outgoing wave amplitude variation . . . . . . . . . . . . 22
2.4 Linear relaxation method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5 Plane-Wave Masking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.6 Time-Domain Impedance Boundary Conditions . . . . . . . . . . . . . . . . . . . 24
2.6.1 Determination of filter coefficients . . . . . . . . . . . . . . . . . . . . . . 26
2.6.2 Determination of normalized angular frequency . . . . . . . . . . . . . . . 27
2.6.3 Stability of filter coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.7 Reflection measurement theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.7.1 Multi-microphone method . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3 Method 30
3.1 Domain model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.1 Boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1.2 Space and time discretization . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2 Fluid models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.2.1 Initial conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.2.2 Heat energy equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.3 Implementation of a TD-IBC in ANSYS CFX . . . . . . . . . . . . . . . . . . . . 36
3.3.1 Fortran programming in ANSYS CFX . . . . . . . . . . . . . . . . . . . . 36
3.3.2 Parallelization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.3.3 Solver data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.4 Memory precision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3.5 Memory Management System . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.3.6 Initialization routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.7 Non-reflective part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.3.8 Plane-wave masking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.3.9 Time-domain impedance boundary condition part . . . . . . . . . . . . . 53
3.4 Reflection measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.4.1 Measurement in test-cases . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.5 Test cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.5.1 Solver settings and convergence criteria . . . . . . . . . . . . . . . . . . . 59
3
3.5.2 Simulation time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.5.3 Relaxation factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.5.4 Non-reflective boundary test cases . . . . . . . . . . . . . . . . . . . . . . 60
3.5.5 Time-domain impedance boundary condition test cases . . . . . . . . . . 62
4 Results 66
4.1 Non-reflective boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.1.1 Heat transfer equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.1.2 Time integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4.1.3 Relaxation factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.1.4 Mean velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
4.1.5 Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.1.6 Linear refinement near boundary . . . . . . . . . . . . . . . . . . . . . . . 77
4.1.7 Sharp gradients in pressure and velocity . . . . . . . . . . . . . . . . . . . 79
4.2 Time-domain impedance boundary condition . . . . . . . . . . . . . . . . . . . . 81
4.2.1 Acoustically hard wall and pressure release surface . . . . . . . . . . . . . 82
4.2.2 Non-reflecting outlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.2.3 Complex reflection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
References 88
Nomenclature 92
Appendix 93
4
Chapter 1
Introduction
The twentieth century has seen unprecedented growth in the fields of science, technology, and
medicine, but also huge advances in civil and political rights. These fundamental and far reach-
ing changes throughout society, more often seen as beneficial than not, increased life span,
well-being and prosperity for people from all walks of life. But the vastly increased quality of
life over the last centuries does come at a price. The dependence on finite reserves of fossil fuels
and the increased pollution are two of the most prominent caveats of these changes. To mitigate
these negative side effects, one can look at possible (partial) solutions from three angles. In
order of priority: 1. To increase efficiency on the demand side (i.e. use less). 2. To use more
sustainable energy sources. And 3. to make more efficient use of fossil fuels. This strategy has
been formulated by E. Lysen [12] and is called Trias Energetica.
This master thesis is based on the premise that thermoacoustic devices can function as a po-
tential solution to some of the aforementioned problems society faces today. A thermoacoustic
engine is a type of thermoacoustic device that uses sound waves as a means to transport heat
5
(heat pump) or convert heat into mechanical work (prime mover). The mechanical work done
in a prime mover could be used to drive electrical generators and produce electricity. These
type of engines could possibly fulfill roles in both point 2 and 3 of the Trias Energetica strategy.
Point 2 by using a sustainable heat sources, and point 3, for example, by using part of the gas
to produce work or electricity while the waste heat is used to heat a building.
While the thermoacoustic engine and principle has been around for a while, the recently
increased awareness on the topic of sustainability has sparked new interest in the technology
which had previously been practically dormant for years. The technology features some promis-
ing characteristics in the light of sustainability. Firstly, thermoacoustic devices can operate
with a small temperature difference between heat source and sink. This opens possibilities for
application with sustainable heat sources, as these are generally of relatively low temperature
compared to fossil fuel combustion. Secondly, the devices usually have minimal or no moving
parts, depending on application. Which can be beneficial to production and maintanance costs,
as well as reliability (especially in rough conditions).
The technology has not enjoyed the amount of research that the piston and turbine engines
had. In this respect it lags behind considerably, and much experimental, analytical, as well
as numerical research needs to be done to bring the technology on par. In this master thesis
focus lays on the numerical modeling aspect. To create a physically realistic numerical model
of a thermoacoustic engine based on a fluid dynamics code, often the complete domain must be
calculated, even if only the performance and flow field of a particular section needs to be deter-
mined. Special boundary conditions called “Time-Domain Impedance Boundary Conditions”
(TD-IBC) can potentially solve these problems. These boundary conditions are, however, not
provided by commercial CFD codes. A literature research is done on these special boundary
conditions, and subsequently are implemented using Fortran subroutines in a commercial CFD
package called Ansys CFX, and their performance is tested.
6
1.1 Thermoacoustics
The first observations and descriptions about the thermoacoustic effect are already over two
centuries old. In 1777, B. Higgins showed how to produce acoustic oscillations excited purely
by a single heat source. His device was simple, just an open glass tube with a hydrogen flame
at a suitable position (quarter length) inside, and was called Higgins‘ singing flame. A similar
experiment was devised by P.L. Rijke, but now the flame was replaced by a heated gauze (see
Fig. 1.2). Rijke also observed that the convective air current was imperative for the acoustic
oscillations to occur [7].
Another device is the Sondhauss tube, which has a closed end with a bulb attached to it
(see Fig. 1.2). The bulb side was heated and did not need convective air current to operate.
Nowadays, Higgins‘ singing flame and the Rijke tube can be characterized as a quarter wave
resonator, while the Sondhauss tube is a half wave resonator. The thermoacoustic effect does
not only occur under heating, but also under cooling. Taconis observed, when cooling a gas-
filled tube from room temperature to cryogenic temperature, spontaneous oscillations of the gas
under extreme cooling. The first, and correct, qualitative explanation about the thermoacoustic
effect has been done by Lord Rayleigh in The Theory of Sound [20], saying:
“If heat be given to the air at the moment of greatest condensation (compression)
or taken from it at the moment of greatest rarefaction (expansion), the vibration is
encouraged.”
7
In free space, gas parcels exposed to an acoustic disturbance behave in a such a way that they
predominantly expand and compress adiabatically. The temperature variations as a function
of pressure in an adiabatic process can be described by equation 1.1. Where γ is the adiabatic
index (1.4 for air), T the temperature, and P the pressure. This means that when the pressure
increases, so does the temperature, and vice versa. (under the assumption that γ > 1, which it
always the case in an adiabatic process).
The acoustic pressure and particle velocity do not necessarily be in phase. When the acous-
tic wave is a purely traveling wave, the phase angle between the pressure and velocity is zero
(see Fig. 1.4b), while a purely standing wave has a phase angle of 90◦ (see Fig. 1.4a). A stand-
ing wave is caused by two traveling waves propagating in opposite directions, and has nodes
at certain positions. Nodes are positions in space where the acoustic pressure or velocity is
constantly zero, and are called pressure nodes and velocity nodes respectively. Positions where
the acoustic pressure or particle velocity periodically reaches the maximum amplitude are called
anti-nodes. Often, acoustic waves are not purely the one or the other, but a combination of both.
8
At a pressure anti-node the pressure variations, and thus the temperature variations, are
largest, while at a pressure node there is no temperature variation. At a velocity anti-node the
displacement is large, while at a velocity node there is no variation. For a standing wave device
this means that at a velocity node the temperature variations are largest, while at a velocity
anti-node there is no temperature variation. Between the nodes both the temperature and
the velocity oscillates (and thus displaces the parcel), which results in a temperature gradient
(visualized in Fig. 1.4c), which is known as the critical temperature gradient.
For a traveling wave the situation is somewhat different because the nodes coincide and move
with the speed of sound. At the moment of greatest compression (hottest), the fluid parcels
moves to the right, it then stops and starts moving to the left while expanding (cooling). This
gives circle like temperature-position cycles (see Fig. 1.4d).
In practice, a device will be designed either as a standing or a traveling wave device, but
both effects will occur. This will result in oval shaped temperature-positions paths (see Fig.
1.4e).
Figure 1.4: Standing and traveling wave temperature position cycles [7]
The heat pump and prime mover parts of a thermoacoustic device are in basic structure
very similar, and often comprised of two heat exchangers with a porous structure between them.
One heat exchanger is cold, the other hot. If the part functions either as a heat pump or prime
mover depends on the actual temperature gradient achieved between the hot and cold heat
exchangers, and the critical temperature gradient. If the temperature gradient at the position
of the porous structure is smaller than the critical temperature gradient, the part will function
as a heat pump (see Fig. 1.5a). If the temperature gradient is larger, than the part will function
as a prime mover (see Fig. 1.5b). A heat pump will cause heat to be “pumped” from the cold
to the hot heat exchanger, while a prime mover will cause the heat to flow from the hot to the
cold heat exchanger.
The porous structure in between the heat exchangers serves two main purposes. For both
traveling and standing wave devices the porous structure provides much more surface area for
heat transfer to take place, and thus increasing the amount of power that can be transferred.
The other porpuse has everything to do with maximizing the encircled area within the P-v
diagram, which will be explained later in this section.
9
Figure 1.5: Refrigerator and prime mover temperature gradients [7]
The physical principle of a heat pump and a prime mover can be explained from a thermo-
dynamical perspective by taking into account the first and second law of thermodynamics. The
first law states that energy is always conserved, which is mathematically described by the sum
of the incoming and outgoing energy flows being equal equal to the change in internal energy
(see eq. 1.2). Where ∆U is the change in internal energy, Q the heat added to the system, and
W the work done by the system. If steady operation is considered, the change in internal energy
∆U is zero. The second law states that the entropy of an isolated system never decreases. In
practive this implies that for a hot and a cold heat exchanger, without any work done, the heat
will always flow from the hot to the cold heat exchanger.
∆U = Q − W (1.2)
An overview of the resulting energy flows for a heat pump and prime mover are shown in
Figure 1.6. From which it can be seen that (acoustic) work is needed to extract heat from a
cold reservoir and move it to the hot reservoir (heat pump function). The other way around,
(acoustic) work can be generated when heat can flow from the hot reservoir to the cold reservoir
(prime mover function).
A more detailed explanation of the thermoacoustic effect, and the conversion between acous-
tic energy and heat in both a standing-wave and traveling wave device, can be given by looking
at the thermodynamic cycle the process cycles through. A thermodynamic cycle is a collection
of thermodynamic processes of both heat and work, which always returns to its initial state. A
pressure-volume diagram (see Fig. 1.7) is a useful way to optimize the efficiency and operation
of the cycle. Because the process is a cycle, the process always encircles an area within this
diagram by definition. This surface area (within A-B-C-D in Figure 1.7) is equal to the power
absorbed or produced. This power, in respect to the heat supplied or extracted, is a figure of
merit for efficiency.
For a traveling wave device, the porous structure in between the heat exchangers needs to
have good thermal contact (heat is exchanged quickly) for the area (and thus power) of the
thermodynamic cycle in the P-v diagram to be maximized. The thermodynamic cycle of the
traveling-wave device now resembles a so-called Stirling cycle (see Fig. 1.7a), and the porous
structure is now called a regenerator. A standing wave device needs a time-lag for it to maxi-
mize the surface area in the P-v diagram. The time-lag can be accomplished by an imperfect
10
Figure 1.6: Heat pump and prime mover energy flows [7]
Figure 1.7: Standing and traveling wave thermodynamic cycles in P-v diagram [7]
(slow heat transfer) thermal contact. The porous structure in a standing wave device is called
a stack, and it resembles a Brayton thermodynamic cyle (see Fig. 1.7b).
The difference between the Stirling and Brayton cycles is the manner in which the path
between states is traversed. A state can be seen as a point within the thermodynamic cycle
for which the state variables are known (for example: pressure and temperature), and between
different states the type of thermodynamic process varies. A gas turbine or a jet engine are
examples of Brayton cycles. A stirling engine is an example of a Stirling cycle. Without go-
ing into too much detail about these cycles, the Brayton cycle in the standing-wave device is
theoretically considered the least efficient of the two, because of the imperfect heat transfer
accompanying the time-lag that increases entropy. An increase in entropy results in a new state
that is “less able” to do work compared to a reference state.
The stack and regenerator also disturb the flow in other ways. The increased surface area
causes extra viscous losses. Also, because of the increased viscous effects, part of the acoustic
waves are reflected. These reflections are usually unwanted in a traveling wave device, as the
11
reflections will cause standing waves to form.
To give a more intuitive explanation, the thermoacoustic effect can be thought of as fluid
parcels that move energy over a small distance each, but together over a large distance. A bit
like firefighters did long ago, standing in a long line passing the buckets of water over from
one person to another. From this analogy comes the term ”Bucket-brigade effect”, which is
graphically represented in Figure 1.8.
A fluid parcel interacts thermally with the boundary and heat is transferred to the fluid
parcel. The fluid parcel then moves a small distance to either a hotter or colder region of the
boundary, before it transfers the heat back to the boundary. If the region is colder, the system
functions as a prime mover. If the heat is released at the hotter region, the system functions as
a heat pump.
The Helmholtz equation has frequency and position as its independent variables, and can be
evaluated using impedance, or the complex reflection coefficient, at bounding surfaces or points
of the domain. Complete thermoacoustic parts can be represented by an impedance or reflection
coefficient. This simplifies the thermoacoustic problems considerably, and decreases domain size.
Impedance is a quantity that relates the amount of sound pressure that is generated to acous-
tic particle velocity. It can be a characteristic of the medium, called characteristic impedance,
or from an acoustic component. The reflection coefficient relates the pressure of the incoming
acoustic wave to the reflected acoustic wave at a bounding surface of an acoustic component.
Impedance and reflection are complex quantities defined in the frequency domain.
12
For time-domain fluid dynamics equations such as the Navier-Stokes equations, and its de-
rived Euler equations and wave equation, these quantities cannot be used directly because they
are only defined in the frequency domain. Conventional boundary conditions, such as a con-
stant pressure outlet, usually behave acoustically fully reflective. One can circumvent these
problems in CFD by modeling the whole domain. This is computationally very expensive, es-
pecially considering one is usually only interested in a certain part of the thermoacoustic device.
A potential solution to decrease domain size, while maintaining correct acoustical proper-
ties, is to use so-called Time-Domain Impedance Boundary Conditions (TD-IBC). These type
of boundary conditions mimic the impedance, or the complex reflection coefficient, in the time-
domain. Several papers are written about this topic in literature, but none are actually available
in commercially available time-domain CFD packages such as ANSYS CFX and ANSYS FLU-
ENT. The goal of this master thesis is to implement and test a time-domain impedance bound-
ary condition in ANSYS CFX, and provide a theoretical reference on the matter for future work.
Chapter 2 is the Theory chapter, which gives the underlying theory of constructing a
TD-IBC. Also related theory such as the Navier-Stokes Characteristic Boundary Conditions
(NSCBC), the Linear Relaxation Method (LRM), Plane-Wave Masking (PWM), and the multi-
microphone method are discussed.
Chapter 3 covers the methodology of simulations and construction of the boundary condi-
tions in ANSYS CFX. An overview of the test cases are given, and their rationale is explained.
Also an overview and the main design choices of the programmed Fortran subroutines in AN-
SYS CFX is discussed.
The last two chapters, chapters 4 and 5, covers the results, conclusions, and recommen-
dations. The results chapter features the influence of the relaxation factor on the reflection
coefficient, the influence of mean flow, an analysis of pressure drift, and an analysis of the error
in the complex plane of the TD-IBC as the most important topics. To prevent clutter and a
plethora of numbers, results are mainly presented by graphs. The actual data used to construct
the graphs can be found in the appendix. In the last chapter a short overview of the conclusions
and recommendations are given.
References to the appendix are not given specifically in the report, but just referenced to
the appendix as a whole. The specific page numbers and headings can be found in the table of
contents of the appendix, at the beginning of the appendix.
13
Chapter 2
Theory
Optionally other terms can be added to the boundary specification. To solve stability prob-
lems discussed in section 2.4, a so-called Linear-Relaxation Method (LRM) can be used [22].
The downside of the LRM method is additional reflections. These additional reflections can sub-
sequently be mitigated by adding a Plane-Wave Masking (PWM) term [16]. Strictly speaking
the LRM method is not required, for example for certain short simulations which remain stable
within its simulation time, but in practice the LRM term must be added to prevent stability
problems.
The construction of the TD-IBC is presented graphically in Figure 2.1. All contributions
can be added as a sum of terms, similar to the superposition principle in linear systems.
14
ANSYS CFX already provides a non-reflective boundary condition as a beta feature. Con-
veniently, this built-in non-reflective boundary condition is also based on the NSCBC formalism
using the Locally One-Dimensional Inviscid (LODI) relations, and the LRM method for stabil-
ity [26]. See section 2.3.1 and 2.3.2 for details about the LODI relations. The ANSYS CFX
non-reflective boundary condition (NRBC) will be used as a reference in the results chapter.
Differential equations in fluid dynamics need additional constraints at the boundaries to be able
to find a solution, thermoacoustic applications in CFD will be no exception to this. These type
of differential equations are called boundary value problems, and the accompanying constraints
are called boundary conditions. Mathematically, a problem that has a solution that is unique,
exists, and does not behave chaotically is called a well-posed problem. To state that a problem
is well-posed in CFD problems based on the Navier-Stokes equations is in general not possible,
because it has never been proven that a solution always exists. One can therefore, in this case,
only say that a problem is more well-posed, or less well-posed, compared to a reference problem
based on the Navier-Stokes equations.
Different kind of boundary conditions exist of which certain types are considered “stronger”
than others, i.e. resulting in a problem being more well-posed. In practice this statement means
that a solver (software that calculates the solution) is usually more able to find a solution to the
problem if the boundary condition is considered stronger. A few important boundary conditions
are summed up in Table 2.1. The boundary conditions are explained using a model differential
equation where y is the dependent variable of the independent variable x, Ω is the domain, ∂Ω
is the boundary of the domain, α(x) and β(x) are given values on the boundary, and a and b
are constants which may, or may not, be a function of x.
The Dirichlet boundary condition specifies the values of the dependent variable (y) at the
boundary, and the Neumann boundary condition specifies the derivative of the dependent vari-
able (y 0 ) at the boundary. A Dirichlet boundary condition is considered stronger than a Neu-
mann boundary condition (in differentiation information is lost, the integration constant). The
others are combinations of aforementioned boundary conditions. The Cauchy boundary con-
dition specifies both y and y 0 , while the Robin boundary condition specifies y via a linear
combination of both y and y 0 .
After derivation of the theory about non-reflective and TD-IBC boundaries later on in the
this chapter, it will become clear that the resulting boundary conditions are of a “weaker” type
than a constant Dirichlet boundary condition often used in CFD (e.g. constant pressure outlet).
This can result in stability and convergence problems.
15
2.2 Governing equations
The most important set of equations in fluid dynamics are the Navier-Stokes equations. These
equations can describe many flow problems, and lie at the basis of many derived and simpler
equations. Important equations in acoustics, such as the wave equation, Helmholtz equation,
and the Euler equations are also derived from the Navier-stokes equations. The notation and
form of the Navier-Stokes equations differ. In this thesis a compact differential form (eq. 2.2)
using four column vectors (eq. 2.1) is used to enhance readability, but other forms exist. The
differential form is also used in the characteristic analysis later on in section 2.3.
~0
ρ ρ(~u − ~u∂V ) 0
inv visc
U = ρ~u ~
F = ρ~u(~u − ~u∂V ) + pI¯ ~
F = τ̄¯ J= ρf~ (2.1)
¯ ~
ρE ρE(~u − ~u∂V ) + p~u τ̄ ~u − ~q ρf · ~u + Q̇
∂U ~ ~ inv ~ visc
+ ∇ · (F − F ) = J (2.2)
∂t
In equation 2.1 and 2.2, U is a column vector with the conserved quantities, F ~ inv are the
~ visc are the viscous flux terms, and J are the source terms. ρ is the density,
inviscid flux terms, F
~u is the velocity vector, E the total specific energy (eq.2.3), p the pressure, τ̄¯ the stress tensor,
~q the heat conduction, f~ the gravity (or any other arbitrary volumetric force field), and Q̇ as
a volumetric heat source. The three-dimensional Navier-Stokes equations contain 7 unknowns
and 5 equations, leaving the system underdetermined. To solve the system of equations, two
additional equations need to be supplied, which are usually state equations such as the ideal
gas law (eq. 2.4).
1
E = e + |u|2 (2.3)
2
P = ρRT (2.4)
In acoustics, the viscous terms and heat conduction terms are generally small, and can be
neglected. From the compact form of the Navier-Stokes equations (eq. 2.2), the Euler equations
~ visc vector.
(eq. 2.5) can easily be constructed by removing the viscous flux terms F
∂U ~ ~ inv
+∇·F =J (2.5)
∂t
From the Euler equations (eq. 2.5) a partial differential equation important to acoustics can
be derived, which is called the wave equation (2.6). An important form of the wave equation
is the scalar velocity potential form in equation 2.7, because only one variable instead of three
needs to be solved for the three spatial dimensions. Apart from its application in acoustics, the
wave equation can also be used to describe other wave phenomena such light waves and water
waves.
∂2u
= c2 ∇2 u (2.6)
∂t2
~ 2 φ − 1 φtt = 0
∇ ~ = ~u
∇φ (2.7)
c20
The wave equation is a hyperbolic second-order linear Partial Differential Equation (PDE).
Solutions of hyperbolic equations exhibit wave-like behavior. Any disturbance made to the
16
initial conditions are not felt immediately throughout the domain, but instead are propagated
at a finite propagation speed. For the wave equation this propagation speed is equal to the
characteristic speed c0 . The wave equation is also a linear PDE, which means solutions can
be added to form other solutions (called superposition principle). The general solution to the
wave equation is given by equation 2.8. The functions f and g represent right and left traveling
waves respectively, and the solution is thus a sum of both (which can be a solution according
to the superposition principle).
Another important equation in acoustics is the Helmholtz equation. The Helmholtz equation
can be seen as a time-independent version of the wave equation. Using separation of variables,
and assuming time-harmonic behavior, the solution can be written in the form shown in equation
2.9. Substitution of this form of the solution in the wave equation (eq. 2.7) results in the
Helmholtz equation (eq. 2.10) (see appendix for detailed derivation). The wave equation can
also be expressed in the pressure amplitude δ p̂ instead of the velocity potential φ (eq. 2.11).
The solution of the Helmholtz equation for the pressure, is of the form given by equation 2.12,
which is, unlike the solution of the wave equation, not an equation of space x and time t, but of
space x and (angular) frequency ω. An important advantage of this equation is that frequency
dependent quantities such as impedance and reflection can be used directly.
~ 2 φ(~x, ω) + k 2 φ(~x, ω) = 0 ω
∇ where k= (2.10)
c
∂ 2 δ p̂
+ k 2 δ p̂ = 0 (2.11)
∂x2
An often used property to describe the acoustic behavior of media or acoustic components
is the acoustic impedance Z (eq. 2.13). The acoustic impedance relates the acoustic pressure
amplitude δ p̂ to the acoustic velocity amplitude δ û, and is used for acoustic components. A
special type of impedance is the so-called characteristic acoustic impedance Z0 , and is used to
describe the acoustic behavior of a medium (eq. 2.13). A high impedance means that a lot of
acoustic pressure is needed to move the fluid parcels, while a low impedance means the fluid
parcels are relatively easily moved.
δ p̂
Z= Z0 = ρ0 c0 Z∈C (2.13)
δ û
The acoustic impedance is equivalent to the reflection coefficient R, given by equation 2.14.
Where f and g are so-called characteristic wave amplitudes given by equation 2.8, and explained
in section 2.3. The reflection coefficient R is the ratio of the acoustic pressure that is reflected
(δ p̂− ) from an acoustic component over the outward traveling acoustic pressure (δ p̂+ ), and is
a measure for reflectivity. The part that is not reflected is transmitted (δ p̂tr ). The reflection
coefficient R can become complex, signifying a phase difference between the incoming and
outgoing waves.
δ p̂−
R= R∈C (2.14)
δ p̂+
17
Z − Z0
R= (2.15)
Z + Z0
In acoustics three special cases can be distinguished, a hard wall, a pressure release surface,
and a matched impedance. These cases are explained using Figure 2.2, which represents two
domains connected by an interacting surface (interface). When it will take a lot more acoustic
pressure to move the fluid parcels in domain 2 compared to domain 1 (Z2 >> Z1 ), the interface
is called a hard wall and the reflection coefficient R will be 1. When on the other hand the fluid
parcels move far more easily in domain 2 compared to 1 (Z2 << Z1 ), the interface is called a
pressure release surface and the reflection coefficient R will be -1. The last special case is the
matched impedance, in which the impedance on both sides are equal (Z2 = Z1 ), and is thus
non-reflective (R = 0).
The NSCBC formalism used in the non-reflective part of the TD-IBC is a method to con-
struct boundary conditions based on the characteristic wave relations of the (modified) hyper-
bolic Euler equations. The characteristic wave relations can be derived by a method called
method of characteristics, and applies to hyperbolic PDEs such as the Euler equations. The
method of characteristics is a technique to decouple a set of coupled partial differential equations
into a set of decoupled ordinary differential equations (ODEs), in order to solve the problem
more easily. The hyperbolic one-dimensional wave equation (eq. 2.6) is considered one of the
simplest hyperbolic equations, and is used in the next paragraph as an example to explain a
few important properties of hyperbolicity and the method of characteristics. The solution of
hyperbolic PDEs are considered “wave-like”, which means that disturbances made to the initial
conditions propagate at a finite speed (called characteristic speed ) trough space and time, and
hence, are not felt immediately in every point of the domain. In case of the one-dimensional wave
equation, the characteristic speed is equal to the sound speed c0 and couples both independent
variables x (space) and t (time), of which so-called characteristic curves (or just characteris-
tics) can be drawn ,originating from an initial condition in a diagram called the characteristic
18
diagram (see Fig. 2.3b). By using the method of characteristics a set of characteristic waves
(also called Riemann invariants) can be constructed, which are variables that are constant
along the accompanying characteristic curves. An expression for these characteristic waves are
comprised of the dependent variables, and their coefficients from the originating equation. For
the one-dimensional wave equation the characteristic waves f and g are given by equation 2.16.
f and g are equivalent to the same variables in equation 2.8 for the general solution to the wave
equation.
1 δp 1 δp
f= + δu g= − δu (2.16)
2 ρ0 c0 2 ρ0 c0
Where δp is the acoustic contribution to the pressure (or simply acoustic pressure), and δu
the acoustic contribution to the velocity (or simple acoustic velocity).
Characteristics and characteristic waves can also be shown graphically, as is done in Figure
2.3. In Figure 2.3a one can see the acoustic wave traveling to the right, and in Figure 2.3b one
can see the accompanying characteristic in the characteristic diagram.
The Euler equations are more complex than the above wave equation, and characteristic
analysis in section 2.3.1 will result in five different characteristics speeds and characteristic
wave expressions. The advantage of the method of characteristics is that different contributions
to the solution can be separated, of which each can be integrated in time via relatively easy
expressions to obtain the next value in time. As one will observe in the characteristic analysis
in section 2.3.1, two of the five characteristic wave expressions are essentially the same as the
characteristic wave expressions given in equation 2.16 for the wave equation, except for the used
NSCBC form being a function of the gradients of the primitive quantities pressure and veloc-
ity. The constructed non-reflective boundary condition, the NSCBC formalism exploits these
properties to calculate and set the pressure at the boundary for the next timestep accordingly.
More extensive analysis and a more detailed derivation of the NSCBC formalism is added
to the appendix.
19
2.3.1 Characteristic analysis
To be able to derive the characteristic wave relations, a modified version of the Euler equations
must be used. One might think that the use of the Euler equations to construct the NSCBC
method severely limits the types of flow that can be modeled, but this is not necessarily the
case as the NSCBC method is only used locally (near the boundary) to calculate and specify
boundary values, and does not bother with the calculation of the interior of the domain. The
approximation at the boundaries is accurate for flows that are pre-dominantly hyperbolic in
nature, which is the case for flows with a Reynolds number (see eq. 2.17) significantly higher
than one. In the asymptotic limit of Re → ∞, the momentum equation of the Navier-Stokes
equations leads to the hyperbolic Euler equations. On the other hand, if the Reynolds number
goes to zero, the flow is dominated by viscosity µ and will result in the elliptic Stokes equation
[24]. Often thermoacoustic devices use low viscocity fluids such as air or helium as a medium,
to minimize viscous losses, and so the approximation is justified. It is therefore possible to use
the full Navier-Stokes equations as the governing equations for the interior of the domain, and
use the NSCBC method based on the modified Euler equations to calculate the values at the
boundary.
ρU∞ L
Re = (2.17)
µ
Where U∞ is the free stream velocity, and L is the characteristic length of the domain.
In the characteristic analysis leading to the NSCBC formalism, Thompson modifies the one-
dimensional Euler equation in such a way that it fits the quasi-linear advection equation (see
eq. 2.18) [22]. This quasi-linear advection equation is a model equation often used to determine
if a system of PDEs is hyperbolic, and subsequently decouple the set of PDEs and put in
characteristic form.
∂Up ∂Up
+ A1 (Up ) =0 (2.18)
∂t ∂x1
Where Up denotes the primitive quantity vector instead of the conserved quantity vector
U, because it simplifies derivation [22]. The primitive quantity vector is given in the following
expression: Up = {ρ, p, ~u}−1 . What exactly constitutes “modified” in the modified Euler
equations are three assumptions and modifications, listed below.
2. Neglecting transverse terms, because else the system cannot be put in characteristic form
for mathematical reasons (see appendix). This basically results in a system with one
dominant direction of propagation: the x-axis.
3. Neglecting source terms because they do not significantly contribute to the analysis, and
only complicate matters.
A more detailed explanation about the assumptions, modifications (i.e. quasi-linear form)
and the full derivation of the characteristic form of the above modified quasi-linear Euler equa-
tion (eq. 2.18) is added to the appendix.
Eventually Thompson arrives at five expressions for the temporal derivative of the primitive
field quantities (see eq. 2.19). These temporal derivatives are a function of the so-called ampli-
tude variations Li , which are time variations in the amplitude of the characteristic waves (see
eq. 2.20). The amplitude variations are in their turn functions of the gradients of the primitive
quantities at the boundary. The complete set of equations given by equations 2.19 and 2.20 are
20
called Locally One-Dimensional Inviscid (LODI) relations.
∂ρ
∂t = − c12 [L2 + 12 (L5 + L1 )]
∂p
∂t = − 12 (L5 + L1 )
∂u1 1
∂t = − 2ρc (L5 − L1 ) (2.19)
∂u2
∂t = −L3
∂u3
∂t = −L4
∂p
L1 = λ1 ( ∂x1
− ρc ∂u
∂x1 )
1
∂ρ ∂p
L2 = λ2 (c2 ∂x1 − ∂x1 )
L3 = λ3 ∂u
∂x1
2
(2.20)
∂u3
L4 = λ4 ∂x1
∂p
L5 = λ5 ( ∂x1 + ρc ∂u
∂x1 )
1
The L1 and L5 amplitude variations are the relevant variations for the construction of a
non-reflective boundary condition. It is assumed that the non-reflective boundary is flat and
has a surface normal pointing outwards (of the domain) along the positive x-axis. If this is
not the case, the equations must be transformed in terms of a local coordinate system with
one coordinate perpendicular to the boundary. This does not add anything to the analysis,
but does require extra work, and is a potential source of error. Based on the aforementioned
assumptions, L1 is the amplitude variation of the incoming characteristic wave, and L5 of the
outgoing characteristic wave. In Figure 2.4 the incoming and outgoing amplitude variations of
the characteristic waves are visualized.
The temporal derivatives of the different primitive variables can be used in conjunction
with a numerical time integration scheme to calculate the values at the next timestep. These
variables can be set in a CFD code to provide a Dirichlet boundary condition. In the case of
a non-reflective boundary condition, the most ideal primitive quantity to set is the pressure,
because of two reasons. The first being the fact that only the “acoustic” characteristics L1 and
L5 are used the specification of the temporal derivative of the pressure. The second reason is
that specifying the pressure instead of the velocity at an outlet boundary condition is consid-
ered more stable in ANSYS CFX [23]. However, this does not restrict non-reflective boundary
conditions to be of the “pressure outlet” type, velocity specified and other type of boundaries
could also be created based on the NSCBC method.
As L1 is the amplitude variation of the incoming, and thus reflected, wave, it should ideally
be zero in a non-reflective outlet boundary condition. By explicitly assigning a value of zero
to L1 , and calculating L5 via one-sided differences of the gradients of the pressure and velocity
near the boundary, an expression for the time-derivative of the pressure for a non-reflective
boundary condition is constructed.
21
2.3.2 Determination of outgoing wave amplitude variation
The method based on the LODI relations to determine the outgoing amplitude variation L5
is not the only method of determining L5 . Another method to determine L5 uses a slightly
different, but equivalent, expression for the characteristic wave f (eq. 2.21, based on eq. 2.16).
The characteristic wave f , which now has units of velocity (m/s), cannot be determined at the
boundary because both values for pressure and velocity are needed. As the whole boundary
condition is constructed such that pressure is specified, the pressure itself cannot be used in
calculating the pressure, because it would create an infinite recursive loop. The pressure and
velocity is retrieved on a sample plane near the boundary, and offset in time (using the sound
speed) towards the boundary. The method is not mentioned by Thompson [22] and Poinsot
[15], but mentioned by Polifke [16] in conjunction with the Plane-Wave masking method.
1 δp
f= + δu (2.21)
2 ρ0 c0
The quantities used in the expression for characteristic wave f are not pressure and velocity,
but the acoustic pressure and velocity. These quantities cannot be directly retrieved from the
flow solution, and must be derived from expressions. The expressions for determining the acous-
tic contributions of the pressure and velocity are the same as used in the Plane-Wave masking
method, and treated in section 2.5.
The most used, and relatively simple, solution to the problem is the Linear Relaxation
Method (LRM) [15][17]. This method is also used by ANSYS CFX in its NRBC to prevent
pressure drift [26]. In the LRM method, the expression for L1 is adjusted to include a term that
restores a deviation from a target pressure, represented by p∞ (eq. 2.22). The target pressure
p∞ , sometimes called the far-field pressure, is the pressure to which one wants the pressure
to be restored. The relaxation factor K is a factor that represents the amount by which the
deviation is restored.
L1 = K · (p − p∞ ) (2.22)
Of course, this term will by definition cause reflections. The non-reflective boundary con-
dition using the LRM method for specifying L1 will always be a compromise between drift
(convergence) and reflection. The better the target pressure is enforced using relaxation factor
K, the higher the reflection coefficient R (eq. 2.14), and vice versa. But also frequency plays
a part, the higher the frequency, the less time the LRM term has to correct the deviation in
pressure, resulting in a lower reflection coefficient, while for a low frequency the LRM term
can easily correct for the pressure deviation within the period of the wave, and results in a
higher reflection coefficient. Selle devised an analytical expression to determine the theoretical
complex reflection coefficient R as a function of frequency (see Fig. 2.5) [17]. The magnitude
22
||Rtheo || and phase ψ of the complex reflection coefficient R are given by equation 2.23.
1 2ω
||Rtheo || = q and ψ = −π − arctan( ) (2.23)
1 + ( 2ω 2 K
K)
ANSYS CFX uses an expression proposed by Selle to determine an optimal relaxation factor
K (eq. 2.24) [17]. The parameters that can be used to determine the optimal value for K are
the free stream mach number M, the sound speed c0 , a characteristic length L, and a coupling
parameter σ. The scaling method from Selle is based on domain dimensions and eigenfrequen-
cies of the domain. Two optimal coupling parameters σ are mentioned by Selle, a value of 0.58
based on numerical simulations, and a value of 0.27 based on theory. See appendix for more
information.
(1 − M2 )
Kopt = σ (2.24)
L
The ANSYS CFX NRBC is tested and compared to the theoretical values by Oosterhuis
[14]. Results showed a good agreement with theoretical values for higher relaxation factors, but
showed a significantly higher reflection coefficient for lower relaxation factor. Proposed hypoth-
esis for the phenomenon where a loss in accuracy due to numerical discretization schemes used,
and a built-in mechanism in ANSYS CFX that is deliberately adjusting the boundary values
to prevent pressure drift and convergence problems.
23
L1 = K · (p − p∞ − ρ0 c0 f ) (2.25)
The acoustic pressure and velocity cannot be directly retrieved from the flow solution. To
determine the acoustic pressure and velocity, Polifke et al proposes to separate the pressure
into three different contributions (see eq. 2.26). Where p0 is the mean pressure, δp is the
acoustic pressure, and p0 is the turbulent component of the pressure. The velocity u is separated
analogously in equation 2.27.
f ≈ hf i (2.28)
Then Polifke reasons that if the turbulent length scale is sufficiently small, the area average
of the turbulent contribution to both pressure and velocity practically vanishes (see eq. 2.29).
No turbulence models will be used in the setup of the numerical problem, and thus this is indeed
the case in this report (see Chapter 3). With the turbulent contribution assumed to be zero,
equations 2.26 and 2.27 can be rewritten for the area averaged acoustic pressure and velocity
(see eq. 2.30).
∂g ∗
L1 = K(p − ρc(f + g ∗ ) − p∞ ) − ρc (2.32)
∂t
24
From an arbitrary reflection coefficient, or equivalently, impedance (see sec. 2.2), an external
perturbation g ∗ with the desired properties mimicking the aforementioned reflection coefficient
can possibly be obtained. Possibly, because for certain reflection coefficients that are a function
of multiple frequencies, the process of determining g ∗ can become very difficult, of which the
details will be explained in section 2.6.1 and 2.6.3.
To construct g ∗ , first the definition of the reflection coefficient 2.14 in the frequency domain
is rewritten with the backward traveling wave ĝ expressed as the product of the reflection
coefficient R and the forward traveling characteristic wave amplitude fˆ in equation 2.33.
gb(ω)
R(ω) = → gb(ω) = R(ω)fb(ω) (2.33)
fb(ω)
Then the product (eq. 2.33) is transformed to the time domain using the property that a
product of two functions in the frequency domain is equivalent to a convolution in the time-
domain, resulting in equation 2.34. Where τ is a time coordinate, comparable to t. The integral
is evaluated from 0 to ∞ instead of −∞ to ∞, because values for τ lower than 0 correspond to
future values, which are not available in the present. This is equivalent to stating the system
must be causal in time.
Z ∞
g(t) = (R ∗ f )(t) = R(τ )f (t − τ )dτ (2.34)
0
The evaluation of a convolution integral (see eq. 2.34) is computationally very expensive
and difficult. To be able to solve this convolution integral, equation 2.33 is converted into the
Laplace domain by exchanging the arguments via the relation s = iω, and the Z-transform is
used to solve the equation at discrete timesteps. The Z-transform is also called the “discrete
Laplace transform”, and allows for a relatively efficient evaluation of equation 2.33. Using the
Z-transform, equation 2.33 can be rewritting in the z-domain as equation 2.35. It is then as-
sumed that R(z) can be approximated by the transfer function syntax in equation 2.36.
a0 + a1 z −1 + a2 z −2 + . . . + an z −n
R(z) = (2.36)
1 − b1 z −1 + b2 z −2 + . . . + bm z −m
The expression for R(z) in equation 2.36 can be substituted in equation 2.35, and rewritten
into equation 2.37. By using the time shift property of the z-transformation (see eq. 2.38) one
arrives at a time-domain expression for the external perturbation g ∗ in equation 2.39.
Equation 2.39 is rewritten in short summation notation in equation 2.40, and expressed in
time t and time increment ∆t.
n
X m
X
g(t) = ai f (t − iδt) − bj g(t − jδt) (2.40)
i=0 j=1
25
Which is the sum of the present and past incoming and outgoing characteristic wave ampli-
tudes multiplied by a constant. The constants are called filter coefficients, and are determined
based on the desired complex reflection coefficient as a function of frequency in a process called
complex-curve fitting, which is discussed in section 2.6.1.
ψ
tdelay (f, φ) = ( ) · f −1 where ψ = phase(R) [rad] (2.41)
2π
From equations 2.41 and 2.42 the filter coefficients needed to mimic an acoustically hard
wall (R = 1) and pressure release surface (R = −1) can also be obtained (see sec. 2.2). For an
acoustically hard wall the reflection coefficient has no phase, and thus time delay, and results
in setting filter coefficient a0 to 1. For a pressure release surface the phase ψ is −π, resulting
in a time delay of half the period of the incoming wave. For a non-reflecting outlet the filter
coefficients are all zero.
In the construction of filters based on the transfer function (eq. 2.36) two types of filters
can be distinguished:
26
Figure 2.7: Coefficient fit for a short duct [9]
Infinite Response Filter (IIR): History of both inputs and outputs are considered (ai , bi 6=
0).
Finite Response Filter (FIR): Only the history of the inputs are considered (ai 6= 0, bj = 0).
FIR filters are naturally stable and easier to fit (discussed in section 2.6.3). The IIR filters
can be unstable, but need (far) less historical information and are more accurate. The merits
of both filters will be investigated for constructing a TD-IBC in chapter 3.
z = r · ejωn (2.44)
The complex argument ωn can be seen as a normalized frequency, which runs from 0 to π for
the causal discrete time systems in question. The frequency of the sampled wave f is normalized
by the sampling frequency fs (fs = ∆t−1 ) (see eq. 2.45). The Nyquist frequency states that
the frequencies above 0.5 times the sampling frequency aliases with lower frequencies, and can
therefore not be uniquely distinguished. From this fact the upper bound of π (in radians) can
be understood, as it corresponds to the maximum frequency that can be uniquely identified on
the grid.
f
ωn = · 2π [rad/sample] (2.45)
fs
27
more difficult. However, it might not lead to stability problems if the frequencies corresponding
to the poles are hardly or not present in the domain. Also, as FIR filters have no poles by defi-
nition, they are more stable. Results by Polifke showed that stable results can be obtained via
this method with the numerical results within an error margin of around 3% for laminar flow [9].
The multi-microphone method is discussed briefly in section 2.7.1. All three methods are
discussed in more detail in the appendix.
The linear system of equations, that will be constructed later on, is based on the solution
of the Helmholtz equation (eq. 2.12). Matters are simplified by introducing a new spatial
coordinate d originating from the boundary with the relation L − d = x (see Fig. 2.8), and
recognizing that δ p̂+ = A · e−ikL and δ p̂− = B(f ) · eikL (evaluated at the boundary). This
results in the solution of the Helmholtz equation given by equation 2.47.
28
δ p̂(di , f ) = p̂+ (f )eikdi + p̂− (f )e−ikdi (2.47)
Using the known pressure amplitude spectra of the microphones an overdetermined linear
system of equations of the form A~x = ~b can be constructed (eq. 2.48). The known pressure
amplitudes δ p̂1 ,δ p̂2 ,..., δ p̂n are in the right-hand side (RHS) vector ~b. The coefficient matrix A
consists entirely of complex powers of the euler number e. The only unknowns are δ p̂+ and δ p̂−
in the ~x vector.
e−ikd1
ikd1
e p̂1
eikd2 e−ikd2 p̂+
p̂2
...
= (2.48)
... p̂−
...
eikdn e−ikdn p̂n
The overdetermined system is solved for ~x using matrix inversion. But because A is not a
square matrix, an inverse A−1 of the matrix in the general sense cannot be created. The problem
is solved by using a so-called Moor-Penrose pseudo-inverse A+ of A, which is determined using
a least-squares method (eq. 2.49).
~x = A+~b (2.49)
Sensor positioning has an influence on the sensitivity to measurement errors, and is quan-
tified in the Singularity Factor (SF). The lower the SF value, the lower the estimation error.
Seung-Ho et al showed that the SF is minimal when an equidistant spacing between micro-
phones is used [18]. In this case of equidistant sensor spacing, the optimal ratio of the wave
number corresponding to freqeuncy to be measured, over the critical wave number kcr , is 0.5.
Using this formula, and the known design frequency, the optimal microphone spacing can be
calculated using the formula given in equation 2.50.
29
Chapter 3
Method
The TD-IBC must be tested against a well-defined numerical problem. This numerical prob-
lem consists of a discretized domain, boundary conditions, initial conditions, fluid models, and
other properties such as spatial and temporal integration schemes. Time discretization, space
discretization, and boundary conditions are discussed in section 3.1. Fluid models and initial
conditions are discussed in section 3.2. The actual implementation of the TD-IBC in ANSYS
CFX using FORTRAN subroutines is discussed in section 3.3. The manner in which the reflec-
tion coefficient R is determined is discussed in section 3.4. Lastly an overview and reasoning
behind the test cases is discussed in section 3.5, of which the results are discussed in the next
chapter, chapter 4.
Figure 3.1: Wavelength of excited wave at fin = 100Hz w.r.t. domain size L = 4m
The applied boundary conditions are discussed in section 3.1.1, and the space and time
discretization is discussed in section 3.1.2.
30
3.1.1 Boundary conditions
An overview of the applied boundary conditions is given in Figure 3.2. At the inlet a sinu-
soidally variying velocity of fin = 100Hz is specified. The choice for the excitation frequency is
somewhat arbitrary, as spatial and temporal discretization can easily be adjusted to account for
different frequencies. However, an excitation freqeuncy of 100Hz is also often used in literature
by Oosterhuis and Bühler, which aids in the comparison of results [14][3]. The other bound-
aries at the sides of the domain are symmetry boundaries, used to emulate a one-dimensional
problem. The solver in ANSYS CFX cannot be set to use a one-dimensional set of equations,
regardless of domain shape and settings, ANSYS CFX always uses a three-dimensional set of
equations to solve the problem at hand. The boundary on the right side of the domain is the
pressure specified TD-IBC boundary condition.
The sinusoidally varying velocity is specified according to equation 3.1, using Command
Expression Language (CEL) in ANSYS CFX.1
u = u0 + ua · sin(2πf t) (3.1)
31
In accuracy however, it is a factor. The solver used by ANSYS CFX is implicit, however, the
implemented boundary conditions later on are explicit (see sec. 3.3). To rule out any conver-
gence problems due to the CFL number being to high, a maximum CFL number CF Lmax = 1
is chosen.
uphys · ∆t
CF L = < CF Lmax (3.2)
∆x
Next, the maximum physical speed at which information travels in the governing problem
needs to be determined. Mean flow velocity u0 and the acoustic velocity amplitude δ û will be
relatively small compared to the sound speed c0 = 346.13m/s in the test cases defined in section
3.5 (see sec. 3.2). The sound speed c0 is therefore the limiting physical velocity uphys . Taking
an acoustic CFL number CF Lacoustic ≤ 1, and keeping the minimum criteria for the element
size and timestep discussed at the beginning of this section in mind, a conforming element size
∆x = 4 · 10−3 m and a timestep ∆t = 1 · 10−5 s is chosen. The minimum and maximum design
criteria leave room open to adjust the element size and timestep, therefore rounded numbers are
chosen to minimize user error in calculations and derivations, and maximize readability. The
resulting discretized domain is visualized in Figure 3.3.
For the spatial discretization of the domain, perfectly cubical elements are chosen.3 All
elements of size ∆x = 4 · 10−3 m in each direction fit exactly 1000 times within the domain
of L = 4m, resulting in perfect mesh quality for different ICEM mesh quality checks, such as
determinant, volume, angle, and warpage [1]. ICEM software is the software used to create the
mesh. A timestep of ∆t = 1 · 10−5 s results in 1000 timesteps per wavelength for a frequency
of fin = 100Hz. The element size ∆x = 4 · 10−3 m results in 857.5 elements per wavelength
λ100 = 3.43m. Both well above the set minimum of 100 elements per wavelength set out at the
beginning of this section.
3
A cube is a form of a hexahedron element: a regular hexahedron with all faces square.
32
The PWM method as well as the TD-IBC need a characteristic wave amplitude f to be de-
termined at a sample plane near the boundary (see sec. 2.5 and 2.6). The sample plane should
be far enough from the boundary to prevent feedback caused by the used schemes (stencil), but
close enough so that the f determined at the sample plane is very close to the actual f when it
hits the boundary (especially amplitude attenuation due to viscous losses). Viscous losses will
be neglected in the heat transfer equations because its influence can hardly be measured (see
sec. 4.1.1). The sample plane is placed at a distance xpwm = 0.4m, or 100 elements, from the
boundary, which should be out of reach for any stencil. See Figure 3.4 for placement of the
boundary within the domain.
Preliminary tests showed that increasing time increment ∆t, until less than 100 timesteps
per period are attained, indeed caused significantly worse results, and even stability issues (i.e.
unusable results), as is predicted by Bühler [3]. The hypothesis is that increasing the mesh
linearly near the boundary will result in a better reflection coefficient R, as the gradients for
pressure and velocity near the boundary might be determined more accurately by ANSYS CFX,
i.e. the discretization error near the boundary decreases. However, a smaller ∆x also increases
the CFL number near the boundary, and causes the hexahedron elements to be non-cubical,
which might decrease accuracy and cause stability problems as mentioned earlier in this section.
See test-cases in section 3.5.4 for the test-cases including linear refinement.
The mesh is linearly refined from a distance of xref ine = 0.4m towards the boundary (see
Figure 3.5). Instead of 100 elements within this section, now 300 elements are used, totaling
1200 elements for the complete domain. The last element against the boundary has a edge ratio
of 1/5, meaning that the x-length of the element is ∆xmin = 0.0008m.
33
3.2 Fluid models
The fluid used as a medium in all test cases is air, and its properties vary according to the ideal
gas law. No turbulence model is used in the simulations, as it is not a fundamental part in
describing acoustic waves, making the flow problem purely laminar.
The initial velocity is equal to the inlet velocity at initialization (eq. 3.1) to prevent dis-
continuities at initialization. The inlet velocity at initialization (t = 0s) is always equal to the
mean velocity u0 due to a sine function being 0 when the argument is zero. The mean velocity
is set per test case, which are defined in section 3.5.
r
γp0
c0 = (3.3)
ρ0
In ANSYS CFX calculations can be done both with a heat transfer equation and without
(isothermal). Using the heat transfer equation, the acoustic waves will behave adiabatically.
Depending on the heat model that is used, there are consequences for the boundary specifica-
tion of the temperature. For isothermal calculations the temperature does not vary throughout
the domain, and need not at the boundary (i.e. constant temperature boundaries). It is a
different story when a heat transfer equation is used. The acoustic waves vary in temperature
cyclically through each period. This temperature variation should also apply to the boundary
condition to prevent reflections. The temperature can be varied on the boundary by using the
adiabatic equation for temperature variation given by equation 3.4, derived from the ideal gas
law (eq. 2.4).
34
γ−1
P2 γ
T2 = T1 (3.4)
P1
Preliminary tests showed that varying temperature using this adiabatic temperature vari-
ation equation (eq. 3.4) resulted in large pressure drift and large reflection coefficients. An
explanation could be that even though the acoustic wave behaved adiabatically, in reality al-
ways some losses and heat transfer to neighboring fluid parcel occurs. Another explanation
could be that something goes wrong in the coupling between boundary values and internally
calculated temperatures. Fortunately, the option exists in ANSYS CFX to specify an opening
pressure at initialization, and let the solver do the calculations using conservation laws. The
results improved significantly, but does still have some slight problems with pressure drift com-
pared to isothermal calculations (see sec. 4).
Two types of heat transfer equations can be used in ANSYS CFX to take into account the
varying temperature, ”Thermal Energy” and ”Total Energy”. The thermal energy equations
only convects enthalpy h with the flow, while the total energy equations also adds kinetic energy
0.5 · u2 (needed for example to take into account stagnation temperatures). The total energy
equation also automatically includes the pressure transient term in the set of equations, while
for the thermal energy equation it is an option. The total energy heat equation is generally
used for high speed flow problems (M > 0.3) [23].
Both heat transfer equations have the options of including viscous work terms in ANSYS
CFX. This option adds the viscous work term to the energy equation, necessary when large
viscous shear forces are to be expected. Viscosity is expected to have a very small influence
because the domain is small compared to the wavelength and sound speed, and the flow field
is laminar (no turbulent viscosity losses). Viscosity causes a decay in amplitude of the acoustic
wave over distance traveled. It can also influence the coupling between acoustic pressure δp
and acoustic velocity δu, which is assumed in phase in many equations (e.g. in the linearized
wave equation, eq. 2.7). The difference is tested in a pragmatic manner by running the same
simulation with the viscous work terms both included and excluded, and comparing the solution
of the flow field via the reflection coefficient R (see sec. 3.5).
The thermal energy equation also has explicitly the option to include a pressure transient
term for describing the influence of the time-varying behavior of the pressure on the tempera-
ture. In the total energy equation it is automatically included. This pressure transient term is
essential for acoustic waves which behave adiabatically (and has a varying temperature). The
influence of this term is also tested (see sec. 3.5).
The theoretical amplitude of the resulting pressure wave p̂ throughout the domain is different
for the isothermal and the thermal energy case because the sound speed differs. The sound speed
c0 can be calculated using equation 3.3, and results in 346.21m/s and 295.86m/s for thermal
energy and isothermal calculations respectively. The pressure will, as a linear approximation,
vary in space as a sine according to equation 3.5.
x
δp = p̂ · sin(2π ) (3.5)
λ
To verify the calculations in ANSYS CFX, it is also important to check if the expected
amplitudes of the pressure and velocity gradients match the theoretical values. As the gradients
are of crucial importance in the LODI-relations (eq. 2.19). By differentiating eq. 3.5 in x using
the chain rule, the resulting expressing for the pressure and velocity gradient can be derived
(eq. 3.6 and eq. 3.7).
35
x 2π
δpx = p̂x · sin(2π ) where p̂x = p̂ (3.6)
λ λ
x 2π
δux = ûx · sin(2π ) where ûx = û (3.7)
λ λ
The properties that pertains to the difference in isothermal and heat transfer equation sim-
ulations are summed up in Table 3.2. The wavelength λ is calculated using the well-known
formula that relates wavelength, frequency, and sound speed in linear media: c = f · λ.
36
1. User (Defined) CEL function: Function that can be called using standard CEL rules.
Solver determines when and how often the subroutine is called.
Both type of subroutines are used in the developed boundary conditions. A total of three
subroutines are used to construct both boundary conditions (NRBC and TD-IBC), two of which
are junction box routines, and one a user CEL routine. The user CEL subroutine is used to
return the pressure, and is automatically called by the solver during its solution process. The
two junction box subroutines are called only at certain stages within the solution process, of
which both positions are given in Figure 3.6. The User Input junction box is only called once,
at the start of the simulation, while the End of Timestep junction box is called at the end of
every timestep when the solution is converged.
The PLinit subroutine at the junction box location User Input creates data areas and
directories, retrieves user parameters, and checks if some important prerequisites for the code
to work are met. The user CEL function Pset sets the pressure at the current locale. To
calculate the returned pressure (to the solver), the subroutine retrieves gradient values for
pressure and velocity, historical information from memory, and does time integration various
quantities. The junction box routine PTloop at the junction box location End of Timestep
calculates the pressure to be set the next timestep and reorders memory, as well as retrieving
area averaged quantities to calculate characteristic wave f .
Figure 3.6: Junction box and user CEL locations of subroutines used.
Note that the graph in Figure 3.6 is not a depiction of all of the available junction box
routines in ANSYS CFX, which far exceeds the shown, but merely shows junction box locations
relevant to the programmed code. See ANSYS CFX docomumentation for all junction box
locations [23].
37
3.3.2 Parallelization
Often multiple processors are used at once to solve a numerical problem that places stringent
demands on computational power within a reasonable time-frame. If the developed boundary
conditions are to be used in such a setting in the future, it is important that they are compat-
ible with running on multiple processors. This is however not as straightforward as it might
seem, especially memory allocation might create problems when constructing the subroutines
in FORTRAN.
ANSYS CFX runs on the Single-Program-Multiple-Data (SPMD) model for distributing
memory. Before the solver starts with the solution routine, the computational domain is split
into many regions. Each region, called locale, is assigned to a different (partition) process
and is handled by a certain processing core. One process is called master, and the rest of the
processes are called slaves. This distinction between master and slave is important in memory
management, because the user-data memory is not shared among processes (see sec. 3.3.4).
Regardless of the type of partitioning that is chosen in ANSYS CFX, both Message Passing
Interface (CHameleon) (MPI(CH)) and Parallel Virtual Machine (PVM) do not result in a
shared memory model for user-data.5
Figure 3.7: Difference “every partition” and “master only” memory handling
Based on the junction box location, or user CEL routine, at which the subroutine is called,
the solver handles memory management differently. Distinction is made between “Every Par-
tition” and “Master only” memory management, which is visualized in Figure 3.7. “Every
partition” means that subroutine called from a partition has its own memory assigned space
throughout the simulation. From this subroutine variables set on other partitions cannot be
read or changed, and vice versa. “Master only” means that when the subroutine is called, the
user-data memory area of the master process overwrites the user-data memory of slave processes.
Any change in the user-data memory will only hold until such a “master only” subroutine is
called. As can be seen from Figure 3.6, the PLinit subroutine at junction box location User
Input is of type “Master only”. The PLinit subroutine is thus only called once from the master
process in a parallel environment, and written data in memory is automatically copied to the
slave processes at the end of the routine. the PTloop subroutine at junction box location End
of Timestep is of type “Every partition”, and is called on every partition once every timestep.
5
The difference between parallel models are discussed in theANSYS CFX solver modeling guide [23]
38
The user CEL function is always of “Every partition” type. However, this type of memory man-
agement does not need to be a problem, but should be taken into account when programming.
The subroutine PTloop called at junction box location End of Timestep determines for each
partition if any data is stored in its user-data area, and does the calculation for this partition.
A boundary condition patch is subdivided multiple in boundary element groups, which com-
prises of element faces that coincide with the boundary. These element faces each have one face
centre (BCENTRE), and, depending on the type of element, multiple boundary integration
points (BIP). In the domain model (see sec. 3.1) cubical elements are used with quadrilateral
faces. The quadrilateral faces that coincide with the boundary have one BCENTRE and four
BIPs, of which the placement is shown in Figure 3.8.
39
Figure 3.8: Integration points and Element center, left: quadrilateral element, right: triangular
element
The Pset routine is only called from these BIP and BCENTRE entities from within a bound-
ary element group (BELGn), other entities are not used directly in the developed subroutines.
The velocity and pressure gradient are needed to construct the amplitude variation L5 based on
the LODI relations (see sec. 2.3.2). The built-in ANSYS CFX boundary condition uses BIPs
for retrieval of the pressure gradient, and BCENTREs for retrieval of the velocity gradient, for
reasons that are not known publicly [19].
40
Depending on the value of the decimal number to be stored, single precision numbers give 6
to 9 significant decimal digits precision, while double precision numbers give 15 to 17 significant
decimal digits precision. When multiplying or adding numbers orders of magnitude apart, the
error in the resulting number can be substantial. This is often the case when multiplying a
time derivative with a very small time increment to retrieve the value at the next time step. Or
when adding a small pressure increment onto the current pressure. These type of mathematical
operations occur in the FORTRAN subroutines written. This results in an error that adds up
every timestep, and can cause the pressure to drift significantly, or even become unstable.
More details about single and double precision numbers are added to the appendix.
To alter data on the stacks, first a pointer to the data area in question needs to be retrieved.
A pointer is an integer data type memory address to the first value of the data structure it points
to. By using a MMS function called LOCDAT, and the MMS path as argument, a pointer can
be retrieved. Multi dimensional arrays are stored as a one-dimensional vector in memory, with
all memory positions reserved in one consecutive data area. For a 2D matrix A of size V × W ,
each cell A(I, J) can be accessed on stack DZ using pointer pPOINT (see eq. 3.8). This is
done in a row for row fashion. For example, for a 4 × 3 matrix A cell A(3, 2) can be accessed
on the stack via eq. 3.9. Pointers are, by convention, written starting with a small p.
41
Figure 3.10: Memory structure used in subroutines
42
3.3.6 Initialization routine
The PLinit routine, of which the flowchart is shown in Figure 3.11, is equal for both the non-
relflective (with or without PWM) and the TD-IBC implementation, except for a few added
user parameters in the case of the TD-IBC. In the first section of the code the user parameters
are retrieved and stored in the MMS. Also other important variables and directories are created.
The second section retrieves global mesh information, such as the number and names of zones in
the problem definition. These are needed for certain utility routines in the other two developed
subroutines PTloop and Pset. If there is more than one zone, the exit-sequence is called. More
than one zone means that multiple domains are defined, which is not supported. The exit-
sequence stops the code, and signals to the solver that it needs to stop the simulation. In the
zonal mesh info section the number and names of BCPs are retrieved, and checked for the “LRM”
prefix needed to mark which boundary is designated to function as a non-reflective or TD-IBC
boundary. If no boundary is found, the exit-sequence is called. The LRM BCP mesh info
section checks which physical type (“OUTLET”, “WALL”, etc) the designated LRM-boundary
has. Only “INLET”, “OUTLET”, and “OPENING” are supported, or else the exit-sequence is
called. The next section is the Zonal Phase Info section that checks if only one phase is present,
as multi-phase flow is not supported in the code. If multi-phase flow is present, the exit-sequence
is called. The last section stores information retrieved regarding the defined problem, such as
domain names, BCPs, and Phase names.
43
44
Figure 3.11: Simplified PLinit subroutine flowchart
45
3.3.7 Non-reflective part
The non-reflective part uses the LODI method to construct amplitude variation L5 , which is
distinct from the TD-IBC part that uses the characteristic wave f retrieved from a sample
plane near the boundary (see sec. 2.3.2). The PTloop and Pset subroutines are more distinct
for both the non-reflective and TD-IBC boundary conditions. The flowchart representing the
PTloop routine is given by Figure 3.12. The orange part is the TD-IBC specific part, the rest is
equal for both boundary conditions. The flowchart in Figure 3.13 is the Pset subroutine for the
non-reflective boundary condition. The LRM and PWM methods are both implemented in the
non-reflective boundary condition, but can be used or neglected based on the user parameters
given. By specifying a relaxation factor K = 01/s, the LRM method is effectively not used. The
inclusion of the PWM term is controlled by the PWM flag in the user parameters, which can
be set to 0 (off) or 1 (on).
3.3.7.0.1 PTloop subroutine description The PTloop subroutine described by the flowchart
in Figure 3.12 is called at the end of each timestep on every partition. First, transient data
such as the timestep and time increment ∆t are retrieved and stored, then it is checked if the
subroutine is in its initial phase (meaning first timestep in the simulation). If the subroutine
is in initial phase, an array that holds data concerning the characteristic wave f sampled on
the sample plan is constructed. How this array is constructed is discussed in section 3.3.8.2.
Then the ISINIT boolean flag is set to false, so the arrays in question are not constructed again
within this partition. As data is stored in memory according to the SPMD model (each partition
isolated), it is checked (using LCALS ) if the current partition is tied to the BCP in question
(and thus holds any relevant data). If it is not tied to the LRM BCP, the routine exists and the
solver continues. Next a memory optimization routine is performed, of which the details are
explained in section 3.3.7.2. In the “Calculate new FAMP” section, the characteristic wave f is
calculated using area average pressure and velocity at a sample plane near the boundary. (see
sec. 3.3.8.1 for more details). The last section is TD-IBC specific, and is explained in section
3.3.9.
46
.
47
Figure 3.12: Simplified PTloop subroutine flowchart
48
Figure 3.13: Simplified Pset subroutine flowchart (NRBC version)
49
3.3.7.1 Time integration
As only temporal derivatives of the pressure are given by the LODI relations (see eq. 3.10),
the pressure derivative must first be integrated using a numerical time integration scheme to
determine a pressure value to be set at the next timestep.
∂p 1
=L where L = − (L5 + L1 ) (3.10)
∂t 2
Z t+∆t
n+1 n
p =p + L dt (3.11)
t
Different time integration schemes can be used to approximate the integral in (3.11), the
simplest being explicit forward (eq. 3.12) and implicit backward Euler (eq. 3.13).
The Euler method is only first order in time, and the accuracy and stability might bene-
fit from higher order schemes. Well-known integration schemes such as Runge-Kutta will not
work, because one can use a Euler-Forward predictor to predict p(n + 12 ), but is not able to
evaluate L at future timesteps, because L does not depend on t and p explicitly. However, for
more accuracy (lower truncation error), one can use higher order backward (finite) differences
to approximate the time derivative, and a predictor of L at n + 21 .
4 1 2 1
pn+1 = pn − pn−1 + ∆t · L∗ (n + ) + O(∆t2 ) (3.14)
3 3 3 2
18 n 9 2 6 1
pn+1 = p − pn−1 + pn−2 + ∆t · L∗ (n + ) + O(∆t3 ) (3.15)
11 11 11 11 2
The time integration schemes given by equation 3.14 and 3.15 are second order and third
order respectively. These higher order integration schemes also require more historical informa-
tion, and thus higher memory requirements. The L∗ (n + 21 ) term is a predictor for the LODI
function at n + 21 , created by using either a (explicit) Lagrange polynomial extrapolation (see
eq. 3.16), or by using an implicit predictor by taking the average left and right of n + 12 (see
eq. 3.17).
1 3 1
L∗ (n + ) = L(n) − L(n − 1) (3.16)
2 2 2
1 1
L∗ (n + ) = (L(n) + L(n + 1)) (3.17)
2 2
Using the implicit predictor for L∗ (n + 12 ) (see eq. 3.17) results in a Crank-Nicolson scheme.
The caveat is how to evaluate L at n + 1, which is not known yet at the beginning of the
timestep. By using a predictor for L(n + 1) at the beginning of the timestep and first coefficient
loop iteration (for example, constant extrapolation: L(n) = L(n + 1)), the loop can be started
and at the second loop the value for L(n + 1) can be calculated on the boundary. This is a
semi-implicit scheme which uses the latest information available.
50
3.3.7.2 Memory optimization
As can be seen in section 3.3.7.1, more historical information is needed at the boundary for
higher order time integration. For a third order approximation of the pressure derivative, pres-
sure data is needed at n, n − 1, and n − 2, and for function L it is L(n) and L(n − 1). This will
most probably causes no big increase in memory requirements, because the number of nodes at
the boundary increases by an order of 2, while the number of nodes in the interior increases by
an order of 3. And when the domain is very small, memory requirements are usually not an
issue. Not only memory requirements increases, but also memory operations if the data is just
shifted over each timestep loop. The number of memory operations can be reduced by using a
modulo operation (see Fig. 3.14).
At each timestep a new pressure needs to be calculated, but the pressure at n − 1 in memory
is not n − 1 anymore (as was the previous timestep), so the value must be moved to n − 2,
and n − 2 to n − 3, and so on. For a third order scheme three memory operations must be
performed per node to store the new value. Each arrow in the Figure (3.14) represents an
operation. By using a new way of managing the memory locations, this can be reduced to just
one. By taking the modulo of 3 (three locations) for timestep n, the correct memory location (0,
1, or 2) for the storage of the new pressure can be determined at the beginning of each timestep.
51
(e.g. boundaries) and 3D regions (e.g. domains). However, one cannot just create an arbitrary
2D region within the mesh. The mesh needs a face to work on, and this cannot be an internal
element face. The approach is to create two blocks in a mesh editor (e.g. ICEM), and create
a named part from the interface between them (see Fig. 3.15). This interface (shown in red)
is used as the sample plane. In ANSYS CFX a 1:1 general connection interface needs to be
constructed, which automatically creates two boundaries. These are now two locations (on
exactly the same location) from which the area averaged field quantities can be retrieved. Also
the mean density and sound speed are needed, but these remain constant during the simulation
and are evaluated at initialization.
Figure 3.15: Plane-wave masking sample plane construction using blocks in ICEM
xpwm
tpwmdelay = (3.18)
c0
The characteristic wave f can only be retrieved at discrete time intervals, and is stored
in a vector of length nf , where nf is calculated by dividing the time delay tpwmdelay by the
time increment ∆t, and adding 1 (see eq. 3.19). If one would choose a fixed position in the
vector for the newest and oldest value (the oldest being the one that should be retrieved to
calculate L1 ), all data must shift one position every timestep, resulting in nf read and write
operations. By using a modulo operation the index of the newest and oldest data shifts one
cell (see eq. 3.20). This results in just one read and write operation per timestep (see Fig. 3.16).
tpwmdelay
nf = lower +1 (3.19)
∆t
52
3.3.9 Time-domain impedance boundary condition part
The TD-IBC part is constructed by adding the temporal derivative of an external perturbation
g ∗ to the amplitude variation L5 , which is determined through filter-methods and historical in-
formation about f and g ∗ (see sec. 2.6). How the filter coefficients are determined is discussed
in section 3.3.9.1. Next, an alternate formulation for L1 and L5 is discussed in section 3.3.9.2,
and in section 3.3.9.3) the storage of quantities and the calculation of the first time derivative
of g ∗ and f is discussed. In the last section (sec. 3.3.9.4) the TD-IBC specific user CEL routine
Pset is explained.
To assess if the filter coefficients will be stable, a pole-zero map is used (see Fig. 3.17 for
an example pole-zero map). Any pole (marked: ×) outside the unit circle in the complex plane
might cause unstable behavior. Preliminary simulations indeed show that filter coefficient sets
with poles outside the unit-circle indeed become unstable. Iterative runs, and slight adjusting
of the reflection coefficient and number of coefficients, might result in better positioning of the
poles, and is discussed in section 3.5.5.
∂f
L5 = − (3.21)
∂t
53
Figure 3.17: Pole-Zero map for R = 0.5 + 0.5i, o:zero, x:pole
the plane wave masking array, and stored in the TD-IBC array for f (see Fig. 3.18). Also g ∗
needs to be stored, but is calculated directly at the boundary using equation 2.40. The size of
both arrays for f and g ∗ are equal to the number of filter coefficients n used.
As can be seen from the expressions for L1 and L5 (see eq. 2.32 and 3.21), the time derivatives
of both f and g are needed. These are approximated using one-sided sixth order finite difference
expressions (see eq. 3.22). Which demands historical information of six timesteps back.
∂f 1 49 15 20 15 6 1
= ft − 6ft−∆t + ft−2∆t − ft−3∆t + ft−4∆t − ft−5∆t + ft−6∆t (3.22)
∂t ∆t 20 2 3 4 5 6
54
3.3.9.4 User CEL routine Pset for TD-IBC
The Pset subroutine for the TD-IBC differs from the NRBC version mainly in the manner in
which the amplitude variation L5 is determined (see sec. 3.3.9.2). The flowchart of the TD-IBC
version of the Pset subroutine is given in Figure 3.19. In the purple section of the flowchart
the forward and backward traveling characteristics f and g are retrieved (which were calculated
after each timestep in the PTloop subroutine using area averaged integrated quantities). From
these quantities the temporal derivatives are determined, which are used in the definition of L1
and L5 . The new pressure of the current timestep can be calculated using equation 3.10 and
3.11, which is subsequently returned to the solver.
55
Figure 3.19: Simplified Pset subroutine flowchart (TD-IBC version)
56
3.4 Reflection measurement
The multi-microphone method discussed in section 2.7.1 is programmed in Matlab using object
oriented programming instead of classing programming. This is done to make the code more
general, easier to understand, use, and extend by others. A class called MultiMicMethod is
written that stores all the data, and harbors all functionality. The class is structured in such a
way that other users can easily extend the functionality by adding methods to the class, or use
class inheritance and keep the original class intact.
Figure 3.20: UML diagram of MultiMicMethod Class (incomplete, see appendix for full UML)
The most important properties and methods are shown in the Unified Modeling Language
(UML) diagram in Figure 3.20. This is only a short list of important properties and methods,
the full UML diagram is added to the appendix. The work-flow in short, first an MultiM-
icMethod object needs to be created, and then the pressure time-series can be imported from
ANSYS CFX using the loadPArray function. The frequency spectrum for the pressure time
series for each microphone must be created using the calcFreqSpectrum function before one can
calculate the reflection coefficient R as a function of frequency with the calcReflection function.
With the function reflectionTargetFreq one can obtain the reflection coefficient nearest to the
given target frequency (as argument). Be advised that one has determined the positioning of
the pressure sensors such as to minimize the error in the Multi-Microphone Method for a given
frequency (see sec. 2.7.1). Further away from this “design” frequency the error in determining
the reflection coefficient R will increase. The plotReflection function plots the reflection coeffi-
cient as a function of frequency.
Losses due to turbulence and viscosity can also be taken into account using the MultiM-
icMethod class, but is not used in determining the reflection coefficient R in all the defined test
cases in section 3.5. The inclusion of viscosity in the heat transfer equations (see sec. 3.2.2)
resulted in a negligible difference in the non-viscous reflection coefficient and solution (see sec.
4.1.1), therefore only the non-reflective version is used. More detail about taking into account
losses in the multi-microphone method is added to the appendix.
57
3.4.1 Measurement in test-cases
In the test-cases defined in section 3.4.1 the reflection coefficient is measured using four equidis-
tant microphones per wavelength, as this is seen optimal according to MMM theory (see sec.
2.7.1). The wavelength varies depending on whether the simulation is performed isothermal,
or the heat equation is included (see sec. 3.2.2). The inclusion of a heat transfer equation
is imperative in thermoacoustics as the change in temperature is what drives thermoacoustic
devices. Therefore this wavelength of λ = 3.472m is chosen as a basis to calculate the micro-
phone spacing ∆xmic , which results in ∆xmic = 0.0825m (see Table 3.4 for absolute position
of microphones, coordinate x and d as shown in Figure 2.8). The pressure time-series of the
microphones are exported from ANSYS CFX to comma-separated values (CSV) format. These
timeseries are then used as input for the Matlab class MultiMicMethod which calculated the
reflection coefficient R based on the MMM method.
58
3.5 Test cases
Several test cases are formulated to test the performance and stability in different situations.
First general solver settings and convergence criteria are discussed in section 3.5.1.Then the rea-
soning behind the simulation time is discussed in section 3.5.2, and the relaxation factor K used
in the LRM term is discussed in section 3.5.3. Distinction is made between the non-reflective
and TD-IBC test cases. Not only the phase and absolute value of the reflection coefficient can
explicitly be set in the TD-IBC boundary, but also the way in which the non-reflective character
is being established is different (see sec. 3.3.9.2). The non-reflective boundary test-cases are
discussed in section 3.5.4, and the TD-IBC test-cases are discussed in section 3.5.5.
59
Table 3.5: K values and corresponding σ values for a mean flow u0 = 0
K 100 101 23 50 102 2 · 102 5 · 102 103 104 105
σ 0.0115 0.1152 0.2650 0.5760 1.152 2.304 5.760 11.52 115.2 1152
Before the standard test cases are performed, first the influence of different time integration
schemes and the type of heat transfer equation are analyzed. The time integration schemes (see
sec. 3.3.7.1) are tested using the total energy heat equation without the viscous work term, and
a relaxation factor of K = 501/s, and are summed up in Table 3.7.
The influence of the heat transfer equation, and their options, are tested. The test cases
are summed up in Table 3.8. The heat transfer test cases are only performed for the built-in
ANSYS CFX NRBC and the custom NRBC. A relaxation factor of K = 501/s is used.
The best performing time integration scheme is determined to be second order with an
60
explicit Lodi function: L∗ = Ln (see sec. 4.1.2 for results and analysis). The best perform-
ing heat transfer equation is the total energy equation without viscous terms (see sec. 4.1.1 for
results and analysis). These options are used in all other simulations, unless specified otherwise.
The sine is smoothed by multiplying a polynomial f (x) for the first quarter of the wave.
To prevent introducing yet another discontinuity, the polynomial should match certain criteria.
First, the product of the functions should equal zero at the onset of the wave, and be equal to
the sine amplitude at a quarter wave-length (at maximum amplitude). This corresponds with
f (0) = 0 and f (1) = 1 (normalized 1 for 0.5π). Also, to prevent a discontinuity, the gradient of
the product should be zero at both the wave-front and at maximum amplitude, which results
in f 0 (0) = 0 and f 0 (1) = 0. Given these four constraints, the polynomial should be of third
order to have a fully determined problem. After solving the system of equations, the smoothing
function f and its derivative are found, and given by equation 3.23.
The smooth sine is added to definition file in ANSYS CFX PRE using the CEL statement
in equation 3.24.
The step function is zero when its argument is smaller than zero, and one when it is larger
than zero. tnorm is the normalized time, from beginning to end of smoothing: tnorm = t/tend .
61
Figure 3.23: Smooth sine and gradient
The influence of the smooth sine is tested for all three NRBCs (ANSYS CFX NRBC, custom
NRBC, and custom NRBC+PWM) using the ten relaxation factors mentioned at the start of
the section.
All test-cases are tested against theory. Only the non-reflective test-case can be tested
against the NRBC boundary conditions. The pressure release surface TD-IBC can be tested
against a constant pressure outlet in ANSYS CFX, and an acoustically hard wall TD-IBC can
be tested against a wall in ANSYS CFX. The reflection coefficient R of the test-cases is also
determined using the Multi-Microphone method (see sec. 2.7.1), because it also captures phase
62
information.
The acoustically hard wall and pressure release surface have relatively simple coefficient sets,
only one non-zero coefficient for both a and b. The acoustically hard wall causes pressure
doubling at the wall, and a reflection coefficient that is real and positive (R = 1). This results
in two non-zero coefficients; a0 = 1 and b0 = 1. For the pressure release surface the reflection
coefficient is R = −1. The phase of R is π, which results in a time delay of half a period.
At a frequency of f = 100Hz this is 0.005 seconds. Using equation 2.42 and ∆t = 10−5 , n is
determined to be 500. The non-zero filter coefficients are a500 = 1 and b0 = 1.
The non-reflecting outlet in question is different from the ANSYS CFX and custom NRBC
based on the NSCBC formalism, as L5 is specified using the characteristic wave f determined
at the sample plane (see eq. 3.21) instead of the gradients at the boundary. The corresponding
filter coefficients are relatively simple, b0 must be equal to 1.
A complex reflection of R = 0.5 + 0.5i is tested with filter coefficients derived from one fixed
frequency, and fitted along different frequencies using the method by E.C. Levy [11]. √ The com-
plex reflection coefficient of R = 0.5 + 0.5i represents an absolute reflection of 0.5 · 2, and a
phase of 45◦ . This is done to mimic a partially reflective outlet with a phase change somewhere
between an acoustically hard wall and a pressure release surface. Using equation√2.41 and 2.42,
n is determined to be 125, which results in two filter coefficients: a125 = 0.5 · 2 and b0 = 1,
the rest being zero.
The second case which is fitted among different frequencies has a more complex coefficient
set. The reflection coefficient is fitted from 100 Hz to 400 Hz. At least 125 filter coefficients
are needed. However, calculating a stable IIR filter (also called minimum-phase filters) for this
many filter-coefficients proved to be a difficult task. Even a damped Gauss newton iteration
method (see [13]) does not result in all poles to reside within the unit circle. Varying parame-
ters, such as the order (number of filter coefficients) and frequency, does not result in a stable
filter. It seems that the invfreqz function in Matlab cannot find stable solutions for a high order,
higher than 10, transfer function. The complex reflection coefficient R is nonetheless fitted very
accurately. See Figure 3.24 for fitted R and pole-zero plot using 303 coefficients.
Filter coefficient sets with only a few poles slightly outside the unit-circle, for frequencies
far from the excitation frequency of f = 100Hz, have been obtained. These filter coefficient
sets also proved to be unstable. The hypothesis is, that although the dominant frequency is
f = 100Hz, practically all frequencies that can be represented on the grid are excited, however
small. An extremely small, but non-zero, amplitude corresponding to a freqeuncy of a (un-
stable) pole slightly outside unit-circle causes the amplitude to grow each timestep, until the
amplitudes becomes extreme, and the solver crashes. When looking at the Fourier transform of
the pressure time-series (see Fig. 3.25), it becomes clear that indeed the amplitude of practically
all frequencies are excited, albeit usually extremely small compared to the dominant excitation
frequency of f = 100. These frequencies can be excited by numerous sources, such as solver
and boundary condition characteristics, the finite precision of numbers stored in memory, and
63
Figure 3.24: Unstable IIR configuration for R = 0.5 + 0.5i, x:pole, o:zero
Figure 3.25: Spectra for pressure sensor P1 , the custom NRBC, K = 50s−1 , Total energy,
u0 = 0m/s.
An obvious alternative would be to use a FIR filter which has no poles by definition. After
simulation this also seems to result in instabilities. This time not because of poles outside the
unit circle, but probably because of the large coefficients which can cause quantization error
[6]. Calculated coefficients are order O(105 ), while for IIR filters the coefficients are generally
of order O(100 ).
By reducing the order of the denominator to 11, and reducing order of numerator to 302, a
stable system in the sense of no poles outside the unit circle can be retrieved (see Fig. 3.26).
However, even this system proves to be unstable during simulations. This might also have to
do with quantification error, as coefficients are generally of order O(101 ). Another cause might
be that the low denominator order might not include enough historical information about g∗.
Another problem with this coefficient set, although not a stability problem, is that the complex
reflection coefficient R is not fitted very accurately.
64
Figure 3.26: “Stable” FIR configuration for R = 0.5 + 0.5i, x:pole, o:zero
65
Chapter 4
Results
The results are separated into two sections, one for the results of the non-reflective boundary
conditions, and the other for the results of the Time-Domain Impedance Boundary Condition
(TD-IBC). In the first section the custom Non-Reflective Boundary Condition (NRBC) with
and without Plane-Wave Masking (PWM) is compared to the ANSYS CFX NRBC and theory.
In the second section the TD-IBC is compared to theory, and for certain complex reflection
coefficients they are compared to other boundary conditions. Those boundary conditions in-
clude a wall and a constant pressure outlet, which are fully reflecting. Also a non-reflective
TD-IBC is tested, as its determination of L5 differs from the other NRBCs (see sec. 2.3.2), and
is compared to the custom NRBC, the PWM NRBC, and the ANSYS CFX NRBC.
The phase angle φ of the measured complex reflection coefficient is not analyzed (but it is
registered in the appendix) for the non-reflective boundary conditions. The goal of non-reflective
boundary conditions, as the name implies, is to be non-reflective, this means that the phasor of
the complex reflection coefficient R is generally small, and is therefore prone to measurement
error of the phase angle. It is also less relevant, as it is not the goal of a non-reflective boundary
condition to influence the phase angle. In contrary to the non-reflective boundary conditions,
the phase-angle φ is fundamental for TD-IBCs, and is therefore taken into account in this section.
The main idea of this chapter is to characterize the different boundary conditions, and to
asses their performance. Several unexpected trends, odd behavior, and lacking performance in
certain areas were observed in various simulations. Not all of the observations can be explained
with absolute certainty, as research would be time-consuming and uncertain. For those obser-
vations only hypothesis are postulated based on theory on other observations.
The results in the following sections are mainly presented by graphs, as showing all the
figures of merit for all simulations would not aid in the readability, given the number of simu-
lations that were run. The numbers behind all the graphs in the results chapter are added to
the appendix.
66
4.1.1 Heat transfer equation
The influence of the heat transfer equation options in ANSYS CFX is tested for both the
custom NRBC as well as the ANSYS CFX NRBC. The results are presented in Figure 4.1 for
the reflection coefficient R, and in Figure 4.2 for the CPU time. The thermal energy equation
is abbreviated as “Thermal E”, and the total energy equation as “Total E”. The acronyms PT
stands for Pressure Transient term on, and VT stands for Viscous work Terms on. Note that the
total energy equation already includes pressure transient behavior on temperature. Explanation
about these terms and equations can be found in section 3.2.2.
What immediately stands out from the reflection coefficient graph (Fig. 4.1) are the high
reflection values when the pressure transient term is not included in the set of equations, as was
expected in section 3.2.2. Although the ANSYS CFX NRBC performs a lot better in this case,
the reflection coefficient R is still very high with R = 22.8% compared to the cases in which
the pressure transient term is included. The CPU time also approximately doubles compared
to the other cases (see Fig. 4.2). While the reflection coefficient R is be lower for the ANSYS
CFX NRBC, the CPU time is higher. The average amount of coeffient loop iterations are
approximately 11.5 for both the ANSYS CFX NRBC as well as the custom NRBC in this case.
The cause remains unknown, but this does not matter as simulations are concerned, as these
parameters (i.e. the exclusion of the pressure transient term) perform abysmally for both the
ANSYS CFX NRBC and the custom NRBC, and thus will not be used. As expected (see sec.
3.2.2), the pressure transient term is essential for correct function of both NRBCs.
Figure 4.1: Influence of heat transfer equations on the reflection coefficient for the ANSYS CFX
NRBC and custom NRBC, K = 50s−1
The reflection coefficient is between R = 3.18% and R = 3.9% for the other four cases tested.
A slight, but almost negligible, difference in favor of the custom NRBC is observed compared
to the ANSYS CFX NRBC. The differences in CPU time between the custom NRBC and the
ANSYS CFX NRBC are negligible. The inclusion of the viscous work terms do not create any
difference, which is to be expected because hardly any attenuation will occur for such short
domains with the used simulation parameters.
The difference in the reflection coefficient between thermal energy equation and total energy
equation is very small. The total energy equation is a more complete equation, but actually
takes approximately an hour shorter to run than the thermal energy simulations. For both the
ANSYS CFX NRBC and the custom NRBC the average number of coefficient loops is approx-
imately three for the total energy simulations, while it is approximately five for the thermal
67
energy simalations. The total energy simulations thus converges faster. The main difference
between the thermal energy and total energy equation is the inclusion of the kinetic energy term
and pressure transient term in the total energy equation (see sec. 3.2.2). It might be that the
pressure transient term is added as an extra equation in the set of equations when the thermal
energy equation is used, while in the total energy equation it is included in the equations, and
therefore takes more time to converge. Based on the results, -a shorter simulation time and
comparable reflection-, the choice is made to use the total energy equation excluding the viscous
work term over the thermal energy equation including the pressure transient term.
Figure 4.2: Influence of heat transfer equations on CPU time [hours : min], K = 50s−1
68
Figure 4.3: Influence of the time integration scheme on reflection for the custom NRBC, K =
50s−1
The CPU time is approximately 3:25 hour for the total energy simulations, and 8:30 hour for
the isothermal simulations. The custom NRBC, both including and excluding the PWM term,
shows the same order of CPU time, and thus does not seem boundary condition dependent. The
total energy simulations need on average three coefficient loops per timestep to meet the con-
vergence criteria, while the isothermal simulations need twelve coefficient loops per timestep.
The isothermal simulations are harder to solve, which might be caused by the heat transfer
needed to maintain a constant temperature (see sec. 3.2.2).
In Figure 4.5 the results for the custom NRBC are shown. The reflection coefficient is con-
sequently slightly below the theoretical value for relaxation factors between K = 23s−1 and
K = 1000s−1 , but follows the same general trend nonetheless. Both the isothermal and total
69
Figure 4.4: Absolute reflection coefficient vs. relaxation factor, for the ANSYS CFX NRBC
energy simulations bottom out at R = 1.31%, with a minimum of R = 1.156% for the total
energy simulation using a relaxation factor K = 10s−1 . The ANSYS CFX NRBC does not
show this bottoming out for the total energy simulations. It seems that something else is limit-
ing the accuracy of the boundary condition, which could be caused by the discretization error
in the returned pressure and velocity gradients near the boundary, that are determined using
one-sided difference approximations. Another cause could be that the used (fluid) properties are
not accurate. The bottom at around R = 1.3% is low nonetheless, so for practical application
this is probably acceptable.
Figure 4.5: Absolute reflection coefficient vs. relaxation factor, for the custom NRBC
The results for the custom NRBC including the PWM term are shown in Figure 4.6. The
reflection coefficient, for both the isothermal and the total energy simulations, remain fairly
constant at around R ≈ 1.2% throughout most of the relaxation factors, with a minimum of
R = 0.07% for a relaxation factor of K = 1000s−1 . There is no relation with the analytically
determined values for the reflection coefficient R as a function of the relaxation factor K,
which can be expected because in the PWM method the pressure difference due to acoustics is
“masked” from the LRM term, while the LRM term without PWM is the basis of the analytically
determined equation for R as function of K (eq. 2.23).
The minimum around K = 104 s−1 looks impressive due to the logarithmic scale, but the
reflection coefficient is actually roughly only 1.1% lower.
70
Figure 4.6: Absolute reflection coefficient vs. relaxation factor, for the custom NRBC+PWM
Figure 4.7: Pressure drift figures of merit. Example pressure is P2 (see sec. 3.4) for the custom
NRBC, total energy equation, and K = 50s−1
For comparison of different simulations a pressure drift versus relaxation factor K graph
is constructed, and shown in Figure 4.8. Certain values are missing, which means that they
cannot be determined, for example when the pressure did not stabilize within the simulation
time.
Comparing the isothermal and total energy simulations, it becomes apparent that the
isothermal simulations show much less pressure drift than the total energy simulations. For
the total energy simulations the trend between the pressure drift and relaxation factor is clear,
the pressure stabilizes with increasing relaxation factor K. This trend is expected, as it is the
reason the LRM term is introduced (see sec. 2.4). For the isothermal equations the trend is
less clear and remains fairly constant throughout the relaxation factors, eventually becoming
negligible (lower than 1P a) for relaxation factors higher than K = 500s−1 . The stabilized pres-
sure drift is also close, or equal, to the maximum pressure drift for the isothermal simulations,
meaning that no or hardly any overshoot occurs. It is a different story for the total energy
simulations, which does show significant overshoot, especially at lower relaxation factors. The
71
Figure 4.8: Pressure drift vs. relaxtion factor K for the custom NRBC and NRBC+PWM
total energy equations seems to stabilize within the simulation time of 0.02s only for relaxation
factors K = 50s−1 or higher.
Using the total energy heat equation, the custom NRBC including the PWM term performs
better and stabilizes sooner than the custom NRBC. But still considerable maximum pressure
drift is observed, see Figure 4.8. When the isothermal simulations are run in combination with
the PWM NRBC however, practically no pressure drift is observed. The small pressure drift
that is observed is in the order of 2P a to 4P a, but all stabilize to 0P a within the simulation time.
The mean pressure of certain simulations seems to asymptotically converge to a value other
than the expected value of 0P a relative pressure, while a relative pressure of 0P a is expected
as the LRM term always “forces” the solution to go to this value. An additional simulation is
run to test if the observed non-zero asymptote continuous after t = 0.2s. This simulation is
five times longer than the standard simulation time, tsim = 1.0s instead of tsim = 0.2s. Apart
from the changed simulation time, the same properties are used as for the simulation shown
in Figure 4.7. The solution of the P2 microphone at x = 2.064m is plotted in Figure 4.9. It
can be seen that the observed mean pressure asymptote did continue after t = 0.2s. This odd
behavior seems to be caused by another restoring “force” (other than the LRM term) with
its equilibrium position elsewhere. It could be that certain properties such as the sound speed
or density are not accurate enough, or that the explicit time integration scheme causes this error.
Figure 4.9: Pressure drift for a simulation of 1 second long. Pressure sensor P2 at x = 2.064m
(see sec. 3.4). Custom NRBC, total energy equation, and K = 50s−1
Although the exact reason behind the observed pressure drift is unclear, there seems to
be a correlation between pressure drift and the varying temperature in combination with the
72
LRM term. The pressure drift decreases when isothermal simulations are run, which suggests
the temperature variation is related to pressure drift. When subsequently the PWM term is
included in the custom NRBC to mask the incoming characteristic pressure perturbation from
the LRM term, the pressure drift basically vanishes. It could be that the restoring force of
the LRM method reacting to the acoustic pressure perturbation in combination with varying
temperature at the boundary is causing the pressure and/or velocity gradients to be incorrectly
returned, and create a “tendency” (or force) for either a positive or negative relative mean
pressure to be attained, which constitutes pressure drift. See section 4.1.3.3 for a more in-depth
analysis of the varying temperature and temperature trends on pressure drift.
Another explanation could be that pressure drift of this kind is expected because the prob-
lem is not “well-posed” enough, and that the ANSYS CFX NRBC has a built-in mechanism
that prevents such ill-posedness.
Based on the results of the reflection coefficient and pressure drift, the conclusion could be
drawn that isothermal simulations using the custom NRBC inlcuding PWM performs the best,
and should therefore be used. But this conclusion is only valid within this idealized numerical
problem. Isothermal simulations would not produce useful results when simulating a stack in
a thermoacoustic device, as it is the temperature gradient that induces sound waves to form,
and thus a heat transfer equation must be used. The custom NRBC including PWM might
be influenced negatively in various situations, such as when very viscous fluids are used, with
significant turbulence, or when the sampled wave is not traveling perpendicular from the sample
plane towards the boundary. In these situations the sampled wave will not be the same as the
actual wave at the boundary. But even when this does happen, it is not expected to cause
major problems as it is only used to mask the acoustic contribution to the pressure from the
LRM term. Only when the phase difference is off by more than a quarter wavelength, problems
can be expected, as it will give positive feedback to the LRM restoring term.
All three NRBCs seem to converge to a mean temperature that is ∆T = 0.175K higher than
the expected T = 298.15K. The ANSYS CFX NRBC converges the fastest to this higher mean
temperature, the custom NRBC comes in second, while the custom NRBC including PWM
lags the most. Maybe some very slight attenuation of the acoustic waves takes place, of which
the energy changes its form to heat by virtue of energy conservation. However, no definitive
explanation can be given about the cause of this phenomenon, but it might influence, or even
instigates, pressure drift.
The increased temperature also influences the density and sound speed in the domain, albeit
slightly. The density decreases with temperature
√ (ideal gas law: ρ = p/RT ), but the sound speed
increases (sound speed, ideal gas: c = γRT ). In the definition of the amplitude variation L5
(eq. 2.20), which is used in the custom NRBC and custom NRBC+PWM to determine the
pressure at the next timestep, both the mean density ρ0 and the small signal sound speed c0
73
Figure 4.10: Temperature vs. time for the ANSYS CFX NRBC, custom NRBC, and custom
NRBC+PWM. Total energy, K = 50s−1 .
are used as factors in the equation. These quantities are determined at initialization of the
simulation, using the pressure and temperature at initialization. The hypothesis is that that
due to a slightly changed mean density ρ0 and small signal sound speed c0 , an error is intro-
duced at each timestep. This error builds-up and causes (more) pressure drift. The fact that
isothermal simulations show much less pressure drift underlines this hypothesis. An algorithm
that updates the mean density and small signal sound speed could potentially decrease this
error from building up, and thus preventing pressure drift.
74
simulation. This observation supports the hypothesis that the sound speed is indeed incorrectly
calculated by ANSYS CFX for isothermal simulations, and the mean flow makes up for it.
Figure 4.11: Influence of mean flow on the reflection coefficient for isothermal simulations
In Figure 4.12 the reflection coefficient R as a function of mean flow u is shown for the total
energy simulations. The custom NRBC and PWM boundary conditions show a comparable
trend and values with respect to the isothermal case. The reflection coefficient R of the ANSYS
CFX NRBC increases only slightly with mean flow, outperforming the custom NRBC and
PWM boundaries when mean flow is introduced.
Figure 4.12: Influence of mean flow on the reflection coefficient for total energy simulations
The custom NRBC increases at approximately the same rate as the custom NRBC including
PWM, but the reflection coefficient of the custom NRBC exhibits an unexpected minimum at
u = 0.5m/s, resulting in the custom NRBC including PWM to have the highest reflection
coefficient for simulations with u = 2.5m/s and u = 5.0m/s mean flow. Possibly an error is
introduced in the custom NRBC method that inadvertently is corrected by a small positive
mean flow, of which a slightly inaccurate sound speed seems a plausible cause.
The reason behind the significantly sharper increase of the reflection coefficient of the custom
NRBC and PWM boundary conditions compared to the ANSYS CFX NRBC is unclear. The
sound speed is adjusted for the mean drift in the governing equations of the NRBCs via c =
c0 + u0 . It might be the case that higher mean flow velocities influence the retrieved pressure
and velocity gradients in an unfavorable manner. The “dip” being only present in the custom
NRBC, and not the PWM boundary condition, suggests that the sharp increase is not caused
by the LRM term, as the pressure difference due to acoustics is masked. On the other hand,
the minimum at u = 0.5m/s might be caused by the LRM method, as it is not present in the
PWM boundary condition.
75
The custom NRBC including PWM showed a very small difference between K = 23s−1 and
K = 50s−1 , which is expected because the LRM term is effectively masked. See the results of
section 4.1.3 for more details.
Figure 4.13: Pressure drift vs. mean flow velocity, isothermal simulations, K = 23s−1 and
K = 50s−1 , ∆|P | = |Pdrif t−f low | − |Pdrif t−u=0 |
The pressure drift difference for the isothermal simulations is shown in Figure 4.13. Practi-
cally all values are positive, which means that the pressure drift is larger. The trend is decreasing
with mean flow velocity, in contrary to what is observed with the reflection coefficient. The
cause might be sought in the propagation of pressure information from the boundary inward.
As the reflection coefficient increases with mean flow velocity, so does propagation of pressure
information from the boundary to the interior, and thus causing a decrease in pressure drift
(i.e. the problem is more “well-posed”).
Figure 4.14: Pressure drift vs. mean flow velocity, total energy simulations, K = 23 and K = 50,
|∆P | = |Pdrif t−f low | − |Pdrif t−u=0 |
In Figure 4.14 the pressure drift difference for the total energy simulations are shown. The
difference is smaller, and even becomes negative for higher mean flow velocities. The pressure
drift for isothermal simulations without mean flow are relatively low compared to the total
76
energy simulations (see sec. 4.1.3). The higher pressure drift difference for the isothermal
simualations therefore work out to be quite similar to the total energy simulations. The con-
clusion that can be drawn based on these observations is that the isothermal simulations are
more sensitive to mean velocity compared to a simulation without mean velocity, but performs
very similar in absolute pressure drift.
4.1.5 Partitioning
Partitioning is often used in computational fluid dynamics to speed up simulations by enabling
the numerical problem to be divided into different sections (partitions), of which each can run
on a single processor core. This enables multiple processor cores to be assigned to solving the
numerical problem, instead of just a single processing core. The influence of partitioning is
tested for the ANSYS CFX NRBC, and the custom NRBC, both including and excluding the
PWM term. The simulations are run serial, on two partitions, and on four partitions. Both
the reflection coefficient and the simulation time is measured. For the test case, with the given
discretization and fluid properties set out in section 3, no difference in the reflection coefficient is
observed between simulations. The simulation time did show a difference between simulations,
of which the speed-up is shown in Figure ??. Using two partitions speeds up the simulation
about 1.6 times, while using four partitions is actually slower than using two partitions, with a
speed-up of 1.38. Assembling and disassembling partitions after each timestep will cost extra
simulation time, for such a small domain of 1000 elements this will probably take more effort
than the gain in processing power [23]. Although the benefit of partitioning on the speed-up of
simulations is slim, the custom NRBC can handle multiple partitions without any performance
hit or stability problems.
Using the linearly refined mesh near the NRBC discussed in section 3.1.2, and the total energy
equation as the heat transfer equation, the difference in reflection coefficient is determined. As
the difference in reflection coefficient R is generally small, it will not be clearly visible in the
logarithmic plots such as 4.4. Therefore the difference is plotted in Figure 4.15. The difference
is defined as |∆R| = |Rlinref | − |R|. A negative value means the linearly refined mesh performs
better than the homogeneous mesh, and vice versa.
From the plot (Fig. 4.15) it can be seen that the ANSYS CFX NRBC profits slightly from
the refined mesh. The custom NRBC benefits from the refinement between K = 231/s and
K = 5001/s, while the custom NRBC including the PWM term is negatively influenced by the
refined mesh. It could be that the gradual refinement influences sound speed in the linearly
defined section of the domain because mesh size is not equal for each element, which causes the
arrival of the characteristic wave f from the sample plane to the boundary to be incorrectly
approximated, and therefore influencing the custom NRBC including PWM negatively.
77
Figure 4.15: Difference in reflection coefficient between the homogeneous mesh and the linearly
refined mesh
Another potential source of increased reflection is the increased acoustic CFL number. For
the normal mesh, the CFL number is CF Lnorm = 0.865325, while the CFL number is five times
higher near the boundary for the linearly refined mesh: CF Lref = 4.326625. This is because the
mesh size ∆x is five times smaller near the boundary, while the timestep ∆t has not changed.
The increased CFL number might cause decreased accuracy and stability near the boundary,
especially in an explicit time marching scheme, such as is used in the custom NRBC. Decreasing
the timestep ∆t might solve this problem, at the cost of simulation time. See section 3.1.2 for
more information about the CFL number.
A simulation run with a relaxation factor of K = 50s−1 , total energy, and using the custom
NRBC, but with a timestep of ∆t = 2 · 10−6 , showed a slight decrease in the reflection coeffi-
cient from R = 2.07% to R = 1.8%. The pressure drift was hardly influenced by the increased
temporal resolution, in the order of a few Pascal.
Figure 4.16: Difference in pressure drift between the homogeneous mesh and the linearly refined
mesh
The decreased pressure drift is probably due to a decreased discretization error of the one-
78
sided finite difference approximation to the first spatial derivative of the pressure and velocity
at the boundary. In conclusion, the increased mesh resolution near the non-reflective boundary
is only significantly helpful for the custom NRBC. The custom NRBC including PWM and the
ANSYS CFX NRBC are hardly influenced, or even negatively influenced.
Figure 4.17: Pressure gradient for the normal sine velocity excitation, at the sample plane and
custom NRBC boundary
The hypothesis is that these jumps might initiate pressure drift (see sec. 4.1.3), as it seems
that pressure drift starts when the traveling wave hits the boundary. This is tested using a
smooth transition at the wave-front, as defined in section 3.5.4. The resulting pressure gradi-
ents at the sample plane location and custom NRBC boundary is shown in Figure 4.18, from
which it can be seen that the transition is much smoother and continuous. A wiggle at around
t = 0.014s is observed, which might be due to the theoretical gradient not being smooth (but
continuous) at that point (see sec. 3.5.4). The second derivative is discontinuous, which ap-
pearently has an influence on the solution, but the wiggly behavior is far less pronounced than
for the normal sine.
79
Figure 4.18: Pressure gradient for the smooth sine velocity excitation, at the sample plane and
custom NRBC boundary
Figure 4.19: Difference in reflection coefficient between the smooth sine and the normal sine,
∆|R| = |Rsmooth | − |Rnormal |
The plot in Figure 4.19 shows the reflection coefficient difference ∆|R| as a function of the
relaxation factor K, for all tested NRBC boundaries. The smooth sine shows lower reflections
for higher relaxation factors for both the ANSYS CFX NRBC and the Custom NRBC. The
PWM NRBC shows a different story, and hardly profits from a smooth sine. For the high
relaxation factors the reflection is already close to 1, which reduces the practical usability of a
smooth sine.
80
with the custom NRBC because it is almost fully reflecting, and therefore not encounter such
pressure drift.
Figure 4.20: Difference in pressure drift of the smooth sine compared to the normal sine, K = 50,
Total energy, ∆|P | = |Pdrif t−f low | − |Pdrif t−u=0 |
In conclusion, it does not seem very helpful to use a smooth sine to prevent drifting or
decrease the reflection coefficient.
|Rmeasured | − |Rtheory |
∆|R̄| = (4.1)
|Rtheory |
81
velocity gradients near the boundary.
Table 4.1: Reflection coefficient results for acoustically hard and pressure release surfaces
Boundary condition |R| φ [rad] ∆|R̄| ∆φ [rad]
Total Energy Calculations
Acoustically hard wall TD-IBC 1.0069 -0.0818 0.69% −0.0818
Wall ANSYS CFX 0.9998 -0.1036 −0.02% −0.1036
Pressure release surface TD-IBC 0.9675 3.1057 −3.25% −0.0359
Constant pressure outlet ANSYS CFX 0.9775 -3.1020 −2.25% 0.0396
Isothermal Calculations
Acoustically hard wall TD-IBC 1.0114 0.0617 1.14% 0.0617
Wall ANSYS CFX 1.0151 0.0433 1.51% 0.0433
Pressure release surface TD-IBC 0.8779 3.0893 −12.21% −0.0523
Constant pressure outlet ANSYS CFX 0.9661 3.0585 −3.39% −0.0831
The measured complex reflection coefficient for the TD-IBC boundaries are close to the
theoretical values, for both absolute reflection coefficient R as well as the phase φ. The “hard”
(Dirichlet) constant pressure and constant velocity (hard wall) boundaries in ANSYS CFX
show errors in the same order of magnitude. The error for the TD-IBC is small and comparable
to constant pressure and velocity boundaries. Pressure drifting is not an issue with constant
pressure and constant velocity boundaries.
Table 4.2: Absolute reflection coefficient |R| for different non-reflecting outlets
ANSYS CFX NRBC Custom NRBC Custom NRBC+PWM TD-IBC
Total E 3.90%/0.12% 3.18%/1.16% 1.21%/0.08% 1.00%
Isothermal 9.07%/8.16% 3.76%/1.31% 1.26%/0.61% 0.45%
K = 50s−1 / Kbest
The nonreflective TD-IBC shows a lower reflection coefficient compared to the other NRBCs
for a reflection coefficient of K = 50s−1 . Taking the best values of the different models, the
TD-IBC is generally within the same order of error.
82
4.2.3 Complex reflection
The complex reflection of R = 0.5 + 0.5i is fitted to one frequency (f = 100Hz), as the
designed complex curve fitted filter coefficient sets of high order
√proved unstable (see sec. 3.5.5).
Theoretically the absolute reflection coefficient is |R| = 0.5 2, and the phase angle is φ =
0.25π rad.
The results are given in Table 4.3. The measured complex reflection comes very close to
the designed complex reflection coefficient. The isothermal simulation showed a slightly smaller
error than the total energy equations. In conclusion, it is indeed possible to implement an
accurate and stable TD-IBC for a single frequency.
83
Chapter 5
The Time-Domain Impedance Boundary Condition (TD-IBC) based on theory set out by Po-
lifke et al [9][6] has been implemented successfully for a numerical problem where a single
frequency is dominant. No stability problems were observed, and pressure drift was absent for
all TD-IBC simulations. Different boundaries have been simulated, among which are the acous-
tically hard wall, the pressure release surface, a non-reflecting outlet, and a complex reflection
of R = 0.5 + 0.5i. The last mentioned boundary showed a small difference in the absolute
reflection coefficient with theory of |∆R̄| = 0.75%, and a phase angle difference with theory
of ∆φ = −0.0333 rad. In the other simulations the absolute reflection coefficient differed with
theory ranging from |∆R̄| = 0.69% for an acoustically hard wall using the total energy equation
to |∆R̄| = 12.21% for a pressure release surface in an isothermal simulation.
The non-reflective part of the TD-IBC, called the custom Non-Reflective Boundary Condi-
tion (NRBC), can work independently from the TD-IBC. In addition, a Plane-Wave Masking
(PWM) term is added to the custom NRBC to improve low-frequency behavior, as is proposed
by Polifke [16]. These two boundary conditions were tested against theory, and a built-in NRBC
by ANSYS CFX. For all three NRBCs a low reflection coefficient is attainable in problems with-
out mean flow, but all have distinct peculiarities. The ANSYS CFX NRBC showed abysmal
performance regarding the reflection coefficient in isothermal simulations, which could be traced
back (using mean flow simulations) to an incorrectly assumed isothermal sound speed by AN-
SYS CFX. The custom NRBC seems to “bottom out” at lower relaxation factors to R ≈ 1.3%,
while the ANSYS CFX NRBC shows a minimum of R = 0.12%, and the PWM NRBC even
has a mimimum of R = 0.07%.
Another observation is that the custom NRBC and the custom NRBC+PWM both showed
considerable pressure drift, especially at lower relaxation factors, while the ANSYS CFX NRBC
never showed any significant pressure drift. The pressure drift seems to decrease either when the
PWM term is used, or when the simulation is run isothermal. When both parameters are set, the
pressure drift is reduced to practically zero. The fact that the isothermal simulations show much
less pressure drift suggests that the (varying) temperature is a contributor to the pressure drift.
84
The mean temperature also increases by ∆T = 0.175K in total energy simulations, which alter
the mean density ρ0 and small signal sound speed c0 , that are determined at initialization. These
quantities, that remain constant during the simulation, are used as factors in the definition of the
amplitude variation L5 . L5 is used in the custom NRBC, both including and excluding PWM,
to determine the pressure at the next time-step via time-integration of the LODI relations.
The slight error introduced in the mean density and small signal sound speed might cause a
small error in the temporal derivative of the pressure in the LODI relations, which, after time-
integration, builds up every time-step and induces pressure drift. Three other explanations of
pressure drift could be that the ANSYS CFX NRBC has a built-in “mechanism” to prevent
pressure drift, uses an algorithm to update the mean density and small signal sound speed,
or uses a higher order finite difference expression at the boundaries to construct the pressure
and velocity gradients. The gradients that are used by the custom NRBC are returned by the
ANSYS CFX solver, and determined using a one-side finite difference expression.
Based on the aforementioned explanations on pressure drift, it is recommended to run sim-
ulations with a built-in algorithm to update the mean density and small signal sound speed
during simulation. This might potentially reduce pressure drift.
When simulations are run using a non-zero mean flow velocity, the custom NRBC and PWM
NRBC show a sharp increase in the reflection coefficient, while the ANSYS CFX NRBC showed
much less sensitivity to mean flow velocity. A possible explanation could be that the returned
pressure and/or velocity gradients are negatively influenced by the mean flow. Mean flow is,
however, less important for thermoacoustic applications.
Two optimizations were investigated to potentially positively influence the reflection coeffi-
cient and pressure drift. The first being a linear increase in mesh resolution towards the NRBC
in question, the other being a smoothed sine in the excitation velocity with a continuous first
spatial derivative. The linear refined mesh showed mixed results regarding the reflection coef-
ficient, which might be related to the increased CFL number due to the smaller mesh size ∆x.
The pressure drift on the other hand decreased, especially at lower relaxation factors. For the
smooth sine simulations the reflection coefficient slightly decreased for higher relaxation factors
for both the custom NRBC and the ANSYS CFX NRBC, while the PWM NRBC was hardly
influenced. The pressure drift on the other hand was, unexpectedly, increased by the smooth
sine. This contradicts the postulated hypothesis that the pressure drift is instigated by the
discontinuity in the pressure and velocity gradient at the wave front.
A non-reflective version of the TD-IBC is also tested, which differs from the other NRBCs
in the expression for the outgoing amplitude variation L5 (see sec. 2.3.2). This non-reflective
TD-IBC showed a reflection coefficient of R = 1% for the total energy equation, and unlike the
custom NRBC and PWM NRBC, does not show any pressure drift. For all NRBCs, including
the non-reflective TD-IBC, a reflection coefficient in the order of R = 1% to R = 3% is attain-
able using the correct parameters.
All boundary conditions have been tested using a one-dimensional problem with purely plane
waves. What has not been done is extensive analysis of two-dimensional and three-dimensional
domains, only the correct working of the NRBCs and TD-IBC have been verified for these
meshes. The boundary conditions have not been tested against other, more complex, numerical
problems. It is therefore recommended that the boundary conditions are tested in other, more
demanding, numerical problems to test their performance and robustness.
Other CFD software could use better approximations to the pressure and velocity gradients
at the boundary, and differ in other fundamental aspects relevant to the application of the
85
developed boundary conditions. Implementing the TD-IBC in other CFD packages, and assess-
ing its stability and performance, is therefore recommended. Also, ANSYS FLUENT uses the
C++ programming language, which is generally considered more user friendly compared to the
antiquated FORTRAN77 language ANSYS CFX uses.
Although the TD-IBC is only extensively tested in a very idealized numerical problem, the
results seem very promising for application in thermoacoustic CFD simulations in which a sin-
gle frequency is dominant. In this regard, subsequent testing in more demanding and complex
simulations to characterize the behavior of the TD-IBC in such settings is recommended.
86
Bibliography
[2] I.C. Sheng A.N. Norris. Acoustic Radiation from a Circular Pipe with an Infinite Flange.
Journal of Sound and Vibration, 135:85–93, 1989.
[3] S Bühler and T.H. van der Meer. Numerical thermoacoustic experiment for verification of
commercial CFD code. 2009.
[4] K. Fung and J. Hongbin. Impedance and Its Time-Domain Extensions. AAIA, 38(1), 2000.
[5] K.Y. Fung and J. Hongbin. Time-domain Impedance Boundary Conditions for Computa-
tional Acoustics and Aeroacoustics. International Journal of Computational Fluid Dynam-
ics, 18(6):503–511, August 2004.
[8] M.G. Jones and T.L. Parrot. Evaluation of a Multi-Point Method for Determining Acoustic
Impedance. Mechanical Systems and Signal Processing, 3:15–35, 1989.
[9] R. Kaess, A. Huber, and W. Polifke. A Time-Domain Impedance Boundary Condition for
Compressible Turbulent Flow. American Institute of Aeronautics and Astronautics, pages
1–15, 2008.
[10] H. Levine and J. Schwinger. On the Radiation of Sound from an Unflanged Circular Pipe.
Physical Review Letters, 73(4):24, 1948.
[12] E.H. Lysen. The Trias Energica : Solar Energy Strategies for Developing Countries. Eu-
rosun Conference, pages 16–19, 1996.
[15] T.J. Poinsot. Boundary conditions for direct simulations of compressible viscous flows.
Journal of Computational Physics, 99(2):352, April 1992.
[16] W. Polifke, C. Wall, and P. Moin. Partially reflecting and non-reflecting boundary con-
ditions for simulation of compressible viscous flow. Journal of Computational Physics,
213(1):437–449, March 2006.
[17] L. Selle. The actual impedance of non-reflecting boundary conditions : implications for the
computation of resonators. pages 1–21, 2003.
87
[18] J. Seung-ho and I. Jeong-guon. On the multiple microphone method for measuring in-duct
acoustic properties in the presence of mean flow. 103(3):1520–1526, 1998.
[20] J.W. Strutt Baron Rayleigh. The Theory Of Sound. MacMillan and Co, 1877.
[21] C.K.W. Tam. Computational Aeroacoustics : Issues and Methods. 33(10), 1995.
[22] W. Thompson. Time- Dependent Boundary Conditions for Hyperbolic Systems , II. Journal
of Computational Physics, 439461:439–461, 1990.
[24] C.H. Venner. On the significance of the Laplace equation and the advection diffusion
equation as model problems for Computational Fluid Dynamics. pages 1–5, 2012.
[25] J. Ward, B. Clark and G. Swift. Design Environment for Low-amplitude Thermoacoustic
Energy Conversion DeltaEC Users Guide. 2012.
88
Nomenclature
SF Singularity Factor
89
L Characteristic length of domain [m]
P Pressure [P a]
T Temperature [K]
Z Impedance [Rayl]
Ω Domain space
I¯ Identity tensor
δp Acoustic pressure [P a]
γ Temperature [K]
A+ Moor-Penrose pseudo-inverse of A
90
Up Column vector of primitive quantities
∂Ω Domain boundary
ρ Density [kg/m3 ]
p Pressure [P a]
91
p0 Turbulent contribution to pressure [P a]
p0 Mean pressure [P a]
p∞ Pressure at infinity [P a]
92
Appendix
93
Contents
1 Acoustic theory 2
1.1 Derivation of the small signal sound speed . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Derivation of the wave equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Fourier and Laplace Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Derivation of the Helmholtz equation . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Reflection and impedance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4 Numerical modeling 23
4.1 General workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 Sample plane creation and use . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3 Problems encountered in programming for ANSYS CFX . . . . . . . . . . . . . . 25
4.4 Single and double precision numbers . . . . . . . . . . . . . . . . . . . . . . . . . 28
5 Simulation data 29
6 Source code 37
6.1 MultiMicMethod MATLAB class . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.2 CCL file with user parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.3 Filter coefficient sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
References 40
Nomenclature 42
1
Chapter 1
Acoustic theory
In this chapter an overview is given on important equations and derivations relevant to acoustics
in general.
A B ρ − ρ0 C ρ − ρ0 2
c2 = + ( )+ ( ) + O(δρ3 ) (1.6)
ρ0 ρ0 ρ0 2ρ0 ρ0
A
c20 = → A = ρ0 c20 (1.7)
ρ0
To construct an expression for c0 in gases, equation 1.4 is rewritten in form 1.8 with the
adiabatic bulk modulus A substituted, and in form 1.9 which is the ideal gas form. When
compared, one can identify c0 (see eq. 1.10).
2 B δρ C δρ 2 3
δp = c0 δρ 1 + ( )+ ( ) + O(δρ ) (1.8)
2!A ρ0 3!A ρ0
2
γp0 (γ − 1) δρ (γ − 1)(γ − 2) δρ 2
δp = δρ 1 + ( )+ ( ) + O(δρ3 ) (1.9)
ρ0 2! ρ0 3! ρ0
r
γp0
c0 = (1.10)
ρ0
Important to mention is the difference between isothermal and adiabatic sound speeds. For
isothermal calculations the adiabatic index is γ = 1 instead of γ = 1.4, resulting in a lower
sound speed as calculated by equation 1.10. In the isothermal case, heat exchange between
the wave and the environment need to take place at moments of rarefaction and compression
to keep the temperature constant, which is only accurate when the period of the wave is of
the same order or longer than the time it takes to cool the medium. Generally this is not the
case for acoustic waves on earth, and these compress and expand by approximation adiabatically.
4. In the absence of sound, the fluid is at static pressure, static density, and with a mean
flow of zero.
5. Acoustic disturbances are small compared to static pressure, density, and sound speed.
|δρ| ρ0 |δpitemize| ρ0 c20 |δu| c0
Using the first three assumptions equations 1.12 and 1.13 are constructed based on the mass
and momentum Euler equations.
∂U ~ ~ inv
+∇·F =J (1.11)
∂t
ρt + (ρu)x = 0 (1.12)
δp = c20 δρ (1.14)
δρt + δρx δu + ρ0 δux + δρδux = 0 (1.15)
ρ0 δut + ρ0 δuδux + δρδut + δρδuδux + δpx = 0 (1.16)
For equation 1.15 the second and fourth term are products of small signal quantities, and
therefor extremely small and can be neglected (i.e. linearized). The same argumentation is valid
3
for the second, third, and fourth terms in equation 1.16, and can be neglected. This results in
a linearized set of equations (see 1.17).
The usual convention in acoustics is to use pressure and velocity as the primary field vari-
ables. Taking the time-derivative of equation 1.14 and combining it with equation 1.17a to
eliminate the density, one arrives at equation 1.18.
~ 2 φ − 1 φtt = 0
∇ (1.21)
c20
∇φ = ~u (1.22)
Z ∞
ū(x, ω) = F[u(x, t)] = u(x, t) · e−iωt dt (1.23)
−∞
Z ∞
−1 1
u(x, t) = F [ū(x, t)] = ū(x, ω) · eiωt dω (1.24)
2π −∞
Z ∞
F (s) = L[f (t)] = f (t) · e−st dt (1.25)
0
Z γ+iT
1
f (t) = L−1 [F (s)] = lim F (s)ds (1.26)
2πi T →∞ γ−iT
Also discrete forms of the Fourier and Laplace transform exist, which are called the Discrete-
Time Fourier Transform (DTFT) and the Z-transform respectively.
4
Convolution integral in Laplace domain An important property is that convolution in
the time-domain is multiplication in the Laplace domain.
~ x, t) = [∇φ(~
∇φ(~ ~ x, ω)]eiωt → ~ 2 φ(~x, t) = [∇
∇ ~ 2 φ(~x, ω)]eiωt (1.28a)
φt (~x, t) = φ(~x, ω)ieiωt → φtt (~x, t) = −φ(~x, ω)ω 2 eiωt (1.28b)
~ 2 φ(~x, ω)]eiωt + [ 1
[∇ φ(~x, ω)ω 2 ]eiωt = 0 (1.29)
c2
~ 2 φ(~x, ω) + ω2
[∇ φ(~x, ω)]eiωt = 0 ∀t (1.30)
c2
~ 2 φ(~x, ω) + k 2 φ(~x, ω) = 0 ω
∇ where k= (1.31)
c
The Helmholtz equation is a function of position and frequency rather than of position and
time like the wave-equation. In the equations, k is the wave number, which can be seen as a
spatial frequency. The Helmholtz equation is a PDE of the elliptic type.
5
1.5 Reflection and impedance
The definition for reflection and impedance are given in equations 1.32 and 1.33 respectively.
Where p̂ is the acoustic pressure phasor, and û is the acoustic particle velocity phasor. These
variables can become complex, signifying a phase difference. This means also the reflection and
impedance can become a complex quantity. The + and − subscript signify the complex pressure
of the forward and backward traveling waves respectively. These quantities can be derived from
the solution of the Helmholtz equations, and is discussed in section 2.1.
p̂− (f )
R(f ) = (1.32)
p̂+ (f )
p̂(f )
Z(f ) = (1.33)
û(f )
When the same assumptions as for the construction of the wave equations apply to the
problem, the characteristic impedance (eq. 1.34) can be used. Which is an inherent property
of the medium.
Z0 = ρ0 · c0 (1.34)
Using the definition of the impedance (eq. 1.33) and the characteristic impedance (eq. 1.34)
the acoustic pressure δp can be easily expressed as a function of the acoustic velocity δu and
the characteristic impedance Z0 (eq. 1.35).
δp = ρ0 c0 δu = Z0 δu (1.35)
The impedance is a complex quantity, and often expressed in a resistive (R) and reactive
(X ) part (see eq. 1.36).
6
Chapter 2
Different methods exist to quantify reflection or impedance of a sample or interface. Among the
most used are the Two-Microphone Method (TMM), the Multi-Microphone Method (MMM),
and the Standing-Wave Ratio Method (SWR Method). The MMM is the method of choice
because the other two methods have certain disadvantages that make them less suitable for this
application. The TMM is simple, but very sensitive to sensor positioning, especially if the mi-
crophone separation is near one half wavelength [1][2]. The SWR method is on the other hand
very accurate and reliable, but very time-consuming because a probe with a pressure sensor
needs to moved through the tube [1][2]. As ANSYS CFX does not support moving monitor
points (to measure pressure), and approximating the Standing-Wave Ratio as a function of
position might be a cumbersome task, the SWR-Method is at a disadvantage. Also, the MMM
method is the only method that takes into account mean flow explicitly.
The method is based on the Helmholtz equation (2.1) and its solution (2.2). The Helmholtz
equation works in the spatial frequency domain.
ω
∇2 p̂ + k 2 p̂ = 0 where k= (2.1)
c0
p̂(x, f ) = A(f ) · e−ikx + B(f ) · eikx (2.2)
By evaluating the solution of the Helmholtz equation (eq. 2.2) for the position of sensor
1 and 2 (eq. 2.3 and 2.4), a fully defined system of equations (eq. 2.5) can be created with
which the forward and backward travelling pressure phasors p̂+ and p̂− at the boundary can
be calculated using either matrix inversion or Gaussian elimination. With this information,
the calculation of the complex reflection coefficient is straightforward by using eq. 1.32. The
7
introduction of a new coordinate d simplifies matters a little bit because p̂+ and p̂− can be
evaluated at d=0 by using the fact that L − d = x.
p̂(x1 , f ) = A(f )e−ikx1 + B(f )eikx1 = A(f )e−ikL eikd1 + B(f )eikL e−ikd1 (2.3)
p̂(x2 , f ) = A(f )e−ikx2 + B(f )eikx2 = A(f )e−ikL eikd2 + B(f )eikL e−ikd2 (2.4)
e 1 e−ikd1
ikd
p̂+ p̂1
ikd −ikd = (2.5)
e 2 e 2 p̂− p̂2
Where p̂+ = A · e−ikL and p̂− = B(f ) · eikL . By normalizing equation 2.3 and 2.4 by p̂(x1 , f ),
a version of the formula for the reflection coefficient which is not dependent on the absolute
position of the pressure sensors, but just the distance s between the sensors can be derived(eq.
2.6). H21 = p̂p̂21 .
H21 − e−iks
R(f ) = (2.6)
eiks − H21
Instead of just the wave numbers, plane wave propagation constants Γ (see eq. 2.7) are
used which correct for the effects of mean flow and attenuation effects due to viscosity and
turbulence. When these effects are not present, Γ just evaluates to the wave number k.
k − iδ
Γ± = ∓ (2.7)
1±M
Where k is the wave number, M is the Mach number, and δ is an attenuation constant. The
new system of equations A~x = ~b (eq. 2.8) resembles equations 2.5, but is now over determined.
−ikx1
eikx1
e p̂1
e−ikx2 eikx2 p̂+
p̂2
...
= (2.8)
... p̂−
...
e−ikxn eikxn p̂n
The Least-Squares solution can be obtained using a Moor-Penrose inverse A+ (eq. 2.9).
Where AH is the Hermitian matrix of A.
8
wave number that can be uniquely determined by the set-up. Also the spacing between different
sensors seems to have an influence on the SF value, where a uniform equidistant spacing between
the sensors resulted in the lowest SF. There are no limitations on the spacing regime in the test
cases, therefore a uniform equidistant spacing is used. Because of the use of uniform equidistant
spacing, a simpler formula to determine the optimal distance between sensors can be used (eq.
2.11). The wave number k of the excited wave is known at forehand, from this kcr can be
calculated using eq. 2.10. Subsequently ∆xmic can be determined using 2.11.
k
kratio = (2.10)
kcr
Attenuation effects Two effects contribute to the attenuation constant δ (eq. 2.12): the
viscothermal effects (δν ) and the turbulent effects (δt ). The viscothermal effects are described
by equation 2.13, and the turbulent effects are described by equation 2.14.
δ = δν + δt (2.12)
r
ω µ κ
r
δν = √ + (γ − 1) (2.13)
2 2a0 c0 ρ0 ω ρ0 ωcp
Ψ0 Re
ΨM
δt = 1+ (2.14)
2a0 2Ψ
Where µ is the shear viscosity constant, κ is the heat conduction coefficient, and Re is
the Reynolds number. The coefficient of friction for turbulent flow Ψ is calculated from the
Prandtl universal resistance law (eq. 2.15). See literature from Sueng-Ho [1] for more detailed
information on the subject.
1 √
√ = 2 · log10 (Re Ψ) − 0.8 (2.15)
Ψ
9
| p̂max |
SW R ≡ (2.16)
| p̂min |
SW R − 1
|R| = (2.17)
SW R + 1
However, with this method one loses phase information of the standing wave field. By
measuring the distance d from the boundary to the first extremum (be it minimum or maximum),
the complex reflection coefficient including phase information can be calculated (eq. 2.18)
SW R − 1 i2(kd)max SW R − 1 i2(kd)min
R= e R=− e (2.18)
SW R + 1 SW R + 1
10
Chapter 3
This chapter discusses the assumptions made, and the derivation of, the Navier-Stokes Charac-
teristic Boundary Conditions (NSCBC). In the last section a formalism to construct boundary
conditions based on the NSCBC method is discussed.
Locally one-dimensional (thus one direction of wave propagation), and the transverse
terms are neglected.
The NSCBC is derived from the Euler equations, however, this does not limit the calculation
of the interior domain to the Euler equations. The interior of the domain can be solved using
the full Navier-Stokes equations by adding boundary conditions that account for the viscous
dissipation and thermal diffusion. To obtain the missing dependent variables on the boundary
one can extrapolate from the inner domain, or use a conservation equation on the boundary.
The NSCBC method uses the latter [6].
11
conservative PDE form (1.11). The hyperbolic model equation (3.1) is in conservative form,
however, boundary conditions further on are greatly simplified by using the primitive form
(primitive quantity vector denoted by a p superscript: Up ). For example: it is easier to prescribe
the velocity u at the boundary than the momentum ρu. Thompson transforms the conserved
form to a primitive form before characteristic analysis:
∂U ∂Up ∂Ui
=P where Pij ≡ (3.2)
∂t ∂t ∂Ujp
Which can be obtained by using the chain rule, after all the conserved quantities U can be
written as a function of primitive quantities Up : U = f (Up ). For example, momentum ρu is a
function of ρ and u. For the flux terms one may do the same:
∂Fk ∂Up
= Qk where k = 1, 2, 3 (3.3)
∂xk ∂xk
The matrix Qk has elements:
∂Fik
Qkij ≡ (3.4)
∂Ujp
Substitution into eq. (3.1) and left multiply by P −1 results in the primitive form of the
model equation:
∂Up ∂Up ∂Up ∂Up
+ A1 + A2 + A3 + Dp = 0 (3.5)
∂t ∂x1 ∂x2 ∂x3
Where Ak = P−1 Qk and Dp = P−1 D. The system of equations is subsequently lumped
into two parts (3.6). The Cp part is composed of the transverse and source terms which do not
substantially add to the characteristic analysis, but are just carried along passively.
∂Up ∂Up ∂Up ∂Up
+ A1 +C=0 C = A2 + A3 +D (3.6)
∂t ∂x1 ∂x2 ∂x3
The system of partial differential equations (PDE) (3.5) is quasi-linear and first order, such
a system is hyperbolic iff the eigenvalues of the matrices Ak are real. However, these multiple
A matrices in multi-dimensional problems are not simultaneously diagonalizable, and there-
for cannot be decoupled and consequently do not have an unique direction of propagation.
Multi-dimensional problems cannot be put into characteristic form, however, one-dimensional
problems with only one A matrix can be diagonalized and thus put into characteristic form.
For multi-dimensional problems locally one-dimensional wave propagation is assumed and the
transverse terms C drops out:
∂Up ∂Up
+ A1 =0 (3.7)
∂t ∂x1
The coefficient matrix A1 in the system of equations (3.7) can be used for eigenvalue ex-
traction. The left l and right r eigenvectors have the following properties:
lTi A1 = λi lTi A 1 ri = λ i ri where i = 1, . . . , m (3.8)
The eigenvalues can be determined via the well-known formula det(A1 − λI) = 0. By
using a similarity transformation the matrix A1 can be transformed to a diagonal matrix with
eigenvalues:
S−1 A1 S = Λ (3.9)
The matrix S and S−1 can be constructed by adding the right eigenvectors as columns or the
left eigenvectors as rows respectively. By substituting eq. (3.9) into eq. (3.6), and subsequently
left multiply with S−1 one arrives at:
∂U ∂U
S−1 + L + S−1 C = 0 where L = ΛS−1 (3.10)
∂t ∂x1
12
In component form:
∂U ∂U
lTi + Li + lTi C = 0 where Li ≡ λi lTi (3.11)
∂t ∂x1
The original hyperbolic equations are now put into a characteristic form, as a function of
the amplitudes of the characteristic waves Li .
3.1.2 LODI-relations
By using the characteristic analysis procedure in section 3.1.1 on the Euler equations (1.11) the
so-called Locally One-Dimensional Inviscid (LODI) relations can be derived. First the column
vectors constructed:
ρ ρ ρuk 0
P3
e p (e + p)u −ρ k=1 uk gk
k
U ≡ ρu1 Up ≡ u1 F k ≡ ρuk u1 + δk1 p D≡ −ρg1 (3.12)
ρu u ρu u + δ p −ρg
2 2 k 2 k2
2
ρu3 u3 ρuk u3 + δk3 p −ρg3
Where δ is the Kronecker delta function. Next the Jacobian matrix P (3.2) and Q (3.4) are
constructed:
1 0 0 0 0
21 3i=1 u2i 1
P
(γ−1) ρu1 ρu2 ρu3
P= u1 0 ρ 0 0
(3.13)
u2 0 0 ρ 0
u3 0 0 0 ρ
Using the two equations of state (eq. 3.14), the matrix Qk can be determined from (3.4):
e ≡ 21 ρ 3k=1 u2k +
P
(3.14)
p ≡ (γ − 1)
u1 0 ρ 0 0
P3
1 2
i=1 ui u1
1
( γ−1 + 1)u1 1 2 2 2
2 ρ(3u1 + u2 + u3 ) ρu2 u1 ρu3 u1
1
2
Q = 2
u1 1 2ρu1 0 0 (3.17)
u1 u2 0 ρu2 ρu1 0
u1 u3 0 ρu3 0 ρu1
13
The inverse of the Jacobian matrix P is found to be:
1 0 0 0 0
1 3 u2 (γ − 1) (γ − 1) −(γ − 1)u1 −(γ − 1)u2 −(γ − 1)u3
P
−1
2 i=1 i
P = −u1 ρ−1 0 ρ−1 0 0
(3.18)
−u2 ρ −1 0 0 ρ−1 0
−u3 ρ −1 0 0 0 ρ−1
Which results in A1 :
u1 0 ρ 0 0
0 u1 γp 0 0
0 ρ−1 u1 0 0
(3.19)
0 0 0 u1 0
0 0 0 0 u1
From which the eigenvalues can be determined using cofactor expansion (where Z is defined
for convenience):
u1 − λ 0 ρ 0 0
0 u1 − λ γp 0 0
1 −1
det(Z) = det(A − λI) = 0 = 0 ρ u1 − λ 0 0 (3.20)
0 0 0 u1 − λ 0
0 0 0 0 u1 − λ
∂U ∂ρ ∂p
L2 = λ2 (c2 , −1, 0, 0, 0) ∂x 1
= λ2 (c2 ∂x 1
− ∂x 1
)
∂U ∂u2
L3 = λ3 (0, 0, 0, 1, 0) ∂x 1
= λ3 ∂x1 (3.23)
∂U
L4 = λ4 (0, 0, 0, 0, 1) ∂x 1
= λ4 ∂u
∂x1
3
∂p
∂U
L5 = λ5 (0, 1, ρc, 0, 0) ∂x 1
= λ5 ( ∂x 1
+ ρc ∂u
∂x1 )
1
14
Rewriting these equation in terms of the spatial derivative of the primitive flow quantities
along propagation x1 :
∂ρ 1 L2 1 L5 L1
∂x1 = c2 [ u1 + 2 ( u1 +c + u1 −c )]
∂p 1 L5 L1
∂x1 = 2 ( u1 +c + u1 −c )
∂u1 1 L L1
∂x1 = 2ρc ( u1 +c − u1 −c ) (3.24)
5
∂u2 L3
∂x1 = u1
∂u3 L4
∂x1 = u1
These two sets of equations (3.23)(3.24) form the LODI-relations. Albeit, different forms of
(3.24) may be constructed, depending on the application. Using eq. (3.7) the time derivatives
of the primitive flow quantities can easily be obtained using the spatial derivatives (3.24) and
the matrix A1 (3.19), which results in the set of LODI relations in temporal derivatives (3.26).
∂Up ∂Up
= −A1 (3.25)
∂t ∂x1
∂ρ
∂t = − c12 [L2 + 12 (L5 + L1 )]
∂p
∂t = − 12 (L5 + L1 )
∂u1 1
∂t = − 2ρc (L5 − L1 ) (3.26)
∂u2
∂t = −L3
∂u3
∂t = −L4
The characteristic velocities λi and the corresponding characteristic waves Li are for num-
bers 1 and 5 the sound waves moving in the negative and positive directions respectively, number
2 the entropy advection, and numbers 3 and 4 are the transverse waves for u3 and u4 respectively.
Boundary Condition
Boundary Treatment
∂U
1. Complete algorithm for defining the values of ∂t along the boundary.
2. Incorporates information of U from both interior Ω and the boundary conditions at
∂Ω.
Where U are the primitive flow quantities and Ω is the interior of the domain. Directly
defining U at the boundary is prohibited in the formalism, the boundary condition only con-
tributes to the determination of ∂U
∂t at the boundary. To overcome this, one could set certain
primitive flow quantities at the boundary as an initial condition, and force the time derivative
of the primitive flow quantity to be zero at the boundary at all times.
To construct boundary conditions the characteristic velocities λ are used to determine
whether a characteristic wave travels from the interior Ω outwards or into the volume. When
the wave travels outwards trough the boundary, Li on the boundary can just be calculated using
one-sided derivative approximations and the definitions for Li (3.23). When the wave travels
15
inwards, the corresponding Li must be determined using the boundary condition specified on
the boundary. From this general procedure all kind of boundary conditions can be derived.
Some frequently used boundary conditions are discussed by Poinsot and Thompson [4][6], but
only the subsonic nonreflecting outflow boundary condition is treated here.
Subsonic
x1 = a1 x1 = b1
With volumetric forces L5 = ρcg1 L1 = −ρcg1
Without volumetric forces L5 = 0 L1 = 0
16
3.2 Linear Relaxation Methods
The L1 amplitude can be set to zero to effectively eliminate reflection, but results often in
an ill-posed problem. Then a drift of the mean flow field quantities occurs because far–field
information about pressure cannot propagate into the domain. To overcome the problem of
ill-posedness one could set the far-field pressure p∞ , but this would create an acoustically hard
surface and thus reflection. One way or another, information from the far–field pressure must
be able to travel into the domain, while maintaining a more or less non-reflecting boundary.
The LRM model is the simplest boundary treatment for L1 that accommodates both:
L1 = K(p − p∞ ) (3.28)
The relaxation factor K can be defined in multiple ways. An expressions for K is:
σ(1 − M2 )c
K= (3.29)
L
For small values of K the problem might become ill-posed again, while for large values of
K the boundary looses its non-reflective character. This behavior also seems frequency depen-
dent as at lower frequencies the boundary treatment causes reflectivity, as will be looked at in
section 3.2.1. Which will also deal with optimal values for coupling parameter σ, and other
performance issues. Section 3.2.2 will look at the performance of the nonreflective boundary in
ANSYS CFX. The last section ?? will look at an extension to the LRM model which in theory
is fully non-reflective while maintaining a well-posed problem.
Two aspects of the LRM model are looked at by Selle in more detail [5]:
The value of K determines the degree to which the far–field pressure p∞ is enforced. A small
value allows for a large pressure difference and reflects only a small fraction, but is not very
able to control the mean pressure. A large value of K enforces the difference between p and
p∞ to be small, but reflects a larger fraction. Thus, the value of K has a direct relation to the
reflection coefficient R.
pref l
R= R∈C (3.30)
pout
The incoming wave L5 is assumed to be harmonic, and is expressed as:
L5 = 2ρcûiωe−iωt (3.31)
And the reflected wave is equal to (3.28), the LRM model. Substituting the two above
expressions in the second and third LODI relations (3.26) leads to the following system of
equations:
17
∂u 1
+ (2ρcûiωe−iωt − K(p − p∞ )) = 0 (3.32)
∂t 2ρc
∂p 1
+ (2ρcûiωe−iωt + K(p − p∞ )) = 0 (3.33)
∂t 2
The second equation depends only on P and can be solved analytically:
Kt ρcûiω −iωt
p(t) = p∞ + A0 e− 2 − K
e (3.34)
2 − iω
Looking at the limit behavior when the transient term vanishes for t → ∞ and K > 0,
which results in:
ρcûiω −iωt
p(t) = p∞ − K e (3.35)
2 − iω
Subsituting the relations for L1 and L5 into the reflection coefficient:
pref l K(p − p∞ )
R= = (3.36)
pout 2ρcûiωe−iωt
Because R is a complex number it can be expressed in a magnitude kRk and a phase angle
φ.
1
kRk = q (3.38)
1 + ( 2ω
K)
2
2ω
φ = −π − arctan( ) (3.39)
K
To illustrate how the reflection coefficient R evolves through the complex plane as a function
of relaxation factor K a plot is made 3.1.
18
Figure 3.1: Reflection coefficient R in the complex plane for varying K
For high frequencies (and low K) the reflection factor R tends to zero, and the boundary
condition can be called non-reflecting (see fig. 3.2). For low frequencies (and high K), however,
the reflection coefficient R tends to 1, and the phase to −π, basically acting as a pressure release
surface. Selle defines a cut-off frequency at A = 1, below which most of the acoustic energy is
reflected back into the domain [5].
ωc K
fc = = (3.41)
2π 4π
19
In practice different cut-off frequencies may be defined depending on problem characteristics.
Scaling strategy for K A scaling strategy for the relaxation factor K is proposed [5]. Good
values of K should allow all duct modes to leave the domain. Using the cut-off frequency, which
defines the reflected from the non-reflected part, lower than the lowest eigenvalue. The lowest
eigen-mode is the quarter-wave mode, which translates to the frequency domain via:
c
f0 = (1 − M2 ) (3.42)
4L
1
Using eq. (3.41) and eq. (3.42), the highest value of K which still significantly damps the 4
wave mode can be determined:
c
K max = π(1 − M2 ) (3.43)
L
When comparing eq. 3.43 to eq. 3.29 it can be seen that σ is bounded above by π. The
lower bound is not fixed by acoustics, but by other parameters such as the Reynolds number
and geometry. A value for σ lower than 0.1 often results in increased convergence times or no
convergence at all due to too much pressure drift. This results in an adequate range of values
for σ as shown in figure 3.3.
Optimal values for σ from literature range from 0.27 based on theory to 0.58 based on nu-
merical simulations [5]. One only needs to verify if the frequency of interest (e.g. excitation
frequency) is higher than the quarter-wave length frequency (see eq. 3.44). This is because eq.
(3.29) is based on this frequency and the cut-off frequency. Important values for σ are summed
up in table 3.2.1.
c0
fquarter = (3.44)
4·L
Using numerical analysis two values for sigma were tested. One value is way to high,
with σ = 10π. At this value the first eigenmodes are unable to leave the domain, and remain
asymptotically as a standing wave. The second value is equal to the maximum value σ = π. The
20
Figure 3.3: Optimal values for sigma
standing waves within the tubes die out rapidly, although the eigenfrequencies are significantly
shifted towards a lower frequency.
21
Figure 3.4: Numerically determined R (dots) vs. analytical model (line)
22
Chapter 4
Numerical modeling
In this chapter workflow in using the developed boundary conditions and problems encountered
during programming in FORTRAN for ANSYS CFX are discussed.
1. Create a mesh with a flat boundary perpendicular to the dominant direction of propaga-
tion.
2. Optional (for PWM and TD-IBC): Create a sample plane within the mesh in a mesh
creation package (see next section).
3. Call the boundary to be used as a NRBC or TD-IBC with the pre-fix LRM*.
4. Create a CCL file with the necessary options (see example CCL files in appendix), and
add to ANSYS CFX PRE file.
5. Compile the *.f files using the built-in Command Editor, and write: !system(”cfx5mkext
double NAMA.f”) or die;. Then process (assuming files are in running directory).
6. Add the junction box and user cell routines in ANSYS CFX PRE.
7. Call the pset routine from user cell in the pressure specification field of the boundary with
the correct arguments and pressure as return dimension.
8. Specify the junction box routines in the Solver Control dialogue box.
23
4.2 Sample plane creation and use
The creation of a sample plane from which the area averaged pressure and velocity are obtained
by the solver is not as straightforward as one might think. Monitor points cannot be used
to retrieve the aforementioned quantities as these are apparently retrieved directly from the
solution that is written to the disk, which can be seen as a sort-of real-time post-processing.
The utility routine user get gvar can retrieve and calculate area averaged quantities like pres-
sure and velocity, but need a user named location within the mesh. These locations include
boundary surfaces. But it is not possible to define a surface within the domain using ANSYS
CFX PRE only, as these are only recognized as unnamed internal element surfaces. To create
a named surface at the location where the sample plane needs to be, mesh modeling software
needs to be used. Follow the step-by-step process listed below to implement the sample plane in
question. The process is written for mesh software ICEM, and assumes the geometry is already
fully designed and opened. Also, the naming is important and should be copied exactly as they
are hard-coded in the Fortran subroutines.
1. Create a surface within the geometry, a certain distance from and parallel to the boundary
in question.
3. Create two blocks which together enclose the geometry, and of which the separating face
is aligned and associated to the SAMPLEP surface.
5. Import the mesh in ANSYS CFX PRE, and check if the SAMPLEP 1 and
SAMPLEP 2 principle 2D regions are shown under the mesh item.
7. Safe, close, and re-open the ANSYS CFX-PRE file (or else the automatically created
boundaries do not show up).
8. Now two boundaries should appear, call them sampleplane Side 1 and
sampleplane Side 2.
The sampleplane Side 1 boundary is used by the Fortran subroutines to retrieve the area
averaged pressure and velocity, and is hard-coded.
24
4.3 Problems encountered in programming for ANSYS CFX
Several problems and bugs were stumbled upon during modeling and programming for ANSYS
CFX. An overview of them is given in table 4.3, and is discussed in detail in the subsections.
In the Type column CFX means ANSYS CFX specific, Doc means ANSYS documentation,
Fort means Fortran specific, and Linx means Linux specific. In the Status column S means
Solved, W means no solution is found but a workaround method can be used to overcome the
problem, and N means No solution.
25
fact that single precision numbers loose significant digits in mathematical operations involving
numbers which vary greatly in order of magnitude.
The solution (at least for the code used in this master thesis) is to use double precision
(8 byte) numbers instead of single precision (4 byte) numbers. Double precision numbers in
Fortran have a significand of 52 bit while a single precision number has a significand of 23 bit.
26
Wrong sound speed in isothermal simulations
When using isothermal simulations the sound speed returned by both monitor points√ as well
as returned by the utility function user getvar is wrong. Surprisingly this is exactly 1.4 too
large. The hypothesis is that the sound speed does not follow directly from √ the solution field,
but is calculated afterwards via equations for the sound speed such as γRT . The adiabatic
index γ used is then still 1.4, while it should be 1.0 for isothermal calculations. It can be worked
around by calculating the sound speed in the subroutines or CEL via the other field quantities
(pressure, temperature, etc).
27
4.4 Single and double precision numbers
Single precision numbers use 32 bit of data, where 23 bits are used for the fraction part, 8 bits
for the exponent, and 1 bit for the sign (plus or minus). 23 bits for the fraction results in 24 bits
of total precision due to a implicit leading bit with a value of 1 (which is assumed zero when
the exponent part is zero) (see fig. 4.1). Depending on the value of the decimal number to be
stored, single precision numbers give 6 to 9 significant decimal digits precision. The decimal
value can be calculated from the stored bits using eq. 4.1. Where e is the decimal value of the
exponent. Not all decimal fractions can be exactly represented in binary, for example 0.1, but
0.125 can (2−3 ).
−i
value = (−1)sign (1 + Σ23
i=1 b23−i 2 ) · 2
e−127
(4.1)
Double precision numbers use 11 bits instead of 8 for the exponent, and 52 bits instead of
23 bits for the significand. Off course also here is an implicit bit used, so 24 bits effectively.
Double precision gives 15 to 17 significant decimal digits precision, which is a lot more precise
than 6 to 9 significant digits with single precision.
28
Chapter 5
Simulation data
In this section all results from simulations (test cases) are shown. Table 5 shows all simulation
parameters for both isothermal and total energy simulations.
The sampled frequency range parameter signifies the part of the time-series pressure data
that is used in the multi-microphone method to determine the reflection. The first part is dis-
carded because the wave has not arrived at the boundary yet, and mainly contributes to the
first coefficient of the Fourier transform associated with a frequency of zero, which is constant
(mean pressure over range).
Table 5.2 and 5.3 show how the different simulations are grouped and in which table they
can be found for the nonreflective and TD-IBC simulations respectively.
29
Table 5.3: TD-IBC test cases
# Group No. Cases Table
1 TD-IBC (Total energy) 4 5.22
2 TD-IBC (Isothermal) 4 ??
3 ANSYS CFX NRBC, hard wall/pressure release (Total energy) 4 5.24
Table 5.4: (1) ANSYS CFX NRBC (Total energy) test cases
Parameters Reflection
# K σ u0 R I |R| φ Cpu
1.1 1 0.0115 0 -0,0011 -0,0005 0,0012 -2,7486 3:13
1.2 10 0.1152 0 -0,0014 -0,0075 0,0077 -1,7536 3:16
1.3 23 0.265 0 -0,0020 -0,0177 0,0178 -1,6829 3:15
1.4 50 0.576 0 -0,0039 -0,0388 0,0390 -1,6713 3:16
1.5 100 1.152 0 -0,0098 -0,0772 0,0778 -1,6964 3:13
1.6 200 2.304 0 -0,0299 -0,1508 0,1537 -1,7668 3:12
1.7 500 5.76 0 -0,1412 -0,3278 0,3569 -1,9775 3:12
1.8 1000 11.52 0 -0,3748 -0,4600 0,5933 -2,2545 3:14
1.9 10000 115.2 0 -0,9493 -0,1228 0,9572 -3,0130 3:14
1.10 100000 1152 0 -0,9719 -0,0480 0,9731 -3,0923 3:15
1.11 23 0.265 0.5 -0,0028 -0,0185 0,0187 -1,7205 3:09
1.12 23 0.265 2.5 -0,0062 -0,0214 0,0223 -1,8535 3:36
1.13 23 0.265 5 -0,0102 -0,0252 0,0272 -1,9540 3:48
1.14 50 0.576 0.5 -0,0047 -0,0396 0,0399 -1,6890 3:12
1.15 50 0.576 2.5 -0,0081 -0,0424 0,0432 -1,7590 3:34
1.16 50 0.576 5 -0,0120 -0,0463 0,0478 -1,8245 3:45
30
Table 5.5: (2) ANSYS CFX NRBC (Isothermal) test cases
Parameters Reflection
# K σ u0 R I |R| φ Cpu
2.1 1 0.0115 0 0,0813 -0,0068 0,0816 -0,0833 11:34
2.2 10 0.1152 0 0,0811 -0,0137 0,0822 -0,1679 11:35
2.3 23 0.265 0 0,0806 -0,0238 0,0840 -0,2869 11:36
2.4 50 0.576 0 0,0790 -0,0446 0,0907 -0,5142 11:32
2.5 100 1.152 0 0,0737 -0,0828 0,1109 -0,8434 11:29
2.6 200 2.304 0 0,0549 -0,1571 0,1665 -1,2347 8:24
2.7 500 5.76 0 -0,0556 -0,3436 0,3481 -1,7313 8:18
2.8 1000 11.52 0 -0,3093 -0,4971 0,5854 -2,1274 8:23
2.9 10000 115.2 0 -0,9898 -0,0762 0,9927 -3,0648 8:30
2.10 100000 1152 0 -0,9656 0,0658 0,9678 3,0735 8:27
2.11 23 0.265 0.5 0,0798 -0,0236 0,0832 -0,2875 9:50
2.12 23 0.265 2.5 0,0766 -0,2240 0,0798 -0,2839 9:58
2.13 23 0.265 5 0,0731 -0,0211 0,0761 -0,2812 9:54
2.14 50 0.576 0.5 0,0781 -0,0444 0,0899 -0,5168 9:55
2.15 50 0.576 2.5 0,0750 -0,0431 0,0865 -0,5215 9:47
2.16 50 0.576 5 0,0715 -0,0418 0,0828 -0,5291 9:53
31
Table 5.7: (4) Custom NRBC (Isothermal) test cases
Parameters Reflection P. drift
# K u0 R I |R| φ Cpu Max. Sta.
4.1 1 0 -0,0126 -0,0033 0,0131 -2,8859 7:18 6 6
4.2 10 0 -0,0127 -0,0092 0,0157 -2,5163 11:44 29.5 29.5
4.3 23 0 -0,0131 -0,0176 0,0219 -2,2124 11:49 33.5 33.5
4.4 50 0 -0,0140 -0,0349 0,0376 -1,9520 11:49 26.5 26.5
4.5 100 0 -0,0178 -0,0669 0,0692 -1,8307 11:42 29 29
4.6 200 0 -0,0315 -0,1291 0,1329 -1,8099 11:33 24 20
4.7 500 0 -0,1162 -0,2909 0,3133 -1,9507 11:36 12.5 12.5
4.8 1000 0 -0,3257 -0,4407 0,5480 -2,2072 11:38
4.9 10000 0 -0,9895 -0,0767 0,9925 -3,0642 11:29
4.10 100000 0 -0,9657 0,0658 0,9680 3,0735 11:34
4.11 23 0.5 -0,0111 0,0062 0,0127 2,6294 10:06 167 167
4.12 23 2.5 0,0473 0,0719 0,0861 0,9888 9:52 100 44
4.13 23 5 0,1126 0,0686 0,1318 0,5472 9:56 48 48
4.14 50 0.5 -0,0111 -0,0110 0,0156 -2,3584 10:07 88 66
4.15 50 2.5 0,0499 0,0529 0,0728 0,8145 9:59 53 41
4.16 50 5 0,1151 0,0465 0,1242 0,3836 10:00 26 18
32
Table 5.9: (6) Custom NRBC+PWM (Isothermal) test cases
Parameters Reflection P. drift
# K u0 R I |R| φ Cpu Max. Sta.
6.1 1 0 -0,0126 -0,0026 0,0129 -2,9362 11:38 4 0
6.2 10 0 -0,0126 -0,0026 0,0128 -2,9411 11:47 4 0
6.3 23 0 -0,0125 -0,0025 0,0128 -2,9482 11:53 3 0
6.4 50 0 -0,0124 -0,0023 0,0126 -2,9627 11:54 3 0
6.5 100 0 -0,0123 -0,0019 0,0124 -2,9888 11:50 3 0
6.6 200 0 -0,0117 -0,0012 0,0118 -3,0370 11:49 3 0
6.7 500 0 -0,0099 0,0003 0,0099 3,1161 11:47 3 0
6.8 1000 0 -0,0066 0,0009 0,0067 3,0009 7:18
6.9 10000 0 -0,0006 -0,0061 0,0061 -1,6744 7:20
6.10 100000 0 -0,0011 -0,0077 0,0078 -1,7091 7:21
6.11 23 0.5 -0,0112 0,0210 0,0238 2,0583 10:14 177 CBD
6.12 23 2.5 0,0462 0,0870 0,0985 1,0822 10:07 165 CBD
6.13 23 5 0,1113 0,0848 0,1399 0,6515 9:57 80 80
6.14 50 0.5 -0,0098 0,0215 0,0236 2,0007 10:09 95 95
6.15 50 2.5 0,0481 0,0869 0,0993 1,0650 10:04 85 85
6.16 50 5 0,1132 0,0831 0,1404 0,6333 9:56 40 40
Table 5.11: (8) Influence of heat transfer options, ANSYS CFX NRBC
Params. Reflection Heat eqs. options
# K σ u0 R I |R| φ Heat equation PT VT Cpu
8.1 50 0.576 0 0,1765 0,1443 0,2280 0,6854 Thermal Off Off 9:27
8.2 50 0.576 0 0,1765 0,1443 0,2280 0,6854 Thermal Off On 9:29
8.3 50 0.576 0 -0,0038 -0,0376 0,0378 -1,6725 Thermal On Off 4:27
8.4 50 0.576 0 -0,0038 -0,0376 0,0378 -1,6725 Thermal On On 4:25
8.5 50 0.576 0 -0,0039 -0,0388 0,0390 -1,6713 Total N/A Off 3:26
8.6 50 0.576 0 -0,0039 -0,0388 0,0390 -1,6713 Total N/A On 3:25
33
Table 5.13: (10) Influence of geometry (Total energy)
Params. Reflection
# K u0 R I |R| φ Boundary Description
10.1 50 0 -0,0037 -0,0382 0,0383 -1,6671 ANSYS NRBC Mesh refined near BC
10.2 50 0 ? ? ? ? ANSYS NRBC 2D Mesh
10.3 50 0 ? ? ? ? ANSYS NRBC 3D Mesh
10.4 50 0 -0,0123 -0,0166 0,0207 -2,2064 Custom NRBC Mesh refined near BC
10.5 50 0 ? ? ? ? Custom NRBC 2D Mesh
10.6 50 0 ? ? ? ? Custom NRBC 3D Mesh
10.7 50 0 -0,0143 0,0166 0,0219 2,2815 Custom NRBC+PWM Mesh refined near BC
10.8 50 0 ? ? ? ? Custom NRBC+PWM 2D Mesh
10.9 50 0 ? ? ? ? Custom NRBC+PWM 3D Mesh
34
Table 5.16: (13) Linear refinement for custom NRBC
Parameters Reflection P. drift
# K u0 R I |R| φ Max. Sta.
13.1 1 0 -0,0180 0,0133 0,0224 2,5033 220 CBD
13.2 10 0 -0,0152 0,0091 0,0177 2,6041 98 98
13.3 23 0 -0,0136 0,0010 0,0136 3,0655 51 39
13.4 50 0 -0,0123 -0,0166 0,0207 -2,2064 29 12
13.5 100 0 -0,0119 -0,0491 0,0505 -1,8085 34 res
13.6 200 0 -0,0175 -0,1122 0,1135 -1,7258 23 res
13.7 500 0 -0,0768 -0,2800 0,2903 -1,8387 37 res
13.8 1000 0 -0,2673 -0,4585 0,5307 -2,0986 51 res
13.9 10000 0 -0,9498 -0,1390 0,9599 -2,9963
13.10 100000 0 -0,9714 -0,0492 0,9727 -3,0910
35
Table 5.19: (16) Smooth sine for custom NRBC
Parameters Reflection P. drift
# K u0 R I |R| φ Max. Sta.
16.1 1 0 -0,0115 0,0063 0,013112 2,6437 414 CBD
16.2 10 0 -0,0114 -0,0017 0,011566 -2,9953 208 208
16.3 23 0 -0,0117 -0,0113 0,016288 -2,3742 112 59
16.4 50 0 -0,0126 -0,0291 0,031701 -1,9793 75 22
16.5 100 0 -0,0157 -0,0611 0,063090 -1,8217 70 34
16.6 200 0 -0,0280 -0,1235 0,126582 -1,7936 60 38
16.7 500 0 -0,1042 -0,2835 0,302091 -1,9231 51 38
16.8 1000 0 -0,2927 -0,4359 0,525088 -2,1622 70 43
16.9 10000 0 -0,9456 -0,1369 0,955453 -2,9979
16.10 100000 0 -0,9660 -0,0514 0,967383 -3,0884
36
Table 5.23: (2) TD-IBC test cases (Isothermal)
Params. Reflection
# K u0 R I |R| φ Description
2.1 50 0 1,0095 0,0623 1,0114 0,0617 Acoustically hard wall
2.2 50 0 -0,8767 0,0459 0,8779 3,0893 Pressure release surface
2.3 50 0 -0,0005 0,0045 0,0045 1,6906 Non-reflecting outlet
2.4 50 0 0,4868 0,5022 0,6994 0,8010 Complex R = 0.5 + 0.5i
37
Chapter 6
Source code
The source code of the FORTRAN subroutines, the MATLAB scripts and classes, the CCL
files, and the used filter coefficient arrays for the construction of the TD-IBCs, are added to
the supplied CD-ROM. The UML diagram and two example CCL files are added to this chapter.
Supplied on CD-ROM:
38
6.1 MultiMicMethod MATLAB class
The complete UML diagram. The source code is added to the supplied CD-ROM.
39
6.2 CCL file with user parameters
The CCL file (with example settings) for both the NRBC as well as the TD-IBC.
USER:
# ====== Model P r o p e r t i e s ======
# R e l a t i v e f a r − f i e l d p r e s s u r e [ Pa ]
pinf = 0.0
# Mean f l o w s p e e d [m/ s ]
u = 0.5
# Relaxation f ac t o r K [1/ s ]
K = 50.0
# D i s t a n c e o f sample p l a n e from Non−r e f l e c t i v e BC [m]
DXSAMPLE = 0 . 4
# Use Plane−Wave Masking ? ( 0 : No , 1 : Yes )
PWM = 1
# ====== F l u i d P r o p e r t i e s ======
# A d i a b a t i c i n d e x gamma
gamma = 1 . 4
# S p e c i f i c gas constant
RSPEC = 2 8 7 . 0 5 8
END
CCL file example for TD-IBC
USER:
# ====== Model P r o p e r t i e s ======
# R e l a t i v e f a r − f i e l d p r e s s u r e [ Pa ]
pinf = 0.0
# Mean f l o w s p e e d [m/ s ]
u = 0.0
# Relaxation f ac t o r K [1/ s ]
K = 50.0
# D i s t a n c e o f sample p l a n e from Non−r e f l e c t i v e BC [m]
DXSAMPLE = 0 . 4
# Use Plane−Wave Masking ? ( 0 : No , 1 : Yes )
PWM = 1
# ====== F l u i d P r o p e r t i e s ======
# A d i a b a t i c i n d e x gamma
gamma = 1 . 4
# S p e c i f i c gas constant
RSPEC = 2 8 7 . 0 5 8
# ====== TD−IBC f i l t e r c o n s t a n t s ======
# Number o f f i l t e r c o n s t a n t s
NFC = 10
# A f i l t e r constants
AFC = 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0
# B f i l t e r constants
BFC = 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
END
40
6.3 Filter coefficient sets
If not mentioned, the coefficient is equal to zero. A minimum of ten coefficients need to be
specified, and all coefficients need to be specified until the last non-zero coefficient (equal for
both A and B). If only coefficient # 1 is non-zero, the others need to be specified with zero.
If coefficient # 350 is non-zero, every coefficient to # 350 need to be specified, even if they are
zero. Coefficient B1 always needs to be equal to 1.
41
Bibliography
[1] Seung-ho Jang and Jeong-guon Ih. On the multiple microphone method for measuring
in-duct acoustic properties in the presence of mean flow. 103(3):1520–1526, 1998.
[2] Michael G Jones and Tony L Parrot. Evaluation of a Multi-Point Method for Determining
Acoustic Impedance. Mechanical Systems and Signal Processing, 3:15–35, 1989.
[3] Joris Oosterhuis. Performance of non-reflective boundary condition in ANSYS CFX. Tech-
nical report, 2012.
[4] T.J. Poinsot. Boundary conditions for direct simulations of compressible viscous flows.
Journal of Computational Physics, 99(2):352, April 1992.
[5] Laurent Selle. The actual impedance of non-reflecting boundary conditions : implications
for the computation of resonators. pages 1–21, 2003.
[6] W Thompson. Time- Dependent Boundary Conditions for Hyperbolic Systems , II. Journal
of Computational Physics, 439461:439–461, 1990.
42
Nomenclature
BC Boundary Condition
Re Reynolds number
δp Acoustic pressure [P a]
γ Adiabatic index
43
p̂+ Forward traveling pressure phasor [P a]
A+ Moor-Penrose psuedo-inverse of A
AH Hermitian matrix of A
Z Impedance [Rayl]
ω Angular frequency
p0 Mean pressure [P a]
44