Forced Induction Superchargers | Turbochargers | Intercoolers

Little compressor mapping script

Thread Tools
 
Search this Thread
 
Old Nov 15, 2007 | 06:03 PM
  #1  
Speed's Avatar
Thread Starter
TECH Enthusiast
20 Year Member
iTrader: (33)
 
Joined: Jul 2002
Posts: 609
Likes: 0
From: Ok
Default Little compressor mapping script

Got bored today and wrote a little script to do the math for you to calculate a couple very common factors when selecting compressors. This is written in PERL. You will need to obtain a perl compiler to run. For those running windows, download PERL from www.activestate.com. Copy and save the code into a text file (notepad works well) and save it as whateveryouwant.pl.

Read the comments after the hashes and change the variables at the top to what ever you need for your application. To modify the settings, just open the file in notepad and change the variables, then save it. For those of you that are so inclined, create some stdin interface. Open a command prompt in Windows, navigate to the directory you stored the script in, and run it by using the command perl somename.pl and hitting enter. If I get some time, I'll write something a little more user friendly. I just copied the compressor maps from Garrett and using this info, plotted my own compressor mapping for the apps I'm considering. Any questions, just lmk!


$maxrpm = 7000; #Plug in your max rpm here
$cid = 347; #Plug in your displacement in cubic inches here
$ve = .9; #Plug in an aprox average volumetric effeciency here
$degR = 70 + 460; #Change the first number to the inlet air temp in *F.
$psia = 20 + 14.7; #Change the first number to the turbo outlet pressure (boost + intercooler pressure loss)
$pin = -.5 + 14.7; #Pressure inlet. Rough guess but should work.
$lbs = 0; #Do not change
$pr = 0; #Do not change
$counter = 0; #Do not change

while($counter < 8)
{
$cfm = $maxrpm * $cid / 3456;
$lbs = ($psia * $cfm * 29) / (10.73 * $degR) * $ve;
$Tout = ($degR + ($degR * (-1+($psia/$pin)**.263)) / .75) - 460;
$pr = ($psia + 3) / $pin;
print "$maxrpm - $Tout - $lbs - $pr\n"; #RPM for airflow - Discharge temps in F - Mass flow lbs/min - Pressure ratio
$counter++;
$maxrpm = $maxrpm - 1000;
#$ve = $ve * .92 #Remove leading hash to make a rough (and linear) change in VE based on rpm
}
exit;
Reply
Old Nov 16, 2007 | 02:38 PM
  #2  
Tiago's Avatar
9 Second Club
iTrader: (27)
 
Joined: Apr 2003
Posts: 3,685
Likes: 0
From: HOUSTON-TX
Default

WTF is this computer science course?

should have done it in EXCEL!
Reply
Old Nov 16, 2007 | 02:55 PM
  #3  
Speed's Avatar
Thread Starter
TECH Enthusiast
20 Year Member
iTrader: (33)
 
Joined: Jul 2002
Posts: 609
Likes: 0
From: Ok
Default

Ahhh bite me. I'm working on trying to build another turbo calc using the new garrett maps.
Reply
Old Nov 16, 2007 | 07:50 PM
  #4  
KraZy's Avatar
TECH Resident
iTrader: (4)
 
Joined: May 2002
Posts: 783
Likes: 0
From: Jacksonville NC
Default

Hell yeah - mind if I port it over to something a little more user friendly?
Reply
Old Nov 16, 2007 | 09:11 PM
  #5  
Speed's Avatar
Thread Starter
TECH Enthusiast
20 Year Member
iTrader: (33)
 
Joined: Jul 2002
Posts: 609
Likes: 0
From: Ok
Default

Tear it up brotha!
Reply
Old Nov 16, 2007 | 09:39 PM
  #6  
Beaflag VonRathburg's Avatar
OWN3D BY MY PROF!
iTrader: (176)
 
Joined: Feb 2006
Posts: 9,146
Likes: 3
From: Jax Beach, Florida
Default

Originally Posted by Tiago
Should have done it in EXCEL!
+1 It sounds like an interesting program and I understand parts of the code. I've taken a couple comp sci classes, but excel is much more user friendly. You also might want to add an explanation or way to calculate volumetric efficiency.
Reply
Old Nov 17, 2007 | 08:39 AM
  #7  
geeteego's Avatar
11 Second Club
iTrader: (1)
 
Joined: Aug 2007
Posts: 503
Likes: 0
From: Orlando, FL
Default

Thank you very much...very informative!!!
Reply




All times are GMT -5. The time now is 08:19 PM.

story-0
Amazing '71 Camaro Restomod Is Modern Muscle Car Under the Skin

Slideshow: This heavily modified 1971 Camaro mixes classic muscle car styling with a fifth-generation Camaro interior and modern LS3 power.

By Verdad Gallardo | 2026-05-12 18:06:42


VIEW MORE
story-1
6 Common C5 Corvette Failures and What's Involved In Repairing Them

Slideshow: From wobbling harmonic balancers to failed EBCMs, these are the issues that define long-term C5 ownership and what repairs typically involve.

By Pouria Savadkouei | 2026-05-07 18:44:57


VIEW MORE
story-2
Retro Modern Bandit Pontiac Trans AM Comes With Burt Reynolds' Autograph

Slideshow: A modern Camaro transformed into a retro icon, this limited-run "Bandit" build blends nostalgia with brute force in a way few revivals manage.

By Verdad Gallardo | 2026-04-21 13:57:02


VIEW MORE
story-3
Top 10 Greatest Cadillac V Series Performance Models Ever, Ranked

Slideshow: Cadillac didn't just crash the high-performance luxury vehicle party, it showed up loud, supercharged, and occasionally a little unhinged...

By Pouria Savadkouei | 2026-04-16 10:05:15


VIEW MORE
story-4
Top 10 Most Powerful Chevy Trucks Ever Made!

Slideshow: Top ten most powerful Chevy trucks ever made

By | 2026-03-25 09:22:26


VIEW MORE
story-5
Hennessey's New Supercharged Silverado ZR2 Has 700 HP

Slideshow: Hennessey has turned the Silverado ZR2 into a 700-hp off-road monster with supercharged V8 power and a limited production run.

By Verdad Gallardo | 2026-03-24 18:57:52


VIEW MORE
story-6
Coachbuilt N2A Anteros Is an LS2-Powered C6 Corvette In Italian Clothes

Slideshow: A one-off sports car that looks like a vintage Italian exotic-but hides a C6 Corvette underneath-just sold for the price of a new mid-engine Corvette.

By Verdad Gallardo | 2026-03-23 18:53:41


VIEW MORE
story-7
Awesome K5 Blazer Restomod Comes With C7 Corvette Power

Slideshow: A heavily reworked 1972 K5 Blazer swaps its off-road roots for a low-slung street-focused build with modern V8 power.

By Verdad Gallardo | 2026-03-09 18:08:45


VIEW MORE
story-8
10 Camaros You Should Never Buy

Slideshow: There are thousands of used Camaros on the market but we think you should avoid these 10

By | 2026-02-17 17:09:30


VIEW MORE
story-9
10 LS Engine Myths That Refuse to Die

Slideshows: Which one of these myths do you believe?

By Verdad Gallardo | 2026-01-28 18:10:11


VIEW MORE