Class JSRMConfigBuilder

java.lang.Object
com.github.jbgust.jsrm.application.JSRMConfigBuilder

public class JSRMConfigBuilder extends Object
This class should be use to create a JSRMConfig
  • Constructor Details

    • JSRMConfigBuilder

      public JSRMConfigBuilder()
  • Method Details

    • withDensityRatio

      public JSRMConfigBuilder withDensityRatio(double densityRatio)
      Change density ratio (Grain actual density / Grain ideal density)
      Parameters:
      densityRatio - typically 0.90 to 0.98 (default 0.95)
      Returns:
      the builder
    • withNozzleErosionInMillimeter

      public JSRMConfigBuilder withNozzleErosionInMillimeter(double nozzleErosionInMillimeter)
      Change increase in throat diameter due to erosion
      Parameters:
      nozzleErosionInMillimeter - in millimeter (default 0.0mm)
      Returns:
      the builder
    • withCombustionEfficiencyRatio

      public JSRMConfigBuilder withCombustionEfficiencyRatio(double combustionEfficiencyRatio)
      Change combustion efficiency ration
      Parameters:
      combustionEfficiencyRatio - Use 0.95 for fine grain propellant. Use 0.93 for coarse grain propellant (default 0.95)
      Returns:
      the builder
    • withAmbiantPressureInMPa

      public JSRMConfigBuilder withAmbiantPressureInMPa(double ambiantPressureInMPa)
      Change local barometric pressure.
      Parameters:
      ambiantPressureInMPa - typically 0.101 MPa at sea level (default 0.101Mpa)
      Returns:
      the builder
    • withErosiveBurningAreaRatioThreshold

      public JSRMConfigBuilder withErosiveBurningAreaRatioThreshold(double erosiveBurningAreaRatioThreshold)
      Change ratio of core to throat cross-sectional areas, above which no erosive burning occurs
      Parameters:
      erosiveBurningAreaRatioThreshold - (default 6.0)
      Returns:
      the builder
    • withErosiveBurningVelocityCoefficient

      public JSRMConfigBuilder withErosiveBurningVelocityCoefficient(double erosiveBurningVelocityCoefficient)
      An empirical constant. Enter zero if no erosive burning expected.
      Parameters:
      erosiveBurningVelocityCoefficient - Typically 0.0 to 1.0 (default 0.0)
      Returns:
      the builder
    • withNozzleEfficiency

      public JSRMConfigBuilder withNozzleEfficiency(double nozzleEfficiency)
      Change nozzle efficiency
      Parameters:
      nozzleEfficiency - For a well-contoured, smooth nozzle, typically 0.75 to 0.85 (default 0.85)
      Returns:
      the builder
    • withOptimalNozzleDesign

      public JSRMConfigBuilder withOptimalNozzleDesign(boolean optimalNozzleDesign)
      Use automatic calculation to obtain the optimum nozzle expansion ratio.
      Parameters:
      optimalNozzleDesign - If set to false, you have to set nozzle expansion ratio with .withNozzleExpansionRatio()
      Returns:
      the builder
    • withNumberOfCalculationLine

      public JSRMConfigBuilder withNumberOfCalculationLine(int numberOfCalculationLine)
      Use to specify more or less line for calculation
      Parameters:
      numberOfCalculationLine - default value is 882 (same as SRM Excel file)
      Returns:
      the builder
    • withNozzleExpansionRatio

      public JSRMConfigBuilder withNozzleExpansionRatio(double nozzleExpansionRatio)
      Change ratio of cross-sectional areas of nozzle exit to throat. Should be set if optimalNozzleDesign is false
      Parameters:
      nozzleExpansionRatio - the expansion ratio
      Returns:
      the builder
    • withSafeKNFailure

      public JSRMConfigBuilder withSafeKNFailure(boolean safeKNFailure)
      If the computation failed, you can set it to true. This parameter help to compute low KN motor that normaly failed. The result will be less precise.
      Parameters:
      safeKNFailure - true to use safeKN feature
      Returns:
      the builder
    • createJSRMConfig

      public JSRMConfig createJSRMConfig()
      Build the configuration
      Returns:
      the config