1 Introduction

Numerical simulations have been in use for the last few decades and have reached high attention for simulating the physical phenomena. A typical Computational Fluid Dynamics(CFD) problem includes geometry definition, mesh generation, numerical solver and post-processing of the simulation results. The most time consuming step is often the mesh generation, especially for complex geometries in traditional CFD. The mesh has to conform to the boundary to be able to depict the geometry precisely. Immersed boundary method is a recent approach to apply the boundary condition to a non-conforming mesh. It simplifies the mesh generation process [1], especially for complex geometries and for dynamic cases. It was proposed by Peskin [2] in 1972 to handle elastic boundaries for simulating blood flow in the heart [3]. As per Rajat Mittal et al. [1], the IB methods can be classified primarily in Continuous Forcing(CF) and Discrete Forcing(DF) approach. The CF approach is very useful for elastic bodies whereas DF approaches are useful for solid objects. As part of the DF approach, “sharp interface” immersed boundary approach is suitable for solid boundaries [1] and can be implemented in two different ways. The first one is the Indirect Boundary Condition(IBC) implementation and the second is the Direct Boundary Condition(DBC) implementation. The Indirect Boundary Condition implementation does not provide the required local accuracy. The DBC approach has proved to be the best candidate for simulating compressible flow cases as evident from the work presented in [4, 5] and [6]. Again, the sharp interface method can be implemented in multiple ways which includes ghost cell and cut-cell approaches. Ghost cells are the cells inside the solid region with at least one neighbour inside the fluid. The Cut-cell method uses a control volume which is entirely in the fluid domain but is an irregular polygon near the boundary [7]. Such polygons result from the modified cells containing the boundary.

The first step for IB implementation is the proper cell classification, called tagging. The cells in the solid domain, inside the geometry, are called solid cells. Fluid cells lie in the fluid domain with complete stencils and the cells in the fluid domain with at least one neighbouring cells in the solid domain are classified as intercepted cells. The intercepted cells need special treatment as these will be used for the boundary condition implementation using an interpolation function. The solid cells are not solved and for fluid cells typical Finite Volume(FV) schemes are used. The classification of solid and fluid cells can be done easily using any one of the methods including Ray tracing [8,9,10,11], Level set approach [12,13,14], point in a polygon method and explicit minimum distance approach [15].

There are numerous implementations of IBM for compressible and incompressible flows. The work by Kumar et al. [16] focused on the issues of mass conservation and pressure fluctuations. Picano et al. [17] implemented the pressure-driven turbulent flow in the presence of buoyant particles. Ji et al. [18] used an iterative IB method for solving viscous flows using finite volume. Roy and Acharya [19] coupled IBM with large-Eddy simulations for turbulent flows. Balaras [20] used the bi-linear interpolation for complex geometries and demonstrated flow over a cylinder as a benchmark case. Later Yang and Balaras [21] modified and improved the method for moving geometries as well. Udaykumar et al. [22] used a sharp interface method for moving geometries using cell modification, i.e. converting a cell to a trapezoid, more similar to a cut-cell method. Many of the schemes focused on the ghost cell approach which includes the work of Zhang et al. [23]. One major drawback of this method is that if the size of the geometry or a part of the geometry is relatively thin such that there is no ghost cell inside the geometry, it can not be captured by the numerical method. However, the one-sided interpolation technique discussed in Yang and Balaras et al. [21] removes these drawbacks.

Most of the work present in the literature are based on the explicit interpolation such as the one presented by Yang and Balaras [21]. In this method, for each intercepted cell, interpolation is done by completing a local interpolation stencil. There are different interpolation schemes that can be applied for constructing the solution for the interface cells. The simplest of these interpolation methods for a 2-dimensional problem is the bi-linear interpolation as presented in Yang and Balaras [21]. Other notable work on linear interpolation includes the work by Mittal et al. [24] which used tri-linear interpolation for 3-D cases. Kim et al. [25] also used bi-linear interpolation but it reverts to a linear interpolation wherever the interpolation stencil is not complete [26]. Least square methods are also used by some authors as interpolation function [27,28,29]. Qu et al. [30] used the constrained moving least square method(CMLS) for the interpolation which eliminates the instabilities observed in moving least square interpolation. The moving least square enables the formulation with higher-order polynomials with flexible interpolation stencils. However, using high-order polynomials for interpolation could be a source of oscillatory behaviour in the solution [31]. Another popular interpolation scheme is radial basis function for which examples can be found in [32, 33] and [34]. The problem with explicit interpolation appears when the interpolation stencil is not complete and one or more cells constituting the interpolation stencil are part of the intercepted cells. In order to perform explicit interpolation in these cases, the interpolation stencil is moved further in the fluid domain. This is one of the problems reported in Yang Balaras et al. [20] and this has been explained in detail in [35].

In this paper, a one-sided bi-linear interpolation using an image point of the intercepted cell is presented for two different governing equations. At first, it is applied for the diffusion equation and then it is extended to the Euler equations. Moreover as stated previously, in some cases, an explicit interpolation can not be performed because of the incomplete interpolation stencils. For these cases, an implicit interpolation strategy is presented. This eliminates the necessity to identify these special cases where the interpolation cannot be performed and to apply a different interpolation strategy which includes moving away from the boundary and selecting the next nearest fluid cell available. A case with an inclined shock tube is presented which validates the tagging as well as the implicit interpolation strategy for compressible flow cases. It has to be noted here that, although the present implementation is for inviscid flows, the implicit interpolation strategy can be implemented in the same way for compressible and incompressible NS equations as well. Moreover, a new way of implementing slip boundary condition has been introduced.

This paper consists of five different sections. Section 1 introduces the Immersed Boundary approach and overall outlook of the paper. Section 2 focuses on the numerical modelling including the interpolation strategy, boundary conditions and the governing equations. Section 3 focused on the Results and discussions and Sect. 4 is the conclusion where the results obtained and drawbacks are discussed.

2 Numerical model

2.1 Governing equations

2.1.1 Governing equations for thermal diffusion

The heat diffusion equation with a constant thermal conductivity (\(\kappa \) = 1) and without any source term is given by

$$\begin{aligned} \frac{\partial ^2 T}{\partial x^2} + \frac{\partial ^2 T}{\partial y^2} = 0 \end{aligned}$$
(1)

where T is the temperature.

2.1.2 Governing equations for inviscid compressible flows

The present study is based on the two-dimensional Euler equations. The Euler equations can be written as

$$\begin{aligned}{} & {} \rho _t +(\rho u)_x+(\rho v)_y=0, \end{aligned}$$
(2)
$$\begin{aligned}{} & {} (\rho u)_t +(\rho u^2 +p)_x+(\rho u v)_y=0, \end{aligned}$$
(3)
$$\begin{aligned}{} & {} (\rho v)_t +(\rho v^2 +p)_y+(\rho u v)_x=0, \end{aligned}$$
(4)
$$\begin{aligned}{} & {} E_t +[u(E+p)]_x+[v(E+p)]_y=0, \end{aligned}$$
(5)

where E is the total energy per unit volume:

$$\begin{aligned} E= \rho \left( \frac{1}{2} {{\textbf {V}}}^2 + e\right) \end{aligned}$$
(6)

Equations (2) to (5) can be expressed in a compact from, suitable for CFD applications:

$$\begin{aligned}{} & {} U_t + F_x +G_y = 0,\nonumber \\{} & {} U = \begin{bmatrix} \rho \\ \rho u \\ \rho v \\ E \end{bmatrix}, \hspace{1.5cm} F = \begin{bmatrix} \rho u \\ \rho u^2 +p \\ \rho u v \\ u(E + p) \end{bmatrix}, \hspace{1.5cm} G = \begin{bmatrix} \rho v \\ \rho u v \\ \rho v^2 +p \\ v(E +p) \end{bmatrix}. \end{aligned}$$
(7)

2.2 Numerical method

2.2.1 Diffusion equation

The diffusion problem is solved using a typical Finite Volume Method as described in Versteeg and Malalasekera [36]. Once Eq. (1) is integrated over a control volume, it gives

$$\begin{aligned} \int \limits _{\Delta V}\frac{\partial ^2 \phi }{\partial x^2} \mathrm{{d}}x. \mathrm{{d}}y + \int \limits _{\Delta V} \frac{\partial ^2 \phi }{\partial y^2} \mathrm{{d}}x. \mathrm{{d}}y = 0. \end{aligned}$$
(8)

Assuming the areas for east, west, north and south faces to be \(A_e\), \(A_w\), \(A_n\) and \(A_s\), respectively, such that \(A_e\) \(=\) \(A_w\) \(=\) \(\Delta y\) and \(A_n\) \(=\) \(A_s\) \(=\) \(\Delta x\) and \(\Delta {v}\) as the control volume. Converting volume integral to boundary integral, Eq. 8 finally becomes

$$\begin{aligned} \left[ A_e{\left( \frac{\partial \phi }{\partial x}\right) }_e - A_w {\left( \frac{\partial \phi }{\partial x}\right) }_w\right] + \left[ A_n\left( {\frac{\partial \phi }{\partial x}}\right) _n - A_s {\left( \frac{\partial \phi }{\partial x}\right) }_s\right] = 0. \end{aligned}$$
(9)

The numerically discretised fluxes through the faces for the control volume can be written as

$$\begin{aligned} \text {East Face flux }= & {} A_e \frac{\phi _E - \phi _Q}{\delta _{QE}}, \end{aligned}$$
(10a)
$$\begin{aligned} \text {West Face flux }= & {} A_w \frac{\phi _Q - \phi _W}{\delta _{WQ}}, \end{aligned}$$
(10b)
$$\begin{aligned} \text {South Face flux }= & {} A_s \frac{\phi _Q - \phi _S}{\delta _{QS}}, \end{aligned}$$
(10c)
$$\begin{aligned} \text {North Face flux }= & {} A_n \frac{\phi _N - \phi _Q}{\delta _{NQ}}. \end{aligned}$$
(10d)

Finally, the final fluxes can be discretised in the form

$$\begin{aligned} a_q \phi _Q = a_e \phi _E + a_w \phi _W + a_n \phi _N + a_s \phi _S, \end{aligned}$$
(11)

where

$$\begin{aligned} \begin{aligned} a_q&= \left( {\frac{A_e}{\delta _{QE}} + \frac{A_w}{\delta _{WQ}} + \frac{A_n}{\delta _{NQ}} + \frac{A_s}{\delta _{QS}}}\right) ; \; a_e = \left( {\frac{A_e}{\delta _{QE}}}\right) ;\; a_w = \left( {\frac{A_w}{\delta _{QW}}}\right) ;\;\\ a_n&= \left( {\frac{A_n}{\delta _{NQ}}}\right) ; \; \text {and} \; \; a_s = \left( {\frac{A_s}{\delta _{QS}}}\right) , \end{aligned} \end{aligned}$$
(12)

where \(\delta _{QE}\) is the distance between points Q and E and all other distances are defined in the same way, as shown in Fig. 1.

Equation (11) is applied to all cells in the fluid region, except for the interface cells.

Fig. 1
figure 1

2-Dimensional mesh representation for diffusion problem

2.2.2 Euler equations

Roe scheme is essentially a flux difference splitting scheme. It was first presented by Roe [37] and since has been used and modified in a number of ways. For the present case, the original Roe scheme has been used as presented in [38].

The inter-cell flux, as per [38], is given as

$$\begin{aligned} F_{i+\frac{1}{2}} = \frac{1}{2} (F_R + F_L) - \frac{1}{2} \sum _{i=1}^m \tilde{\alpha _i} |\tilde{\lambda _i}| {\tilde{K}}^{(i)}, \end{aligned}$$
(13)

where \(m=3\) for one-dimensional case and \(F_R\) and \(F_L\) are the flux values for the right and left face of the \(i^{th}\) cell calculated from the primitive variables from the previous time step. \({\tilde{\alpha }}\) is the wave strength and \({\tilde{K}}\) is the right eigenvector with averaged variables.

Dimensional splitting is used to get the 2-D Roe scheme from 1-D Roe scheme as defined in [38]. The sweeps are handled by a single subroutine. In the x-sweep, following equations are solved:

$$\begin{aligned} \begin{bmatrix} \rho \\ \rho u \\ \rho v \\ E \end{bmatrix}_t \hspace{0.5cm} + \hspace{0.5cm} \begin{bmatrix} \rho u \\ \rho u^2 +p \\ \rho u v \\ u(E + p) \end{bmatrix}_x = 0. \end{aligned}$$

In the y-sweep, following equations are solved:

$$\begin{aligned} \begin{bmatrix} \rho \\ \rho u \\ \rho v \\ E \end{bmatrix}_t \hspace{0.5cm} + \hspace{0.5cm} \begin{bmatrix} \rho v \\ \rho u v \\ \rho v^2 +p \\ v(E +p) \end{bmatrix}_y = 0. \end{aligned}$$

The scheme is explicit and transient and for x-sweep, the explicit conservative form looks like

$$\begin{aligned} U_{i,j}^{n+\frac{1}{2}} = U_{i,j}^{n} + \frac{\Delta t}{\Delta x} \Big [F_{i - \frac{1}{2},j}^{n} - F_{i + \frac{1}{2},j}^{n} \Big ]. \end{aligned}$$
(14)

\(F_{i + \frac{1}{2},j}^{n}\) is the flux at the cell interface \(x_{i + \frac{1}{2}}\) as described in Eq. (13). Similarly, for y-sweep

$$\begin{aligned} U_{i,j}^{n + 1} = U_{i,j}^{n + \frac{1}{2}} + \frac{\Delta t}{\Delta x} \Big [G_{i,j - \frac{1}{2}}^{n + \frac{1}{2}} - G_{i, j + \frac{1}{2}}^{n + \frac{1}{2}} \Big ]. \end{aligned}$$
(15)

2.3 Tagging and immersed boundary implementation

For implementing immersed boundary, the tagging of the geometry with respect to the Cartesian mesh is required. In the present work, tagging has been done using point in a polygon approach. The tagging schematic is presented in Fig. 3. While moving in the clockwise direction along the geometric points, if, for a particular cell centre, \(|\textbf{A} X \textbf{B}| <0 \) for all the points on the geometry, then the cell centre lies inside the geometry; otherwise, it lies outside. Once, inside and outside have been determined, one needs to find the intercepted cells. For that, one needs to look into the cells which lie inside the fluid domain and for which the stencils are not complete.

Once the tagging is done, the cells can be broadly classified into three different types namely intercepted/interface cells, solid cells and the fluid cells. After that, the numerical solver is applied for the fluid cells. The solid cells are not solved and for the interface cells, interpolation schemes have to be applied. Figure 2 shows the classification of the cell types and stencil for bi-linear interpolation. The beauty of this scheme is that it is possible to tag the geometry even if the width of the geometry is less than the mesh size ("thin geometries") and the interpolation function can be applied to it.

Fig. 2
figure 2

Bi-linear interpolation with cell classification

Fig. 3
figure 3

Cross-product depiction

2.4 Bi-linear interpolation

2.4.1 Diffusion case

For implementing bi-linear interpolation with respect to immersed boundary, at first an image point "I" has to be found out which is \(\overrightarrow{PQ} = \overrightarrow{IP}\) which can be interpreted from Fig. 2. Also, it has to be noted that \(\overrightarrow{PQ} \) is perpendicular to the boundary. The geometry consists of set of points and ultimately a set of line segments joining two consecutive points. \(\overrightarrow{PQ} \) is perpendicular to the nearest line segments joining two consecutive points on the geometry. One example is shown in Fig. 4. After that, the image point is found out, upon this there are two different equations for a Dirichlet boundary condition:

$$\begin{aligned} \phi _{P} = (\phi _{I} + \phi _{Q})/2. \end{aligned}$$
(16)

From bi-linear interpolation, Fig. 2

$$\begin{aligned} \phi _{I} = a_{1}\phi _{1} +a_{2} \phi _{2}+ a_{6} \phi _{6}+a_{5} \phi _{5}; \quad \quad \mathrm{{where}} \quad \phi _5 = \phi _p. \end{aligned}$$
(17)
Fig. 4
figure 4

Normal to the boundary

The coefficients depend on the geometric location of the cell centres. Thus, from Equations (16) and (17), \(\phi _{P}\) can be found out. The image point, I as depicted in Fig. 2, lies along the normal to the geometry. There should be sufficient number of points to define the geometry, especially when the geometry consists of curves.

In Fig. 2, cell number 5 is an interface cell; therefore, the coefficients are to be found using the bi-linear interpolation described by Eq. (17). The ingenuity of the proposed method lies in the way interpolation is done. In some of the previous cited papers [20], the interpolation is done locally and if the interpolation stencil is not complete, it is required to move further away from the boundary in the fluid domain. However, this might induce error in the interpolation process. Moreover, finding whether the interpolation stencil is complete or not adds to the computational cost.

In this paper, we introduce the implicit interpolation strategy. This means that the interpolation is not done explicitly but through the construction of a system of equations which are solved at once. One such case is presented in Fig. 5 where the interpolation stencil is not complete. As per [20], it is not possible to do a regular bi-linear local or explicit interpolation for point \(IN_2\) as the interpolation stencil includes another interface cell \(IN_1\). This becomes a special case and in order to perform a bi-linear interpolation, the image point is moved further in the fluid domain. In this way, the stencil for bi-linear interpolation is complete.

Fig. 5
figure 5

Problem with explicit interpolation as presented in [20]

With implicit interpolation, the problem described above is not encountered. The system of equations obtained for each of the interface cells are assembled in a matrix and solved. Considering \(IN_2\) in Fig. 6, the equation for bi-linear interpolation for primitive variable represented as f(xy) can be written as

$$\begin{aligned} f(x, y)= & {} B_{11} f(x_{F_5}, y_{F_5}) + B_{21} f(x_{IN_2}, y_{IN_2}) + B_{12} f(x_{F_1}, y_{F_1}) \nonumber \\{} & {} + B_{22} f(x_{F_2}, y_{F_2}), \end{aligned}$$
(18)

where the coefficients \(B_{11}\), \(B_{21}\), \(B_{12}\) and \(B_{22}\) can be found by solving the following matrix system

$$\begin{aligned} \begin{bmatrix} B_{11}\\ B_{21}\\ B_{12}\\ B_{22} \end{bmatrix} = \left( {\begin{bmatrix} 1 &{} x_{F_5} &{} y_{F_5} &{} x_{F_5}y_{F_5} \\ 1 &{} x_{IN_2} &{} y_{IN_2} &{} x_{IN_2}y_{IN_2}\\ 1 &{} x_{F_1} &{} y_{F_1} &{} x_{F_1}y_{F_1}\\ 1 &{} x_{F_2} &{} y_{F_2} &{} x_{F_2}x_{F_2}\end{bmatrix}}^{-1}\right) ^{T} \begin{bmatrix} 1\\ x\\ y\\ xy \end{bmatrix}. \end{aligned}$$
(19)
Fig. 6
figure 6

Implicit interpolation; Only one interface cell in the interpolation stencil

Considering a Dirichlet boundary condition and applying Eq. (16) and Eq. (17), Eq (18) will become

$$\begin{aligned} f(x, y) (2-B_{21})= & {} B_{11} f(x_{F_5}, y_{F_5}) + B_{12} f(x_{F_1}, y_{F_1}) \nonumber \\{} & {} + B_{22} f(x_{F_2}, y_{F_2}) + \phi _B, \end{aligned}$$
(20)

where \(\phi _B\) is the boundary value of the variable.

For a two-point system, the implicit interpolation scheme can be implemented easily. Considering interface cells \(IN_3\) and \(IN_2\) in Fig. 6 and assuming local coefficients for \(IN_3\) as \(C_{11}\), \(C_{21}\), \(C_{12}\) and \(C_{22}\), the matrix system to find the flow variables looks like

$$\begin{aligned}{} & {} \begin{bmatrix} (2-B_{21}) &{} 0 \\ 0 &{} (2-C_{21})\\ \end{bmatrix} \begin{bmatrix} f(x_{IN_2}, y_{IN_2}) \\ f(x_{IN_3}, y_{IN_3}) \\ \end{bmatrix}\nonumber \\{} & {} \quad = \begin{bmatrix} B_{11} f(x_{F_5}, y_{F_5}) + B_{12} f(x_{F_1}, y_{F_1}) + B_{22} f(x_{F_2}, y_{F_2}) + \phi _{IN_2} \\ C_{11} f(x_{F_2}, y_{F_2}) + C_{12} f(x_{F_4}, y_{F_4}) + C_{22} f(x_{F_3}, y_{F_3}) + \phi _{IN_3}\\ \end{bmatrix}. \end{aligned}$$
(21)

This is a typical bi-linear interpolation that can be done in the explicit way as well. For the problem faced in Fig. 5, the implicit interpolation strategy has to be used to avoid the failure of explicit interpolation. Using Eqs. (16) and (17), the system of equations for two interface cells in a single bi-linear interpolation stencil can be written separately. For \(IN_1\):

$$\begin{aligned} f(x_{IN_1}, y_{IN_1}) (2-B_{21})= & {} B_{11} f(x_{F_6}, y_{F_6}) + B_{12} f(x_{F_5}, y_{F_5}) \nonumber \\{} & {} + B_{22} f(x_{F_1}, y_{F_1}). \end{aligned}$$
(22)

Similarly, for \(IN_2\)

$$\begin{aligned}{} & {} f(x_{IN_2}, y_{IN_2}) (2-D_{21}) - D_{11} f(x_{IN_1}, y_{IN_1}) \nonumber \\ {}{} & {} \qquad = D_{12} f(x_{F_1}, y_{F_1}) + D_{22} f(x_{F_2}, y_{F_2}). \end{aligned}$$
(23)

Also for \(IN_3\):

$$\begin{aligned} f(x_{IN_3}, y_{IN_3}) (2-C_{21})= & {} C_{11} f(x_{F_2}, y_{F_2}) + C_{12} f(x_{F_4}, y_{F_4}) \nonumber \\{} & {} + C_{22} f(x_{F_3}, y_{F_3}), \end{aligned}$$
(24)

where \(B_{ij}, C_{ij}\) and \(D_{ij}\) are the coefficients obtained using Eq. (19).

Therefore, the final matrix will look like

$$\begin{aligned} \begin{aligned}&\begin{bmatrix} (2-B_{21} ) &{} 0 &{} 0 \\ - D_{11} &{} (2-D_{21}) &{} 0\\ 0 &{} 0 &{} (2 - C_{21}) \end{bmatrix} \begin{bmatrix} f(x_{IN_1}, y_{IN_1}) \\ f(x_{IN_2}, y_{IN_2}) \\ f(x_{IN_3}, y_{IN_3}) \\ \end{bmatrix}\\&\quad = \begin{bmatrix} B_{11} f(x_{F_6}, y_{F_6}) + B_{12} f(x_{F_5}, y_{F_5}) + B_{22} f(x_{F_1}, y_{F_1}) \\ D_{12} f(x_{F_1}, y_{F_1}) + D_{22} f(x_{F_2}, y_{F_2}) \\ C_{11} f(x_{F_2}, y_{F_2}) + C_{12} f(x_{F_4}, y_{F_4}) + C_{22} f(x_{F_3}, y_{F_3}) \\ \end{bmatrix}. \end{aligned} \end{aligned}$$
(25)

Therefore, for a problem with N interface cells, the left side matrix will be \([N * N]\).

2.4.2 Euler equations

The sequence for tagging and the implicit interpolation is same as that presented in the previous section for diffusion. For Euler equations, a Neumann boundary condition is required for pressure and density. Therefore, the value of the primitive variable at I is considered equal to its value at \(IN_2\), in Fig. 6, thus Eq (18) becomes

$$\begin{aligned} f(x, y) (1-B_{21}) = B_{11} f(x_{F_5}, y_{F_5}) + B_{12} f(x_{F_1}, y_{F_1}) + B_{22} f(x_{F_2}, y_{F_2}). \end{aligned}$$
(26)

For a two-point system, considering interface cells \(IN_3\) and \(IN_2\) in Fig. 6 and assuming local coefficients for \(IN_3\) as \(C_{11}\), \(C_{21}\), \(C_{12}\) and \(C_{22}\), the matrix system to find the flow variables looks like,

$$\begin{aligned} \begin{aligned}&\begin{bmatrix} (1-B_{21}) &{} 0 \\ 0 &{} (1-C_{21})\\ \end{bmatrix} \begin{bmatrix} f(x_{IN_2}, y_{IN_2}) \\ f(x_{IN_3}, y_{IN_3}) \\ \end{bmatrix}\\&\quad = \begin{bmatrix} B_{11} f(x_{F_5}, y_{F_5}) + B_{12} f(x_{F_1}, y_{F_1}) + B_{22} f(x_{F_2}, y_{F_2}) \\ C_{11} f(x_{F_2}, y_{F_2}) + C_{12} f(x_{F_4}, y_{F_4}) + C_{22} f(x_{F_3}, y_{F_3}) \\ \end{bmatrix}. \end{aligned} \end{aligned}$$
(27)

Similarly, for a three-point system, as in Fig. 5, for \(IN_1\) and \(IN_3\), the implementation of interpolation is very straightforward. Assuming the local coefficients for IN1 as D11, D21, D12 and D22. The interpolation equation for \(IN_2\) can be written as

$$\begin{aligned} f(x, y) (1-B_{21}) - B_{11} f(x_{IN_1}, y_{IN_1}) = B_{12} f(x_{F_1}, y_{F_1}) + B_{22} f(x_{F_2}, y_{F_2}). \end{aligned}$$
(28)

The matrix system to find the flow variables looks like

$$\begin{aligned} \begin{aligned}&\begin{bmatrix} (1-D_{21} ) &{} 0 &{} 0 \\ - B_{11} &{} (1-B_{21}) &{} 0\\ 0 &{} 0 &{} (1-C_{21}) \end{bmatrix} \begin{bmatrix} f(x_{IN_1}, y_{IN_1}) \\ f(x_{IN_2}, y_{IN_2}) \\ f(x_{IN_3}, y_{IN_3}) \\ \end{bmatrix}\\&\quad = \begin{bmatrix} D_{11} f(x_{F_6}, y_{F_6}) + D_{12} f(x_{F_5}, y_{F_5}) + D_{22} f(x_{F_5}, y_{F_5}) \\ B_{12} f(x_{F_1}, y_{F_1}) + B_{22} f(x_{F_2}, y_{F_2}) \\ C_{11} f(x_{F_2}, y_{F_2}) + C_{12} f(x_{F_4}, y_{F_4}) + C_{22} f(x_{F_3}, y_{F_3}) \\ \end{bmatrix}. \end{aligned} \end{aligned}$$
(29)

Again, for a problem with N interface cells, the left side matrix will be \([N * N]\). One thing to be noted here is that after x-sweep, Eq. (14), the implicit bi-linear interpolation is done for the interface cells such that the primitive variables are present for calculating the fluxes for the y-sweep. Therefore, the interpolation is done twice for a single time step: for x-seep and then for y-sweep. If dimensional splitting is not used, the interpolation is done once for one time step.

2.5 Boundary conditions

The boundary can be either Dirichlet or Neumann. Both can be represented easily with the interpolation scheme. For the Euler equations case, Neumann boundary condition has to be applied on the wall for pressure and density and for velocity, a slip boundary condition has to be implemented.

The Neumann boundary condition for pressure and density is very straight forward. As shown in Fig. 7, the values are interpolated at point I, assuming that the primitive variable value does not change in the normal direction such that pressure or density at point I is same as that of P and Q. For velocity, in order to implement slip boundary condition, a two-step procedure is implemented:

1. The image point I, shown in Fig. 7, is not considered and the velocity is extrapolated at point P using the points 5, 6 and 10.

2. The velocity U is divided into tangential and normal components to the solid surface. The normal component is neglected as it will be zero for a slip boundary condition. The tangential component is broken into X and Y-directions contributing to the velocity in those directions accordingly, as presented in Fig. 8. This is repeated for V.

From Fig. 8 and 9, final velocity obtained in X-direction is \(U sin\theta cos \delta - V sin\theta sin\delta \) and in y-direction is \(V sin\delta cos \theta - U sin \theta sin \delta \).

Fig. 7
figure 7

Bi-linear interpolation

The implementation of the Neumann boundary condition is also unique and gives a more geometric sense to the boundary condition implementation.

Fig. 8
figure 8

U velocity components

Fig. 9
figure 9

V velocity components

The sequence of steps for IB implementation for Euler equation includes:

  1. 1.

    Defining the geometry discretely using a set of points. Define the number of elements in X and Y-directions for the mesh.

  2. 2.

    Tagging of the geometry with respect to the background mesh. Identify the solid, fluid and interface cells.

  3. 3.

    Initialise the fluid domain

  4. 4.

    Use Roe scheme for X-sweep

  5. 5.

    Use implicit bi-linear interpolation as described in Sect. 2.4.1 for pressure and density. For velocity, use the slip boundary condition presented in Sect. 2.5

  6. 6.

    Use Roe scheme for Y-sweep

  7. 7.

    Use implicit bi-linear interpolation as described in Sect. 2.4.1 for pressure and density. For velocity, use the slip boundary condition presented in Sect. 2.5.

3 Results and discussions

3.1 Diffusion problem

The schematic of the problem is described in Fig. 10, consisting of a domain bounded by two concentric circles with Dirichlet boundary condition. The inner circle has a temperature \(T_1\) and the outer circle has temperature \(T_2\). The heat conduction for this problem is governed by Eq. 1, which is the heat diffusion equation with a constant thermal conductivity, \((\kappa = 1)\), and without any source term.

Fig. 10
figure 10

Geometry Definition

The analytical solution, as presented in [39], for this case, is given by Eqs. (30) and (31):

$$\begin{aligned} \text {Heat Transfer[watts]} \; \;= & {} \; \; q_{r} = 2\pi k (T_{1} - T_{2})/ln{({r_{2}/r_{1}})}, \end{aligned}$$
(30)
$$\begin{aligned} \text {Temperature[K]} \;= & {} \; T(r) = \frac{(T_{1} - T_{2})}{ln(r_{2}/r_{1})}ln\left( \frac{r}{r_{2}}\right) +T_{2}, \end{aligned}$$
(31)

where \(q_r\) is the heat transfer rate, and T(r) is the temperature at radius r.

The numerical solution is shown in Fig. 11 for a 200 x 200 cells in the mesh:

Fig. 11
figure 11

Numerical temperature distribution in x and y-directions : Concentric cylinders at a temperature differential

The variation of temperature in the radial direction is compared with the analytical solution in Fig. 12. The results match with the analytical solution and are accurate.

Fig. 12
figure 12

Comparison of Temperature[T] for numerical and analytical solutions for concentric cylinders in radial direction[R]

A convergence analysis is performed to verify the order of convergence that is obtained by the present numerical algorithm. This consists of finding the error(norm) (L2 or L1), against the number of points. In present case, convergence analysis has been done using the L2 norm and is given by Eq. (32):

$$\begin{aligned} Error = L2 = \sum _{i = 1}^{M}{\sqrt{ ({{T}_{i, analytical}} - {{T}_{i, numerical}})^2}}/Nx, \end{aligned}$$
(32)

where Nx is the total number points considered for the numerical calculation.

Fig. 13
figure 13

Convergence Analysis: Temperature

The convergence analysis for the numerical solution using L2 norm is shown in Fig. 13. The order of convergence obtained is of second order, which is expected.

The error analysis for the change in the temperature in the normal direction is presented in Fig. 15, which is basically the error calculation for the flux. Calculation of the analytical fluxes has been modified such that the numerical and analytical fluxes are compared on the same basis. For calculating the analytical fluxes, Eq. (33) is used.

Fig. 14
figure 14

Calculating analytical temperature for concentric cylinder case. Here, \(T_{Analytical}\) is the analytical temperature calculated at the cell centre and \(T_{Boundary}\) is the temperature on the boundary

In Fig. 14,

$$\begin{aligned} \left( \frac{dT}{dn}\right) _\mathrm{{Analytical}} = \frac{T_\mathrm{{Boundary}}-T_\mathrm{{Analytical}}}{\Delta {n}}. \end{aligned}$$
(33)

Similarly, for the numerical solution,

$$\begin{aligned} \left( \frac{dT}{dn}\right) _\mathrm{{Numerical}} = \frac{T_\mathrm{{Boundary}}-T_\mathrm{{Numerical}}}{\Delta {n}}, \end{aligned}$$
(34)

where \(T_\mathrm{{Numerical}}\) is the interface cell centre where solution is obtained using the interpolation function.

Fig. 15
figure 15

Convergence for dT/dn with 1000 points on the geometry and assuming that the geometry is represented by straight line in between two points. The error has been reported with respect to L2 norm

3.2 Euler equations

The shock tube problem schematic is shown in Fig. 16. The high pressure \(P_l = 10\), high density \(\rho _l = 11.6\), \(u_l = 0\) and \(V_l = 0\) is set on the left. The low pressure \(P_r = 1.0\), low density \(\rho _r = 1.16\), \(u_r = 0\) and \(V_r = 0\) is set on the right. When the diaphragm ruptures, the shock wave moves to the right and the rarefaction wave moves to the left. This problem has an exact solution which is explained in Toro [38], and therefore, this problem is a good benchmark test for the numerical method.

Fig. 16
figure 16

Inclined Shock Tube schematic with an inclination of \(30^0\)

The results obtained for this problem are presented in Fig. 17c. The convergence for the inclined shock tube is represented in Fig. 18. It has to be noted that the order of convergence for the shock tube case is found to be around 0.5 which is less than the expected value of 1 and this is in agreement with the similar test cases of flow discontinues and shock waves for a first-order flow solver [40].

Fig. 17
figure 17

Pressure, Velocity and Density contours for inclined shock tube for 500 X 500 background mesh with the angle of inclination of \(140^0\)

Fig. 18
figure 18

Pressure convergence for inclined shock tube with implicit bi-linear interpolation for an angle of rotation of \(140^0\)

3.3 Computational efficiency

The explicit and implicit interpolation methods are compared based on the CPU time that is required for each type of interpolation. For this, a case of straight immersed shock tube is taken. The test case of inclined shock tube cannot be used for the comparison as the explicit interpolation will fail in that case. The comparison is presented in Table 1. The time for implicit interpolation is normalised by the CPU time of the explicit interpolation. As expected, the implicit interpolation is more computationally expensive than the explicit interpolation, but the increase is reasonable considering the improvement in the overall robustness of the approach.

Table 1 Comparison for computational time of explicit and implicit interpolation

3.4 Problems with shock tube for corner cells

For the two-dimensional cases, some problems can still be present with the sharp corner cells, as found at the four corners of the shock tube problem presented earlier. The non-availability of the fluid cells to fill the coefficients in the implicit bi-linear equation matrix leads to the failure of even the implicit approach. As presented in Fig. 19, it is clear that the bi-linear interpolation cannot be implemented at the corner cells as one of the cells that constitute the interpolation stencil is a solid cell. For these cases, other interpolation strategies like least square or radial basis functions are recommended.

Fig. 19
figure 19

Demonstration of corner cell problem for shock tube

In order to get rid of this problem, one suggestion is to use a linear interpolation with three points. Even at the corners, it is ensured that three nearest points are available from the fluid and interface regions and the interpolation has to be done implicitly. Mathematically, it is similar to the bi-linear interpolation expressed in Eq. (19) except that the fourth point has to be dropped.

4 Conclusion

The idea of implicit interpolation gets rid of the problems faced with explicit interpolation especially when the interpolation stencil includes another interface cells. The use of the image point is helpful for implementing the Neumann boundary condition for pressure and density. However, as with most of the IB methods drawback, the problem of the corner cells for the shock tube case remains and can be solved even using the three-point linear implicit interpolation. Although it is implemented for inviscid compressible flows(Euler equations), same can be implemented easily for NS solvers. Also, the implicit interpolation can be implemented for higher order interpolation methods as well in a similar way. However, the computational cost is expected to increase, as is the case for bi-linear implicit interpolation.