Jump to content

atmCurve formula for 1.0.4


Recommended Posts

I'm not sure if this is the right section so if this is posted in the wrong spot please move it. The forums seemed to change since my last posting lol.

The other day a friend who plays KSP asked me to alter some files for him because he's squeamish about doing it himself. He told me what he wanted changed and to about where he wanted it performance wise. Basically he wants a more realistic version of the broadsword from the Mk IV system mod and a dual or tri mode Mk 2 TurboRam Jet ("screamjet") from the OPT mod.

For the broadsword alterations I'm looking for a formula or equation to calculate specific ATM pressures for custom altitudes not listed here: http://wiki.kerbalspaceprogram.com/wiki/Kerbin#Atmosphere ; such as 32,500 ft. I found this equation Formula:

ATM * e ^ ( -ALTITUDE / SCALE ) 

but the post didn't specify what "e" is supposed to be or if this even still works (I read that there may not be a simple equation for this anymore). I've spent the last ~5 hours searching here and google and found nothing that seems to make sense for this.

For the Mk2 turboram, I can't seem to get the exhaust nozzle lighting to work for both modes. If I place it like this.....


MODULE
{
name = ModuleEnginesFX
engineID = TurboJet
thrustVectorTransformName = thrustTransform
exhaustDamage = True
ignitionThreshold = 0.03
minThrust = 0
maxThrust = 650
heatProduction = 291
useEngineResponseTime = True
engineAccelerationSpeed = 0.2
engineDecelerationSpeed = 0.4
useVelocityCurve = False
flameoutEffectName = flameout
powerEffectName = running_thrust
engageEffectName = engage
disengageEffectName = disengage
spoolEffectName = running_turbine
engineSpoolIdle = 0.05
engineSpoolTime = 2.0
EngineType = Turbine

PROPELLANT
{
name = LiquidFuel
resourceFlowMode = STAGE_PRIORITY_FLOW
ratio = 4
DrawGauge = True
}
PROPELLANT
{
name = IntakeAir
ignoreForIsp = True
ratio = 9
}
atmosphereCurve
{
key = 0 7000 0 0
}
// Jet params
atmChangeFlow = True
useVelCurve = True
useAtmCurve = True
machLimit = 4
machHeatMult = 3.0
velCurve
{
key = 0 0.6

key = 0.2 0.8

key = 1.36 0.9

key = 2.0875 1.306206 0.558359 0.2083685

key = 2.474524 1.870126 1.621842 1.29743

key = 2.945652 2.160394 0.3836924 -0.04622887

key = 3.842887 1.940503 -0.2246427 -0.2246427

key = 6 1.5

key = 7.5 0

}
atmCurve
{
//Airflow vs max thrust?
key = 0 0
key = 0.005 0.3

key = 0.03469022 0.8916956 19.92897 0.5922443

key = 0.2 1

key = 0.3 1

key = 1 0.6
}
}
MODULE
{
name = FXModuleAnimateThrottle
ThermalAnim = engine_light
dependOnEngineState = True
responseSpeed = 0.01
}

I only get the throttle controlled lighting for the air breathing mode. If I place it anywhere else it is either always on or always off for both modes.

My second question for this engine is: Is it possible to set a tertiary mode in the below module to allow for a LF/O closed cycle engine option alongside the turbojet and ramjet for use in an SSTO or would the tertiary setting not be recognized?


MODULE
{
name = MultiModeEngine
primaryEngineID = TurboJet
secondaryEngineID = RamJet
tertiaryEngineID = Closed-Cycle
}

Hopefully you guys can help me out with this, I've hit a dead end with the first two issues.

Link to comment
Share on other sites

1. Nope, multimode engine supports only two modes.

2. Um. atmCurve uses normalized density (where 1.0 in the curve = 1.225kg/m^3 density). If you want to find Kerbin atmospheric properties, your best bet is to go here, take your Kerbin altitude and multiply it by 1.25, and put it in the altitude box. Then change the density readout to 'sigma' not kg/m^3.

I'm...not even going to address how crazy it is to have an engine provide nearly double the thrust of sea level with only 1/3 the mass flow of sea level, that's all on your head. :P

Link to comment
Share on other sites

Thank you so much! It never occurred to me that it was a constant and not a placeholder.

1. Nope, multimode engine supports only two modes.

2. Um. atmCurve uses normalized density (where 1.0 in the curve = 1.225kg/m^3 density). If you want to find Kerbin atmospheric properties, your best bet is to go here, take your Kerbin altitude and multiply it by 1.25, and put it in the altitude box. Then change the density readout to 'sigma' not kg/m^3.

I'm...not even going to address how crazy it is to have an engine provide nearly double the thrust of sea level with only 1/3 the mass flow of sea level, that's all on your head. :P

1) That's what I had figured.

2) Right, but the curve table in cfg files uses the "atm" value to denote altitude for the atmCurve, from what I've read. If the equation I posted in the OP is still accurate then I can use that in a spreadsheet since I now have "e". (If it proves to be no longer accurate I'll definitely use that calculator!)

3) Yeah, I'm going to have to adjust that. I haven't even begun changing the velCurve tables yet, I wanted to get the atmCurve tables done first.

Thanks for the help Red and Nathan!

I could still use some insight with making the throttle controlled jet exhaust nozzle lighting effect work for both modes though.

Link to comment
Share on other sites

Sure! :)

Re: 2, it's no longer accurate. Thought I made that clear, sorry. That formula calculates pressure (not density, let alone normalized density) and is only correct for KSP prior to 1.0.

I found that out when I tried using it after posting yesterday. I was able to fix it though, by using a dynamic scale height which I estimated by graphing the known altitudes/ATM values from the kerbin table in the wiki, then graphing my desired altitude. I found that if I slid it along the altitude line that when it lined up to the curve that I get a close enough scale height factor to use in the calculation (since the scale height appears to be nonlinear). Based on that, I was able to find the scale height and ATM value for my desired 10,833m altitude (which comes to about 5714 and .150 respectively).

Of course, the above was rather pointless if I'm understanding you correctly because I need the density and not pressure. I was under the impression that the first number in the atmCurve table was atm pressure which told ksp what altitude was desired and then ksp looked up the density based on the input pressure for the altitude. It doesn't help that I've been trying to do this when I'm already tired but I've come across conflicting explanations of what the numbers in the atm and velCurve tables represent and what's worse is none of what I found was posted as "official", just findings of random forum posters.

I'll have to come back to this after I've had some rest.

Link to comment
Share on other sites

1. Nope, multimode engine supports only two modes.

2. Um. atmCurve uses normalized density (where 1.0 in the curve = 1.225kg/m^3 density). If you want to find Kerbin atmospheric properties, your best bet is to go here, take your Kerbin altitude and multiply it by 1.25, and put it in the altitude box. Then change the density readout to 'sigma' not kg/m^3.

I'm...not even going to address how crazy it is to have an engine provide nearly double the thrust of sea level with only 1/3 the mass flow of sea level, that's all on your head. :P

KSP really follows the (US) standard atmosphere?

The standard atmosphere isn't isothermal, and hence isn't a simple exponent. (First 12km the temperature drops, then it stays constant up to an altitude of 20km, after which is rises), the density is calculated from this temperature, and it's slightly deviated from an exponent.

500px-Comparison_US_standard_atmosphere_1962.svg.png

Link to comment
Share on other sites

paul23: Yes, it does, with a .8 multiplier to height. There's lots of discussion in the Overhauls for 1.0 thread: http://forum.kerbalspaceprogram.com/threads/119108-Overhauls-for-1-0

SpecTRe-X: atmosphereCurve, which is used to set Isp, uses pressure (in units of one atmosphere of pressure). atmCurve, used for changing flow with density, uses normalized density (normalized so a sea level density of 1.225kg/m^3 appears as 1.0).

Link to comment
Share on other sites

SpecTRe-X: atmosphereCurve, which is used to set Isp, uses pressure (in units of one atmosphere of pressure). atmCurve, used for changing flow with density, uses normalized density (normalized so a sea level density of 1.225kg/m^3 appears as 1.0).

Oh dear, I understand now. I had myself all turned around. I appreciate your patience and taking the time to iron me out! :)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...