Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.text.DecimalFormat;
- import java.time.*;
- import java.util.*;
- import java.nio.file.*;
- import org.apache.poi.xwpf.usermodel.*;
- import java.time.format.DateTimeFormatter;
- class AutoEngineGen {
- public static boolean MStringS(String[] strings, String tbc) {
- boolean IsThere = false;
- for (String s : strings) {
- if (tbc.contains(s)) {
- IsThere = true;
- break;
- }
- }
- return IsThere;
- }
- public static int rN (double add, int maxV){
- return (int)(add + (Math.random() * maxV));
- }
- public static String rand(String[] array){
- Collections.shuffle(Arrays.asList(array));
- Random arrayChosen = new Random();
- int arrayChosen_index = arrayChosen.nextInt(array.length);
- return array[arrayChosen_index];
- }
- public static String[] split(String string, String sep) {
- return string.split(sep);
- }
- public static int findex(String[] array, String searched){
- ArrayList<String> clist = new ArrayList<>();
- Collections.addAll(clist, array);
- return clist.indexOf(searched);
- }
- public static boolean isHypergolic (String OCC, String FCC) {
- boolean isHypergolic = false;
- switch (OCC) {
- case "N2O4 (Nitrogen Tetroxide)" -> {
- switch (FCC) {
- case "50% CH6N2 + 50% N2H4 (Aerosine-50)", "75% CH6N2 + 25% N2H4 (UH-25)", "C6H5NH2 (Aniline)" ,
- "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)" ->{
- isHypergolic = true;
- } default -> {
- isHypergolic = false;
- }
- }
- } case "H2O2 (Hydrogen Peroxide) 95%", "H2O2 (Hydrogen Peroxide) 85%", "O2 (Oxygen)" -> {
- isHypergolic = false;
- } case "O3 (Ozone)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)" -> {
- isHypergolic = true;
- } case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)",
- "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)",
- "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)" -> {
- switch (FCC) {
- case "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)" ->{
- isHypergolic = true;
- } default -> {
- isHypergolic = false;
- }
- }
- }
- }
- return isHypergolic;
- }
- public static String propDataFind (String fuel, String oxid) {
- String combust_temp = null, mixRatio = null, exhaustVel = null;
- String[] fuel_List = new String[0];
- int[] combustionTemps = new int[0], exhaustVels = new int[0];
- double[] mixRatios = new double [0];
- switch (oxid) {
- case "O2 (Oxygen)" -> {
- fuel_List = new String[]{"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- combustionTemps = new int[]{3304, 3379, 3314, 3167, 3657, 3020, 3399, 3275, 3214, 3526};
- mixRatios = new double[]{5.00, 2.77, 1.49, 1.29, 1.72, 1.28, 1.15, 0.74, 1.19, 2.29};
- exhaustVels = new int[]{3738, 2932, 2713, 2635, 2708, 2815, 2938, 2973, 2687, 2834};
- }
- case "F2 (Fluorine)" -> {
- fuel_List = new String[]{"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
- "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- combustionTemps = new int[]{3689, -1, -1, 4344, -1, 4469, -1, -1, 4544, 4402, -1};
- mixRatios = new double[]{6.00, -1.00, -1.00, 2.26, -1.00, 2.81, -1.00, -1.00, 1.82, 2.20, -1.00};
- exhaustVels = new int[]{3925, -1, -1, 3106, -1, 3278, -1, -1, 3315, 3146, -1};
- }
- case "F2 (Fluorine) + O2 (Oxygen)" -> {
- fuel_List = new String[]{"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
- "CH6N2 (MonomethylHydrazine)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)", "N2H4 (Hydrazine)"};
- combustionTemps = new int[]{-1, 4530, 4437, -1, 4517, 4584, 4575, 4583, -1, 4571, -1};
- mixRatios = new double[]{-1.00, 4.82, 2.56, -1.00, 2.41, 2.41, 2.22, 2.33, -1.00, 3.67, -1.00};
- exhaustVels = new int[]{-1, 3281, 3134, -1, 3006, 3255, 3273, 3264, -1, 3166, -1};
- }
- case "O3 (Ozone)" -> {
- fuel_List = new String[]{"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
- "CH6N2 (MonomethylHydrazine)", "C12H26 (n-Dodecane)", "CH3OH (Methanol)", "N2H4 (Hydrazine)",
- "NH3 (Ammonia)"};
- combustionTemps = new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
- mixRatios = new double[]{-1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00};
- exhaustVels = new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
- }
- case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)",
- "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)",
- "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)" -> {
- fuel_List = new String[]{"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)"};
- combustionTemps = new int[]{2795, 2905, 3033, 2932, 2824};
- mixRatios = new double[]{8.00, 2.75, 2.13, 1.28, 2.13};
- exhaustVels = new int[]{3112, 2449, 2635, 2702, 2441};
- }
- case "N2O4 (Nitrogen Tetroxide)" -> {
- fuel_List = new String[]{"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
- "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- combustionTemps = new int[]{2973, 3151, 3006, 3468, 3268, 3229, 3296, 3252, 3137, 3058, 3342};
- mixRatios = new double[]{6.50, 2.26, 1.93, 2.64, 1.85, 1.59, 2.10, 1.73, 1.08, 1.78, 3.53};
- exhaustVels = new int[]{3334, 2540, 2479, 2538, 2730, 2750, 2713, 2742, 2803, 2528, 2619};
- }
- case "H2O2 (Hydrogen Peroxide) 85%" -> {
- fuel_List = new String[]{"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
- "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- combustionTemps = new int[]{2544, 2552, 2447, 2719, 2681, 2668, 2690, 2681, 2630, 2511, 2666};
- mixRatios = new double[]{14.00, 4.62, 3.77, 5.95, 4.02, 3.39, 4.63, 3.76, 2.15, 3.55, 7.84};
- exhaustVels = new int[]{2882, 2476, 2425, 2495, 2592, 2604, 2582, 2600, 2642, 2464, 2530};
- }
- case "H2O2 (Hydrogen Peroxide) 95%" -> {
- fuel_List = new String[]{"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
- "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- combustionTemps = new int[]{2666, 2762, 2653, 2934, 2870, 2852, 2884, 2871, 2801, 2709, 2878};
- mixRatios = new double[]{11.00, 3.97, 3.27, 4.94, 3.32, 2.82, 3.82, 3.13, 1.82, 3.06, 6.50};
- exhaustVels = new int[]{1918, 1599, 1566, 1610, 1683, 1692, 1676, 1688, 1718, 1590, 1639};
- }
- }
- int x = 0, b = 0;
- try {
- x = findex(fuel_List, fuel);
- b++;
- combust_temp = String.valueOf(combustionTemps[x]);
- b++;
- mixRatio = String.valueOf(mixRatios[x]);
- b++;
- exhaustVel = String.valueOf(exhaustVels[x]);
- b++;
- } catch(Exception e) {
- System.out.println("Fuel selected index: " + x);
- System.out.println("Error Line Number: " + b);
- System.out.println("Chosen Oxidizer: " + oxid);
- System.out.println("Chosen Fuel: " + fuel);
- System.exit(1);
- }
- return combust_temp + ", " + mixRatio + ", " + exhaustVel;
- }
- public static String NzlParameters (String altitude_Of_Operation_Chosen) {
- String nozzle_Type_Chosen = "", OExpansionRatio = "";
- switch (altitude_Of_Operation_Chosen) {
- case "0-20 km (Sea Level)" -> {
- String[] nozzle_Type_List_SL = {"Contour Bell Nozzle", "Parabolic Bell Nozzle", "Conical Nozzle",
- "Stepped Dual Bell Nozzle"};
- nozzle_Type_Chosen = rand(nozzle_Type_List_SL);
- if (nozzle_Type_Chosen.equalsIgnoreCase("Conical Nozzle")) {
- OExpansionRatio = rN(10, 9) + ":1";
- } else {
- OExpansionRatio = rN(10, 12) + ":1";
- }
- } case "20-30 km (Medium Atmosphere)" -> {
- String[] nozzle_Type_List_HA = {"Contour Bell Nozzle", "Parabolic Bell Nozzle", "Stepped Dual Bell Nozzle"};
- nozzle_Type_Chosen = rand(nozzle_Type_List_HA);
- OExpansionRatio = rN(32, 14) + ":1";
- } case "30-80 km (High Atmosphere)" -> {
- String[] nozzle_Type_List_HAi = {"Contour Bell Nozzle", "Parabolic Bell Nozzle", "Stepped Dual Bell Nozzle"};
- nozzle_Type_Chosen = rand(nozzle_Type_List_HAi);
- OExpansionRatio = rN(47, 43) + ":1";
- } case "80 km+ (Vacuum)" -> {
- String[] nozzle_Type_List_VA = {"Contour Bell Nozzle", "Parabolic Bell Nozzle", "Expanding Nozzle"};
- nozzle_Type_Chosen = rand(nozzle_Type_List_VA);
- OExpansionRatio = rN(90, 110) + ":1";
- } case "Any Altitude (0-80 km+)" -> {
- String[] nozzle_Type_List_Aero = {"Linear Aerospike Nozzle", "Toroidal Aerospike Nozzle",
- "Stepped Dual Bell Nozzle"};
- nozzle_Type_Chosen = rand(nozzle_Type_List_Aero);
- if (nozzle_Type_Chosen.equalsIgnoreCase("Stepped Dual Bell Nozzle")) {
- OExpansionRatio = rN(10, 9) + ":1";
- } else {
- OExpansionRatio = "None";
- }
- }
- }
- return nozzle_Type_Chosen + ", " + OExpansionRatio;
- }
- public static void StndrdDet(String engine_Name, String engine_Cycle_Chosen, String oxidizer_Chosen, String fuel_Chosen,
- String[] tank_Repressurisation, String[] altitude_Of_Operation) throws IOException {
- String[] Eng_Data = split(propDataFind(fuel_Chosen, oxidizer_Chosen), ", ");
- String combust_temp = Eng_Data[0];
- String mixRatio = Eng_Data[1];
- String exhaustVel = Eng_Data[2];
- String altitude_Of_Operation_Chosen = rand(altitude_Of_Operation);
- String[] NzlData = split(NzlParameters(altitude_Of_Operation_Chosen), ", ");
- String nozzle_Type_Chosen = NzlData[0];
- String AreaRatio = NzlData[1];
- String tank_Repressurisation_Chosen = rand(tank_Repressurisation);
- boolean isHypergolic = isHypergolic(oxidizer_Chosen, fuel_Chosen);
- boolean isCryogenic = isCryogenic(oxidizer_Chosen, fuel_Chosen);
- String purpose = uses(isHypergolic, isCryogenic, altitude_Of_Operation_Chosen, engine_Cycle_Chosen);
- String[] search_for = {"Upper", "Payload", "Space"}, cooling_mechanism;
- boolean longDur = MStringS(search_for, purpose);
- if (longDur) {
- cooling_mechanism = new String[]{"Radiative Cooling", "Dump Cooling", "Film Cooling", "Regenerative Cooling",
- "Transpiration Cooling"};
- } else {
- cooling_mechanism = new String[]{"Ablative Cooling", "Radiative Cooling", "Dump Cooling", "Film Cooling",
- "Regenerative Cooling", "Transpiration Cooling"};
- }
- String cooling_Mechanism_Chosen = rand(cooling_mechanism);
- String f_regen = "";
- if (cooling_Mechanism_Chosen.equals("Regenerative Cooling")) {
- int choice = (rN(4, 63))/2;
- if (Math.ceil(choice) == Math.floor(choice)) {
- f_regen = "Fuel ";
- } else {
- f_regen = "Oxidizer ";
- }
- }
- String cooling_Mechanism_C = f_regen + cooling_Mechanism_Chosen;
- String injector = Injector(cooling_Mechanism_C, engine_Cycle_Chosen);
- output_def(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, altitude_Of_Operation_Chosen,
- nozzle_Type_Chosen, tank_Repressurisation_Chosen, cooling_Mechanism_C, isHypergolic, isCryogenic,
- purpose, injector, AreaRatio, combust_temp, mixRatio, exhaustVel);
- }
- public static boolean isCryogenic(String oxidizer_chosen, String fuel_chosen) {
- boolean isCryo = false;
- switch (oxidizer_chosen) {
- case "O3 (Ozone)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O2 (Oxygen)" -> {
- isCryo = true;
- }
- }
- switch (fuel_chosen) {
- case "CH3OH (Methanol)", "C12H26 (n-Dodecane)", "H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "NH3 (Ammonia)", "CH4 (Methane)" -> {
- isCryo = true;
- }
- }
- return isCryo;
- }
- public static String uses(boolean isHypergolic, boolean isCryogenic, String alt, String En_Cycle) {
- String use = "";
- String[] pot_uses;
- boolean complex = En_Cycle.contains("Combustion Tap") || En_Cycle.contains("Staged") || En_Cycle.contains("Full Flow");
- if ((alt.equals("0-10 km (Sea Level)")) || (alt.equals("20-30 km (Medium Atmosphere)"))) {
- if (complex) {
- pot_uses = new String[]{"Lower Stage (Main Propulsion)"};
- } else {
- pot_uses = new String[]{"Lower Stage (Main Propulsion)", "Lower Stage (Course Correction)", "Lower Stage (Vernier)"};
- }
- use = rand(pot_uses);
- } else if ((alt.equals("30-80 km (High Atmosphere)")) || (alt.equals("80 km+ (Vacuum)"))) {
- if (isHypergolic && isCryogenic) {
- if (complex) {
- pot_uses = new String[]{"Upper Stage (Main Propulsion)"};
- } else {
- pot_uses = new String[]{"Upper Stage(Main Propulsion)", "Upper Stage(Course Correction)",
- "Upper Stage(Vernier)", "Upper Stage (Ullage)", "Payload (Main Propulsion)", "Payload (ACS)"};
- }
- use = rand(pot_uses);
- } else if (!isHypergolic && isCryogenic) {
- if (complex) {
- pot_uses = new String[]{"Upper Stage (Main Propulsion)"};
- } else {
- pot_uses = new String[]{"Upper Stage (Main Propulsion)", "Upper Stage (Vernier)"};
- }
- use = rand(pot_uses);
- } else if (isHypergolic && !isCryogenic) {
- if (complex) {
- pot_uses = new String[]{"Upper Stage(Main Propulsion)", "Payload (Main Propulsion)",
- "Space Tug (Main Propulsion)"};
- } else {
- pot_uses = new String[]{"Upper Stage(Main Propulsion)", "Upper Stage(Course Correction)",
- "Upper Stage(Vernier)", "Upper Stage (Ullage)", "Payload (Main Propulsion)",
- "Payload (ACS)", "Payload (Course Correction)", "Payload (Vernier)",
- "Space Tug (Main Propulsion)", "Space Tug (Course Correction)", "Space Tug (Vernier)",
- "Space Tug (Ullage)"};
- }
- use = rand(pot_uses);
- }
- } else {
- pot_uses = new String[]{"Lower Stage (Main Propulsion)", "Upper Stage(Main Propulsion)", "Payload (Main Propulsion)"};
- use = rand(pot_uses);
- }
- return use;
- }
- public static String Injector(String cooling_Mechanism, String engine_Cycle_Chosen) {
- String fuel_state = "Liquid";
- if (cooling_Mechanism.contains("Regenerative Cooling") || engine_Cycle_Chosen.contains("Expander")) {
- fuel_state = "Gas";
- }
- String[] injector = {"Showerhead Injector", "Self-impinging Injector", "Cross-impinging Injector",
- "Swirl Injector", "Pintle Injector"};
- return fuel_state + " " + rand(injector);
- }
- public static String nameGen(String[] engine_Name1, String[] firstPart) {
- String engine_Name;
- Collections.shuffle(Arrays.asList(engine_Name1));
- Collections.shuffle(Arrays.asList(firstPart));
- Random engineNameChosen = new Random();
- Random firstPartC = new Random();
- int engineNameChosen_index = engineNameChosen.nextInt(engine_Name1.length);
- int firstPart_index = firstPartC.nextInt(firstPart.length);
- String engNameFinalf = " " + engine_Name1[engineNameChosen_index];
- String firstPart_f = firstPart[firstPart_index] + "-";
- int finalNumber = rN(12, 999);
- if (finalNumber % 8 == 0) {
- engine_Name = firstPart_f + finalNumber + engNameFinalf;
- } else {
- char randomizedCharacter;
- int uio93 = rN(1, 999);
- int uio94 = rN(1, 11);
- Random randomLetter = new Random();
- if (uio93 % uio94 == 0) {
- randomizedCharacter = (char) (randomLetter.nextInt(26) + 'a');
- while (randomizedCharacter != 'l' || randomizedCharacter == 'o' || randomizedCharacter == 'i' || randomizedCharacter == 'q' || randomizedCharacter == 'e' || randomizedCharacter == 'h' || randomizedCharacter == 'g' || randomizedCharacter == 'c' || randomizedCharacter == 'j') {
- randomizedCharacter = (char) (randomLetter.nextInt(26) + 'a');
- if (randomizedCharacter != 'l' && randomizedCharacter != 'o' && randomizedCharacter != 'i' && randomizedCharacter != 'q' && randomizedCharacter != 'e' && randomizedCharacter != 'h' && randomizedCharacter != 'g' && randomizedCharacter != 'c' && randomizedCharacter != 'j') {
- break;
- }
- }
- } else {
- randomizedCharacter = (char) (randomLetter.nextInt(26) + 'A');
- while (randomizedCharacter == 'O' || randomizedCharacter == 'I' || randomizedCharacter == 'Q') {
- randomizedCharacter = (char) (randomLetter.nextInt(26) + 'A');
- if (randomizedCharacter == 'O' || randomizedCharacter == 'I' || randomizedCharacter == 'Q') {
- break;
- }
- }
- }
- engine_Name = firstPart_f + finalNumber + randomizedCharacter + engNameFinalf;
- }
- return engine_Name;
- }
- public static void output_monod(String ENN, String ECC, String AOOC, String PLC, String NTLC, String CMC, String CCC, String purpose) throws IOException {
- String lbrk = "======================================================================================================================";
- File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
- System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
- System.out.println("Fuel Flow Cycle: " + ECC);
- System.out.println("Propellant: " + PLC);
- System.out.println("Altitude Of Operation: " + AOOC);
- System.out.println("Exhaust Nozzle Geometry: " + NTLC);
- System.out.println("Engine Use Case: " + purpose);
- System.out.println("Nozzle Cooling Mechanism: " + CMC);
- System.out.println("Propellant catalyst: " + CCC + '\n');
- XWPFDocument docx = new XWPFDocument();
- if (new File(String.valueOf(pathn1)).exists()) {
- FileInputStream jesus = new FileInputStream(String.valueOf(pathn1));
- docx = new XWPFDocument(jesus);
- }
- XWPFParagraph par = docx.createParagraph();
- XWPFRun run = par.createRun();
- run.setFontSize(12);
- run.setBold(true);
- run.setFontFamily("Arial");
- run.setText("Engine Designation: ");
- run.setTextPosition(15);
- XWPFRun run2 = par.createRun();
- run2.setFontSize(12);
- run2.setBold(true);
- run2.setFontFamily("Arial");
- run2.setText(ENN);
- run2.setTextPosition(15);
- run2.addBreak();
- // -----------------------------------------------------------
- XWPFRun run3 = par.createRun();
- run3.setFontSize(10);
- run3.setBold(true);
- run3.setFontFamily("Arial");
- run3.setText("Fuel Flow Cycle: ");
- XWPFRun run4 = par.createRun();
- run4.setFontSize(10);
- run4.setFontFamily("Arial");
- run4.setText(ECC);
- run4.addBreak();
- // -----------------------------------------------------------
- XWPFRun run5 = par.createRun();
- run5.setFontSize(10);
- run5.setBold(true);
- run5.setFontFamily("Arial");
- run5.setText("Propellant(Remass): ");
- XWPFRun run6 = par.createRun();
- run6.setFontSize(10);
- run6.setFontFamily("Arial");
- run6.setText(PLC);
- run6.addBreak();
- // -----------------------------------------------------------
- XWPFRun run9 = par.createRun();
- run9.setFontSize(10);
- run9.setBold(true);
- run9.setFontFamily("Arial");
- run9.setText("Exhaust Nozzle Geometry: ");
- XWPFRun run0 = par.createRun();
- run0.setFontSize(10);
- run0.setFontFamily("Arial");
- run0.setText(NTLC);
- run0.addBreak();
- // -----------------------------------------------------------
- XWPFRun run104 = par.createRun();
- run104.setFontSize(10);
- run104.setBold(true);
- run104.setFontFamily("Arial");
- run104.setText("Engine Use Case: ");
- XWPFRun run105 = par.createRun();
- run105.setFontSize(10);
- run105.setFontFamily("Arial");
- run105.setText(purpose);
- run105.addBreak();
- // -----------------------------------------------------------
- XWPFRun run10 = par.createRun();
- run10.setFontSize(10);
- run10.setBold(true);
- run10.setFontFamily("Arial");
- run10.setText("Altitude Of Operation: ");
- XWPFRun run23 = par.createRun();
- run23.setFontSize(10);
- run23.setFontFamily("Arial");
- run23.setText(AOOC);
- run23.addBreak();
- // -----------------------------------------------------------
- XWPFRun run13 = par.createRun();
- run13.setFontSize(10);
- run13.setBold(true);
- run13.setFontFamily("Arial");
- run13.setText("Nozzle Cooling Mechanism: ");
- XWPFRun run14 = par.createRun();
- run14.setFontSize(10);
- run14.setFontFamily("Arial");
- run14.setText(CMC);
- run14.addBreak();
- // -----------------------------------------------------------
- XWPFRun run15 = par.createRun();
- run15.setFontSize(10);
- run15.setBold(true);
- run15.setFontFamily("Arial");
- run15.setText("Engine catalyst: ");
- XWPFRun run16 = par.createRun();
- run16.setFontSize(10);
- run16.setFontFamily("Arial");
- run16.setText(CCC);
- run16.addBreak();
- run16.addBreak();
- // -----------------------------------------------------------
- try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
- docx.write(out);
- }
- }
- public static void output_mono(String ENN, String ECC, String AOOC, String PLC, String NTLC, String CMC, String purpose) throws IOException {
- String lbrk = "======================================================================================================================";
- File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
- System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
- System.out.println("Fuel Flow Cycle: " + ECC);
- System.out.println("Propellant: " + PLC);
- System.out.println("Altitude Of Operation: " + AOOC);
- System.out.println("Exhaust Nozzle Geometry: " + NTLC);
- System.out.println("Engine Use Case: " + purpose);
- System.out.println("Nozzle Cooling Mechanism: " + CMC + '\n');
- XWPFDocument docx = new XWPFDocument();
- if (new File(String.valueOf(pathn1)).exists()) {
- FileInputStream jesus = new FileInputStream(String.valueOf(pathn1));
- docx = new XWPFDocument(jesus);
- }
- XWPFParagraph par = docx.createParagraph();
- XWPFRun run = par.createRun();
- run.setFontSize(12);
- run.setBold(true);
- run.setFontFamily("Arial");
- run.setText("Engine Designation: ");
- run.setTextPosition(15);
- XWPFRun run2 = par.createRun();
- run2.setFontSize(12);
- run2.setBold(true);
- run2.setFontFamily("Arial");
- run2.setText(ENN);
- run2.setTextPosition(15);
- run2.addBreak();
- // -----------------------------------------------------------
- XWPFRun run3 = par.createRun();
- run3.setFontSize(10);
- run3.setBold(true);
- run3.setFontFamily("Arial");
- run3.setText("Fuel Flow Cycle: ");
- XWPFRun run4 = par.createRun();
- run4.setFontSize(10);
- run4.setFontFamily("Arial");
- run4.setText(ECC);
- run4.addBreak();
- // -----------------------------------------------------------
- XWPFRun run5 = par.createRun();
- run5.setFontSize(10);
- run5.setBold(true);
- run5.setFontFamily("Arial");
- run5.setText("Propellant(Remass): ");
- XWPFRun run6 = par.createRun();
- run6.setFontSize(10);
- run6.setFontFamily("Arial");
- run6.setText(PLC);
- run6.addBreak();
- // -----------------------------------------------------------
- XWPFRun run9 = par.createRun();
- run9.setFontSize(10);
- run9.setBold(true);
- run9.setFontFamily("Arial");
- run9.setText("Exhaust Nozzle Geometry: ");
- XWPFRun run0 = par.createRun();
- run0.setFontSize(10);
- run0.setFontFamily("Arial");
- run0.setText(NTLC);
- run0.addBreak();
- // -----------------------------------------------------------
- XWPFRun run104 = par.createRun();
- run104.setFontSize(10);
- run104.setBold(true);
- run104.setFontFamily("Arial");
- run104.setText("Engine Use Case: ");
- XWPFRun run105 = par.createRun();
- run105.setFontSize(10);
- run105.setFontFamily("Arial");
- run105.setText(purpose);
- run105.addBreak();
- // -----------------------------------------------------------
- XWPFRun run10 = par.createRun();
- run10.setFontSize(10);
- run10.setBold(true);
- run10.setFontFamily("Arial");
- run10.setText("Altitude Of Operation: ");
- XWPFRun run23 = par.createRun();
- run23.setFontSize(10);
- run23.setFontFamily("Arial");
- run23.setText(AOOC);
- run23.addBreak();
- // -----------------------------------------------------------
- XWPFRun run13 = par.createRun();
- run13.setFontSize(10);
- run13.setBold(true);
- run13.setFontFamily("Arial");
- run13.setText("Nozzle Cooling Mechanism: ");
- XWPFRun run14 = par.createRun();
- run14.setFontSize(10);
- run14.setFontFamily("Arial");
- run14.setText(CMC);
- run14.addBreak();
- run14.addBreak();
- // -----------------------------------------------------------
- try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
- docx.write(out);
- }
- }
- public static void output_et(String ENN, String ECC, String AOOC, String PLC, String NTLC, String PGLC, String purpose) throws IOException {
- String lbrk = "======================================================================================================================";
- File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
- String pwr = (Math.round((float)rN(20, 980)/10))*10 + " kW" + '\n';
- System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
- System.out.println("Fuel Flow Cycle: " + ECC);
- System.out.println("Propellant(Remass): " + PLC);
- System.out.println("Altitude Of Operation: " + AOOC);
- System.out.println("Exhaust Nozzle Geometry: " + NTLC);
- System.out.println("Engine Use Case: " + purpose);
- System.out.println("Engine Power Source: " + PGLC);
- System.out.println("Rated Power Level: " + pwr);
- XWPFDocument docx = new XWPFDocument();
- if (new File(String.valueOf(pathn1)).exists()) {
- FileInputStream jesus = new FileInputStream(String.valueOf(pathn1));
- docx = new XWPFDocument(jesus);
- }
- XWPFParagraph par = docx.createParagraph();
- XWPFRun run = par.createRun();
- run.setFontSize(12);
- run.setBold(true);
- run.setFontFamily("Arial");
- run.setText("Engine Designation: ");
- run.setTextPosition(15);
- XWPFRun run2 = par.createRun();
- run2.setFontSize(12);
- run2.setBold(true);
- run2.setFontFamily("Arial");
- run2.setText(ENN);
- run2.setTextPosition(15);
- run2.addBreak();
- // -----------------------------------------------------------
- XWPFRun run3 = par.createRun();
- run3.setFontSize(10);
- run3.setBold(true);
- run3.setFontFamily("Arial");
- run3.setText("Fuel Flow Cycle: ");
- XWPFRun run4 = par.createRun();
- run4.setFontSize(10);
- run4.setFontFamily("Arial");
- run4.setText(ECC);
- run4.addBreak();
- // -----------------------------------------------------------
- XWPFRun run5 = par.createRun();
- run5.setFontSize(10);
- run5.setBold(true);
- run5.setFontFamily("Arial");
- run5.setText("Propellant(Remass): ");
- XWPFRun run6 = par.createRun();
- run6.setFontSize(10);
- run6.setFontFamily("Arial");
- run6.setText(PLC);
- run6.addBreak();
- // -----------------------------------------------------------
- XWPFRun run9 = par.createRun();
- run9.setFontSize(10);
- run9.setBold(true);
- run9.setFontFamily("Arial");
- run9.setText("Exhaust Nozzle Geometry: ");
- XWPFRun run0 = par.createRun();
- run0.setFontSize(10);
- run0.setFontFamily("Arial");
- run0.setText(NTLC);
- run0.addBreak();
- // -----------------------------------------------------------
- XWPFRun run104 = par.createRun();
- run104.setFontSize(10);
- run104.setBold(true);
- run104.setFontFamily("Arial");
- run104.setText("Engine Use Case: ");
- XWPFRun run105 = par.createRun();
- run105.setFontSize(10);
- run105.setFontFamily("Arial");
- run105.setText(purpose);
- run105.addBreak();
- // -----------------------------------------------------------
- XWPFRun run10 = par.createRun();
- run10.setFontSize(10);
- run10.setBold(true);
- run10.setFontFamily("Arial");
- run10.setText("Altitude Of Operation: ");
- XWPFRun run23 = par.createRun();
- run23.setFontSize(10);
- run23.setFontFamily("Arial");
- run23.setText(AOOC);
- run23.addBreak();
- // -----------------------------------------------------------
- XWPFRun run11 = par.createRun();
- run11.setFontSize(10);
- run11.setBold(true);
- run11.setFontFamily("Arial");
- run11.setText("Engine Power Source: ");
- XWPFRun run12 = par.createRun();
- run12.setFontSize(10);
- run12.setFontFamily("Arial");
- run12.setText(PGLC);
- run12.addBreak();
- // -----------------------------------------------------------
- XWPFRun run13 = par.createRun();
- run13.setFontSize(10);
- run13.setBold(true);
- run13.setFontFamily("Arial");
- run13.setText("Rated Power Level: ");
- XWPFRun run14 = par.createRun();
- run14.setFontSize(10);
- run14.setFontFamily("Arial");
- run14.setText(pwr);
- run14.addBreak();
- run14.addBreak();
- // -----------------------------------------------------------
- try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
- docx.write(out);
- }
- }
- public static void output_nt(String ENN, String ECC, String AOOC, String NCC, String PLC, String RFC, String NTLC,
- double EEV, String TRC, String CMC, String purpose, String react_gen, boolean bimodal, String ERC,
- String PRS, String ARR, int ECT) throws IOException {
- DecimalFormat f = new DecimalFormat("###,###,###");
- String lbrk = "======================================================================================================================";
- File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
- String bimm1, bimm2, oo1, oo2;
- if (!bimodal || ECC.equals("Nuclear SaltWater")) {
- bimm1 = "Engine Bimodality: ";
- oo1 = "Engine isn't bimodal";
- bimm2 = "Engine Electrical Output: ";
- oo2 = "None";
- } else {
- bimm1 = "Engine Bimodality: ";
- oo1 = "Engine is bimodal";
- bimm2 = "Engine Electrical Output: ";
- double ops = ((double)ECT/100)*18;
- oo2 = f.format(ops);
- oo2 = oo2 + " MW";
- }
- double bruh = (((double)ECT/90)*100)/1000;
- //============================================================================================
- System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
- if (!ECC.equals("Nuclear SaltWater") || !ECC.equals("Radioisotope Engine") || !NCC.equals("")) {
- System.out.println("Fuel Flow Cycle: " + NCC + " " + ECC);
- } else {
- System.out.println("Fuel Flow Cycle: " + ECC);
- }
- System.out.println("Propellant (Remass): " + PLC);
- System.out.println("Propellant State: " + PRS);
- System.out.println("Reactor Generation: " + react_gen);
- System.out.println("Reactor Maximum Power: " + f.format(bruh) + " GW");
- System.out.println("Reactor Fuel Material: " + RFC);
- if (NCC.equals("LANTR")) {
- System.out.println("Engine Exhaust Velocity: " + "(" + f.format(EEV) + "/~" + 3850 + ")" + " m/s");
- } else {
- System.out.println("Engine Exhaust Velocity: " + f.format(EEV) + " m/s");
- }
- System.out.println("Reactor Core Temperature: " + f.format(ECT) + "°K");
- System.out.println("Reactor Coolant: " + ERC);
- System.out.println(bimm1 + oo1);
- System.out.println(bimm2 + oo2);
- System.out.println("Altitude Of Operation: " + AOOC);
- System.out.println("Exhaust Nozzle Geometry: " + NTLC);
- System.out.println("Exhaust Nozzle Area Ratio: " + ARR);
- System.out.println("Exhaust Nozzle Cooling Mechanism: " + CMC);
- System.out.println("Engine Use Case: " + purpose);
- System.out.println("Tank repressurisation Method: " + TRC + '\n');
- //============================================================================================
- XWPFDocument docx = new XWPFDocument();
- if (new File(String.valueOf(pathn1)).exists()) {
- FileInputStream jesus = new FileInputStream(String.valueOf(pathn1));
- docx = new XWPFDocument(jesus);
- }
- XWPFParagraph par = docx.createParagraph();
- XWPFRun run = par.createRun();
- run.setFontSize(12);
- run.setBold(true);
- run.setFontFamily("Arial");
- run.setText("Engine Designation: ");
- run.setTextPosition(15);
- XWPFRun run2 = par.createRun();
- run2.setFontSize(12);
- run2.setBold(true);
- run2.setFontFamily("Arial");
- run2.setText(ENN);
- run2.setTextPosition(15);
- run2.addBreak();
- // -----------------------------------------------------------
- XWPFRun run3 = par.createRun();
- run3.setFontSize(10);
- run3.setBold(true);
- run3.setFontFamily("Arial");
- run3.setText("Fuel Flow Cycle: ");
- XWPFRun run4 = par.createRun();
- run4.setFontSize(10);
- run4.setFontFamily("Arial");
- if (ECC.equals("Nuclear SaltWater") || ECC.equals("Radioisotope Engine") || !NCC.equals("")) {
- run4.setText(ECC);
- } else {
- run4.setText(NCC + " " + ECC);
- }
- run4.addBreak();
- // -----------------------------------------------------------
- XWPFRun run5 = par.createRun();
- run5.setFontSize(10);
- run5.setBold(true);
- run5.setFontFamily("Arial");
- run5.setText("Propellant(Remass): ");
- XWPFRun run6 = par.createRun();
- run6.setFontSize(10);
- run6.setFontFamily("Arial");
- run6.setText(PLC);
- run6.addBreak();
- // -----------------------------------------------------------
- XWPFRun run65 = par.createRun();
- run65.setFontSize(10);
- run65.setBold(true);
- run65.setFontFamily("Arial");
- run65.setText("Propellant State: ");
- XWPFRun run66 = par.createRun();
- run66.setFontSize(10);
- run66.setFontFamily("Arial");
- run66.setText(PRS);
- run66.addBreak();
- // -----------------------------------------------------------
- XWPFRun run767 = par.createRun();
- run767.setFontSize(10);
- run767.setBold(true);
- run767.setFontFamily("Arial");
- run767.setText("Reactor Generation: ");
- XWPFRun run768 = par.createRun();
- run768.setFontSize(10);
- run768.setFontFamily("Arial");
- run768.setText(react_gen);
- run768.addBreak();
- // -----------------------------------------------------------
- XWPFRun run7 = par.createRun();
- run7.setFontSize(10);
- run7.setBold(true);
- run7.setFontFamily("Arial");
- run7.setText("Reactor Fuel Material: ");
- XWPFRun run8 = par.createRun();
- run8.setFontSize(10);
- run8.setFontFamily("Arial");
- run8.setText(RFC);
- run8.addBreak();
- // -----------------------------------------------------------
- XWPFRun run777 = par.createRun();
- run777.setFontSize(10);
- run777.setBold(true);
- run777.setFontFamily("Arial");
- run777.setText("Engine Exhaust velocity: ");
- XWPFRun run778 = par.createRun();
- run778.setFontSize(10);
- run778.setFontFamily("Arial");
- if (NCC.equals("LANTR")) {
- run778.setText("(" + f.format(EEV) + "/~" + 3850 + ")" + " m/s");
- } else {
- run778.setText(f.format(EEV) + " m/s");
- }
- run778.addBreak();
- // -----------------------------------------------------------
- XWPFRun run7767 = par.createRun();
- run7767.setFontSize(10);
- run7767.setBold(true);
- run7767.setFontFamily("Arial");
- run7767.setText("Reactor Core Temperature: ");
- XWPFRun run7768 = par.createRun();
- run7768.setFontSize(10);
- run7768.setFontFamily("Arial");
- run7768.setText(f.format(ECT) + " °K");
- run7768.addBreak();
- // -----------------------------------------------------------
- XWPFRun run566 = par.createRun();
- run566.setFontSize(10);
- run566.setBold(true);
- run566.setFontFamily("Arial");
- run566.setText("Reactor Coolant: ");
- XWPFRun run567 = par.createRun();
- run567.setFontSize(10);
- run567.setFontFamily("Arial");
- run567.setText(ERC);
- run567.addBreak();
- // -----------------------------------------------------------
- XWPFRun run769 = par.createRun();
- run769.setFontSize(10);
- run769.setBold(true);
- run769.setFontFamily("Arial");
- run769.setText(bimm1);
- XWPFRun run770 = par.createRun();
- run770.setFontSize(10);
- run770.setFontFamily("Arial");
- run770.setText(oo1);
- run770.addBreak();
- // -----------------------------------------------------------
- XWPFRun run771 = par.createRun();
- run771.setFontSize(10);
- run771.setBold(true);
- run771.setFontFamily("Arial");
- run771.setText(bimm2);
- XWPFRun run772 = par.createRun();
- run772.setFontSize(10);
- run772.setFontFamily("Arial");
- run772.setText(oo2);
- run772.addBreak();
- // -----------------------------------------------------------
- XWPFRun run10 = par.createRun();
- run10.setFontSize(10);
- run10.setBold(true);
- run10.setFontFamily("Arial");
- run10.setText("Altitude Of Operation: ");
- XWPFRun run23 = par.createRun();
- run23.setFontSize(10);
- run23.setFontFamily("Arial");
- run23.setText(AOOC);
- run23.addBreak();
- // -----------------------------------------------------------
- XWPFRun run9 = par.createRun();
- run9.setFontSize(10);
- run9.setBold(true);
- run9.setFontFamily("Arial");
- run9.setText("Exhaust Nozzle Geometry: ");
- XWPFRun run0 = par.createRun();
- run0.setFontSize(10);
- run0.setFontFamily("Arial");
- run0.setText(NTLC);
- run0.addBreak();
- // -----------------------------------------------------------
- XWPFRun run69 = par.createRun();
- run69.setFontSize(10);
- run69.setBold(true);
- run69.setFontFamily("Arial");
- run69.setText("Exhaust Nozzle Area Ratio: ");
- XWPFRun run60 = par.createRun();
- run60.setFontSize(10);
- run60.setFontFamily("Arial");
- run60.setText(ARR);
- run60.addBreak();
- // -----------------------------------------------------------
- XWPFRun run13 = par.createRun();
- run13.setFontSize(10);
- run13.setBold(true);
- run13.setFontFamily("Arial");
- run13.setText("Exhaust Nozzle Cooling Mechanism: ");
- XWPFRun run14 = par.createRun();
- run14.setFontSize(10);
- run14.setFontFamily("Arial");
- run14.setText(CMC);
- run14.addBreak();
- // -----------------------------------------------------------
- XWPFRun run104 = par.createRun();
- run104.setFontSize(10);
- run104.setBold(true);
- run104.setFontFamily("Arial");
- run104.setText("Engine Use Case: ");
- XWPFRun run105 = par.createRun();
- run105.setFontSize(10);
- run105.setFontFamily("Arial");
- run105.setText(purpose);
- run105.addBreak();
- // ------------------------------------------------------------
- XWPFRun run11 = par.createRun();
- run11.setFontSize(10);
- run11.setBold(true);
- run11.setFontFamily("Arial");
- run11.setText("Tank repressurisation Method: ");
- XWPFRun run12 = par.createRun();
- run12.setFontSize(10);
- run12.setFontFamily("Arial");
- run12.setText(TRC);
- run12.addBreak();
- run12.addBreak();
- // -----------------------------------------------------------
- try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
- docx.write(out);
- }
- }
- public static void output_def(String ENN, String ECC, String OCC, String FCC, String AOOC, String NTC, String TRC,
- String CMC, boolean isHyp, boolean isCryo, String purpose, String injector, String ARR,
- String PCT, String PMR, String EET) throws IOException {
- String lbrk = "======================================================================================================================";
- File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
- String message1 = "Propellant properties: ", message2, ThrottleRange, F_gimbalangle;
- DecimalFormat f = new DecimalFormat("###,###,###");
- //============================================================================================
- if ((isCryo) && (isHyp)) {
- message2 = "Hypergolic and cryogenic";
- } else if ((isCryo) && (!isHyp)) {
- message2 = "Not Hypergolic but cryogenic";
- } else if ((!isCryo) && (isHyp)) {
- message2 = "Hypergolic but not cryogenic";
- } else {
- message2 = "Neither Hypergolic nor cryogenic";
- }
- //============================================================================================
- int uio96 = rN(1, 999);
- int uio97 = rN(1, 11);
- if (uio96 % uio97 == 0) {
- int Throttle_MinV = rN(1, 99);
- int Throttle_MaxV = rN(100, 15);
- ThrottleRange = Throttle_MinV + "-" + Throttle_MaxV + "%";
- } else {
- ThrottleRange = "Not Throttleable";
- }
- //============================================================================================
- if (purpose.contains("Vernier")) {
- int gimbalangle = rN(0, 30);
- if ((!(gimbalangle >= 1)) || AOOC.equals("80 km+ (Vacuum)")) {
- F_gimbalangle = "None";
- } else {
- F_gimbalangle = gimbalangle+ "";
- }
- } else if (purpose.contains("Course Correction") && !purpose.contains("Lower Stage")) {
- F_gimbalangle = "None";
- } else {
- int gimbalangle = rN(0, 10);
- if ((!(gimbalangle >= 1)) || AOOC.equals("80 km+ (Vacuum)")) {
- F_gimbalangle = "None";
- } else {
- F_gimbalangle = "±" + gimbalangle + "°";
- }
- }
- //============================================================================================
- int chambers = rN(1, 2);
- String chamberN = "", cmbrM = "Engine chamber configuration: ";
- if (chambers == 1 || NTC.contains("Aerospike")) {
- chamberN = "Single Chamber";
- } else if (chambers == 2) {
- chamberN = "Dual Chamber";
- } else if (chambers == 3) {
- chamberN = "Quadruple Chamber";
- }
- //============================================================================================
- System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
- System.out.println("Fuel Flow Cycle: " + ECC);
- System.out.println("Engine Oxidizer: " + OCC);
- System.out.println("Engine Fuel: " + FCC);
- System.out.println("Average Mixture Ratio: " + PMR);
- System.out.println(message1 + message2);
- System.out.println("Altitude Of Operation: " + AOOC);
- System.out.println("Exhaust Nozzle Geometry: " + NTC);
- System.out.println("Exhaust Nozzle Area Ratio: " + ARR);
- System.out.println("Characteristic Exhaust Velocity: " + f.format(Integer.parseInt(EET)) + " m/s");
- System.out.println("Adiabatic Combustion Temperature: " + f.format(Integer.parseInt(PCT)) + "°K");
- System.out.println("Engine Gimbal Range: " + F_gimbalangle);
- System.out.println("Engine Injector Design: " + injector);
- System.out.println(cmbrM + chamberN);
- System.out.println("Engine Use Case: " + purpose);
- System.out.println("Tank repressurisation Method: " + TRC);
- System.out.println("Nozzle Cooling Mechanism: " + CMC);
- System.out.println("Engine Throttle Range: " + ThrottleRange + '\n');
- //============================================================================================
- XWPFDocument docx = new XWPFDocument();
- if (new File(String.valueOf(pathn1)).exists()) {
- docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
- }
- XWPFParagraph par = docx.createParagraph();
- XWPFRun run = par.createRun();
- run.setFontSize(12);
- run.setBold(true);
- run.setFontFamily("Arial");
- run.setText("Engine Designation: ");
- run.setTextPosition(15);
- XWPFRun run2 = par.createRun();
- run2.setFontSize(12);
- run2.setBold(true);
- run2.setFontFamily("Arial");
- run2.setText(ENN);
- run2.setTextPosition(15);
- run2.addBreak();
- // -----------------------------------------------------------
- XWPFRun run3 = par.createRun();
- run3.setFontSize(10);
- run3.setBold(true);
- run3.setFontFamily("Arial");
- run3.setText("Fuel Flow Cycle: ");
- XWPFRun run4 = par.createRun();
- run4.setFontSize(10);
- run4.setFontFamily("Arial");
- run4.setText(ECC);
- run4.addBreak();
- // -----------------------------------------------------------
- XWPFRun run5 = par.createRun();
- run5.setFontSize(10);
- run5.setBold(true);
- run5.setFontFamily("Arial");
- run5.setText("Engine Oxidizer: ");
- XWPFRun run6 = par.createRun();
- run6.setFontSize(10);
- run6.setFontFamily("Arial");
- run6.setText(OCC);
- run6.addBreak();
- // -----------------------------------------------------------
- XWPFRun run8 = par.createRun();
- run8.setFontSize(10);
- run8.setBold(true);
- run8.setFontFamily("Arial");
- run8.setText("Engine Fuel: ");
- XWPFRun run7 = par.createRun();
- run7.setFontSize(10);
- run7.setFontFamily("Arial");
- run7.setText(FCC);
- run7.addBreak();
- // -----------------------------------------------------------
- XWPFRun run68 = par.createRun();
- run68.setFontSize(10);
- run68.setBold(true);
- run68.setFontFamily("Arial");
- run68.setText("Average Mixture Ratio: ");
- XWPFRun run67 = par.createRun();
- run67.setFontSize(10);
- run67.setFontFamily("Arial");
- run67.setText(PMR);
- run67.addBreak();
- // -----------------------------------------------------------
- XWPFRun run100 = par.createRun();
- run100.setFontSize(10);
- run100.setBold(true);
- run100.setFontFamily("Arial");
- run100.setText(message1);
- XWPFRun run107 = par.createRun();
- run107.setFontSize(10);
- run107.setBold(false);
- run107.setFontFamily("Arial");
- run107.setText(message2);
- run107.addBreak();
- // -----------------------------------------------------------
- XWPFRun run10 = par.createRun();
- run10.setFontSize(10);
- run10.setBold(true);
- run10.setFontFamily("Arial");
- run10.setText("Altitude Of Operation: ");
- XWPFRun run23 = par.createRun();
- run23.setFontSize(10);
- run23.setFontFamily("Arial");
- run23.setText(AOOC);
- run23.addBreak();
- // -----------------------------------------------------------
- XWPFRun run9 = par.createRun();
- run9.setFontSize(10);
- run9.setBold(true);
- run9.setFontFamily("Arial");
- run9.setText("Exhaust Nozzle Geometry: ");
- XWPFRun run0 = par.createRun();
- run0.setFontSize(10);
- run0.setFontFamily("Arial");
- run0.setText(NTC);
- run0.addBreak();
- // -----------------------------------------------------------
- XWPFRun run69 = par.createRun();
- run69.setFontSize(10);
- run69.setBold(true);
- run69.setFontFamily("Arial");
- run69.setText("Exhaust Nozzle Area Ratio: ");
- XWPFRun run60 = par.createRun();
- run60.setFontSize(10);
- run60.setFontFamily("Arial");
- run60.setText(ARR);
- run60.addBreak();
- // -----------------------------------------------------------
- XWPFRun run80 = par.createRun();
- run80.setFontSize(10);
- run80.setBold(true);
- run80.setFontFamily("Arial");
- run80.setText("Characteristic Exhaust Velocity: ");
- XWPFRun run79 = par.createRun();
- run79.setFontSize(10);
- run79.setFontFamily("Arial");
- run79.setText(f.format(Integer.parseInt(EET)) + " m/s");
- run79.addBreak();
- // -----------------------------------------------------------
- XWPFRun run89 = par.createRun();
- run89.setFontSize(10);
- run89.setBold(true);
- run89.setFontFamily("Arial");
- run89.setText("Adiabatic Combustion Temperature: ");
- XWPFRun run78 = par.createRun();
- run78.setFontSize(10);
- run78.setFontFamily("Arial");
- run78.setText(f.format(Integer.parseInt(PCT)) + "°K");
- run78.addBreak();
- // -----------------------------------------------------------
- XWPFRun run101 = par.createRun();
- run101.setFontSize(10);
- run101.setBold(true);
- run101.setFontFamily("Arial");
- run101.setText("Engine Gimbal Range: ");
- XWPFRun run27 = par.createRun();
- run27.setFontSize(10);
- run27.setFontFamily("Arial");
- run27.setText(F_gimbalangle);
- run27.addBreak();
- // -----------------------------------------------------------
- XWPFRun run102 = par.createRun();
- run102.setFontSize(10);
- run102.setBold(true);
- run102.setFontFamily("Arial");
- run102.setText("Engine Injector Design: ");
- XWPFRun run103 = par.createRun();
- run103.setFontSize(10);
- run103.setFontFamily("Arial");
- run103.setText(injector);
- run103.addBreak();
- // -----------------------------------------------------------
- XWPFRun run167 = par.createRun();
- run167.setFontSize(10);
- run167.setBold(true);
- run167.setFontFamily("Arial");
- run167.setText(cmbrM);
- XWPFRun run168 = par.createRun();
- run168.setFontSize(10);
- run168.setFontFamily("Arial");
- run168.setText(chamberN);
- run168.addBreak();
- // -----------------------------------------------------------
- XWPFRun run104 = par.createRun();
- run104.setFontSize(10);
- run104.setBold(true);
- run104.setFontFamily("Arial");
- run104.setText("Engine Use Case: ");
- XWPFRun run105 = par.createRun();
- run105.setFontSize(10);
- run105.setFontFamily("Arial");
- run105.setText(purpose);
- run105.addBreak();
- // -----------------------------------------------------------
- XWPFRun run11 = par.createRun();
- run11.setFontSize(10);
- run11.setBold(true);
- run11.setFontFamily("Arial");
- run11.setText("Tank repressurisation Method: ");
- XWPFRun run12 = par.createRun();
- run12.setFontSize(10);
- run12.setFontFamily("Arial");
- run12.setText(TRC);
- run12.addBreak();
- // -----------------------------------------------------------
- XWPFRun run13 = par.createRun();
- run13.setFontSize(10);
- run13.setBold(true);
- run13.setFontFamily("Arial");
- run13.setText("Nozzle Cooling Mechanism: ");
- XWPFRun run14 = par.createRun();
- run14.setFontSize(10);
- run14.setFontFamily("Arial");
- run14.setText(CMC);
- run14.addBreak();
- // -----------------------------------------------------------
- XWPFRun run15 = par.createRun();
- run15.setFontSize(10);
- run15.setBold(true);
- run15.setFontFamily("Arial");
- run15.setText("Engine Throttle Range: ");
- XWPFRun run16 = par.createRun();
- run16.setFontSize(10);
- run16.setFontFamily("Arial");
- run16.setText(ThrottleRange);
- run16.addBreak();
- run16.addBreak();
- // -----------------------------------------------------------
- try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
- docx.write(out);
- }
- }
- public static void main(String[] args) throws IOException {
- long start = System.currentTimeMillis();
- File org = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles");
- org.mkdir();
- File org1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/DevData");
- org1.mkdir();
- File org2 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData");
- org2.mkdir();
- // -------------------------------------
- File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
- if (!(new File(String.valueOf(pathn1)).exists())) {
- XWPFDocument docx1 = new XWPFDocument();
- XWPFParagraph par1 = docx1.createParagraph();
- par1.setAlignment(ParagraphAlignment.CENTER);
- XWPFRun run1 = par1.createRun();
- run1.setText("Rocket Engine Registry");
- run1.setFontFamily("Arial");
- run1.setBold(true);
- run1.setFontSize(33);
- run1.setTextPosition(60);
- // -----------------------------------------------------------------------------
- XWPFParagraph par2 = docx1.createParagraph();
- par2.setAlignment(ParagraphAlignment.RIGHT);
- XWPFRun run2 = par2.createRun();
- LocalDateTime date = LocalDateTime.now();
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMM yyyy, HH:mm:ss");
- String dt = date.format(formatter);
- run2.setText("Created on: " + dt);
- run2.setFontFamily("Arial");
- run2.setBold(true);
- run2.setFontSize(10);
- run2.setTextPosition(75);
- // ----------------------------------------------------------------------------------------------------
- try (FileOutputStream out1 = new FileOutputStream(String.valueOf(pathn1))) {
- docx1.write(out1);
- out1.close();
- docx1.close();
- }
- }
- File ops = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData");
- ops.mkdir();
- System.out.println("""
- Welcome to the Advanced Rocket Engine Generator!
- """);
- Scanner scanner = new Scanner(System.in);
- String repeatCommand = "Y";
- int y = 0, h = 0;
- ArrayList<Double> yi = new ArrayList<>(100);
- while (!repeatCommand.equals("N")) {
- int FileLimit = 25;
- boolean test = true;
- if (test) {
- if ((new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full]" + FileLimit + ".docx")).exists()) repeatCommand = "N";
- } else {
- System.out.println("Do you want to generate a new rocket engine? Answer [Y/N] or [Yes/No]");
- System.out.print(">>>>> ");
- repeatCommand = scanner.next();
- }
- Path pathOne = Path.of(String.valueOf(pathn1));
- if (repeatCommand.equalsIgnoreCase("N") || repeatCommand.equalsIgnoreCase("NO")) {
- float sum = 0;
- for (int u = 0; u < (yi.size() - 1); u++) sum = (float) (sum + yi.get(u));
- long end = System.currentTimeMillis();
- float timen = (float)(end - start)/1000;
- int engines = yi.size();
- String FilesCreated = "Number of files created: " + FileLimit;
- String bytesPerEngine;
- if (engines <= 1) {
- bytesPerEngine = '\n' + "Average amount of bytes per engine: " + (pathn1.length()/y) + " bytes";
- } else {
- bytesPerEngine = '\n' + "Average amount of bytes per engine: " + (sum / yi.size()) + " bytes";
- }
- String runTime;
- if (timen < 60) {
- runTime = "Total run time: " + timen + " secs";
- } else if (timen/60 < 2) {
- runTime = "Total run time: " + (int)Math.floor(timen/60) + " min " + Math.round(timen%60) + " secs";
- } else {
- runTime = "Total run time: " + (int)Math.floor(timen/60) + " mins " + Math.round(timen%60) + " secs";
- }
- try {
- FileWriter fwrite = new FileWriter("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/DevData/dev.txt", true);
- BufferedWriter fwriteFinal = new BufferedWriter(fwrite);
- fwriteFinal.write('\n' + "===========================================================================");
- fwriteFinal.write('\n');
- fwriteFinal.write(FilesCreated);
- fwriteFinal.write('\n');
- fwriteFinal.write(bytesPerEngine);
- fwriteFinal.write('\n');
- fwriteFinal.write("Average amount of engines per file: " + sum + " engines");
- fwriteFinal.write('\n');
- fwriteFinal.write(runTime);
- fwriteFinal.write('\n');
- fwriteFinal.write("Rate of engine generation: " + h/timen + " engines/second");
- fwriteFinal.write('\n');
- fwriteFinal.write("Number of engines in files: " + h);
- fwriteFinal.write('\n' + '\n');
- fwriteFinal.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- System.exit(0);
- } else if (repeatCommand.equalsIgnoreCase("Y") || repeatCommand.equalsIgnoreCase("YES")) {
- double sizeInbytes = pathn1.length();
- double sizeInKilobytes = (sizeInbytes / 1024);
- if (sizeInKilobytes >= 20) {
- yi.add(sizeInbytes/y);
- File logM = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles");
- logM.mkdir();
- // -------------------------------------------------------------------------------------------------
- if ((new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full].docx")).exists()) {
- int i;
- y = 0;
- int x = 2;
- for (i = 1; i < x; i++) {
- if ((new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full]" + i + ".docx")).exists()) {
- x++;
- } else {
- Files.copy(pathOne, Paths.get("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full]" + i + ".docx"));
- }
- }
- } else {
- File org3 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders");
- org3.mkdir();
- Path logPF = Paths.get("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full].docx");
- Files.copy(pathOne, logPF);
- }
- XWPFDocument docx1 = new XWPFDocument();
- XWPFParagraph par1 = docx1.createParagraph();
- par1.setAlignment(ParagraphAlignment.CENTER);
- XWPFRun run1 = par1.createRun();
- run1.setText("Rocket Engine Generator");
- run1.setFontFamily("Arial");
- run1.setBold(true);
- run1.setFontSize(33);
- run1.setTextPosition(60);
- // -----------------------------------------------------------------------------
- XWPFParagraph par2 = docx1.createParagraph();
- par2.setAlignment(ParagraphAlignment.RIGHT);
- XWPFRun run2 = par2.createRun();
- LocalDateTime date = LocalDateTime.now();
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMM yyyy, HH:mm:ss");
- String dt = date.format(formatter);
- run2.setText("Created on: " + dt);
- run2.setFontFamily("Arial");
- run2.setBold(true);
- run2.setFontSize(10);
- run2.setTextPosition(60);
- // ----------------------------------------------------------------------------------------------------
- FileOutputStream out1 = new FileOutputStream(String.valueOf(pathn1));
- docx1.write(out1);
- out1.close();
- docx1.close();
- }
- String[] engine_Name1 = {"\"Argosy\"", "\"Galileo\"", "\"Callisto\"", "\"Nauka\"", "\"Insider\"", "\"Granis\"",
- "\"Rassvet\"", "\"Zvezda\"", "\"Zarya\"", "\"Orion\"", "\"Ares\"", "\"Delta\"", "\"Atlas\"", "\"Dreadnought\"",
- "\"Daedalus\"", "\"Baltia\"", "\"Dizhou\"", "\"Hermes\"", "\"Icarus\"", "\"Connestoga\"", "\"Yupiter\"",
- "\"Emphasis\"", "\"Olympus\"", "\"Kronos\"", "\"Helios\"", "\"Alabaster\"", "\"Falcon\"", "\"Saturn\"",
- "\"Eagle\"", "\"Endeavour\"", "\"Atlantis\"", "\"Cygnus\"", "\"Apollo\"", "\"Horizon\"", "\"Bulava\"",
- "\"Pioneer\"", "\"Voyager\"", "\"Exploration\"", "\"Expedition\"", "\"Vulcan\"", "\"Vysota\"",
- "\"Federation\"", "\"Sojourner\"", "\"Nautilus\"", "\"Jubilance\"", "\"Lagrange\"", "\"Volna\"",
- "\"Prometheus\"", "\"Tellus\"", "\"Alpha\"", "\"Delta\"", "\"Proton\"", "\"Neutron\"", "\"Topol\"",
- "\"Electron\"", "\"Pluton\"", "\"Poodle\"", "\"Skipper\"", "\"Convair\"", "\"Nexus\"", "\"Oko\"",
- "\"Vector\"", "\"Terrier\"", "\"Rhino\"", "\"Panther\"", "\"Goliath\"", "\"Juno\"", "\"Shrimp\"",
- "\"Thumper\"", "\"Mainsail\"", "\"Dart\"", "\"Twitch\"", "\"Stratus\"", "\"Oscar\"", "\"Kosmos\"",
- "\"Sentinel\"", "\"Pegasus\"", "\"Kelus\"", "\"Starshot\"", "\"Vernor\"", "\"Mammoth\"", "\"Liberty\"",
- "\"Douglas\"", "\"Heimdall\"", "\"Dynetics\"", "\"Pathfinder\"", "\"Horizon\"", "\"Poisk\"",
- "\"Pirs\"", "\"Philae\"", "\"Mariner\"", "\"Centaur\"", "\"Orel\"", "\"Pratt\"", "\"Hyperion\"",
- "\"Sagittarius\"", "\"Apollo\"", "\"Bryton\"", "\"Volga\"", "\"Harmony\"", "\"Cassini\"", "\"Contour\"",
- "\"Altair\"", "\"Dream\"", "\"Baikal\"", "\"Zenith\"", "\"Urpinod\"", "\"Bernal\"", "\"Condor\"",
- "\"Athena\"", "\"Astra\"", "\"Aerolus\"", "\"Rombus\"", "\"Lunokhod\"", "\"Fregat\"", "\"Glonass\"",
- "\"Dragon\"", "\"Salyut\"", "\"Starliner\"", "\"Skylab\"", "\"Briz\"", "\"Colombus\"", "\"Rosetta\"",
- "\"Redstone\"", "\"Antares\"", "\"Philae\"", "\"Prospero\"", "\"Leonardo\"", "\"Parker\"", "\"Dyson\"",
- "\"Oberon\"", "\"DragonFly\"", "\"Energia\"", "\"Buran\"", "\"Urgan\"", "\"Angara\"", "\"Vostok\"",
- "\"Voskhod\"", "\"Shenzhou\"", "\"Ingenuity\"", "\"Oberon\"", "\"Discovery\"", "\"Horizon\"", "\"Visionalis\"",
- "\"Cerasus\"", "\"Progress\"", "\"Unity\"", "\"Surveyor\"", "\"Prospector\"", "\"Ikar\"", "\"Redstone\"",
- "\"Lapis\"", "\"Caesius\"", "\"Iridium\"", "\"Daedlus\"", "\"Aelita\"", "\"Beta\"", "\"Gamma\"",
- "\"Alpha\"", "\"Epsilon\"", "\"Omega\"", "\"Discoverer\"", "\"Explorer\"", "\"Hornet\"", "\"Serenity\"",
- "\"Ariane\"", "\"Hornet\"", "\"Asimov\"", "\"Pegasus\"", "\"Venture\"", "\"Antares\"", "\"Star\"",
- "\"Archimedes\"", "\"Hera\"", "\"Iris\"", "\"Titan\"", "\"Artemis\"", "\"Phoenix\"", "\"Ross\"",
- "\"Sarychev\"", "\"Nemesis\"", "\"Heimdall\"", "\"Sturt\"", "\"Odin\"", "\"Aethelred\"", "\"Vesper\"",
- "\"Aces\"", "\"Argon\"", "\"Olympia\"", "\"Perseus\"", "\"Chyron\"", "\"Proxima\"", "\"Arminus\"",
- "\"Destiny\"", "\"Valient\"", "\"FireFly\"", "\"Obsidian\"", "\"Leviathan\"", "\"Magellan\"", "\"Voyager\"",
- "\"Mariner\"", "\"Joist\"", "\"Crimson\"", "\"Fortune\"", "\"Vanguard\"", "\"Aurora\"", "\"Ulysses\"",
- "\"Crusader\"", "\"Python\"", "\"Kuiper\"", "\"Insurgent\"", "\"Pathfinder\"", "\"Kvant\"", "\"Spektr\"",
- "\"Cassini\"", "\"Zemlya\"", "\"Dawn\"", "\"Kepler\"", "\"Parom\"", "\"Elektron\"", "\"Aeonian\"",
- "\"Node\"", "\"Burya\"", "\"Voyager\"", "\"Ceres\"", "\"Bayern\"", "\"Chasovoy\"", "\"Copernicus\"",
- "\"Quaoar\"", "\"Minotaur\"", "\"Agena\"", "\"Thor\"", "\"Vega\"", "\"Scout\"", "\"Coeus\"", "\"Minerva\"",
- "\"Kratos\"", "\"Neith\"", "\"Omoikane\"", "\"Gayamun\"", "\"Odin\"", "\"Kronos\"", "\"Hope\"", "\"Polet\"",
- "\"Polyot\"", "\"Sputnik\"", "\"Clementine\"", "\"Sojourner\"", "\"Ingenuity\"", "\"Perseverence\"",
- "\"Onatchesko\"", "\"Atlantis\"", "\"Tsyklon\"", "\"Zenit\"", "\"Almaz\"", "\"Soyuz\"", "\"Molniya\"",
- "\"Oreol\"", "\"Yantar\"", "\"Foton\"", "\"Meteor\"", "\"Ekran\"", "\"Strela\"", "\"Bion\"", "\"Piroda\"",
- "\"Salyut\"", "\"Strela\"", "\"Luch\"", "\"Potok\"", "\"Prognoz\"", "\"Orlets\"", "\"Etalon\"", "\"Astron\"",
- "\"Efir\"", "\"Kometa\"", "\"Fram\"", "\"Zemlya\"", "\"Gorizont\"", "\"Arkon\"", "\"Gamma\"", "\"Ekspress\"",
- "\"Gonets\"", "\"Taifun\"", "\"Okean\"", "\"Reflektor\"", "\"Kolibr\"", "\"Sever\"", "\"Comet\"",
- "\"Roton\"", "\"Solaris\"", "\"Altaris\"", "\"Ithacus\"", "\"Dekto\"", "\"Dream\"", "\"Impuls\"",
- "\"Vremya\"", "\"Portal\"", "\"Zodiak\"", "\"Slava\"", "\"Inertsiya\"", "\"Stimuls\"", "\"Ambross\"",
- "\"Amal\"", "\"Thea\"", "\"Orphelia\"", "\"Polyot\"", "\"Mudrost\"", "\"Carrack\"", "\"Artak\"",
- "\"Questar\"", "\"Artyom\"", "\"Tsyclon\"", "\"Ascension\"", "\"Tenacity\"", "\"Contour\"", "\"Zephyr\"",
- "\"Atlanta\"", "\"Polaris\"", "\"Aeolus\"", "\"Mayak\"", "\"Pamir\"", "\"Taimyr\"", "\"Cheget\"", "\"Sirius\"",
- "\"Uragan\"", "\"Agat\"", "\"Skiph\"", "\"Kristall\"", "\"Altair\"", "\"Uran\"", "\"Ingul\"", "\"Carat\"",
- "\"Pulsar\"", "\"Titan\"", "\"Eridanus\"", "\"Parus\"", "\"Cepheus\"", "\"Varagian\"", "\"Olympus\"",
- "\"Tarkhaniy\"", "\"Astraeus\"", "\"Antares\"", "\"Kazbek\"", "\"Burlak\"", "\"Borei\"", "\"Favor\"",
- "\"Rubin\"", "\"Almaz\"", "\"Granit\"", "\"Ruby\"", "\"Sokol\"", "\"Argon\"", "\"Kavkaz\"", "\"Ural\"",
- "\"Berkut\"", "\"Dunay\"", "\"Yastreb\"", "\"Terek\"", "\"Radon\"", "\"Taymyr\"", "\"Pamir\"", "\"Photon\"",
- "\"Elbrus\"", "\"Isayiev\"", "\"Shmel\"", "\"Kobra\"", "\"Shturn\"", "\"Metis\"", "\"Malyutka\"", "\"Fleyta\"",
- "\"Konkurs\"", "\"Bastion\"", "\"Svir\"", "\"Ataka\"", "\"Vodopad\"", "\"Veter\"", "\"Vyuga\"", "\"Vulga\"",
- "\"Tochka\"", "\"Oka\"", "\"Dvina\"", "\"Almaz\"", "\"Araks\"", "\"Kanopus\"", "\"Kliper\"", "\"Kobalt\"",
- "\"Siluet\"", "\"Kondor\"", "\"Lotos\"", "\"Luch\"", "\"Mir\"", "\"Neman\"", "\"Obzor\"", "\"Okean\"",
- "\"Oktan\"", "\"Orlets\"", "\"Poisk\"", "\"Potok\"", "\"Pirs\"", "\"Prognoz\"", "\"Resurs\"", "\"Rodnik\"",
- "\"Romb\"", "\"Kapustin\"", "\"Oplot\"", "\"Tsygan\"", "\"Teplokhod\"", "\"Sokosha\"", "\"Rubezh\"",
- "\"Zircon\"", "\"Moskva\"", "\"Tryol\"", "\"Ustinov\"", "\"Belyayev\"", "\"Novorod\"", "\"Argos\"",
- "\"Nerthus\"", "\"Janus\"", "\"Hephaestus\"", "\"Themis\"", "\"Chronos\"", "\"Tethys\"", "\"Minos\"",
- "\"Autumn\"", "\"Resilience\"", "\"Aelita\"", "\"Rheus\"", "\"Solntspek\"", "\"Spitzer\"", "\"Cartago\"",
- "\"Melibea\"", "\"Spartacus\"", "\"Pulsar\"", "\"Fusion\"", "\"Reliant\"", "\"Thunder\"", "\"Novo\"",
- "\"Panthera\"", "\"Nematoda\"", "\"Anelida\"", "\"Chordata\"", "\"Tetrapoda\"", "\"Cyclero\"", "\"Carrier\"",
- "\"Gaia\"", "\"Irtysh\"", "\"Wyvern\"", "\"Tarsier\"", "\"Alpina\"", "\"Espadon\"", "\"Parlos\"", "\"Nebula\"",
- "\"Lazarus\"", "\"Rufus\"", "\"Dornier\"", "\"Argus\"", "\"Kybau\"", "\"Kalau\"", "\"Chasvoy\"", "\"Zephyr\"",
- "\"Temny\"", "\"Gorizont\"", "\"Yars\"", "\"Krugazor\"", "\"Soprotivlenye\"", "\"Shtil\"", "\"Layner\"",
- "\"Arthropoda\"", "\"Hexapoda\"", "\"Crustacea\"", "\"Tardigrada\"", "\"Mollusca\"", "\"Annelida\"",
- "\"Bryozoa\"", "\"Rotifera", "\"Brachiopoda\"", "\"Echinodermata\"", "\"Hemichordata\"", "\"Cnidaria\"",
- "\"Staurozoa\"", "\"Hydrozoa\"", "\"Porifera", "\"Placozoa\"", "\"Craniata\"", "\"Tunicata\"", "\"Conodonta\"",
- "\"Tetrapoda\"", "\"Amniota\"", "\"Synapsida\"", "\"Sauropsida", "\"Mammalia\"", "\"Sarcodina\"", "\"Aspin\"",
- "\"Sporozoa\"", "\"Ciliata\"", "\"Filosa\"", "\"Toxoplasma\"", "\"Plasmodium\"", "\"Cryptomonada",
- "\"Heterokonta\"", "\"Haptophyta\"", "\"Cercozoa\"", "\"Heliozoa\"", "\"Anapsida\"", "\"Aves\"", "\"Peewee\""};
- String[] engine_Cycle = {"Gas Generator", "Staged Combustion (Oxidizer Rich)", "Staged Combustion (Fuel Rich)",
- "Expander (Open/Bleed)", "Expander (Closed)", "Dual Expander (Open/Bleed)", "Dual Expander (Closed)",
- "Pressure-Fed", "Full Flow Staged", "Electric Pump Fed", "Combustion Tap Off", "Monopropellant (Cold Gas)",
- "Monopropellant (Decomposition)", "Gas Core", "Droplet Core", "Liquid Core", "Solid Core", "Vapor Core",
- "Nuclear SaltWater", "Radioisotope Engine", "MagnetoPlasmaDynamic Thruster", "Hall Effect Thruster",
- "Gridded Ion Thruster", "Colloid Thruster", "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)"};
- String[] propellant_List1 = {"H2O2 (Hydrogen Peroxide)", "N2H4 (Hydrazine)", "NH2OH+NO3 (Hydroxylammonium nitrate)",
- "65% NH4N(NO2)2 (Ammonium Dinitramide) + 35% CH3OH(Methanol)"};
- String[] propellant_List2 = {"Nitrogen (N2)", "Helium (He)", "Carbon Dioxide (CO2)", "Ammonia (NH3)", "Hydrogen (H2)",
- "Methane (CH4)"};
- String[] altitude_Of_Operation = {"0-20 km (Sea Level)", "20-30 km (Medium Atmosphere)", "30-80 km (High Atmosphere)",
- "80 km+ (Vacuum)", "Any Altitude (0-80 km+)"};
- String[] tank_Repressurisation = {"Autogenous", "Inert Gas"};
- String[] firstPart = {"RD", "RS", "AJ", "XLR", "NK", "RL", "KDTU", "AR", "BE", "MV", "YF", "PKA", "J", "RSA",
- "MJ", "XS", "LM10", "HM", "LE", "LRE", "CE", "DST", "DOK", "KDU", "KRD", "RO", "LMS", "LMP", "RT",
- "F", "E", "A", "B", "S.10", "engines", "JDK", "SPP", "TYS", "SOK", "RES", "FWR", "NAA75", "LR", "MA", "GE",
- "OSA", "OBA", "NA", "RM02", "RM", "H", "MBB", "MB", "DF", "DE", "BF", "X", "BW", "BADR", "HS", "DC",
- "UA", "FG", "P", "KMV", "M", "SRMU", "V", "KVD", "JD", "PS", "CE"};
- String engine_Name = nameGen(engine_Name1, firstPart), engine_Cycle_Chosen = rand(engine_Cycle);
- switch (engine_Cycle_Chosen) {
- case "Gas Core", "Droplet Core", "Liquid Core", "Solid Core", "Vapor Core", "Nuclear SaltWater",
- "Radioisotope Engine" -> {
- String propellant_List_Chosen = "", nuclear_Cycle_Chosen = "", reactor_Fuel_Chosen = "",
- nozzle_Type_List_Chosen, remass_List_Chosen = "", propellantState = "", material;
- double exhaustVel = 0;
- int coreTemp = 0;
- switch (engine_Cycle_Chosen) {
- case "Radioisotope Engine" -> {
- String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
- "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
- double [] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
- remass_List_Chosen = rand(remass_List);
- propellant_List_Chosen = remass_List_Chosen;
- nuclear_Cycle_Chosen = "";
- String[] reactor_fuel = {"Polonium-210", "Fermium-252", "Uranium-233", "Plutonium-238"};
- reactor_Fuel_Chosen = rand(reactor_fuel);
- propellantState = "Cryogenic Liquid";
- coreTemp = rN(2000, 200);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel =(12400 / Math.pow(molmass, 0.531));
- }
- case "Solid Core" -> {
- String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
- "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
- double [] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
- propellant_List_Chosen = remass_List_Chosen;
- String[] nuclear_cycle = {"LANTR", "LEUNTR", "LPNTR", "CERMET", "Pebble-Bed", ""};
- nuclear_Cycle_Chosen = rand(nuclear_cycle);
- String[] reactor_fuel = {"Uranium-235", "Plutonium-238"};
- propellantState = "Cryogenic Liquid";
- if (nuclear_Cycle_Chosen.equalsIgnoreCase("LANTR")) {
- // Combustion NTR (O2 + H2 = Higher Thrust)
- // 9,221 m/s with LH2 (Higher Isp, Lower Thrust)
- // 6,347 m/s with LOx-LH2 [3.5 Of ratio] (Lower Isp, Higher Thrust)
- // 3300 K
- // LOx injected after LH2 goes through nuclear core
- // Two gears: (LOx-LH2 and LH2)
- remass_List_Chosen = "Hydrogen (H2)";
- int enr_level = rN(8, 87);
- reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
- coreTemp = rN(1900 + (enr_level * 5), 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel = (17600 / Math.pow(molmass, 0.531));
- } else if (nuclear_Cycle_Chosen.equalsIgnoreCase("LEUNTR")) {
- // Low enrichment NTR (Higher Isp, 12.5% U-235)
- // 10,610 m/s with LH2
- // 3300 K
- // Uranium-235 within tungsten-rhenium cladding to allow molten Uranium
- remass_List_Chosen = rand(remass_List);
- int enr_level = rN(5, 10);
- reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
- coreTemp = rN(1900 + (enr_level * 5), 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel =(17600 / Math.pow(molmass, 0.531));
- } else if (nuclear_Cycle_Chosen.equalsIgnoreCase("LPNTR")){
- // Low Pressure NTR (Higher Isp)
- // 13,200 m/s with 1 dalton Exhaust
- // 12,100 m/s with 2 daltons Exhaust
- // 3600 K maximum
- // LightWeight and Reliable = Absence of certain heavy and fault-prone components
- // 1 Bar internal Pressure to allow mono-H to not pulverise the engine
- // Tank Pressure Fed = No Turbopump
- // Two gears = [H: for High Isp and H2: for lower Isp]
- // High temperature: is needed to make Single-H and crank up the specific impulse 1,350 seconds
- // Low pressure: counteracts the high temperature so the heat level is not high enough to melt the reactor
- // Maximizing propellant mass flow: counteracts the low pressure so the thrust-to-weight ratio is higher
- // LH2 injected into the center of the spherical core
- remass_List_Chosen = rand(remass_List);
- int enr_level = rN(8, 87);
- reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
- coreTemp = rN(1900 + (enr_level * 5), 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel =(17600 / Math.pow(molmass, 0.531));
- } else if (nuclear_Cycle_Chosen.equalsIgnoreCase("CERMET")){
- // Porous Tungsten impregnated with Uranium(IV) oxide
- // Thermal efficiency: 96%
- // Total efficiency: 70%
- // 9,810 m/s with LH2
- // 2800 K maximum
- remass_List_Chosen = rand(remass_List);
- int enr_level = rN(8, 87);
- reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
- coreTemp = rN(1900 + (enr_level * 5), 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel =(17600 / Math.pow(molmass, 0.531));
- } else if (nuclear_Cycle_Chosen.equalsIgnoreCase("Pebble-Bed")){
- // Particulate bed through which the working fluid is pumped
- // Rotated at 3000 RPM
- /* The radioactive particle core can be dumped at the end of an
- operational cycle to simplify maintenance and refurbishment. */
- // 9,530 m/s with LH2
- // 2800 K
- remass_List_Chosen = rand(remass_List);
- propellantState = "Cryogenic Liquid";
- propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen;
- nuclear_Cycle_Chosen = rand(nuclear_cycle);
- int enr_level = rN(8, 87);
- reactor_Fuel_Chosen = enr_level + "% " + "Uranium-235";
- coreTemp = rN(1400 + (enr_level * 5), 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel = ((9530*2) / Math.pow(molmass, 0.531));
- } else {
- // Normal Average NTR (GigaVirgin)
- remass_List_Chosen = rand(remass_List);
- int enr_level = rN(8, 87);
- reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
- coreTemp = rN(1900 + (enr_level * 5), 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel =(11000 / Math.pow(molmass, 0.531));
- }
- }
- case "Colloid Core" -> {
- // Between Gas core, Liquid Core and Solid Core
- // 11,800 m/s with H2
- // Uranium is a colloid in uranium carbide along with zirconium carbide
- // Uranium Fuel Loss: 28 kg/min
- // Engine Temp: 3,950°K
- // Engine Pressure: 200 atm
- String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
- "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
- double [] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
- remass_List_Chosen = rand(remass_List);
- propellant_List_Chosen = "Uranium Zirconium Carbide(UC2 + ZrC) Colloid and " + remass_List_Chosen;
- nuclear_Cycle_Chosen = "";
- propellantState = "Cryogenic Liquid";
- int enr_level = rN(8, 87);
- reactor_Fuel_Chosen = enr_level + "% " + "Uranium-235";
- coreTemp = rN(2500 + (enr_level * 5), 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel = (11800 / Math.pow(molmass, 0.531));
- }
- case "Liquid Core" -> {
- // 19,620 m/s with H2
- // 5,000K maximum
- String[] remass_List, nuclear_cycle = {"\"Expander Bleed\"", "\"Expander Closed\"",
- "\"Vortex Confined\"", "LARS"};
- remass_List = new String[]{"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
- "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
- double[] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
- String[] materials = {"Tungsten", "Osmium", "Rhenium", "Tantalum"};
- remass_List_Chosen = rand(remass_List);
- material = rand(materials);
- propellantState = "Cryogenic Liquid";
- propellant_List_Chosen = "Uranium impregnated " + material + " and " + remass_List_Chosen;
- nuclear_Cycle_Chosen = rand(nuclear_cycle);
- int enr_level = rN(8, 87);
- reactor_Fuel_Chosen = enr_level + "% " + "Uranium-235";
- coreTemp = rN(3500 + (enr_level * 5), 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel = (19620 / Math.pow(molmass, 0.531));
- }
- case "Droplet Core" -> {
- String[] remass_List, nuclear_cycle = {"\"Expander Bleed\"", "\"Expander Closed\"",
- "\"Vortex Confined\""};
- remass_List = new String[]{"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
- "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
- double[] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
- remass_List_Chosen = rand(remass_List);
- propellantState = "Cryogenic Liquid";
- propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen;
- nuclear_Cycle_Chosen = rand(nuclear_cycle);
- int enr_level = rN(8, 87);
- reactor_Fuel_Chosen = enr_level + "% " + "Uranium-235";
- coreTemp = rN(5400 + (enr_level * 5), 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel = (19600 / Math.pow(molmass, 0.531));
- }
- case "Vapor Core" -> {
- String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
- "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
- double[] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
- remass_List_Chosen = rand(remass_List);
- propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen;
- nuclear_Cycle_Chosen = "";
- reactor_Fuel_Chosen = "93% Uranium-235";
- propellantState = "Cryogenic Liquid";
- coreTemp = rN(5500, 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel = (11800 / Math.pow(molmass, 0.531));
- }
- case "Gas Core" -> {
- // Gaseous Nuclear vortex in a separate chamber of quartz suspended in Neon (Lightbulb)
- // 20,405 m/s with H2 (Closed)
- // 13,650 K
- String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
- "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
- String[] nuclear_cycle = {"\"Nuclear Lightbulb\"", "\"Vortex Confined\"", "\"Wheel Flow\"",
- "\"Magnetohydrodynamic(MHD) vortex\""};
- double[] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
- remass_List_Chosen = rand(remass_List);
- propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen;
- nuclear_Cycle_Chosen = rand(nuclear_cycle);
- reactor_Fuel_Chosen = "93% Uranium-235";
- propellantState = "Cryogenic Liquid";
- coreTemp = rN(13650, 1000);
- int molmassi = findex(remass_List, remass_List_Chosen);
- double molmass = remass_EVD[molmassi];
- exhaustVel = (20405 / Math.pow(molmass, 0.531));
- }
- case "Nuclear SaltWater" -> {
- String[] fissile_salts = {"Uranium", "Plutonium"};
- String fissile_salt = rand(fissile_salts);
- if (!fissile_salt.equals("Plutonium")) {
- propellant_List_Chosen = fissile_salt + "(IV) TetraBromide (UBr4) + Water (H2O)";
- } else {
- propellant_List_Chosen = fissile_salt + "(III) TriBromide (PuBr3) + Water (H2O)";
- }
- remass_List_Chosen = "Water (H2O)";
- nuclear_Cycle_Chosen = "";
- propellantState = "Aqueous";
- int enri_level = rN(1, 2);
- if (enri_level == 1) {
- coreTemp = rN(25000, 1000);
- exhaustVel = rN(65500, 1000);
- reactor_Fuel_Chosen = 2 + "% " + fissile_salt;
- } else {
- coreTemp = rN(126800, 1000);
- exhaustVel = rN(4725000, 1000);
- reactor_Fuel_Chosen = 90 + "% " + fissile_salt;
- }
- }
- }
- //============================================================================================
- if (!engine_Cycle_Chosen.equals("Solid Core") || !engine_Cycle_Chosen.equals("Radioisotope Engine")) {
- nozzle_Type_List_Chosen = rand(new String[]{"Contour Bell Nozzle", "Parabolic Bell Nozzle",
- "Magnetic Virtual Nozzle"});
- } else {
- nozzle_Type_List_Chosen = rand(new String[]{"Contour Bell Nozzle", "Parabolic Bell Nozzle"});
- }
- //============================================================================================
- String[] cooling_mechanism = {"Radiative Cooling", "Dump Cooling", "Film Cooling", "Regenerative Cooling",
- "Transpiration Cooling"}, pot_uses = new String[] {"Upper Stage(Main Propulsion)",
- "Payload (Main Propulsion)", "Space Tug (Main Propulsion)"}, reactor_gen;
- //============================================================================================
- String use = rand(pot_uses), altitude_Of_Operation_Chosen = "80 km+ (Vacuum)",
- tank_Repressurisation_Chosen = rand(tank_Repressurisation),
- cooling_Mechanism_Chosen = rand(cooling_mechanism), reactor_gen_Chosen;
- //============================================================================================
- if ((engine_Cycle_Chosen.equals("Liquid Core") || engine_Cycle_Chosen.equals("Solid Core")
- || engine_Cycle_Chosen.equals("Pulsed Nuclear"))) {
- reactor_gen = new String[]{"Generation III+", "Generation IV", "Generation V", "Generation V+"};
- } else if (engine_Cycle_Chosen.equals("Nuclear SaltWater") || engine_Cycle_Chosen.equals("Radioisotope Engine")) {
- reactor_gen = new String[]{"Engine has no reactor"};
- } else {
- reactor_gen = new String[]{"Generation II", "Generation III", "Generation III+",
- "Generation IV", "Generation V", "Generation V+"};
- }
- //============================================================================================
- reactor_gen_Chosen = rand(reactor_gen);
- int uio97 = rN(1, 456);
- int uio98 = rN(1, 77);
- boolean isBimodal = uio97%uio98 != 0;
- String NzlReturnP = NzlParameters(altitude_Of_Operation_Chosen);
- String[] parts = NzlReturnP.split(", ");
- String AreaRatio = parts[1];
- output_nt(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, nuclear_Cycle_Chosen,
- propellant_List_Chosen, reactor_Fuel_Chosen, nozzle_Type_List_Chosen, exhaustVel,
- tank_Repressurisation_Chosen, cooling_Mechanism_Chosen, use, reactor_gen_Chosen,
- isBimodal, remass_List_Chosen, propellantState, AreaRatio, coreTemp);
- y++;
- h++;
- }
- //============================================================================================
- case "MagnetoPlasmaDynamic Thruster", "Hall Effect Thruster", "Gridded Ion Thruster",
- "Colloid Thruster", "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)" -> {
- String propellant_List_Chosen = null, nozzle_Type_List_Chosen = null;
- switch (engine_Cycle_Chosen) {
- case "Hall Effect Thruster" -> {
- String[] propellant_List = {"Xe (Xenon)", "Kr (Krypton)", "Ar (Argon)", "Bi (Bismuth)",
- "I2 (Iodine)", "Mg (Magnesium)", "Zn (Zinc)", "C10H16 (Adamantane)"};
- propellant_List_Chosen = rand(propellant_List);
- nozzle_Type_List_Chosen = "Hall Effect Thruster Nozzle";
- } case "Gridded Ion Thruster" -> {
- String[] propellant_List = {"Xe (Xenon)", "Hg (Mercury)", "Cs (Caesium)"};
- propellant_List_Chosen = rand(propellant_List);
- nozzle_Type_List_Chosen = "Electrostatic Ion Nozzle";
- } case "Colloid Thruster" -> {
- propellant_List_Chosen = "NH2OH+NO3 (Hydroxylammonium nitrate)";
- nozzle_Type_List_Chosen = "Capillary Emitter-Electrode Cone";
- } case "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)" -> {
- String[] propellant_List = {"Xe (Xenon)", "Kr (Krypton)", "Ar (Argon)"};
- propellant_List_Chosen = rand(propellant_List);
- nozzle_Type_List_Chosen = "VASIMR Magnetic Confinement Nozzle";
- } case "MagnetoPlasmaDynamic Thruster" -> {
- String[] propellant_List = {"Xe (Xenon)", "Ne (Neon)", "Ar (Argon)", "H2 (Hydrogen)", "N2H4 (Hydrazine)", "Li (Lithium)"};
- propellant_List_Chosen = rand(propellant_List);
- nozzle_Type_List_Chosen = "Cathode Plug Magnetic Confinement Nozzle";
- }
- }
- String[] pot_uses = new String[]{"Payload (Main Propulsion)", "Space Tug (Main Propulsion)"};
- String use = rand(pot_uses);
- String[] powerGen_List = {"Hydrogen Fuel cell", "Nuclear Fission Reactor",
- "Nuclear Fusion Reactor", "Photovoltaic Panel", "Solar Thermal Panel",
- "Radioisotope Thermoelectric Generator (RTG)"};
- String powerGen_List_Chosen = rand(powerGen_List);
- String altitude_Of_Operation_Chosen = "80 km+ (Vacuum)";
- output_et(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, propellant_List_Chosen,
- nozzle_Type_List_Chosen, powerGen_List_Chosen, use);
- y++;
- h++;
- }
- //============================================================================================
- case "Monopropellant (Decomposition)" -> {
- String[] nozzle_Type_List1 = {"Conical Nozzle", "Contour Bell Nozzle", "Parabolic Bell Nozzle"};
- String[] cooling_mechanism = {"Ablative Cooling", "Radiative Cooling"};
- String propellant_List_Chosen = rand(propellant_List1);
- String altitude_Of_Operation_Chosen = "80 km+ (Vacuum)";
- String nozzle_Type_List_Chosen = rand(nozzle_Type_List1);
- String cooling_Mechanism_Chosen = rand(cooling_mechanism), catalyst_Chosen = null;
- switch (propellant_List_Chosen) {
- case "N2H4 (Hydrazine)", "65% NH4N(NO2)2 (Ammonium Dinitramide) + 35% CH3OH(Methanol)" -> {
- catalyst_Chosen = "Iridium coated Alumina Pellets";
- } case "H2O2 (Hydrogen Peroxide)" -> {
- String[] catalyst = {"KMnO4 (Potassium Permanganate) Honeycomb", "Ag (Silver) Honeycomb",
- "MnO2 (Manganese Dioxide) Honeycomb", "K2Cr2O7 (Potassium dichromate) Honeycomb",
- "FeO (Iron (II) oxide)"};
- catalyst_Chosen = rand(catalyst);
- } case "NH2OH+NO3 (Hydroxylammonium nitrate)" -> {
- catalyst_Chosen = "Iridium coated Copper Pellets";
- }
- }
- String[] pot_uses = new String[]{"Upper Stage(Ullage)", "Upper Stage(Vernier)", "Payload (Main Propulsion)",
- "Payload (Vernier)", "Space Tug (Ullage)", "Space Tug (Vernier)"};
- String use = rand(pot_uses);
- output_monod(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, propellant_List_Chosen,
- nozzle_Type_List_Chosen, cooling_Mechanism_Chosen, catalyst_Chosen, use);
- y++;
- h++;
- } case "Monopropellant (Cold Gas)" -> {
- String[] nozzle_Type_List1 = {"Conical Nozzle", "Contour Bell Nozzle", "Parabolic Bell Nozzle"};
- String propellant_List_Chosen = rand(propellant_List2);
- String altitude_Of_Operation_Chosen = "80 km+ (Vacuum)";
- String nozzle_Type_List_Chosen = rand(nozzle_Type_List1);
- String cooling_Mechanism_Chosen = "Ablative Cooling";
- String[] pot_uses = {"Upper Stage(Ullage)", "Upper Stage(Vernier)", "Payload (Main Propulsion)",
- "Payload (Vernier)", "Space Tug (Ullage)", "Space Tug (Vernier)"};
- String purpose = rand(pot_uses);
- output_mono(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen,
- propellant_List_Chosen, nozzle_Type_List_Chosen, cooling_Mechanism_Chosen, purpose);
- y++;
- h++;
- }
- //============================================================================================
- case "Expander (Closed)", "Expander (Open/Bleed)" -> {
- String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)"};
- String oxidizer_Chosen = rand(oxidizer_List), fuel_Chosen = "";
- switch (oxidizer_Chosen) {
- case "O2 (Oxygen)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- fuel_Chosen = rand(fuel_List);
- } case "F2 (Fluorine)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
- "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- fuel_Chosen = rand(fuel_List);
- } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
- "C12H26 (n-Dodecane)"};
- fuel_Chosen = rand(fuel_List);
- }
- }
- StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
- tank_Repressurisation, altitude_Of_Operation);
- y++;
- h++;
- }
- //============================================================================================
- case "Dual Expander (Closed)", "Dual Expander (Open/Bleed)" -> {
- String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)"};
- String oxidizer_Chosen = rand(oxidizer_List), fuel_Chosen = "";
- String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)"};
- switch (oxidizer_Chosen) {
- case "O2 (Oxygen)", "F2 (Fluorine)" -> {
- fuel_Chosen = rand(fuel_List);
- } case "F2 (Fluorine) + O2 (Oxygen)" -> fuel_Chosen = "H2 (Hydrogen)";
- }
- StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
- tank_Repressurisation, altitude_Of_Operation);
- y++;
- h++;
- }
- //============================================================================================
- case "Staged Combustion (Fuel Rich)" -> {
- String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)"};
- String oxidizer_Chosen = rand(oxidizer_List), fuel_Chosen = "";
- switch (oxidizer_Chosen) {
- case "O2 (Oxygen)", "F2 (Fluorine)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "NH3 (Ammonia)", "N2H4 (Hydrazine)"};
- fuel_Chosen = rand(fuel_List);
- } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> fuel_Chosen = "H2 (Hydrogen)";
- }
- StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
- tank_Repressurisation, altitude_Of_Operation);
- y++;
- h++;
- }
- //============================================================================================
- case "Staged Combustion (Oxidizer Rich)" -> {
- String[] oxidizer_List = {"O2 (Oxygen)", "O3 (Ozone)", "N2O4 (Nitrogen Tetroxide)"};
- String oxidizer_Chosen = rand(oxidizer_List);
- String fuel_Chosen = "";
- switch (oxidizer_Chosen) {
- case "O2 (Oxygen)", "O3 (Ozone)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)"};
- fuel_Chosen = rand(fuel_List);
- } case "N2O4 (Nitrogen Tetroxide)" -> {
- String[] fuel_List = {"C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
- "C2H8N2 (UnsymmetricalDimethylHydrazine)"};
- fuel_Chosen = rand(fuel_List);
- }
- }
- StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
- tank_Repressurisation, altitude_Of_Operation);
- y++;
- h++;
- }
- //============================================================================================
- case "Full Flow Staged Combustion", "Combustion Tap Off" -> {
- String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)",
- "O3 (Ozone)", "N2O4 (Nitrogen Tetroxide)"};
- String oxidizer_Chosen = rand(oxidizer_List);
- String fuel_Chosen = "";
- switch (oxidizer_Chosen) {
- case "O2 (Oxygen)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)"};
- fuel_Chosen = rand(fuel_List);
- } case "F2 (Fluorine)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)",
- "N2H4 (Hydrazine)", "CH3OH (Methanol)"};
- fuel_Chosen = rand(fuel_List);
- } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
- "CH6N2 (MonomethylHydrazine)"};
- fuel_Chosen = rand(fuel_List);
- } case "N2O4 (Nitrogen Tetroxide)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
- "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH3OH (Methanol)"};
- fuel_Chosen = rand(fuel_List);
- }
- }
- StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
- tank_Repressurisation, altitude_Of_Operation);
- y++;
- h++;
- }
- //============================================================================================
- default -> {
- String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)",
- "N2O4 (Nitrogen Tetroxide)", "H2O2 (Hydrogen Peroxide) 95%", "H2O2 (Hydrogen Peroxide) 85%",
- "O3 (Ozone)", "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)",
- "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)",
- "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)", "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)"};
- String oxidizer_Chosen = rand(oxidizer_List);
- String fuel_Chosen = "";
- switch (oxidizer_Chosen) {
- case "O2 (Oxygen)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- fuel_Chosen = rand(fuel_List);
- } case "F2 (Fluorine)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
- "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
- "C12H26 (n-Dodecane)"};
- fuel_Chosen = rand(fuel_List);
- } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- fuel_Chosen = rand(fuel_List);
- } case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)",
- "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)",
- "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)" -> {
- String[] fuel_List = {"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)"};
- fuel_Chosen = rand(fuel_List);
- } case "N2O4 (Nitrogen Tetroxide)", "H2O2 (Hydrogen Peroxide) 95%", "H2O2 (Hydrogen Peroxide) 85%"-> {
- String[] fuel_List = {"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
- "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
- "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
- "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
- fuel_Chosen = rand(fuel_List);
- }
- }
- StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
- tank_Repressurisation, altitude_Of_Operation);
- y++;
- h++;
- }
- }
- } else {
- while (!(repeatCommand.equalsIgnoreCase("Y") && repeatCommand.equalsIgnoreCase("N") && repeatCommand.equalsIgnoreCase("YES") && repeatCommand.equalsIgnoreCase("NO"))) {
- System.out.println("'" + repeatCommand + "'" + " is not a registered command,Please input an appropriate command [Y/N] or [Yes/No]");
- System.out.print(">>>>> ");
- repeatCommand = scanner.next();
- if (repeatCommand.equalsIgnoreCase("Y") || repeatCommand.equalsIgnoreCase("N") || repeatCommand.equalsIgnoreCase("YES") || repeatCommand.equalsIgnoreCase("NO")) {
- break;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment