Class CompressorChartGenerator
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 Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate final Compressorprivate doubleImpeller diameter in meters (for Reynolds calculation).private intNumber of compression stages (for multistage surge correction).private booleanEnable Mach number limitation for stonewall flow.private booleanEnable multistage surge correction.private booleanEnable Reynolds number correction for efficiency. -
Constructor Summary
ConstructorsConstructorDescriptionCompressorChartGenerator(Compressor inpCompressor) Constructor for CompressorChartGenerator. -
Method Summary
Modifier and TypeMethodDescriptionprivate CompressorChartInterfaceCreate a chart instance of the configured type.private SafeSplineSurgeCurvecreateSurgeCurve(CompressorChartInterface compChart, double refFlow, double refSpeed, double minFlow, double maxFlow, double minSpeed, double maxSpeed, boolean isNormalCurves) Creates a surge curve with proper interpolation points.enableAdvancedCorrections(int numberOfStages) Enable all advanced corrections.generateCompressorChart(String generationOption) Generates a single-speed compressor chart using the compressor's current speed.generateCompressorChart(String generationOption, double[] speeds) Generates a compressor chart with specified speed values.generateCompressorChart(String generationOption, int numberOfSpeeds) Generates a multi-speed compressor chart with automatic speed range.generateFromTemplate(String templateName, double[] speeds) Generates a compressor chart from a predefined curve template with specific speeds.generateFromTemplate(String templateName, int numberOfSpeeds) Generates a compressor chart from a predefined curve template.generateFromTemplate(CompressorCurveTemplate template, int numberOfSpeeds) Generates a compressor chart from a curve template object.static String[]Get list of available template names.Get the chart type.doubleGet the impeller diameter.intGet the number of compression stages.static CompressorChartInterfacegetOriginalTemplateChart(String templateName) Get the original (unscaled) chart from a template.booleanGet whether Mach correction is enabled.booleanGet whether multistage surge correction is enabled.booleanGet whether Reynolds correction is enabled.private CompressorChartInterfacescaleTemplateWithSpeeds(CompressorCurveTemplate template, double designSpeed, double designFlow, double designHead, double[] targetSpeeds) Scale a template to specific speed values.setChartType(String type) Set the chart type to generate.setImpellerDiameter(double diameter) Set the impeller diameter for Reynolds number calculation.setNumberOfStages(int stages) Set the number of compression stages.setUseMachCorrection(boolean enable) Enable or disable Mach number limitation for stonewall flow.setUseMultistageSurgeCorrection(boolean enable) Enable or disable multistage surge correction.setUseReynoldsCorrection(boolean enable) Enable or disable Reynolds number correction for efficiency.
-
Field Details
-
compressor
-
chartType
-
useReynoldsCorrection
private boolean useReynoldsCorrectionEnable Reynolds number correction for efficiency. -
useMachCorrection
private boolean useMachCorrectionEnable Mach number limitation for stonewall flow. -
useMultistageSurgeCorrection
private boolean useMultistageSurgeCorrectionEnable multistage surge correction. -
numberOfStages
private int numberOfStagesNumber of compression stages (for multistage surge correction). -
impellerDiameter
private double impellerDiameterImpeller diameter in meters (for Reynolds calculation).
-
-
Constructor Details
-
CompressorChartGenerator
Constructor for CompressorChartGenerator.- Parameters:
inpCompressor- The compressor for which the chart is generated.
-
-
Method Details
-
setChartType
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
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
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
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
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
Set the impeller diameter for Reynolds number calculation.- Parameters:
diameter- Impeller diameter in meters- Returns:
- this generator for method chaining
-
enableAdvancedCorrections
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
Create a chart instance of the configured type.- Returns:
- A new chart instance
-
generateCompressorChart
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
CompressorChartInterfaceobject.
-
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
CompressorChartInterfaceobject.
-
generateFromTemplate
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 usenumberOfSpeeds- Number of speed curves to generate- Returns:
- A
CompressorChartInterfaceobject
-
generateFromTemplate
public CompressorChartInterface generateFromTemplate(CompressorCurveTemplate template, int numberOfSpeeds) Generates a compressor chart from a curve template object.- Parameters:
template- The template to usenumberOfSpeeds- Number of speed curves to generate- Returns:
- A
CompressorChartInterfaceobject
-
generateFromTemplate
Generates a compressor chart from a predefined curve template with specific speeds.- Parameters:
templateName- Name of the template to usespeeds- Array of speed values in RPM to generate curves for- Returns:
- A
CompressorChartInterfaceobject
-
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 templatedesignSpeed- the design speed in RPMdesignFlow- the design flow in m3/hrdesignHead- the design head in kJ/kgtargetSpeeds- array of target speeds- Returns:
- the scaled compressor chart
-
getOriginalTemplateChart
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
CompressorChartInterfaceobject with original data
-
getAvailableTemplates
Get list of available template names.- Returns:
- Array of available template names
-
generateCompressorChart
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
CompressorChartInterfaceobject.
-
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
-
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 objectrefFlow- the reference flow raterefSpeed- the reference speedminFlow- the minimum flow ratemaxFlow- the maximum flow rateminSpeed- the minimum speedmaxSpeed- the maximum speedisNormalCurves- whether to generate normal curves- Returns:
- a
SafeSplineSurgeCurveobject representing the surge curve
-