Class Compressor.Builder
java.lang.Object
neqsim.process.equipment.compressor.Compressor.Builder
- Enclosing class:
Compressor
Builder class for constructing Compressor instances with a fluent API.
Provides a readable and maintainable way to construct complex compressor configurations. All configuration options available through setters on Compressor are accessible via builder methods.
- Version:
- 1.0
- Author:
- NeqSim
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate StreamInterfaceprivate booleanprivate doubleprivate doubleprivate doubleprivate doubleprivate final Stringprivate intprivate doubleprivate doubleprivate doubleprivate Stringprivate Stringprivate doubleprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns the configured Compressor instance.compressionRatio(double ratio) Sets the compression ratio (outlet/inlet pressure).inletStream(StreamInterface stream) Sets the inlet stream for the compressor.Enables interpolated map lookup for compressor chart.isentropicEfficiency(double efficiency) Sets the isentropic efficiency.maxOutletPressure(double pressure) Sets the maximum outlet pressure limit.maxSpeed(double maxSpeed) Sets the maximum allowed speed in RPM.minSpeed(double minSpeed) Sets the minimum allowed speed in RPM.numberOfCompressorCalcSteps(int steps) Sets the number of calculation steps for polytropic calculations.outletPressure(double pressure) Sets the outlet pressure in bara.outletPressure(double pressure, String unit) Sets the outlet pressure with unit specification.outletTemperature(double temperature) Sets the target outlet temperature (used for back-calculating efficiency).outletTemperature(double temperature, String unit) Sets the outlet temperature with unit specification.polytropicEfficiency(double efficiency) Sets the polytropic efficiency.polytropicMethod(String method) Sets the polytropic calculation method.speed(double speed) Sets the compressor speed in RPM.Enables use of a compressor performance chart.Enables GERG-2008 equation of state for calculations.Enables Leachman equation of state for hydrogen calculations.Enables the rigorous polytropic calculation method with many steps.useVega()Enables VEGA equation of state for helium calculations.
-
Field Details
-
name
-
inletStream
-
outletPressure
private double outletPressure -
pressureUnit
-
compressionRatio
private double compressionRatio -
isentropicEfficiency
private double isentropicEfficiency -
polytropicEfficiency
private double polytropicEfficiency -
usePolytropicCalc
private boolean usePolytropicCalc -
speed
private double speed -
maxSpeed
private double maxSpeed -
minSpeed
private double minSpeed -
outTemperature
private double outTemperature -
useOutTemperature
private boolean useOutTemperature -
maxOutletPressure
private double maxOutletPressure -
useCompressorChart
private boolean useCompressorChart -
polytropicMethod
-
useRigorousPolytropicMethod
private boolean useRigorousPolytropicMethod -
useGERG2008
private boolean useGERG2008 -
useLeachman
private boolean useLeachman -
useVega
private boolean useVega -
numberOfCompressorCalcSteps
private int numberOfCompressorCalcSteps -
interpolateMapLookup
private boolean interpolateMapLookup
-
-
Constructor Details
-
Builder
Creates a new Builder with the specified compressor name.- Parameters:
name- the name of the compressor
-
-
Method Details
-
inletStream
Sets the inlet stream for the compressor.- Parameters:
stream- the inlet stream- Returns:
- this builder for chaining
-
outletPressure
Sets the outlet pressure in bara.- Parameters:
pressure- outlet pressure value in bara- Returns:
- this builder for chaining
-
outletPressure
Sets the outlet pressure with unit specification.- Parameters:
pressure- outlet pressure valueunit- pressure unit (e.g., "bara", "barg", "psia")- Returns:
- this builder for chaining
-
compressionRatio
Sets the compression ratio (outlet/inlet pressure).- Parameters:
ratio- compression ratio (must be>1.0)- Returns:
- this builder for chaining
-
isentropicEfficiency
Sets the isentropic efficiency.- Parameters:
efficiency- efficiency value (0.0-1.0)- Returns:
- this builder for chaining
-
polytropicEfficiency
Sets the polytropic efficiency.- Parameters:
efficiency- efficiency value (0.0-1.0)- Returns:
- this builder for chaining
-
speed
Sets the compressor speed in RPM.- Parameters:
speed- speed in RPM- Returns:
- this builder for chaining
-
maxSpeed
Sets the maximum allowed speed in RPM.- Parameters:
maxSpeed- maximum speed in RPM- Returns:
- this builder for chaining
-
minSpeed
Sets the minimum allowed speed in RPM.- Parameters:
minSpeed- minimum speed in RPM- Returns:
- this builder for chaining
-
outletTemperature
Sets the target outlet temperature (used for back-calculating efficiency).- Parameters:
temperature- outlet temperature in Kelvin- Returns:
- this builder for chaining
-
outletTemperature
Sets the outlet temperature with unit specification.- Parameters:
temperature- outlet temperature valueunit- temperature unit ("K", "C", "F")- Returns:
- this builder for chaining
-
maxOutletPressure
Sets the maximum outlet pressure limit.- Parameters:
pressure- maximum outlet pressure in bara- Returns:
- this builder for chaining
-
useCompressorChart
Enables use of a compressor performance chart.- Returns:
- this builder for chaining
-
interpolateMapLookup
Enables interpolated map lookup for compressor chart.- Returns:
- this builder for chaining
-
polytropicMethod
Sets the polytropic calculation method.- Parameters:
method- method name ("schultz", "mallen", or "huntington")- Returns:
- this builder for chaining
-
useRigorousPolytropicMethod
Enables the rigorous polytropic calculation method with many steps.- Returns:
- this builder for chaining
-
numberOfCompressorCalcSteps
Sets the number of calculation steps for polytropic calculations.- Parameters:
steps- number of steps (default is 40)- Returns:
- this builder for chaining
-
useGERG2008
Enables GERG-2008 equation of state for calculations.- Returns:
- this builder for chaining
-
useLeachman
Enables Leachman equation of state for hydrogen calculations.- Returns:
- this builder for chaining
-
useVega
Enables VEGA equation of state for helium calculations.- Returns:
- this builder for chaining
-
build
Builds and returns the configured Compressor instance.- Returns:
- a new Compressor instance with the specified configuration
- Throws:
IllegalStateException- if required parameters are missing
-