# Modelling of Air Flow Analysis for Residential Homes Using Particle Image Velocimetry

Rajiv Pratap, Ramesh Rayudu, Manfred Plagmann

► To cite this version:

Rajiv Pratap, Ramesh Rayudu, Manfred Plagmann. Modelling of Air Flow Analysis for Residential Homes Using Particle Image Velocimetry. 11th International Symposium on Environmental Software Systems (ISESS), Mar 2015, Melbourne, Australia. pp.293-302, 10.1007/978-3-319-15994-2_29. hal-01328562

HAL Id: hal-01328562

https://inria.hal.science/hal-01328562

Submitted on 8 Jun 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Modelling of Air Flow Analysis for Residential Homes
using Particle Image Velocimetry

Rajiv Pratap¹, Ramesh Rayudu¹, and Manfred Plagmann²

¹School of Engineering and Computer Science, ²BRANZ
Wellington, New Zealand
Ramesh.Rayudu@vuw.ac.nz

**Abstract.** The purpose of this paper is to simulate the designed physical Particle Image Velocimetry (PIV) system, as a simulation platform to physically build and implement a system for residential building and housing research. The focus is on the angle filter; the filter used to process the images of a laser progressively scanning through a space by adjusting its angle.

An indicator of heat escape and ventilation in buildings is the airflow itself. Conventional airflow measurement techniques are typically intrusive, interfering with the data or the environment. For small flows such as that in residential housing, the error introduced can sometimes be large relative to the measured data. In contrast, PIV is a relatively a non-intrusive measurement tool that measures flows. However, there are a few problems with standard PIV techniques, for implementation in an attic space.

The proposed solution is to use dust particles, already present in the air, as tracers for the PIV system. In conclusion, our PIV system with a non-diverging laser beam produces a velocity field of similar quality to a velocity field of a standard PIV system.

**Keywords:** Particle Image Velocimetry · PIV · air flow measurement · building ventilation analysis · Angle filtering

## 1 Introduction

NZ homes are well known to be cold, damp and poorly ventilated. There have been several papers reporting on the quality of these conditions [1,2], as well as how to mitigate these problems. In some cases it can be relatively easy to identify causes and find solutions to them, such as by adding insulation [3]. Other times it can be more difficult, such as finding gaps where heat is escaping, or identifying poor ventilation. These problems require less conventional methods to solve.

One indicator of both heat escape and ventilation is the airflow itself. Conventional airflow measurement techniques are typically intrusive, interfering with the data or the environment. For small flows such as that in housing, the error introduced can sometimes be large relative to the data measured. In contrast, Particle Image Velocimetry (PIV) is a relatively non-intrusive measurement tool that measures such flow. PIV systems have been researched and implemented for decades, especially useful in
wind tunnel experiments and other complex flow scenarios [4]. The typical setup for a PIV system uses a camera, tracer particles, a laser to illuminate the tracers and a data processing unit, typically a computer, to compute a vector field of the space [6]. The use of tracer particles in combination with a laser, through a diverging lens, gives a clear representation of the flow through a space, providing high contrast to the background which makes it easier to visualise and process the space.

There are a few problems with this standard setup, for implementation in an attic space. Firstly, the use of tracer particles involves adding potential pollutants to the housing space. These could get stuck in cracks and other gaps where air escapes, disrupting or changing the airflow, which would defeat the purpose of such a system. Another problem is that the reflected light intensity of particles decreases dependant on distance from the lens. This is because the mirror modifies the laser's beam to be diverging, and so the beam's power density decreases as a result of distance. When the incoming light intensity decreases, so does the reflected intensity of the particles. This limits the dimensions which the system can be used, and to compensate for it the laser's power may need to be adjusted for various scenarios.

The proposed solution uses dust particles, already present in the air, as tracers for the PIV system. Research has previously been done in use of small particle tracers for PIV [5], outlining specifications for suitable tracer particles. The scattering intensity of dust particles prevents its use as a tracer particle in standard PIV systems. However, through experimental observation it was found that the space containing dust particles could be illuminated using a non-diverging, high power laser beam. The level of illumination produced was comparable to the images used in existing PIV systems, suggesting this modified system could perform equivalently.

The purpose of this paper is to simulate the modified PIV system, as a confirmation to build and apply the system for building and housing research. The simulation provides insight to algorithm design for a new system, allowing for rapid adjustment and testing. Once simulated, the final algorithm in the simulation was implemented in a physical system, and tested in a building. This paper focuses on the simulation side of the project, in particular the angle filter used to process the images of a laser progressively scanning through a space.

## 2 Modelling of PIV System

The simulated PIV system was implemented in Mathematica. The PIV simulation takes in images and generates a vector field overlaid on top of the two images used for correlation, blended together.

The PIV simulation utilises a multi-frame single pulse PIV technique [6], with some additional features. The method uses two images taken a small time frame apart, divide each image into cells, and cross correlate each cell with the corresponding cell in the second image. By observing various shifts in both vertical and horizontal direction, the shift that results in the highest correlation corresponds to the estimated displacement in that time for the particles in that cell.
The convolution is calculated using the Fast-Fourier Transform (FFT), by utilizing the Convolution Theorem of Fourier Transforms. By using this property the convolution can be found significantly faster than by directly calculating the convolution. The Convolution Theorem property can be observed in the equation below.

$$F[a * b] = F[a] \cdot F[b] \qquad (1)$$

$$a * b = F^{-1}[F[a] \cdot F[b]] \qquad (2)$$

To prevent aliasing, the data was zero padded. This allows the correlation at the edges of the cells to be calculated without distortion from the opposite side of the cell. The details of the developed algorithm are discussed in the following sections.

## 2.1 Correlation Adjustment

### 2.1.1 Background Correlation

Background correlation as described in [7] was removed by subtracting the mean from each image. Background correlation is caused by images' direct correlation, resulting in a high correlation at '0' displacement. This is prevalent in a PIV system, as it involves repeated photographing of and at a relatively stationary point. The background would remain constant, and using small tracer particles of dust would result in a majority of the image consisting of the background. The majority of the image would have a net velocity of 0, and so the algorithm would indicate a '0' vector field. By removing the constant background correlation, the exclusive velocity vector field of the particles can be observed.

The difference in clarity of the correlation is significant, and can be seen in Fig. 1. Here, the cross correlation values can be graphically observed, both with and without the mean. Notice the sharper peak after the mean is removed, allowing for an easier decision of net velocity vector.
<figure><img src="image_2.png" /><figcaption>Fig. 1. (a) Mean Adjustment: before.</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>Fig. 1. (b) Mean Adjustment: after.</figcaption></figure>

### 2.1.2 Correlation Peak averaging

Cross correlation calculates the correlation at each integer displacement by considering the peak displacement and thereby choosing the most likely integer displacement.
One drawback with this method is that velocities are locked into integer values, and so the error introduced can be ±0.5 pixels. A second drawback is the decision method cannot consider several velocities as it only takes the single peak. Both the drawbacks can be solved by peak averaging, as described in [8]. Fig. 1 depicts the case where the true velocity lies between two integer pixel displacements. Cross-Correlation PIV [8] method looks at the estimated region of peak, and determines the 'centre of gravity' by using a weighted average at that location to improve the accuracy. The modified algorithm used in the simulation takes a weighted average of all local maxima within 80-100% of the largest correlation. For this simulation, taking above the 80th percentile of peaks empirically provides a good balance between accurate vector estimation and speed.

## 2.2 Angle Filtering Systems

The final feature that is unique to this simulation is the filter for the laser's scanning angle. The laser may not be able to sweep the entire field in a single time frame, so utilisation of these filters allows the system to obtain partial information and can be combined to provide an accurate full field.

### 2.2.1 Physical Setup

There are two physical configurations (methods) for the considered angular filter: 1. Successive images per step (pre-processing) and 2. Scan the field and correlate (post processing).

Method 1 iterates through a range of angles, and for each iteration, takes two successive images. These images are directly compared against each other, and the resultant vector fields combined. Method 2 iterates through a range of angles twice; each time taking a single image. Iterating twice produces two images per angle, with a longer time step between each image.

The limiting factor for these systems is the time gap between correlations, which determines the maximum measurable velocity. To compare each system, the time gap was set constant and the space to scan was divided up into 20 segments. It was found that the time to scan the field using Method 1 required 20 times that of Method 2, and the time between each angle was 40 times that of Method 2. This suggests that for measuring a velocity field, Method 1 takes longer to scan however puts less strain on equipment. It should also be noted that Method 2 has a significant memory cost, as the system must hold the image in memory until another image appears for comparison. For 20 segments, this would require 20 images to be stored in memory at any time. The extension of this project will have access to a high speed scanner, and hence Method 2 was chosen.

Applying maximum dust speed calculations to the model, with an estimate of the laser being 1 pixel in diameter and a 1200x1000 pixel image, the time taken to scan the entire field using Method 2 is about 0.5 seconds ignoring the camera delay. A large delay is introduced from the high resolution required due to the small diameter of the laser. However, by utilising the exposure of the camera and the indirect illumi-
nation from the beam, the effective resolution and hence the time can be vastly improved. This will introduce an error due to blurring, and will require calibration and filtering to reduce the error to an acceptable level.

### 2.2.2 Vector Merging Algorithm.

It is possible that the laser may not cover the field fast enough to include it within one frame, and even if it does, the exposure may increase noise beyond an acceptable threshold. This scenario would instead require multiple frame comparisons, and a method to merge the resultant fields. The method of merging can be done by adding using a rectangular window; however by using more complex functions a higher accuracy can be achieved per vector coordinate, via a weighted average.

The proposed method uses a triangle function. For a particular measured angle, the following algorithm is used:

For each Vector Position,

```
If[θ_laser - angleStepSize < θ_V < θ_laser + angleStepSize]
    Vector V += 1-Abs[ (θ_laser - θ_V) ] / angleStepSize * VectorV_0
```

where

θ_laser is the angular position of the laser.

angleStepSize is the space between laser positions, determined by 'resolution'.

θ_V is the polar coordinate angle of the vector's position in the vector field.

Vector_V is the current state of the output vector at a position, and initialised as {0,0}.

Vector_V0 is the original state of the vector, produced using the correlation algorithm with the unfiltered images.

This results in the following function per vector point:

$$a = (θ1 - θ_a)/(θ1 - θ2).a2 + (θ_a - θ2)/(θ1 - θ2).a1 \quad (3)$$

where

θ1 and θ2 are the two closest possible angular positions of the laser

θ_a is the polar coordinate angle of the vector's position

a1 is the vector at the position generated from images at laser angle θ1

a2 is the vector at the position generated from images at laser angle θ2

The above is a basic weighing function which weighs the vectors according to the closeness to the laser in each laser's iteration. The sum across the full range of angles results in a full field with unit scaling on all vectors.

For regular repeating angles, the algorithm can be pre-processed, which allows the merging function to be implemented by simply multiplying a 'kernel' to each field, effectively applying a scalar weighting to each vector. By estimating the angle to match that of the kernel, the processing speed can be vastly improved.
The use of this algorithm allows a continuous sum that emphasises vectors that contain accurate information, by being closer to the beam. It should be noted that although a simple triangle function was used, any other window function that sums to unity would also work.

# 3 Simulation and Testing

## 3.1 Methodology

Initially the original, non-angle filtered PIV system was tested using a simulation of randomly moving pixels, with a net velocity applied to the pixels. The purpose of this simulation was to confirm that the system was processing and displaying the right velocities. Once confirmed, the original system was used as a benchmark for comparison with the new system.

A particle-based fluid dynamics simulation was developed to test the PIV system for complex flow. Here, a typical attic space was modelled in Mathematica. This attic space allowed for particles to flow in from the sides of the attic, and force applied to eject them from the top. This simulation was based on algorithms described in a fluid modelling thesis [9]. A screen-shot of the simulation can be seen in Figure 2, and the applied angle filtering algorithm in Figure 3.

The fluid simulation has several features, including particle collision, diffusion, advection, velocity damping, boundary conditions, and force. It also simulates the laser by displaying the particles at a particular depth, as well as within a range of a polar coordinate angle with a Gaussian decaying boundary. A sample of this can be seen in Figure 3. This display method assumes the light scattering of the laser on the particles is Mie scattering. Physical dust particles have a highly irregular shape and hence irregular scattering. However, for this system the dust particles move and rotate relatively slow compared to the camera and scanner, even after considering their volatility. Hence it can be assumed that scattering will not fluctuate significantly within the time frame.

The fluid simulation was run with 100 particles, simulating an attic space of dimensions 4mx5mx2m. The PIV system was then applied to these images, in various sample steps. The original and angle filtered systems were measured over the same time interval. The original system was tested over 50 steps at 0.01 seconds while the angle filtered system was measured over 1000 steps, angular resolution 1/20 of a frame, at 0.01 seconds. This provided a 0.5 sec total interval.

The test used to measure the quality of the system was correlation distance. To measure consistency, the correlation distance was measured between the original and the angle filtered system.
<figure><img src="image_4.png" /><figcaption>**Fig. 2.** Screen-shot of a 3d view of the fluid simulation. Arrows indicate a force field, replicating the force due to negative pressure.</figcaption></figure>
<figure><img src="image_5.png" /><figcaption>**Fig. 3.** Screen-shot of 2d view (rotated), during scan and generation of velocity field. Overlaid is the interrogation cells and their effective weighing (brighter is stronger weighting).</figcaption></figure>

## 3.2 Results

The results of the pixel simulation can be seen in Figure 4. The net velocity applied to the pixels were {30, 20, 1} as {x,y,z} coordinates, with uniform randomness of up to ±5. On empirical analysis, the velocity field displays an accurate velocity where pixels are present, and displays a small error for velocities where the cell contains few pixels.

A second set of results can be seen in Figure 4. Here, a system describing an attic space, as displayed in the Methodology, is analysed for particle flow where air feeds from the sides and force applied to remove them from the top.

A noticeable problem with the system is that velocities appear to change slowly across sharp borders. An example of this can be observed in Figure 5 between the boundary of visible and non-visible particles. Only the beam of particles (visible as
white dots) show a visible displacement per frame, and so it is expected that non-zero
velocities only exist at the location of the particles. However, in the Figure the non-
zero velocities extend to no particle space in a cell. This can be explained as an effect
of linear spatial smoothing, in an attempt to generate smoother flow. The presence of
this smoothing is questionable, so the effect may need to be removed or improved
using a different function, depending on the desired effect.

<figure><img src="image_6.png" /><figcaption>Fig. 4. Vector field describing fluid flow in an attic space.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 5. Vector field of velocities due to pixel drift.</figcaption></figure>

4 Conclusion

In conclusion, a PIV system utilising a non-diverging laser beam produces a velocity
field of similar quality to a velocity field of a standard PIV systems. By using appro-
priate filters the accuracy of this new system is comparable to that of standard ones, while maintaining constant beam power across a distance. The downside to this filtering produces errors at boundaries, and so is a consideration for implementation of such systems.

The simulation suggests the use of dust particle tracers works for PIV systems, and provides evidence for proceeding to implement a PIV system with this methodology.

## References

1. Lloyd, C. R., Callau, M. F., Bishop, T., & Smith, I. J. The efficacy of an energy efficient upgrade program in New Zealand. *Energy and Buildings*, 40(7), 1228-1239 (2008).

2. Isaacs N., et al. Energy Use in New Zealand Households: Final Report on the Household Energy End-use Project (HEEP). BRANZ Study Report 221, BRANZ Ltd, Judgeford, New Zealand (2010).

3. Howden-Chapman P., Crane J., Matheson A., Viggers H., Cunningham M., Blakely T., O'Dea D., Cunningham C., Woodward A., Saville-Smith K., Baker M., Waipara N. Retrofitting houses with insulation to reduce health inequalities: Aims and methods of a clustered, randomised community-based trial, *Social Science & Medicine*, Volume 61, Issue 12, December 2005, Pages 2600-2610 (2005).

4. Raffel, M., Willert, C., & Kompenhans, J. Particle Image Velocimetry, A Practical Guide Springer. New York. (1998).

5. Cao, X., Liu, J., Jiang, N., & Chen, Q. Particle image velocimetry measurement of indoor airflow field: A review of the technologies and applications. *Energy and Buildings*, 69, 367-380. (2014).

6. Adrian, R. J. Particle-imaging techniques for experimental fluid mechanics. *Annual review of fluid mechanics*, 23(1), 261-304 (1991).

7. Westerweel, J. Fundamentals of digital particle image velocimetry. *Measurement Science and Technology*, 8(12), 1379 (1997).

8. Bastiaans, R. J. Cross-correlation PIV; theory, implementation and accuracy. Eindhoven University of Technology, Faculty of Mechanical Engineering. (2000).

9. Roy T. M. Physically-Based Fluid Modeling using Smoothed Particle Hydrodynamics. http://www.plunk.org/~trina/thesis/html/thesis_toc.html. Accessed 20 Feb 2014. (1995).