*3.2. Method of Charateristics*

The equations for calculating the mass flow rate in 1D model to obtain the discharge coefficient is as follows.

The mass flow rate of the intake air .*mmoc* was calculated using the MOC, as follows [18]:

$$
\dot{m}\_{\text{mac}} = \rho\_2 \times u\_2 \times F\_{2\prime} \tag{4}
$$

where the subscript 2 refers to the downstream conditions.

The air density can be calculated with equation related to pressure, specific heat ratio and speed of sound. ρ2 is the air density under downstream conditions and was calculated using Equation (5).

$$
\rho\_2 = \left(\frac{p\_2}{p\_{01}}\right)^{\frac{1}{\kappa}} \times \frac{\kappa \times p\_{01}}{a\_{01}^{-2}},\tag{5}
$$

where subscript 01 refers to the upstream stagnation conditions.

The speed of sound *<sup>a</sup>*01<sup>2</sup> was calculated using the energy equation.

$$\left|a\_{01}\right|^2 = a\_2^2 + \frac{\kappa - 1}{2} \times u\_2^2. \tag{6}$$

Using Equations (5) and (6), Equation (4) can be expressed as follows:

$$\dot{m}\_{\text{max}} = \frac{p\_{01} \times F\_2}{a\_{01}} \times \left[ \left( \frac{2 \times \kappa^2}{\kappa - 1} \right) \times \left( \frac{p\_2}{p\_{01}} \right)^{\frac{2}{\kappa}} \times \left\{ 1 - \left( \frac{p\_2}{p\_{01}} \right)^{\frac{\kappa - 1}{\kappa}} \right\} \right]^{\frac{1}{2}},\tag{7}$$

to obtain the characteristics, nondimensional form is required:

$$\mathbb{X}\_f = \frac{\dot{m}\_{\text{max}} \times a\_{01}}{p\_{01} \times F\_2} \times \left[ \left( \frac{2 \times \kappa^2}{\kappa - 1} \right) \times \left( \frac{p\_2}{p\_{01}} \right)^{\frac{2}{\kappa}} \times \left\{ 1 - \left( \frac{p\_2}{p\_{01}} \right)^{\frac{\kappa - 1}{\kappa}} \right\} \right]^{\frac{1}{2}}.\tag{8}$$

Equation (8) can be computed directly from the pressure ratio *p*2 *p*01 across the valve or port depending on the direction of flow. When the flow is choked in the throat, Equation (8) becomes:

$$\xi\_f = \frac{\dot{m}\_{\text{max}} \times a\_0}{p\_0 \times F\_2} = \kappa \times \left(\frac{2}{\kappa + 1}\right)^{\frac{\kappa + 1}{2(\kappa - 1)}},\tag{9}$$

where subscript 0 refers to the stagnation conditions.

The actual gas flow has to take into account the discharge coefficient *Cd*, which can be calculated by multiplying Equations (8) and (9) by *Cd*. If the value of ρ*h* is the same, *Cd* can be expressed using Equation (10) [23,24].

$$\mathbb{C}\_d = \frac{\dot{m}\_{\text{exp}}}{\dot{m}\_{\text{max}}}.\tag{10}$$

### **4. One-Dimensional Gas Flow Analysis**

Figure 3 shows the 1D modeling of the gas flow analysis of a single cylinder diesel engine. The intake and exhaust ports are bent pipes and cannot be modeled in 1D [18,25]. Therefore, the geometry of the intake and exhaust ports was excluded from the modeling, and the length of the intake and exhaust ports was included in the intake and exhaust pipes. The only difference between the experimental and 1D modeling is the intake and exhaust ports. The purpose is to observe the errors caused by such differences, and all other boundary conditions were modeled in the same as in the experiment.

The number of meshes was 50 meshes in the intake pipe and 100 meshes in the exhaust pipe. Benson et al. verified the mesh independence in more than 12 meshes of the exhaust pipe [18], and this study confirmed the mesh independence in more than 15 meshes.

The 1D gas flow analysis of a single cylinder diesel engine was programmed using the C language. The structure of the program consisted of a main program for applying the initial conditions and calculating the pressure, velocity, and time, and a subroutine function for calculating the cylinder and intake and the exhaust gas flow [18]. Figure 4 shows the algorithm for calculating the intake air mass flow rate among the subroutine functions.

**Figure 3.** One-dimensional (1D) modeling of the gas flow analysis of a single cylinder diesel engine.

**Figure 4.** Algorithm for calculating the intake mass flow rate of the one-dimensional gas flow analysis program.

The calculation of the intake subroutine function came after the cylinder subroutine function, which calculated the pressure and mass flow rate of the cylinder. If the intake valve was open, the intake subroutine function was started. Through the cylinder pressure and intake pressure ratio, it was possible to determine the choked flow, and to calculate whether the type of flow from the cylinder was inflow or outflow. When the characteristics of the flow are determined through the calculation algorithm, the mass flow rate can be calculated using Equation (8) or Equation (9).
