Forced Induction Superchargers | Turbochargers | Intercoolers

Little compressor mapping script

Thread Tools
 
Search this Thread
 
Old 11-15-2007, 06:03 PM
  #1  
TECH Enthusiast
Thread Starter
iTrader: (33)
 
Speed's Avatar
 
Join Date: Jul 2002
Location: Ok
Posts: 609
Likes: 0
Received 0 Likes on 0 Posts

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;
Old 11-16-2007, 02:38 PM
  #2  
9 Second Club
iTrader: (27)
 
Tiago's Avatar
 
Join Date: Apr 2003
Location: HOUSTON-TX
Posts: 3,685
Likes: 0
Received 0 Likes on 0 Posts

Default

WTF is this computer science course?

should have done it in EXCEL!
Old 11-16-2007, 02:55 PM
  #3  
TECH Enthusiast
Thread Starter
iTrader: (33)
 
Speed's Avatar
 
Join Date: Jul 2002
Location: Ok
Posts: 609
Likes: 0
Received 0 Likes on 0 Posts

Default

Ahhh bite me. I'm working on trying to build another turbo calc using the new garrett maps.
Old 11-16-2007, 07:50 PM
  #4  
TECH Resident
iTrader: (4)
 
KraZy's Avatar
 
Join Date: May 2002
Location: Jacksonville NC
Posts: 783
Likes: 0
Received 0 Likes on 0 Posts

Default

Hell yeah - mind if I port it over to something a little more user friendly?
Old 11-16-2007, 09:11 PM
  #5  
TECH Enthusiast
Thread Starter
iTrader: (33)
 
Speed's Avatar
 
Join Date: Jul 2002
Location: Ok
Posts: 609
Likes: 0
Received 0 Likes on 0 Posts

Default

Tear it up brotha!
Old 11-16-2007, 09:39 PM
  #6  
OWN3D BY MY PROF!
iTrader: (176)
 
Beaflag VonRathburg's Avatar
 
Join Date: Feb 2006
Location: Jax Beach, Florida
Posts: 9,149
Likes: 0
Received 3 Likes on 3 Posts

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.
Old 11-17-2007, 08:39 AM
  #7  
11 Second Club
iTrader: (1)
 
geeteego's Avatar
 
Join Date: Aug 2007
Location: Orlando, FL
Posts: 503
Likes: 0
Received 0 Likes on 0 Posts
Default

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



Quick Reply: Little compressor mapping script



All times are GMT -5. The time now is 10:32 PM.