**4. In-cylinder modeling**

#### **4.1 Mass conservation**

The total mass of the cylinder is a combination of the energy of the in-cylinder and fluid phase volume of PM:

$$(\mathbf{m}\ )\_{cylinder,n} + (\mathbf{m}\ )\_{PM\ fluid,n} = (\mathbf{m}\ )\_{cylinder,n+1} \tag{38}$$

#### **4.2 Energy equation**

The total energy of the cylinder is a combination of the energy of the in-cylinder and the fluid phase volume of PM:

$$(\mathbf{m}\,\mathbf{c}\_{\nu}\,\mathbf{T})\_{cylindrical, n} + (\mathbf{m}\,\mathbf{c}\_{\nu}\,\mathbf{T})\_{\text{PM}\,fluid, n} = (\mathbf{m}\,\mathbf{c}\_{\nu}\,\mathbf{T})\_{cylinder, n+1} \tag{39}$$

$$\mathbf{m}\_{\text{cyl},n} \mathbf{c}\_{\nu,\text{cyl},n} T\_{\text{cyl},n} + m\_{f\_{\text{PM}},n} \mathbf{c}\_{\nu f\_{\text{PM}},n} T\_{f\_{\text{PM}},n} = \mathbf{m}\_{\text{cyl},n+1} \mathbf{c}\_{\nu,\text{cyl},n+1} T\_{\text{cyl},n+1} \tag{40}$$

So finally, in-cylinder temperature and pressure were updated according to Eqs. (41) and (42):

$$T\_{cyl,n+1} = \frac{\mathbf{m}\_{cyl,n} c\_{v,cyl,n} T\_{cyl,n} + m\_{f\_{PM}n} c\_{vf\_{PM},n} T\_{f\_{PM},n}}{\left( (\mathbf{m}\_{\phantom{\text{ ${}}}})\_{cylider,n} + (\mathbf{m}\_{\phantom{\text{$ {}}}})\_{PM} f\_{fluid,n} \right) c\_{v,cyl,n}} \tag{41}$$

$$P\_{cyl,n+1} = \sum\_{i} [X\_i]\_{n+1} \, R \, T\_{cyl,n+1} \tag{42}$$
