Little compressor mapping script
#1
TECH Enthusiast
Thread Starter
iTrader: (33)
Join Date: Jul 2002
Location: Ok
Posts: 609
Likes: 0
Received 0 Likes
on
0 Posts
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;
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;