# Investigation on the Interface Smoothing of Coupled N–S/DSMC Method Using Image Processing Filters

## Abstract

Gas flow problems involving both continuum and rarefied regimes are common in many scientific and engineering applications. Coupled N–S/DSMC method is a major solution to simulate the continuum–rarefied transitional flow. Interface determination is one of the key aspects in developing coupled N–S/DSMC solver, which is often implemented using continuum breakdown parameters to indicate the rarefication level. Due to the statistics characteristic of DSMC method, distribution of the continuum breakdown parameters usually fluctuates, resulting in difficulty in locating the interface. Considering the similarity between continuum breakdown parameter smoothing and noise reduction in image processing, a general smoothing method is proposed in this paper, which employs the image filters to smoothen the distribution of continuum breakdown parameters. Two commonly used image filters, the mean filter and the median filter, are investigated. Several comparison studies are implemented by simulating a typical vacuum plume impingement flow problem. The median filter with 5 × 5 mask provides the best performance. The flow problem of flow over a 2D cylinder is used to validate the coupled N–S/DSMC solver using median filter to smoothen continuum breakdown parameter, which proves the accuracy of the coupled solver and validity of the smoothing method.

## Keywords

Coupled N–S/DSMC method Continuum breakdown parameter Interface smoothing Mean filter Median filter## 1 Introduction

In many scientific and engineering applications, gas flows containing both continuum and rarefied regimes need to be studied, such as in the vacuum plume flow problem of space thrusters, inside the thruster nozzle, the gas density is high, while outside the nozzle, it drops rapidly, approaching to the vacuum state and the degree of the rarefaction of gas changes extremely, from continuous gas flow to rarefied gas flow. It is difficult to adopt one single method to simulate this kind of problem and the coupled Navier–Stokes (N–S) and Direct Simulation Monte Carlo (DSMC) [1] method is a preferable solution, which handles the continuous and rarefied gas regions using Computational Fluid Dynamics (CFD) method and DSMC method, respectively. There are two important issues in developing an N–S/DSMC solver, which are interface location and information exchange between the continuums and rarefied regions, and current paper pays special attention to the former one.

To measure the extent of rarefaction quantitatively, researchers have proposed different continuous breakdown parameters. Because the *Kn* parameter [1] is a global parameter, it isn’t suitable for coupled N–S/DSMC method as a continuous breakdown parameter. Based on the *Kn* number, several continuous breakdown parameters have been developed, including *P* parameter [2], *Kn*_{GLL} parameter [3], *Kn*_{GL} parameter [4], *B* parameter [5, 6, 7], and the *P*_{tne} parameter [8].

Previous studies have been carried out on the formation of continuous breakdown parameters, but no matter what kind of continuous breakdown parameters are employed, an extra smoothing operation must be performed before a satisfactory interface location result can be obtained. The reason is that, the continuum breakdown parameters within the DSMC region are calculated from variables those are got from particle statistics, and thus the fluctuation of the continuum breakdown parameters is inevitable. After a threshold value is set, the interface will not be an ideal curve or curved surface in 2D and 3D coordinate, respectively, but a complicated situation will appear. Many scattered isolated partitions will appear near the interface, making the further coupled calculation hard to implement.

Former coupled N–S/DSMC solvers [9, 10, 11] must have had considered this problem in some manner, but no special research has focused on it. In the present paper, investigations are performed on this subject, aiming to find a general solution for coupled N–S/DSMC method to locate the interface more reliably and flexibly.

The interface smoothing problem and the noise reduction problem in the image processing are considered analogous in the present paper. Thus two common filtering methods in image processing, the mean filter and median filter, are introduced to deal with the partition smoothing in coupled N–S/DSMC calculation.

## 2 Coupled N–S/DSMC Method

The DSMC method, which was proposed by G. A. Bird [1, 12], uses a small number of simulation particles instead of a large number of gas molecules in the real flowfield to obtain the macroscopic flow parameters by statistical means. In the actual gas flow, the movement and collision of gas molecules are always carried out simultaneously, meaning that they are coupled. DSMC method uses probabilistic (Monte Carlo) means to decouple the motion and the collision of gas molecules, simplifying the process of the algorithm and saving much computational time. But the consumption of computational resources is still unacceptable to employ DSMC method in the continuum region, while the CFD method, which solves the gas dynamic equations using finite difference schemes, is quite mature and efficient in modeling the continuum flow. The N–S solver is only available in the continuum region because of the hypothesis that the equations based on. Since DSMC method and N–S solver have their own proper applications, respectively, the concept to couple these two methods to form a continuum–rarefied transitional flow solver is straightforward.

A DSMC code named PWS [13] (Plume Work Station) is used as the DSMC solver in the current coupled N–S/DSMC research. The PWS is developed by the authors based on the Cartesian grid system. The surfaces in complex geometries of flowfield are divided into several simple convex units and embedded in the grid as described in Ref. [13]. HS (Hard Sphere), VHS (Variable Hard Sphere), VSS (Variable Soft Sphere), CLL (Cercignani–Lampis–Lord) molecular models are implemented in PWS, and RSF (Random Sampling Frequency) collision sampling method is adopted [14].

*μ*

_{ref}and

*T*

_{ref}denote reference viscosity and reference temperature, respectively, and

*ω*is the power-law exponent.

*Kn*

_{GL}is used as the continuum breakdown parameter in the current study, which is defined as:

*Q*represents density, velocity magnitude and temperature in Eq. (2).

*λ*is the mean molecule-free path.

## 3 Problem in Interface Determination

In the coupled method, the continuum/rarefied interface is decided by continuous breakdown parameters. From the definitions of *Kn*_{GL}, it can be figured out that they are all calculated from the derivation of macroscopic gas parameters. When calculating the *Kn*_{GL} within the rarefied regions, the related gas parameters are all obtained by the statistics of particles, and thus the fluctuation is inevitable. What is even worse is that before the interface reaches to a steady state, there will not be enough steps of DSMC calculations in each coupled iteration to increase the convergence speed, and thus there will not be enough number of particles to obtain smooth macroscopic gas parameters by statistics.

*Kn*

_{GL}(left) and domain partition (right, by setting 0.05 as the threshold value) obtained by N–S/DSMC simulation after 15 coupled iterations without continuum breakdown parameter smoothing technique. It can be seen that the higher

*Kn*

_{GL}regions, which indicate more rarefied, are mainly distributed in three types of zones: the bow shock zone within the direct impingement region, the backflow zone and the shear flow zone near the plate with high radial position. This distribution result is qualitatively reasonable. A notable issue can be found from the figure is that the

*Kn*

_{GL}distribution in some zones is very disorderly. As mentioned above, the statistic fluctuation in the rarefied partition results in the rough distribution of

*Kn*

_{GL}. By setting 0.05 as the continuum–rarefied threshold value, the domain partition result can be obtained as shown in the right part of Fig. 4. Several small isolated N–S regions are located within the DSMC region. It is obvious that this partition result is unacceptable in coupled calculation. Meanwhile, the bow shock narrow zone is also labeled as DSMC region because of the higher

*Kn*

_{GL}value within the shock wave. Although the gradient of parameters is large within the shock, which results in the high

*Kn*

_{GL}, the density is much high here comparing with the back-flow region. N–S calculation can provide reliable results in this zone, and it would consume much more computational resources if DSMC is employed in this region.

This demonstration case shows that, without continuum breakdown parameter smoothing technique, further coupled N–S/DSMC calculation is difficult to perform.

## 4 Two Commonly Used Spatial Image Filters

*f*(

*x*,

*y*), defined in the neighborhood of (

*x, y*), which represents the pixels segment of the original image.

*T*is a kind of smooth, de-noising operation for

*f*(

*x*,

*y*). The output function is

*g*(

*x*,

*y*), that expresses the pixel distribution of the processed image. To define neighborhood of (

*x, y*), the main method is to use a rectangular or square sub-image, whose center is (

*x*,

*y*), as shown in Fig. 5. The sub-image can be called mask. The mask’s center moves from one pixel to another, and the operation is applied to each position to get the output. Mean filter and median filter are two kinds of spatial filtering methods for de-noising [15].

### 4.1 Mean Filter

*M*×

*N*matrix, after a m × n (

*m*and

*n*are odd numbers) weighted mean filtering process can be given by the following formula:

*x*= 0, 1, 2, 3 …

*M*− 1,

*y*= 0, 1, 2, 3 …

*N −*1.

The smoothing effect of mean filter is related to the radius of the mask. The larger the radius, the greater the fuzzy degree, the more smooth the image is. Due to the very small area occupied by the mask in an image, it is difficult to see the difference between the images after smoothing by various masks in Fig. 6 [15].

### 4.2 Median Filter

*f*

_{1},

*f*

_{2}, …

*f*

_{n}}, and do median filtering to the sequence by a masking with a length of

*m*(

*m*is an odd number). That is, extract

*m*numbers: {

*f*

_{i},

*f*

_{i+1}, …

*f*

_{i+m−1/},…

*f*

_{i+m−2},

*f*

_{i+m−1}}, sort the

*m*numbers according to numerical value, and replace the center point’s gray value by the middle value of the rank. Its principle can be expressed by the following formula:

In practical, the larger the masking, the more obvious the de-noising effect is. If the mask is too large, it will lead to changes in contour lines. It is necessary to select the size of the masking carefully.

## 5 Image Filters Applied to *Kn* _{GL} Smoothing

In image filtering, the data to be operated is the pixel values. Correspondingly in N–S/DSMC-coupled computation, the filtering method is employed, while the target data to be operated is replaced with continuum breakdown parameter, which is *Kn*_{GL} parameter in the present study. A cell in the coupled calculation mesh corresponds to a pixel position in an image, and the *Kn*_{GL} is regarded as the pixel gray value in an image.

There are several configuration parameters for each image filter, such as mask radius and using weight or not in mean filter. To investigate which filter and what kind of filter configuration is more preferable, several simulations are performed using different filters and different configurations.

### 5.1 Mean Filter

*Kn*

_{GL}comparison results are shown in Fig. 7.

It can be figured out that, when the radius is 3 × 3, *Kn*_{GL} distribution is more disordered, the 0.05 contour lines surround several isolated zones, and some cells within the shock wave have *Kn*_{GL} larger than 0.05, which means it will be determined as DSMC cells. The 5 × 5 mask includes more pixels to average, increases the fuzzy level, and thus achieves a more smooth *Kn*_{GL} distribution result, at the same time reserves the overall shape. Within the shock-wave cells, all the *Kn*_{GL} values are below 0.05, and thus can be considered as continuum partition.

Among the three configurations, comparison results show that the 5 × 5 standard average mean filter mask provides an acceptable smoothing effect.

### 5.2 Median Filter

*Kn*

_{GL}in the shock-wave zone cells to less than 0.03. Again, the smaller filter mask results in some isolated zones, and like the results in Fig. 7, the larger filter mask gets a preferable

*Kn*

_{GL}distribution.

*Kn*

_{GL}distribution seems smoother after operated by the median filter and at the same time reserves the overall characteristics. So the median filter is proved to be a more preferable continuum breakdown parameter smooth method.

## 6 2D Cylinder Flow for Validation

*U*

_{∞}= 1884 m/s,

*T*

_{∞}= 217 K,

*P*

_{∞}= 4.8 Pa, and Ma = 6.

*Kn*

_{GL}contour lines between the median filter-operated data and the original without smoothing one. After treatment, the final interface removes the isolated areas. A bow shock wave is produced ahead of the cylinder where the flow parameters change extremely. Because the pressure is relatively low and thus the shock is much thicker than the one in the previous flow problem. The filter smoothens the contour lines instead of diminishing the shock-wave zone. Likewise, from the view of accuracy, the DSMC calculation describes the shock-wave structure more precisely. The DSMC region close to the cylinder surface is due to the slip of gas. The domain partition result is reasonable.

The comparison validates the accuracy of the coupled solver employing median filter to smoothen *Kn*_{GL} and demonstrate the smoothing effect again.

## 7 Conclusion

The coupled N–S/DSMC method is an efficient and accurate solution for continuum–rarefied gas flow simulation. Determination of the continuum–rarefied interface is one of the important aspects in coupled N–S/DSMC computation. Although several continuum breakdown parameters have been proposed by former researchers to indicate the rarefication level, the continuum breakdown parameter would fluctuate in practice, making the interface hard to locate. The present paper proposed a new method to pre-process the continuum breakdown parameter, which borrows the ideas form image processing. Two commonly used image filters, the mean filter and the median filter, are employed to smoothen the *Kn*_{GL} continuum breakdown parameter in the coupled N–S/DSMC calculation. Several comparison studies were implemented by simulating a typical vacuum plume impingement flow problem. The median filter with 5 × 5 mask was proved to be more preferable. A benchmark flow problem of flow over a 2D cylinder was simulated with the coupled N–S/DSMC method, using median filter to smoothen continuum breakdown parameter, and was compared to the full DSMC results, which validated the accuracy of the coupled solver and demonstrated the median filter smoothing effect. The image filter investigated in this paper is also suitable for other coupled solver and continuum breakdown parameters.

## 8 Future Work

The interface determination technique contains more or less some empirical factors. To ensure the accuracy, the median filter with strong smoothing property is employed in the present investigation. The reviewers inspired us a new interesting idea that the interface can be defined using an edge detector operator. In this case, the image is smoothed first by a Gaussian Kernel and then the interface is determined using the Canny operator. This idea will be studied in the future.

## References

- 1.Bird GA (1976) molecular gas dynamics. Oxford University Press, OxfordGoogle Scholar
- 2.Bird GA (1970) Breakdown of translational and rotational equilibrium in gaseous expansions. AIAA J 8(11):1998–2003ADSCrossRefGoogle Scholar
- 3.Boyd ID, Chen G, Candler GV (1995) Predicting failure of the continuum fluid equations in transitional hypersonic flows. Phys Fluids 7:210–219ADSCrossRefGoogle Scholar
- 4.Wang WL, Boyd ID (2003) Predicting continuum breakdown in hypersonic viscous fows. Phys Fluids 15:91–100ADSCrossRefGoogle Scholar
- 5.Sun Q, Boyd ID, Candler GV (2004) A hybrid continuum/particle approach for modeling subsonic, rarefied gas flows. J Comput Phys 194:256–277ADSCrossRefGoogle Scholar
- 6.Garcia Alejandro L, Bell John B, Crutchfield William Y et al (1999) Adaptive mesh and algorithm refinement using direct simulation Monte Carlo. J Comput Phys 154:134–155ADSCrossRefGoogle Scholar
- 7.Schwartzentruber TE, Scalabrin LC, Boyd ID (2007) A modular particle-continuum numerical method for hypersonic non-equilibrium gas flows. J Comput Phys 225(1):1159–1174ADSMathSciNetCrossRefGoogle Scholar
- 8.Lian Y (2006) Development and verification of a parallel coupled DSMC–NS scheme using a three-dimensional unstructured grid. National Chiao Tung University, HsinchuGoogle Scholar
- 9.Schwartzentruber TE, Boyd ID (2006) A hybrid particle-continuum method applied to shock waves. J Comput Phys 215(2):402–416ADSMathSciNetCrossRefGoogle Scholar
- 10.Wu J-S, Lian Y-Y, Cheng G et al (2006) Development and verification of a coupled DSMC–NS scheme using unstructured mesh. J Comput Phys 219:579–607ADSCrossRefGoogle Scholar
- 11.Zhenyu Tang, Bijiao He, Guobiao Cai (2014) Investigation on a coupled Navier–Stokes-direct simulation Monte Carlo method for the simulation of plume flowfield of a conical nozzle. Int J Numer Meth Fluids 76(2):95–108MathSciNetCrossRefGoogle Scholar
- 12.Bird GA (1994) Molecular gas dynamics and the direct simulation of gas flows. Clarendon Press, OxfordGoogle Scholar
- 13.Bijiao He, Xiaoying He, Mingxing Zhang et al (2013) Plume aerodynamic effects of cushion engine in lunar landing. Chin J Aeronaut 26(2):269–278CrossRefGoogle Scholar
- 14.Shen Q (2003) Rarefied gas dynamcis. National Defense Science and Technology Industry Press, Beijing, p 321
**(in Chinese)**Google Scholar - 15.Gonzalez RC, Wintz P (2001) Digital image processing, vol 28, no 4. Prentice Hall International, Upper Saddle RiverGoogle Scholar