Class CompressorChartGenerator

java.lang.Object
neqsim.process.equipment.compressor.CompressorChartGenerator

public class CompressorChartGenerator extends Object
Compressor chart generator.

This class generates a compressor chart based on the provided compressor and the specified generation option. Supports generating curves for single-speed or multi-speed compressors using either simple fan law scaling or predefined curve templates.

Usage examples:

// Single speed (uses compressor's current speed)
CompressorChart chart = generator.generateCompressorChart("normal");

// Multi-speed with automatic speed range
CompressorChart chart = generator.generateCompressorChart("normal", 5);

// Multi-speed with specific speeds
double[] speeds = {7000, 8000, 9000, 10000};
CompressorChart chart = generator.generateCompressorChart("normal", speeds);

// Using a predefined curve template
CompressorChart chart = generator.generateFromTemplate("CENTRIFUGAL_STANDARD", 9);

// Available templates: CENTRIFUGAL_STANDARD, CENTRIFUGAL_HIGH_FLOW, CENTRIFUGAL_HIGH_HEAD
Version:
1.0
Author:
Even Solbraa
  • Field Details

    • compressor

      private final Compressor compressor
    • chartType

      private String chartType
    • useReynoldsCorrection

      private boolean useReynoldsCorrection
      Enable Reynolds number correction for efficiency.
    • useMachCorrection

      private boolean useMachCorrection
      Enable Mach number limitation for stonewall flow.
    • useMultistageSurgeCorrection

      private boolean useMultistageSurgeCorrection
      Enable multistage surge correction.
    • numberOfStages

      private int numberOfStages
      Number of compression stages (for multistage surge correction).
    • impellerDiameter

      private double impellerDiameter
      Impeller diameter in meters (for Reynolds calculation).
  • Constructor Details

    • CompressorChartGenerator

      public CompressorChartGenerator(Compressor inpCompressor)
      Constructor for CompressorChartGenerator.
      Parameters:
      inpCompressor - The compressor for which the chart is generated.
  • Method Details

    • setChartType

      public CompressorChartGenerator setChartType(String type)
      Set the chart type to generate.

      Available types:

      • "simple" or "fan law" - Basic CompressorChart with fan law calculations
      • "interpolate" - CompressorChartAlternativeMapLookup with interpolation
      • "interpolate and extrapolate" - CompressorChartAlternativeMapLookupExtrapolate (default)
      Parameters:
      type - The chart type to use
      Returns:
      this generator for method chaining
    • setUseReynoldsCorrection

      public CompressorChartGenerator setUseReynoldsCorrection(boolean enable)
      Enable or disable Reynolds number correction for efficiency.

      When enabled, efficiency values are adjusted based on the Reynolds number at each operating point. This accounts for viscous losses that vary with gas properties and speed.

      Parameters:
      enable - true to enable Reynolds correction
      Returns:
      this generator for method chaining
    • setUseMachCorrection

      public CompressorChartGenerator setUseMachCorrection(boolean enable)
      Enable or disable Mach number limitation for stonewall flow.

      When enabled, the stonewall flow is calculated based on sonic velocity, accounting for gas composition effects on choke conditions.

      Parameters:
      enable - true to enable Mach number correction
      Returns:
      this generator for method chaining
    • setUseMultistageSurgeCorrection

      public CompressorChartGenerator setUseMultistageSurgeCorrection(boolean enable)
      Enable or disable multistage surge correction.

      When enabled, the surge line is adjusted to account for stage mismatching at reduced speeds in multistage compressors. This typically shifts the surge line to higher flows at lower speeds.

      Parameters:
      enable - true to enable multistage surge correction
      Returns:
      this generator for method chaining
    • setNumberOfStages

      public CompressorChartGenerator setNumberOfStages(int stages)
      Set the number of compression stages.

      This is used for multistage surge correction. More stages result in larger corrections at reduced speeds.

      Parameters:
      stages - Number of compression stages (must be at least 1)
      Returns:
      this generator for method chaining
    • setImpellerDiameter

      public CompressorChartGenerator setImpellerDiameter(double diameter)
      Set the impeller diameter for Reynolds number calculation.
      Parameters:
      diameter - Impeller diameter in meters
      Returns:
      this generator for method chaining
    • enableAdvancedCorrections

      public CompressorChartGenerator enableAdvancedCorrections(int numberOfStages)
      Enable all advanced corrections.

      This is a convenience method that enables Reynolds correction, Mach correction, and multistage surge correction.

      Parameters:
      numberOfStages - Number of compression stages
      Returns:
      this generator for method chaining
    • createChart

      private CompressorChartInterface createChart()
      Create a chart instance of the configured type.
      Returns:
      A new chart instance
    • generateCompressorChart

      public CompressorChartInterface generateCompressorChart(String generationOption)
      Generates a single-speed compressor chart using the compressor's current speed.
      Parameters:
      generationOption - Specifies how to generate the compressor chart. Options: "normal curves" or other types.
      Returns:
      A CompressorChartInterface object.
    • generateCompressorChart

      public CompressorChartInterface generateCompressorChart(String generationOption, int numberOfSpeeds)
      Generates a multi-speed compressor chart with automatic speed range.

      The speeds are distributed evenly from 75% to 105% of the compressor's current speed for "normal" curves, or from 50% to 200% for other curve types.

      Parameters:
      generationOption - Specifies how to generate the compressor chart. Options: "normal curves" or other types.
      numberOfSpeeds - The number of speed curves to generate (must be at least 1).
      Returns:
      A CompressorChartInterface object.
    • generateFromTemplate

      public CompressorChartInterface generateFromTemplate(String templateName, int numberOfSpeeds)
      Generates a compressor chart from a predefined curve template.

      This method uses realistic compressor curve shapes from predefined templates and scales them to match the compressor's current operating point. Available templates:

      • "CENTRIFUGAL_STANDARD" - Standard centrifugal compressor (default)
      • "CENTRIFUGAL_HIGH_FLOW" - High flow, lower head compressor
      • "CENTRIFUGAL_HIGH_HEAD" - High head, narrower operating range
      Parameters:
      templateName - Name of the template to use
      numberOfSpeeds - Number of speed curves to generate
      Returns:
      A CompressorChartInterface object
    • generateFromTemplate

      public CompressorChartInterface generateFromTemplate(CompressorCurveTemplate template, int numberOfSpeeds)
      Generates a compressor chart from a curve template object.
      Parameters:
      template - The template to use
      numberOfSpeeds - Number of speed curves to generate
      Returns:
      A CompressorChartInterface object
    • generateFromTemplate

      public CompressorChartInterface generateFromTemplate(String templateName, double[] speeds)
      Generates a compressor chart from a predefined curve template with specific speeds.
      Parameters:
      templateName - Name of the template to use
      speeds - Array of speed values in RPM to generate curves for
      Returns:
      A CompressorChartInterface object
    • scaleTemplateWithSpeeds

      private CompressorChartInterface scaleTemplateWithSpeeds(CompressorCurveTemplate template, double designSpeed, double designFlow, double designHead, double[] targetSpeeds)
      Scale a template to specific speed values.
      Parameters:
      template - the compressor curve template
      designSpeed - the design speed in RPM
      designFlow - the design flow in m3/hr
      designHead - the design head in kJ/kg
      targetSpeeds - array of target speeds
      Returns:
      the scaled compressor chart
    • getOriginalTemplateChart

      public static CompressorChartInterface getOriginalTemplateChart(String templateName)
      Get the original (unscaled) chart from a template.

      This returns the exact curve data stored in the template without any scaling. Useful for recreating reference curves or when you want to use the template data directly.

      Parameters:
      templateName - Name of the template to use
      Returns:
      A CompressorChartInterface object with original data
    • getAvailableTemplates

      public static String[] getAvailableTemplates()
      Get list of available template names.
      Returns:
      Array of available template names
    • generateCompressorChart

      public CompressorChartInterface generateCompressorChart(String generationOption, double[] speeds)
      Generates a compressor chart with specified speed values.

      This method allows full control over which speeds to include in the chart. When advanced corrections are enabled, the following adjustments are applied:

      • Reynolds correction: Efficiency adjusted for viscous effects at different speeds
      • Mach correction: Stonewall flow limited by sonic velocity
      • Multistage surge correction: Surge line adjusted for stage mismatching at reduced speeds
      Parameters:
      generationOption - Specifies how to generate the compressor chart. Options: "normal curves" or other types.
      speeds - An array of speed values in RPM to generate curves for.
      Returns:
      A CompressorChartInterface object.
    • isUseReynoldsCorrection

      public boolean isUseReynoldsCorrection()
      Get whether Reynolds correction is enabled.
      Returns:
      true if Reynolds correction is enabled
    • isUseMachCorrection

      public boolean isUseMachCorrection()
      Get whether Mach correction is enabled.
      Returns:
      true if Mach correction is enabled
    • isUseMultistageSurgeCorrection

      public boolean isUseMultistageSurgeCorrection()
      Get whether multistage surge correction is enabled.
      Returns:
      true if multistage surge correction is enabled
    • getNumberOfStages

      public int getNumberOfStages()
      Get the number of compression stages.
      Returns:
      number of stages
    • getImpellerDiameter

      public double getImpellerDiameter()
      Get the impeller diameter.
      Returns:
      impeller diameter in meters
    • getChartType

      public String getChartType()
      Get the chart type.
      Returns:
      chart type string
    • createSurgeCurve

      private SafeSplineSurgeCurve createSurgeCurve(CompressorChartInterface compChart, double refFlow, double refSpeed, double minFlow, double maxFlow, double minSpeed, double maxSpeed, boolean isNormalCurves)
      Creates a surge curve with proper interpolation points.

      This method generates a 3-point surge curve that represents the relationship between surge flow and head across different operating conditions. This allows for meaningful interpolation when querying surge flow at different head values.

      Parameters:
      compChart - the compressor chart object
      refFlow - the reference flow rate
      refSpeed - the reference speed
      minFlow - the minimum flow rate
      maxFlow - the maximum flow rate
      minSpeed - the minimum speed
      maxSpeed - the maximum speed
      isNormalCurves - whether to generate normal curves
      Returns:
      a SafeSplineSurgeCurve object representing the surge curve