public TurbopumpCalculator(BiPropellantConfig config, EngineCalculatorBase engineCalc) { this.engineCalc = engineCalc; this.biPropConfig = config; fuelAux = PropellantMixtureLibrary.AuxPropellantProperties[config.Fuel]; oxAux = PropellantMixtureLibrary.AuxPropellantProperties[config.Oxidizer]; if ((object)pumpEffFromSpecificSpeed == null) { LoadEfficiencyCurves(); } if (turbopumpArrangementSelector == null) { string[] turbopumpString = new string[] { "Direct Drive", "Gear Reduction", "Two Turbine" }; TurbopumpArrangementEnum[] turbopumpEnums = new TurbopumpArrangementEnum[] { TurbopumpArrangementEnum.DIRECT_DRIVE, TurbopumpArrangementEnum.GEAR_REDUCTION, TurbopumpArrangementEnum.TWO_TURBINE }; turbopumpArrangementSelector = new GUIDropDown <TurbopumpArrangementEnum>(turbopumpString, turbopumpEnums); } }
public void SetEngineProperties(BiPropellantConfig mixture, double oFRatio, double chamberPresMPa, double areaRatio, double throatDiameter) { bool unchanged = true; unchanged &= biPropConfig == mixture; this.mixtureTitle = mixture.MixtureTitle; biPropConfig = mixture; if (oFRatio < biPropConfig.ChamberOFLimitLean) { oFRatio = biPropConfig.ChamberOFLimitLean; } if (oFRatio > biPropConfig.ChamberOFLimitRich) { oFRatio = biPropConfig.ChamberOFLimitRich; } unchanged &= this.chamberOFRatio == oFRatio; this.chamberOFRatio = oFRatio; if (chamberPresMPa > biPropConfig.ChamberPresLimHigh) { chamberPresMPa = biPropConfig.ChamberPresLimHigh; } if (chamberPresMPa < biPropConfig.ChamberPresLimLow) { chamberPresMPa = biPropConfig.ChamberPresLimLow; } unchanged &= this.chamberPresMPa == oFRatio; this.chamberPresMPa = chamberPresMPa; if (areaRatio < biPropConfig.FrozenAreaRatio) { areaRatio = biPropConfig.FrozenAreaRatio; } unchanged &= this.areaRatio == areaRatio; double extensionRatio = nozzleExtensionArea / this.areaRatio; this.areaRatio = areaRatio; nozzleExtensionArea = extensionRatio * this.areaRatio; unchanged &= this.throatDiameter == throatDiameter; this.throatDiameter = throatDiameter; if (!unchanged) { CalculateEngineProperties(); } }
public void SetEngineModule(ProceduralEngineModule module) { uiActive = true; currentEngineModule = module; engineCalcBase = module.procEngineConfig; if (engineCalcBase == null) { BiPropellantConfig biprop = biPropellantConfigs.ActiveSelection; engineCalcBase = new EngineCalculatorGasGen(biprop, (biprop.ChamberOFLimitLean + biprop.ChamberOFLimitRich) * 0.5, 4, 5, 0.3); } else { biPropellantConfigs.SetOption(engineCalcBase.biPropConfig.MixtureTitle); powerCycleDropdown.SetOption(engineCalcBase.EngineCalculatorType()); } }
public EngineCalculatorBase(BiPropellantConfig mixture, double oFRatio, double chamberPresMPa, double areaRatio, double throatDiameter) { nozzle = new NozzleCalculator(0.8, areaRatio, NozzleShapeType.BELL); SetEngineProperties(mixture, oFRatio, chamberPresMPa, areaRatio, throatDiameter); nozzleExtensionArea = areaRatio; }
public EngineCalculatorGasGen(BiPropellantConfig mixture, double oFRatio, double chamberPresMPa, double areaRatio, double throatDiameter) : base(mixture, oFRatio, chamberPresMPa, areaRatio, throatDiameter) { }
public void UpdateMixture(BiPropellantConfig config) { biPropConfig = config; }