Jump to content

[WIP]EngineDevelopment: Performance Calculation& Fuel, Chamber and Nozzle ( Based on RF)


Librazy

Recommended Posts

I'm a member of Chinese modder group Kerwis

This mod is a fork of the RealFuels by NathanKell licence CC-BY-SA

Get rid of FloatCurves, Just let it feel like real!

use chamber, nozzle and fuel's parameters instead of FloatCurves.

There must be an collocation that fit you need!

You can not only switching fuels but also chambers&nozzles!(And may be more you can custom in the future)

Zq6mmIj.png

BVzzruJ.png

Got anything about you engine

IOzzPQS.png

Download

(Test only^I need more data of historical engine)

https://github.com/Librazy/ModularFuelSystem/releases/tag/DEV.RC.v.1.0.-1

the /zDEVtest folder is a modified Mainsail with some silly config to test whether it is working

Parameters

From the propellants used:

* Mexh

Exhaust's molecular weight

Used by C*

* fuelFraction

Used by CalculateGamma()

* nominalTcns

Theoretical chamber temperature

Determine running chamber temperature

From nozzle

* nominalPe

Theoretical nozzle exit pressure at max fuel flow

Used by nozzleExpansionRatio and Ct

* At

Nozzle's throat area

Used by Pcns

From chamber

* nominalPcns

Theoretical chamber pressure at max fuel flow

Determine running chamber pressure

* maxMassFlow

Max fuel flow that chamber can load

* minMassFlow

Min fuel flow that chamber needs to maintain stable combustion

Edited by Librazy
Link to comment
Share on other sites

Interesting, couple of questions:

Shouldn't max fuel flow be determinate from chamber thermodynamics and throat area? (since the throat must be choked). See the second equation on this page.

The CalculateGamma available in SolverEngines is only currently good for mixtures of air and some hydrocarbon fuel. I've been meaning to implement something better for a while but haven't gotten around on it yet.

I had a system worked out where Cp was read from a float for a particular gas component and other thermodynamic parameters were determined from molecular mass. But then RealHeat came along, with dissociation modeled, and wasn't sure whether to try and model dissociation as well, since dissociation matters a lot at the temperatures reached in engines, however it makes the combustion reactions in AJE a lot more difficult to model.

Link to comment
Share on other sites

Okay, more notes. Sorry to spam your thread, but I spent on the order of months trying to wrestle meaning out of this stuff for jet engines, so I'd like to think that I know at least a bit of it (and if I don't, I'd certainly like to know what you do and I don't :P).

  • You shouldn't need to specify nominal exit pressure - exit conditions should be determinate from chamber conditions and expansion (area) ratio. It's not analytically solvable, but ferram4 gave us an implementation of Brent's method to use for nonlinear zero finding in SolverEngines (in SolverMathUtil.cs). You can use equation 9 here to solve for exit mach based on expansion ratio (this should only has to be done once - probably in InitializeOverallEngineData), and based on that you can find the nominal exit pressure and velocity. This might also simplify your thrust calculations too, since (in the absence of flow separation), thrust is just mdot * v_exit + (p_exit - p_ambient) * A_exit. Not sure if this would work well with your flow separation calculations though.
  • There's no need to use 0.10001 for the pressure ratio at jet separation. One of (x >= 0.1) and (x < 0.1) will always return true. Where does the number 0.1 come from anyway?
  • After all the rest of the details are worked out, I will show you a way to automatically fit some of the engine parameters based on available data for thrust and Isp, using an API I build into SolverEngines (at its core, this uses the same nonlinear solver I mentioned above). You should be able to fit chamber temperature and throat area (which are often not known for engines) based on thrust and Isp :D

Link to comment
Share on other sites

  • 2 weeks later...
Okay, more notes. Sorry to spam your thread, but I spent on the order of months trying to wrestle meaning out of this stuff for jet engines, so I'd like to think that I know at least a bit of it (and if I don't, I'd certainly like to know what you do and I don't :P).

  • You shouldn't need to specify nominal exit pressure - exit conditions should be determinate from chamber conditions and expansion (area) ratio. It's not analytically solvable, but ferram4 gave us an implementation of Brent's method to use for nonlinear zero finding in SolverEngines (in SolverMathUtil.cs). You can use equation 9 here to solve for exit mach based on expansion ratio (this should only has to be done once - probably in InitializeOverallEngineData), and based on that you can find the nominal exit pressure and velocity. This might also simplify your thrust calculations too, since (in the absence of flow separation), thrust is just mdot * v_exit + (p_exit - p_ambient) * A_exit. Not sure if this would work well with your flow separation calculations though.
  • There's no need to use 0.10001 for the pressure ratio at jet separation. One of (x >= 0.1) and (x < 0.1) will always return true. Where does the number 0.1 come from anyway?
  • After all the rest of the details are worked out, I will show you a way to automatically fit some of the engine parameters based on available data for thrust and Isp, using an API I build into SolverEngines (at its core, this uses the same nonlinear solver I mentioned above). You should be able to fit chamber temperature and throat area (which are often not known for engines) based on thrust and Isp :D

Sorry for my not responding, first month in college should be that busy...

-1.Haven't work out what the relation between fuel flow and chamber pressure……

For now, the max fuel flow indicates only the maximum workload of the powercycle, and increase throttle will increase fuelflow, leading to the chamber pressure .

0.[DEL]The throttle will respond to chamber pressure in next release^[/DEL] May be later

1.An Chinese textbook shows that exit pressure can be a basic parameter for liquid engine.And some conveniences can be brought by taking it.

2.Yuh...^It is just a placeholder waiting a more precise jet separation calculation……

3.Good job for FitEngine^Figuring out how it works now=w=

- - - Updated - - -

Hi. I'm interested in the method you used for creating different configurations for the engine. I'm thinking of creating a simple, stock-alike version of that.

Can you tell me simply, how you do it?

Sorry for my not responding, first month in college should be that busy...

Yeah...Could I say that I just copy the method of RealFuels……

The different sets of parameters for one engine is storaged in the cfg, and the plugin will load them to the engine module when needs

Edited by Librazy
Link to comment
Share on other sites

The issue I have is that you specify throat area, nozzle area, and exit pressure, whereas one of those three is determinate knowing the other two. If you allow all three to be specified, there's nothing forcing them to be consistent with each other.

Link to comment
Share on other sites

The issue I have is that you specify throat area, nozzle area, and exit pressure, whereas one of those three is determinate knowing the other two. If you allow all three to be specified, there's nothing forcing them to be consistent with each other.

So……Could you tell me what&how basic parameters should be used to represent an engine?

I have no idea about them(

Actually I'd only specify throat area and exit pressure, nozzle area was calculated from the pressure ratio of chamber and nozzle. And I found two( of throat area, nozzle area and exit pressure) is needed to represent a nozzle...Did I left some eq out?

Edited by Librazy
Link to comment
Share on other sites

Refer to equations 6 and 9 here. If you have the exit pressure you can solve for exit Mach number, and from there solve for expansion ratio. The issue I have with this is that exit pressure is typically not known for real engines, whereas expansion ratio is often given. If you specify the expansion ratio, you can still solve for exit pressure as I mentioned above.

Link to comment
Share on other sites

Another reason for I to use exit pressure is that chamber condition is unknown for an nozzle config, so if we specify expansion ratio, the exit pressure will be determined by both the chamber and nozzle condition.(Though that is practicable but will be a little more complex for the users)

We can solve the exit pressure from the real data when generating cfg from real data.

Edited by Librazy
Link to comment
Share on other sites

We can solve the exit pressure from the real data when generating cfg from real data.

That is, in general, very annoying to do because it requires working through the isentropic flow calculations. When you have to work through hundreds of engine configs (what RF has to deal with), then it becomes a significant barrier. In writing both configs and code for AJE I have come to the conclusion that the simpler it is to specify engine parameters, the better. If you can calculate something and store it, do so in KSP rather than forcing the user to do it.

Link to comment
Share on other sites

The more the better, but the generating and maintaining of the engine is a hot potato as blowfish said above.

- - - Updated - - -

When you have to work through hundreds of engine configs (what RF has to deal with), then it becomes a significant barrier.

Yup, considering it.

Link to comment
Share on other sites

That is, in general, very annoying to do because it requires working through the isentropic flow calculations. When you have to work through hundreds of engine configs (what RF has to deal with), then it becomes a significant barrier. In writing both configs and code for AJE I have come to the conclusion that the simpler it is to specify engine parameters, the better. If you can calculate something and store it, do so in KSP rather than forcing the user to do it.

Maybe it is okay to generate configs automatically by existing configs that RF has...

But yes, working through hundreds of engines and change configs basing on every engine's own characteristics requires a HUGE amount of work. (don't ask me why, I have done it before)

Link to comment
Share on other sites

Librazy,

Please see my fork of your ModularEngines fork. Specifically https://github.com/Saabstory88/ModularFuelSystem/blob/master/Source/Engines/MagicSolver.cs

I know I need to clean up the code executing a lot, but this is a similar implementation to your own. I am getting the combustion params from some equations I put together which describe the relationship between Molar mass / mix ratio / chamber pressure / flame temp. After plugging in some real engines, they seem to be a good enough approximation.

Anyway, have a look, some of these methods may be more simple.

Link to comment
Share on other sites

Might be coming from a totally different direction here but couldn't you solve the whole 'configs for mods' problem by just having this be a sort of modular / procedural engines mod with one part that has a range of interchangeable nozzles / chambers / fuel mixtures / etc.? Of course, if you wanted to have the model change for different nozzles and things you'd probably need another plugin, but the general idea seems a lot simpler, at least to me, than writing hundreds of configs for different engines to add a few extra options to them

Link to comment
Share on other sites

Might be coming from a totally different direction here but couldn't you solve the whole 'configs for mods' problem by just having this be a sort of modular / procedural engines mod with one part that has a range of interchangeable nozzles / chambers / fuel mixtures / etc.? Of course, if you wanted to have the model change for different nozzles and things you'd probably need another plugin, but the general idea seems a lot simpler, at least to me, than writing hundreds of configs for different engines to add a few extra options to them

Actually,that is what I want to do at first, and it's my working direction now.=w=

- - - Updated - - -

This is very interesting, congratulations. Will it works also for Interstellar Extended engines?

So I leave out the NozzleType and ChamberType in config.(Though I had only implemed one type^the liquid engine with delaval nozzle.Some more types will be support later.(I don't know when will be later TAT

- - - Updated - - -

Maybe it is okay to generate configs automatically by existing configs that RF has...

But yes, working through hundreds of engines and change configs basing on every engine's own characteristics requires a HUGE amount of work. (don't ask me why, I have done it before)

Yup……So I choose to be compatible with RF, for that we can use RF configs for those engine that don't have their EDev configs.

Edited by Librazy
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...