Spark ignition engine modeling for in-cylinder pressure and temperature prediction using simulink

Mathematical model for four-stroke gasoline engines based on a cylinder-by-cylinder engine modeling method that incorporates physical formulas such as engine geometry and empirical formulas such as combustion duration are applied in this study. In-cylinder pressure and temperature can be calculated for gasoline four-cycle engine. Modeling is done by treating each step in the cylinder as a volume control, solving the conservation equations of energy with submodules for combustion, heat transfer and dynamic analysis. Calculations in cycles are performed at each crank angle, so that the correct angle of ignition, variations in velocity, amount of intake mass and fuel burning speed can be predicted. Adjustment for the combustion parameter such as burn duration and form factor of the Wiebe function to increase the model accuracy was performed. It is shown that the optimization of the Wiebe function parameters able to improve the sum squared error of the engine pressure estimation by 58.17% compared to the result from generalized parameter functions, and the parameter of form factor and burn duration are influential by around twice of (1.86 and 2.55 times, respectively) the efficiency factor.


Introduction
The application of Spark Ignition (SI) engine has been greatly evolved since its discovery, ranging from cars, motorcycles, buses, planes, ships and generators in various scales.The SI engine has a different design structure for each type of application field.The SI engine has a cycle consisting of four consecutive processes, starting with intake, compression, combustion which includes expansion, and exhaust gas blowdown.From that process, the process of changing energy from fuel to pressure energy through the combustion process is the most important process, where the energy of this pressure is converted into mechanical energy [1,2].
In engine combustion modeling, the main purpose is to determine how much the mass fraction is burned during the combustion process.The quantity of mass fraction burning will decide the characteristic of the combustion and energy conversion of the fuel.The equations for empirical combustion characteristics have several coefficients that must be determined precisely at the beginning of the calculation.For the Wiebe function, these parameters are the starting angle of combustion (θs), combustion duration (θd), efficiency (a) and form factor (n) [1,2].These parameters are generally determined either by matching the experimental pressure data in the cylinder as well as by estimation [1][2][3]5].From the author's knowledge, how closely the correlation of each parameter to the results of the combustion characteristics to date has not been studied.
In this study, a modeling of SI engine is developed to predict the in-cylinder and temperature data as well as observing the correlation of each parameter in Wiebe function towards the simulation results using Monte Carlo analysis.

Mathematical Model
The modeled engine is a gasoline SI engine that does not have an exhaust gas recirculation (EGR) and turbocharging system.The selected model is based on the pressure prediction in the combustion chamber, the model is formulated to relate the effect of each engine parameter towards the output of the modeling.This is mainly important to understand the basic phenomena and the extension of the future study, such as parametric and optimization study.To be able to predict the pressure inside the combustion chamber, both physical and empirical formulations are used in this model.Geometry of the engine such as bore (b), stroke (s), connecting rod length (lc) and compression ratio (rc) are used to obtain physical data such as instantaneous volume of combustion chamber, combustion area, piston speed, and clearance volume.The data will be used to further predict the pressure inside the cylinder for each crank angle position (θ).The resulting pressure will be used to determine the temperature inside the cylinder as well as the heat transfer from the combustion chamber to the wall, these data will then used as a feedback input of pressure prediction calculation.The amount of energy from the fuel requires mass flow data and combustion characteristic in this model is predicted using the Wiebe function.This combustion characteristic is also used in predicting pressure inside the combustion chamber.
The equations of instantaneous combustion volume (V) and area (A) are described as follows [2]: The pressure prediction model is derived from the first law of thermodynamics.It is also instantaneous pressure inside the combustion chamber at given crank angle.
where the specific heat ratio () is assumed to be a constant value of 1.4, Qin is the overall heat input with 95% combustion efficiency (ηc) [4], h is the overall heat transfer coefficient inside the combustion chamber, Tg is in-cylinder gas temperature and Tw is wall temperature with a value of 400 K [2].Gasoline fuel with a lower heating value (LHV) of 44.5 MJ/kg and the stoichiometric air fuel ratio (AFRs) of 14.6 are employed Mass fraction burned f is a functional form of Wiebe function [2] 2 where θs is start of combustion angle, Δθ and n are burn duration and form factor, respectively, which are estimated from the empirical correlations for the 0-90% burn duration and form factor [5], while efficiency factor (a) with a value of 2.302 is selected [2].
where ρs is density at spark timing,  ̅  and xrg are mean piston speed and residual mass fraction, respectively, which are calculated as follow where the exhaust pressure (Pexh) is assumed to be 1.5 atm as it is in the range of 1 -1.5 atm [4], VEVC is the volume at exhaust valve close (EVC) position, MWm is the mixture gas molecular weight, R is the universal gas constant and Texh is the exhaust gas temperature.The exhaust gas temperature is empirically estimated as follows [6]  exh (K) = −2.537× 10 −5   2 + 0.2523  + 273.15 The overall heat transfer coefficient is calculated using Woschni formula [2] ℎ = 3.26 where TIVC, VIVC and PIVC are temperature, volume and pressure at intake valve close (IVC), respectively, while Pm is motored pressure at each crank angle position with isentropic assumption The in-cylinder gas temperature is calculated using ideal gas equation as follows where θvld is the valve opening duration, θIVO, θIVC, θEVO and θEVC are intake valve opening angle, intake valve closing angle, exhaust valve opening angle and exhaust valve closing angle, respectively.The manifold pressure and temperature are assumed to be 1 atm and 300 K, respectively.All the equations above are solved using variable step and Bogacki-Shampine [9] solver in Simulink with max step size of 0.1 and absolute tolerance of 1×10 -6 .The detail of the engine specification for the modeling can be seen in Table 1.

Results and Discussions
Experiments to determine the correlation of the parameters in Wiebe function was performed with 100 random samples of burn duration, efficiency and form factor combinations.The burn duration range of 40 -80 degree, efficiency factor range of 2 -7, and form factor range of 1 -5 were selected to perform the sample variations.Each of the sample then simulated in the model and monitored to determine the distribution of the error which was calculated using sum squared error (SSE) formula between the measured and simulation data.Figure 1.(a) shows the distribution of the samples.From the figure, samples with the error below the value of 10 for burn duration are mostly distributed in the range higher than the burn duration of 60, while for form factor in the range higher than the form factor of 2. For efficiency factor, the distribution is almost equal in all value.
Statistical correlation was also performed.In Figure 1.(b), it is shown that the form factor and burn duration are almost equally dominant compared to the efficiency factor.Both form factor and burn duration are in the decreasing or inverse relationship with the pressure output, while the efficiency factor is in the increasing correlation with the output pressure.Statistic evaluation of linear correlation shows that the form factor is almost twice (1.86 times) more influential than that of the efficient factor, while the burn duration is more than twice (2.55 times) more influential than that of the efficient factor.Based on this analysis, the efficiency factor is set to a constant value of 2.302 as recommended for the correlation of 0-90% duration [2.5], while the form factor and burn duration is optimized following the measured data.
The parameter correlation was performed by using the optimization method of Nonlinear least square Levenberg-Marquardt algorithm, this algorithm is a combination of the two other minimization methods: the gradient descent method and the Gauss-Newton method [10].The initial guess for the form factor and burn duration were calculated following equations ( 6) and ( 7) to reduce the number of optimization iterations.
The results of the simulation are shown in Figure 2. The comparison of in-cylinder pressure between the experiment, simulation without optimized parameter and with optimized one is plotted in figure 2.(a).Simulation without optimized parameter is a result from the initial guess with the form factor of 3.633 and burn duration of 70.16 deg.It is shown that the simulation with parameter using equation ( 6) and ( 7) is slightly retarded compare to the experiment.The sum squared error for this simulation is in the value of 4.0382.The simulation with parameter optimization is in line with the experiment with the form factor of 1.883 and burn duration of 86.463.The sum squared error of 1.689 is shown using those optimized parameters.Both pressure peak of the simulation results is lower than the experiment.For in-cylinder temperature, the simulation without optimization has a higher peak temperature while the simulation with optimization is lower with wider temperature profile following wider optimized burn duration as shown in Figure 2

Conclusions
SI engine simulation was performed for in-cylinder pressure and temperature prediction.It is shown that the estimation of Wiebe function parameters is important in determining the results of the simulation in the SI engine.The optimization of the Wiebe function parameters able to improve the sum squared error of the engine pressure estimation by 58.17% compared to the result from generalized parameter functions.It is also shown that the parameter of form factor and burn duration are more dominant by around twice of (1.86 and 2.55 times, respectively) the influence of the efficiency factor in deciding the simulation results. (b).