ferram4 / ProcEngines

Procedural Engines for Kerbal Space Program
MIT License
5 stars 2 forks source link

Python script to ease data collection for config files. #3

Open Tyaedalis opened 7 years ago

Tyaedalis commented 7 years ago

I have created a simple script to help with the all the data collection from RPA,

You can find it in a gist, here.

Assumptions

This script assumes the following initial file structure:

./
./data/
./data_parser.py

Operation

  1. Choose an O/F ratio to work on.
  2. Use RPA to generate data for each chamber pressure (Pe) you need in increasing order, saving the results in ./data/ with an individual and also increasing name (e.g. 1.txt, 2.txt, etc.).
  3. Run the python script when you have all data you desire for the current O/F ratio.
  4. A file results.txt will appear in ./, containing all the key values formatted for the config.
  5. You must delete all files in ./data/ and ./results.txt before starting the next O/F ratio! I have not added any file handling other than reading the data files and writing the results.

I may update this with further improvements, but this saves so much time already. Just make sure to watch for any questionable data while doing this.

dgeastman commented 7 years ago

I've updated the script, here: https://gist.github.com/dgeastman/29a26dd8c08fb156660fefea1a8ffda8

It now has the Cpc and Cpe fields, and I also moved the results.txt file into the ./data directory, so that you can easily archive the input and results in case we need to go back again.

Tyaedalis commented 7 years ago

@ferram4 Do you foresee needing any data on propellant mixtures/mass ratios, nozzle inlet/throat, or anything else that RPA calculates?

ferram4 commented 7 years ago

@Tyaedalis I don't see any reason to keep the nozzle inlet data, since in this situation it's identical to the injector data. I'm not using the throat data currently, but I can see that I might at some point so keep that. Only other data I'd archive is the stoichiometric O/F somewhere (shouldn't change between O/Fs). If you want to plan ahead for solid fuel, keep track of the mass fraction of condensed phases (liquid or solid) at the nozzle exit, since that'll be useful for handling solid rocket losses.

Tyaedalis commented 7 years ago

Hey, I just gotta say I've been busy with other work, and not only disappointed that I have to redo everything. BUT! I do have plans to redo my script and regenerate everything. I've only been quiet here because of other business. I really want to see this project reach finality.

ferram4 commented 7 years ago

Oh, don't worry too much. I made some minor updates to the kerolox config since everything with an O/F lower than ~O/F 2.2 had the wrong area ratio set (to 1.5 rather than 1.3, understandable) so that's fixed except for 0.8 since that requires the averaging process and I've been putting off doing that one.

Also, interesting thing: it looks like the Cps for really stupidly rich mixtures are a little too high. I don't think it requires changes in the data capturing procedure, I'll adjust it in code instead.