Menu

Executive Programs

Workshops

Projects

Blogs

Careers

Placements

Student Reviews


For Business


More

Academic Training

Informative Articles

Find Jobs

We are Hiring!


All Courses

Choose a category

Mechanical

Electrical

Civil

Computer Science

Electronics

Offline Program

All Courses

All Courses

logo

CHOOSE A CATEGORY

Mechanical

Electrical

Civil

Computer Science

Electronics

Offline Program

Top Job Leading Courses

Automotive

CFD

FEA

Design

MBD

Med Tech

Courses by Software

Design

Solver

Automation

Vehicle Dynamics

CFD Solver

Preprocessor

Courses by Semester

First Year

Second Year

Third Year

Fourth Year

Courses by Domain

Automotive

CFD

Design

FEA

Tool-focused Courses

Design

Solver

Automation

Preprocessor

CFD Solver

Vehicle Dynamics

Machine learning

Machine Learning and AI

POPULAR COURSES

coursePost Graduate Program in Hybrid Electric Vehicle Design and Analysis
coursePost Graduate Program in Computational Fluid Dynamics
coursePost Graduate Program in CAD
coursePost Graduate Program in CAE
coursePost Graduate Program in Manufacturing Design
coursePost Graduate Program in Computational Design and Pre-processing
coursePost Graduate Program in Complete Passenger Car Design & Product Development
Executive Programs
Workshops
For Business

Success Stories

Placements

Student Reviews

More

Projects

Blogs

Academic Training

Find Jobs

Informative Articles

We're Hiring!

phone+91 9342691281Log in
  1. Home/
  2. Aadil Shaikh/
  3. Data Analysis of an IC engine Simulation using PYTHON

Data Analysis of an IC engine Simulation using PYTHON

I. Introduction : In this project, we use a data file obtained during an Internal Combustion engine simulation using Converge software. The simulation creates a large amount of data amounting to thousands of lines and to analyse such data we create a Data visualizer tool, scripting it in python.  Since the data produces…

  • CFD
  • IC-ENGINE-CFD
  • PYTHON
  • PYTHON-BASICS
  • Aadil Shaikh

    updated on 18 Sep 2020

I. Introduction :

In this project, we use a data file obtained during an Internal Combustion engine simulation using Converge software. The simulation creates a large amount of data amounting to thousands of lines and to analyse such data we create a Data visualizer tool, scripting it in python.  Since the data produces a number of properties of an Ic engine, this tool helps us visualize exactly the property we need, its behaviour and allows the flexibility to perform calculations on this data set with individual properties. 

 

Data file from Converge software : engine_data.out

 

II. Data Visualizer : 

  • Python Script : 
"""
	File parsing in python 

	Code by : Aadil Shaikh 
"""

import matplotlib.pyplot as plt
import numpy as np
import math

line_count = 1
crank = []
pressure = []
max_press = []
min_press = []
mean_temp = []
max_temp = []
min_temp = []
mass = []
density = []
temperature = []
volume=[]
integrated_hr=[]
hr_rate = []
c_p = []
c_v = []
gamma = []
kin_visc = []
dyn_visc = []
column_no=[]
properties=[]
units=[]


data_file = input('Type the file name : ')

try: 
	file_data = open(data_file,'r')

	# File parsing starts here
	for line in file_data:

		if line_count is 2:
			for i in range(2,18):
				column_no.append(line.split()[i])
			#print(column_no)

		if line_count is 3:
			for k in range(0,18):
				properties.append(line.split()[k])
			#print(properties)

		if line_count is 4:
			for p in range(0,18):
				units.append(line.split()[p])
			#print(units)

		
		line_count = line_count + 1

		if '#' not in line:
			crank.append(float(line.split()[0]))
			pressure.append(float(line.split()[1]))
			max_press.append(float(line.split()[2]))
			min_press.append(float(line.split()[3]))
			mean_temp.append(float(line.split()[4]))
			max_temp.append(float(line.split()[5]))
			min_temp.append(float(line.split()[6]))
			volume.append(float(line.split()[7]))
			mass.append(float(line.split()[8]))
			density.append(float(line.split()[9]))
			integrated_hr.append(float(line.split()[10]))
			hr_rate.append(float(line.split()[11]))
			c_p.append(float(line.split()[12]))
			c_v.append(float(line.split()[13]))
			gamma.append(float(line.split()[14]))
			kin_visc.append(float(line.split()[15]))
			dyn_visc.append(float(line.split()[16]))

	column_nos = np.array([[0],crank,pressure,max_press,min_press,mean_temp,max_temp,min_temp,volume,mass,density,integrated_hr,hr_rate,c_p,c_v,gamma,kin_visc,dyn_visc])

	print('n Choose Simulation parameters to Generate plot :  ')
	print('n 1. Crank n 2. Pressure n 3. max_press n 4. min_press n 5. mean_temp n 6. max_temp n 7. min_temp n 8. volume n 9. mass n 10. density n 11. integrated_hr n 12. hr_rate n 13. c_p n 14. c_v n 15. gamma n 16. kin_visc n 17. dyn_visc')
	x_value = int(input('n Choose parameter on X-axis : '))
	y_value = int(input('n Choose parameter on Y-axis : '))


	plt.plot(column_nos[x_value],column_nos[y_value],color="red",linewidth = 2)
	plt.xlabel(str(properties[x_value]) + ' ' + str(units[x_value]))
	plt.ylabel(str(properties[y_value]) + ' ' + str(units[y_value]))
	plt.title(str(properties[x_value]) + ' '+'vs'+ ' ' + properties[y_value])
	plt.savefig(str(properties[x_value]) + ' '+'vs'+ ' ' + properties[y_value])
	plt.show()


	if x_value == 2 and y_value == 8 or x_value == 8 and y_value == 2:

		rpm = 1500
		fuel_consumed_perstroke = 20 #micrograms
		N = np.trapz(column_nos[x_value],column_nos[y_value])
		p = (2*math.pi*rpm*N)/(60)
		sfc = ((fuel_consumed_perstroke*rpm)*(pow(10,-6))*(3600))/(p*1000*60)

	plt.fill_between(column_nos[x_value],column_nos[y_value],linewidth = 2 , color = 'red' , alpha = 0.35)
	plt.show()

	print('n Engine Performance Calculation')
	print('n Area under the pV plot = ', N , 'N-m')
	print('n Power output = ', p, 'MW')
	print('n sfc = ',sfc, 'g/kW-h')	


except FileNotFoundError:
		print("File not recognized. Please provide a valid CONVERGE output file")

finally: 
	print("n code exiting")

 

1. The Data visualizer script asks for a converge output file name, and starts appending all the Column Numbers which represent different thermodynamic properties of the IC engine simulation. Then the Property header names and units. 

2. The data is in a column format, hence we append all the values of the data as per each column in its respective property after splitting it. 

3. The array of all properties is created using numpy module, to call each property data set according to its column number inside the data.

4. Then the program asks for the user to input in X and Y axis column number, representing the property needed to visualize. 

5.                        

6. Once the user inputs the property required to be visualized, the program generates its plot and extracts the Property names, units & its title automatically from the header information and saves the Plot by its name. 

6. Few plots Generated : 

7                      . 

8.                        

 

9.                          

 

III. Performance Calculation : 

Demonstration of how this data set can be utilized in perfomance calculation from these properties . Here, the calculation of Area under the PV diagram,  Power output and specific fuel consumption of the engine is calculated. 

The code has been modfied to give the performance results only when selecting the properties - Pressue and volume in either order. 

Assumptions :  

1500 rpm, Fuel consumed per stroke = 20 micrograms

             

 

                 

 

IV. Compability check : 

Code gives an error when non-compatible file is provided as an input and exits. 

     

 

keyword - PYTHON, PYTHON-BASICS, CFD, IC-ENGINE-CFD

Leave a comment

Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.

Please  login to add a comment

Other comments...

No comments yet!
Be the first to add a comment

Read more Projects by Aadil Shaikh (39)

Flow over a Throttle body - Using CONVERGE CFD

Objective:

I. Introduction:  In this Project, A Steady & Transient state simulation is done of a Flow through an Elbow joint consisting of a throttle valve. The steady state case is solved with the Throttle valve fully open until convergence is reached. While the Transient case is ran with the throttle valve rotating i.e…

calendar

18 Sep 2020 08:29 PM IST

  • CAE
  • CFD
  • CONVERGE-CFD
  • PARAVIEW
Read more

Literature review – RANS Derivation and analysis

Objective:

Introduction: The Reynolds-averaged Navier–Stokes equations (or RANS equations) are time-averaged equations of motion for fluid flow. The idea behind the equations is Reynolds decomposition, whereby an instantaneous quantity is decomposed into its time-averaged and fluctuating quantities,…

calendar

18 Sep 2020 08:28 PM IST

  • AERODYNAMICS
  • CAE
  • CFD
  • NUMERICAL-ANALYSIS
Read more

C.H.T Analysis on a Graphic card using ANSYS FLUENT

Objective:

I. Introduction : In this project, A steady state conjugate heat transfer analysis on a Graphic card model is done. Graphic card has become an everyday used object and a very importat part of any computer system, laptops etc. This product is mass produced daily in millions and has made computers exceptionally efficient.…

calendar

18 Sep 2020 08:23 PM IST

  • ANSYS-FLUENT
  • CFD
Read more

Aerodynamics : Flow around the Ahmed Body using ANSYS FLUENT

Objective:

I. Introduction :  Automotive aerodynamics comprises of the study of aerodynamics of road vehicles. Its main goals are reducing drag, minimizing noise emission, improving fuel economy, preventing undesired lift forces and minimising other causes of aerodynamic instability at high speeds. Also, in order to maintain…

calendar

18 Sep 2020 08:21 PM IST

  • AERODYNAMICS
  • ANSYS-FLUENT
  • CAE
  • CFD
Read more

Schedule a counselling session

Please enter your name
Please enter a valid email
Please enter a valid number

Related Courses

coursecardcoursetype

Post Graduate Program in CFD Solver Development

4.8

119 Hours of Content

coursecard

Introduction to OpenFOAM Development

4.9

18 Hours of Content

coursecard

Core and Advanced Python Programming

4.8

30 Hours of Content

coursecard

Applying CV for Autonomous Vehicles using Python

Recently launched

21 Hours of Content

coursecardcoursetype

Post Graduate Program in Battery Technology for Mechanical Engineers

4.8

81 Hours of Content

Schedule a counselling session

Please enter your name
Please enter a valid email
Please enter a valid number

logo

Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.

https://d27yxarlh48w6q.cloudfront.net/web/v1/images/facebook.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/insta.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/twitter.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/youtube.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/linkedin.svg

Our Company

News & EventsBlogCareersGrievance RedressalSkill-Lync ReviewsTermsPrivacy PolicyBecome an Affiliate
map
EpowerX Learning Technologies Pvt Ltd.
4th Floor, BLOCK-B, Velachery - Tambaram Main Rd, Ram Nagar South, Madipakkam, Chennai, Tamil Nadu 600042.
mail
info@skill-lync.com
mail
ITgrievance@skill-lync.com

Top Individual Courses

Computational Combustion Using Python and CanteraIntroduction to Physical Modeling using SimscapeIntroduction to Structural Analysis using ANSYS WorkbenchIntroduction to Structural Analysis using ANSYS Workbench

Top PG Programs

Post Graduate Program in Hybrid Electric Vehicle Design and AnalysisPost Graduate Program in Computational Fluid DynamicsPost Graduate Program in CADPost Graduate Program in Electric Vehicle Design & Development

Skill-Lync Plus

Executive Program in Electric Vehicle Embedded SoftwareExecutive Program in Electric Vehicle DesignExecutive Program in Cybersecurity

Trending Blogs

Heat Transfer Principles in Energy-Efficient Refrigerators and Air Conditioners Advanced Modeling and Result Visualization in Simscape Exploring Simulink and Library Browser in Simscape Advanced Simulink Tools and Libraries in SimscapeExploring Simulink Basics in Simscape

© 2025 Skill-Lync Inc. All Rights Reserved.

              Do You Want To Showcase Your Technical Skills?
              Sign-Up for our projects.