The main function of an engine in all different types that they exist as is to change the energy stored in fuel as chemical energy into a thermal energy which is a form where the engine can extract and produce mechanical work outputs from it. 
Usually the engine is the device that makes all of this possible by allowing the air/fuel mixture to go through different kind of stages to reach to the main goal which is extracting mechanical work out of the main energy supply which is usually chemical energy .
There are two different type of engines which are: internal combustion engine, an external combustion Engine, the main difference between the two is where the Burning of fuel happens, in an external engine the combustion of fuel/ air mixture happens outside the cylinder halls, while on the other hand the combustion take place inside the cylinder of the piston in the internal combustion engine .
There are different components that together form an internal combustion engine some of the important ones are :Cylinder shape that contains Piston moving up and down of it, Spark plug to ignite the fuel/air mixture, Valves (inlet and exhaust), Piston rings, Connecting rods, and Crankshafts (Refer to figure 1 to illustrate the Engine components ) .
Figure Engine parts
The engine terminology can be summarised by four simple steps: first step being the inlet valve opening and the piston going down inside a cylinder to let as much air/fuel mixture into the cylinder as possible and then step two takes place where the piston moves back upwards to compress the mixture this is done only when both valves are closed inlet and exhaust valves is closed to stop any chance of mixture escaping , the third stage is summarised by the ignition of the mixture to release thermal energy which causes the piston to be driven down to extract all the energy through piston and connecting rod. Once the energy is extracted the piston hit the bottom of the cylinder the exhaust valve is open to allow to push the fuel outside of the cylinders so the cycle can be then again carried out .this will be further explained in sections below .there are different kind of ways in which internal combustion engines can be classified under such as: based on thermodynamic cycles, working cycles, Fuel used in it, Method of ignition, Speeds, method of cooling, lubrication systems, application area and basic engine designs and many others . However a focus is drawn to two types of engines in this article which are: Diesel engine, Petroleum engine and mainly a deeper research and focus is done on the petroleum internal combustion engine .
There is a quite difference between the two engines, in an Otto Engine (petroleum engine), the first difference is being that the Otto engine suction stage sucks in both fuel and air together while diesel engine suck in air only and then inject fuel in the air, therefore more components are required in the Petroleum engines as a part needed to mix the fuel and air before entering the combustion chamber which are usually carburettors and parts to ignite the mixture to release thermal energy out of it unlike in diesel engine where self-ignite is carried out. Furthermore, they operate with different compression ratios with petroleum having less compression ratios and many other differences are shown in the table below .
Internal combustion engine (Spark ignition) the four stroke engine existed ever since 1876 when Otto introduced his
Figure Comparison between Spark ignition engine and Compression ignition engines
idea at the world exhibition in Paris and it was found that his idea of Otto engines is considered to be most economical at that time, just like any other technology that exist and introduced to the market the Four stroke engine has gone under different kind of adjustment to increase the efficiency and to improve the functionality and adaption for new kind of different application. However the concept still remains the same as the function of Otto engines is define by an Otto Cycle which consists of 4 Stages in each of these stages a critical timings and different factors affect the work, the main idea was summarized earlier but now a further explanation is given with regard of how an Spark ignition internal combustion engine work .
As said earlier, Otto Engines are called four stroke engines which mean each engine cycle take four stages to complete, or in another words the piston has to travel four times inside the cylinder in order to produce any work .
First stage being the suction stage which is illustrated in figure 4, part (a) this stage start by the inlet valve open to allow air/fuel mixture to enter the cylinder when the piston head moves down to suck in air/fuel mixture, while in the same time the exhaust valve is closed to stop escaping gases, this stage stop when the piston has travelled fully to the bottom and the Inlet valve closing. This also can be seen as the 0-1 stage on the P-V diagram in Figure 3 .
Second stage is explained as the compression stage, where the chemical mixture is compressed and it is illustrated in figure 4, part (b). In this stage both valve is closed for the same reason earlier which is to stop mixture from escaping while the piston is compressing it during upward movement this can be seen in 1-2 in a P-V diagram figure 3, towards the end of this stage the compressed mixture is then ignited to using a spark plug which is usually found in the centre of the cylinder, this ignition helps in changing the chemical energy into a thermal energy form which will results in high increase in temperature inside the combustion chamber ,this is shown by 2-3 on the P-V diagram figure 4 .
Stage 3 could be explained as the stage where expansion is happening which is illustrated in Figure 4 part (c).the condition is almost the same as the compression stage except the piston is forced downwards as result of the burning gases pressures, hence power is produced during this stage and absorbed by the piston. A noticeable drop in both temperature and pressure is happening due to the expansion happening this is seen 3-4 in Figure 3 .
Stage four is the stage where gases are allowed to escape outside the cylinder this is shown in figure 4 part (d).In this stage the Exhaust valve is opened and this piston moves again up wards to force the remaining gases outside the cylinder this is shown in 5-0 in the P-V diagram in Figure 3 .
This is where an engine finish one cycle now the same cycle is repeated only with mixing of residual gasses (gases that did not escape during the exhaust stage) .
Figure P-V diagram
Figure Four-Stroke Engine stages
The advantages of having four stroke engines over the 2 stroke engines are many such as the four stroke engines are much more fuel economic than the 2 stroke engines cause during 2 stages there is not enough time to burn all fuel, which again leads to another advantage of being less polluted than 2 stroke engines as it tends to burn most of the mixture. Another advantage being that the four stroke engine produces more torque at low rpm when compared to the 2 strokes engines this is again related to the fuel burning and the time take to consume the energy over all. Moreover comparing both engines in durability area, a huge advantage is found on the four stroke engine than it is in the two stroke engine, the reason being is that 2 stroke engines are to run at really revolutions to produce power and the more you revolute the more you wear your engine components .
Moreover, when comparing both engine gasoline and diesel there are certain points where the gasoline take advantage over diesel while the other way around in some other, when it comes to power and torque it is a split decision between them none of them shines, it is more like based on the application. When fuel economy diesel takes over in this field as the energy density in fuel is higher than this present in gasoline which means takes lot energy to produce the same power produced by a diesel engine .
Another field to look at is cost when comparing both engines a gasoline is cheaper than a diesel as diesel engine required to work under high compression ratios hence everything comes with price. Noise and vibration a gasoline engine takes over this field as it is much more quitter than a diesel engine and it shake less and sometimes it is even hard to tell if a gasoline engine is running at low speed .
Cold weathers is another aspect to compare both engine and the advantage of gasoline is by clear mile as the gasoline tends to have spark plugs which helps in overcoming the cold weather unlike diesel engines where it self-ignite which means it may take time before it can do so. Maintenance wise, the gasoline engines have advantage in short-term as there are several reasons causing diesel to lose in this category such as large amount of oil present in the engine fuel filters and so on .
Fuel cost, diesel engines tend to have it as advantage because diesel is easy to refine from raw petrol than gasoline which means it cost less than gasoline usually but however in some cases, diesel may end up with high prices as it is not a usual fuel to operate vehicle in that specific region. Finally fuel availability gasoline is more likely to be found all over nations than the diesels found as it is used more often when it comes to cars for obvious reasons such as comfort and safety and size .
Engine performance is usually referred to as engine efficiency (η). There are different kinds of efficiency that outline the overall performance of an engine, such as :
Indicated thermal efficiency (-Indicated thermal efficiency is basically defined as how much energy in an indicated power (ìp) is resulting per the injected fuel (ìf) .
Brake thermal efficiency (-This is similar to the Indicated thermal efficiency except it defines the break power rather than the indicated power, so it is how much break power ( is resulting due to fuel injected(ìf) .
Mechanical thermal efficiency (-Mechanical efficiency is defined and found to be as amount of break power (to the corresponding indicated power ( and may also be found by as the amount of break thermal efficiency to a corresponding thermal indicated efficiency .
Volumetric efficiency (- This efficiency usually found as how much volume flow rate of air is sucked in an engine over the rate of displaced volume .
Density is the density of air at the inlet valve.
This efficiency is consider to be an important parameter that defines and outlines the over all of four stroke engines. As the overall engine breathing is controlled by this efficiency .
Furthermore, the better condition of air sucked in by engine will define the power of the engine under the condition of an engine will suck in as much air allowed inside. The average ideal volumetric efficiency found when applying full throttle in spark engines is between 80%-85% .
You want maximise the volumetric efficiency of an engine to increase the thermal efficiency of an engine which will increases the overall performance of an engine .
Relative efficiency ( - Relative efficiency is explained as the amount of thermal efficiency produced by an engine during a cycle compared to an ideal cycle. The value of the relative efficiency is important as it defines the progress of an engine .
Mean piston speed()-the mean piston speed counts and play a huge role in defining engine performance it is found to be as
L is the stroke of piston
N is the crank shaft rotational speed
The mean piston speed defines how much each stage of the four stroke engines is efficient. However this parameter comes with limits as the gases resist flowing into an engine or as the stress produced due to the friction of different moving components .
Specific power output (- Specific power output is found to be the amount of power produced to the corresponding piston area, this can be used to define how well is the piston area used by the engine manufacturer to produce power without taking cylinder size into consideration .
Specific Fuel consumption (sfc)-The amount of fuel consumed by an engine is usually explained and defined by the specific fuel consumption, which is found by dividing the fuel over time by the power produced by the engine. The value of SFC tells how good is the engine performing .
Fuel/Air (F/A) ratio or air/fuel ratio (A/F) - this is another important factor that effect the overall performance of an engine, it is very important to match the right values of fuel and air.
Looking at both terms usually the term fuel to air is used as the fuel is the factor changing with the speed in four stroke engine. There are three different kinds of mixtures that can result of different ratios; the first mixture is referred to it as chemically correct (stoichiometric) amount of air to reach complete combustion of all fuel, second one is called Rich mixture where the ratio of fuel inside is higher to the corresponding air particles, and finally the lean mixture where the amount of fuel/air ratio is less than stoichiometric. Lean mixtures are considered to be the most efficient .
The main point to reach the goal of high efficiency is to fill the cylinder of an engine with as much possible and then combust in an efficient way. To control how much is the charge being drawn by a cylinder, a very important component plays a great role in controlling that, Cam shafts, as an increase on the valve opening or being lifted will result in limiting the restriction on the charge at the intake which will lead to and increase on the amount drawn to inside of the cylinder .
This is fairly simple and not a hard task to achieve. However the result of overlapping is complicated, overlapping is defined as the period where the intake valve and the exhaust valve are open at the same time .
To explain, when the exhaust valve is open during the exhaust stage, at the end of that stage the air being exhausted out could cause to suck in more charges into the cylinder if the intake valve is open to a certain extent, this relates to good exhaust scavenging (the process of removing left combusted gases out of the cylinder and filling it with new mixture) .
Second point to maximize the air at the inlet, an intake design should be near idle at relation with the camshafts. Different RPM required different runner times and diameters .
At low RPM, Long but small diameter runner are required which will result in reaching maximum intake velocity, hence will lead to higher intake inertia. As the RPM increases the diameter runners tend to increase in size and get shorter. Also an increase in the number of intake valves and inlet ports will lead to an increase of charges inside of cylinder however this is tend to be limited to the design of the combustion chamber .
Compression ratios are considered to be a high priority factor that enhances an engine performance, the higher the compression ratio the more thermal efficiency. But just like any other factor this comes with a limitation as the more compress a mixture, the more you move towards self-ignite(as the expansion of fuel/air mixture will result in high temperature which will lead the fuel to ignite before the release of the spark) this is the terminology used to operate diesel engines. Another reason of the limitation of ability to increase the compression ratio is that it may detonate if not self-ignite (detonate also known as the engine knock, it is defined as the burning of fuel at high temperatures due to high compression ratios which will lead to knock or sudden explosion inside of a combustion engine). The ideal compression ratios that usually a petroleum engine can handle are around 10.5:1 .
However , in real life scenario engines are subject to losses at every stage, so even as it is desired to have 100% efficiency, it is quite impossible to achieve due to friction and other reasons such as transmission and so on, the ideal spark ignition engine will have around 25% -30% maximum .
Internal combustion engines manufacturing and handling practical aspects
In general internal combustion engines existed since long time now and different kind of development and improvement where introduced to the engines in which some of them where successful and some of them where not. A lot of these developments where discarded as it did not prove it is functionality. Most engines that exist today are just improved versions of those in early ages, Engine Design count to be a major important aspect while manufacturing an engine, as any fault or mistake in small details can cost the company a lot of money other than affecting the safety and the comfort of a passenger. Engine design requires critical decisions that are not based on mathematical background rather situational .
A successful engine design regarding weight, bulk, finical and reliability and durability will depend on how good is the original detailed design. Major problems during designing an engine and manufacturing an engine occur such as Structural integrity, which means offering a part practical structural position that can handle a lot of the resultant gas pressures, thermal expansions and vibrational forces without adding extra cost and weight or size in the engine, it is a very difficult task to achieve and yet the most important factor to consider while looking at designing/manufacturing of an engine  . Choosing the right material in which each part of the engine is manufactured from is another critical step to be taken care of; as the condition inside of an engine differs some of part should withstand high pressures while other should stand high temperatures. Also the ability of these materials to withstand different kind of daily conditions such as wear, corrosions and so on based on the location of each part, In general the material used to manufacture parts of engines are almost standardised however the amount of composites inside the material is still a variable to look at in order to achieve good results .
Packaging and installing engine inside of vehicle requires a deep thought to isolating the engine from the vehicle structure to reduce all the vibration cause by the inertial moment of engine which if transmitted will lead to noises and unwanted uncomfortable ride. Engine mounts are there to serve and help in solving this problem, their main function is to support the engine weight inside a car hood and to stop transmission of the vibrational voices which limits the above conditions and increases comfort of the ride. Choosing the right mount for the engine to settle on is very important as if the mount chosen is not suitable it may lead to cracks and breaking down of the engine pipes and exhaust pipes which will cause a lot of money to replace .
The factors above were considered while making and designing an engine and then installing. Another aspect to look at is the maintenance of engines after installation and how it affects the overall performance of an engine and the life time of that particular engine.
Furthermore since engines are running usually at very high temperatures, and most of the energy released is heat, a cooling system is required to be installed to prevent engine away of overheating, moreover cooling systems have another important role which is to heat up the engine at very fast rate yet keep it on desired temperature, cause engine running at cold conditions will increase the wear of it components and the rate of producing pollutant gases, another reason to maintain engines at constant desired temperature is that to have the combustion chamber hot enough to achieve complete burn of the fuel and to maintain the oil at low viscosity values which make it easy for the engines part to move. There are two different types of engine cooling which is either liquid or air cooling .
When it comes to use of car, it is used on daily basis so maintenance of different kind of car parts is required; engine maintenance is one of those parts. Carburettors that mix fuel should be checked on regular basis to ensure having the right mixtures to burn, Oil changing is required as well on regular as it has important role of lubricating the engine parts such as piston and camshafts and connecting rods and many others, oil systems are usually running in a loop where the oil is collected finally in a sump, the oil usually should be changed cause it accumulates dirt and wont lubricate as much, cause oil additives will eventually grow less so it will not be as effective .
Well to wheel Energy/ Emissions
Well to wheel energy is defined as the energy spent from extracting different fuels from the raw material up until the energy is used by the car and released as emissions. There are two main phrase should be understood, first one is the Well to Tank (WIT) which is the energy spent to get fuel from raw material extracted from to the fuel pumps and tanks and ready to be distributed for cars, the other is called Tank to Wheel (TIW) which is defined as amount of energy released during pumping and burning of fuel up until its consumed and used by the car wheels as mechanical energy, (WIT) and(TIW) represent a life cycle of fuel which is shown in figure (5).The usual fluid found and used in the internal combustion engines in automotive field such as gasoline and diesel are extracted from crude oil .
Extraction of crude oil is usually by natural pressure of underground tanks, however some situation it requires the gas pressure injected in to extract the crude oil, next step is to stabilize the crude oil before shipping it as it is usually come with gases (usually either shipped as by product or used to inject back into the underground tanks). The condition of extracting crude oil and producing it vary based on many factors such as region it is extracted from, fields, even from one well to another. So accurate value of emissions and energy cannot be stated, an estimation of those values can be give as 3.3g emissions eq/MJ and 0.025 MJ/MJ, usually the crude oil available for use in Europe countries is shipped all the way from Gulf countries this explain the low energy spent as it tends to be at low range in that region where crude oils extracted . C:\Users\Gambit\Desktop\Fuel cycle.JPG
Figure Fuel Cycle Well To Wheel
Crude oils then shipped to different countries to be refined after it has been extracted and produced. Mostly crude oil is transported using the sea but this may change based on the distance it has to travel, another mean of transportation of crude oil is the pipeline through different areas such as Russian area to the European eastern countries .
Here again the diversity of shipping a fuel it makes it hard to estimate the total energy/emissions, but since it is already considered most fuel is from middle east the values of energy is around 10MJ/MJ and 0.8 eq/MJ  .
Now that the crude oil has been transported to European region it has to be refined before use, so the study of energy spent and emissions produced is based on studies in the Europe refineries. Oil refinery basically is to separate different components of the crude oil, get rid of the unwanted compounds such as sulphur, changing the heavy molecules presented to desired light weighted molecules. Usually refineries spent an average of 6% of energy to produce and refine, oil refineries tends to create a lot of products from one stock, so it is almost impossible to separate and find values of energy and co2 emissions of single product but rather the values of the refinery itself as whole. However a rough estimation can be achieved based on study done on 3 different products and different kind of limitation has been set before giving the results shown in graph (6) .
Figure Energy and Greenhouse Gases emissions in refineries
Then fuel is transported to fuel station by different kind of mean such as road tanker, trains or even pipelines, to assume the total energy and emission produced, all of the above transportation is been taken into consideration. A value of 20KJ and more than 1 gram eq per MJ is set to be the final station of fuel .
The standard NEDC [New European Driving Cycle] has been taken as reference for calculating and estimating the TTW emissions and fuel consumptions. The usual road fuels are taking into consideration while estimating the value below in the graphs based on the NEDC regulation and calculations. According to many studies that the mix of different technologies are introduced to run cars are growing so that is taken into consideration as well .
The NEDC WTW Energy and emission equations are given below as :
WTW GHG (g CO2eq/km) = TTW GHG (g CO2eq/km) + TTW energy (MJf/100 km)/100 x WTT GHG (g CO2eq/ MJf) 
Total WTW energy (MJ/100 km) = TTW energy (MJf/100 km) x (1 + WTT total expended energy (MJxt/MJf)) 
The data in figure (7) and figure (8) represent the energy spent and used to move the car in a European cycle for 1 km without disregard to the origin of the fuel .
Figure (6) illustrate the well to wheel energy spent by different type of vehicles such port injection spark ignition (PISI), direct injection spark ignition (DISI) for both gasoline and diesel over the years of 2002 till 2010 and then including different kind of hybrid cars in the 2010s. We can observer a lot of improvement towards using energy as the DICI and PICI engines are closing the gap between them with regard to efficiency and fuel consumption as the technology is taking a good advantages of turbocharging and downsizing, as well as moving towards hybrid cars the energy consuming is improved by almost 15% in petroleum engines and 18% in diesel .
So the focus towards building hybrid cars and improving existing ones will help in sufficiently in decreasing the energy consumed to run cars. 
Figure WTW Energy Using NEDC Cycle 2002-2010
Figure 7 represents the Greenhouse Gases emitted WTW numbers using the NEDC road Cycle again, and as said earlier the PICI and DICI are moving towards improving and the gap in between them is narrowing and as well as they are getting closer to competing with diesel efficiency due to reasons Clearfield earlier, now as the efficiency of any engine increase means the fuel consumption decreases which means less fuel to burn to get same energy, less fuel mean less emissions are produced. Hybrid cars introduction and improvements is helping a lot in reducing the emissions because electrical components function differently and a burn of chemical energy is not required therefore, there is no release of gases .
Figure WTW Greenhouse Gas emissions Using NEDC Cycle as reference