Class CompressorDriver
- All Implemented Interfaces:
Serializable
The driver model includes power limits, efficiency curves, and dynamic response characteristics that affect compressor operation during transient simulations.
- Version:
- 1.0
- Author:
- esol
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate doubleprivate doubleprivate doubleprivate DriverTypeprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate double[]private double[]private double[]private doubleprivate doubleprivate doubleprivate booleanprivate doubleprivate doubleprivate doubleprivate doubleprivate static final longprivate doubleprivate booleanprivate booleanprivate double[] -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.CompressorDriver(DriverType type) Constructor with driver type.CompressorDriver(DriverType type, double ratedPower) Constructor with driver type and rated power. -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateSpeedChange(double currentSpeed, double targetSpeed, double currentPower, double timeStep) Calculate speed change over a time step.booleancanDeliverPower(double requiredPower) Check if the driver can deliver the required power.booleancanDeliverPowerAtSpeed(double requiredPower, double speed) Check if the driver can deliver the required power at a specific speed.booleancheckOverloadTrip(double currentPower, double timeStep) Update overload tracking and check for trip.voidDisable the speed-dependent max power curve.voidDisable the tabular max power curve.voidEnable the speed-dependent max power curve.doubleGet the ambient pressure.doubleGet the ambient temperature.doubleGet the available power at current conditions.doubleGet the driver efficiency.Get the driver type.doublegetEfficiencyAtSpeed(double speed) Calculate driver efficiency at given speed.doubleGet the combined inertia.doubleGet the maximum acceleration.doublegetMaxAccelerationAtConditions(double currentSpeed, double currentPower) Calculate the maximum acceleration at current speed considering torque limits.doubleGet the maximum available power at current conditions.doublegetMaxAvailablePowerAtSpeed(double speed) Get the maximum available power at a specific speed.doubleGet the maximum deceleration.doubleGet the maximum power.double[]Get the max power curve coefficients.doubleGet the maximum speed.doubleGet the minimum power.doubleGet the minimum speed.doubleGet the overload trip delay.doublegetPowerMargin(double currentPower) Get the power margin (remaining power capacity).doublegetPowerMarginAtSpeed(double currentPower, double speed) Get the power margin (remaining power capacity) at a specific speed.doublegetPowerMarginRatio(double currentPower) Get the power margin as a ratio.doubleGet the rated power.doubleGet the rated speed.doublegetRequiredDriverPower(double shaftPower, double speed) Calculate required driver power for given compressor shaft power.doubleGet the response time.private doubleinterpolateMaxPower(double speed) Interpolates max power from the tabular curve data.booleanCheck if speed-dependent max power curve is enabled.booleanCheck if tabular max power curve is enabled.booleanCheck if overload protection is enabled.voidReset the overload timer.voidsetAmbientPressure(double ambientPressure) Set the ambient pressure.voidsetAmbientTemperature(double ambientTemperature) Set the ambient temperature.voidsetDriverEfficiency(double driverEfficiency) Set the driver efficiency.voidsetDriverType(DriverType driverType) Set the driver type.voidsetInertia(double inertia) Set the combined inertia.voidsetMaxAcceleration(double maxAcceleration) Set the maximum acceleration.voidsetMaxDeceleration(double maxDeceleration) Set the maximum deceleration.voidsetMaxPower(double maxPower) Set the maximum power.voidsetMaxPowerCurveCoefficients(double a, double b, double c) Set max power curve coefficients for speed-dependent max power.voidsetMaxPowerSpeedCurve(double[] speeds, double[] powers, String powerUnit) Set the max power vs speed curve using tabular data with linear interpolation.voidsetMaxSpeed(double maxSpeed) Set the maximum speed.voidsetMinPower(double minPower) Set the minimum power.voidsetMinSpeed(double minSpeed) Set the minimum speed.voidsetOverloadProtectionEnabled(boolean enabled) Set overload protection enabled.voidsetOverloadTripDelay(double delay) Set the overload trip delay.voidsetRatedPower(double ratedPower) Set the rated power.voidsetRatedSpeed(double ratedSpeed) Set the rated speed.voidsetResponseTime(double responseTime) Set the response time.voidsetTemperatureDerateFactor(double factor) Set gas turbine temperature derate factor.voidsetVfdEfficiencyCoefficients(double a, double b, double c) Set VFD efficiency curve coefficients.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
driverType
-
ratedPower
private double ratedPower -
maxPower
private double maxPower -
minPower
private double minPower -
driverEfficiency
private double driverEfficiency -
responseTime
private double responseTime -
inertia
private double inertia -
maxAcceleration
private double maxAcceleration -
maxDeceleration
private double maxDeceleration -
ambientTemperature
private double ambientTemperature -
ambientPressure
private double ambientPressure -
overloadProtectionEnabled
private boolean overloadProtectionEnabled -
overloadTripDelay
private double overloadTripDelay -
currentOverloadTime
private double currentOverloadTime -
minSpeed
private double minSpeed -
maxSpeed
private double maxSpeed -
ratedSpeed
private double ratedSpeed -
vfdEfficiencyCoeffs
private double[] vfdEfficiencyCoeffs -
isoTemperature
private double isoTemperature -
temperatureDerateFactor
private double temperatureDerateFactor -
maxPowerCurveCoeffs
private double[] maxPowerCurveCoeffs -
useMaxPowerCurve
private boolean useMaxPowerCurve -
maxPowerCurveSpeeds
private double[] maxPowerCurveSpeeds -
maxPowerCurvePowers
private double[] maxPowerCurvePowers -
useMaxPowerCurveTable
private boolean useMaxPowerCurveTable
-
-
Constructor Details
-
CompressorDriver
public CompressorDriver()Default constructor. -
CompressorDriver
Constructor with driver type.- Parameters:
type- the driver type
-
CompressorDriver
Constructor with driver type and rated power.- Parameters:
type- the driver typeratedPower- rated power in kW
-
-
Method Details
-
getAvailablePower
public double getAvailablePower()Get the available power at current conditions.For gas turbines, this accounts for ambient temperature derating. For electric motors, this returns rated power.
- Returns:
- available power in kW
-
getMaxAvailablePower
public double getMaxAvailablePower()Get the maximum available power at current conditions.This method returns a constant max power. Use
getMaxAvailablePowerAtSpeed(double)if a speed-dependent max power curve has been configured.- Returns:
- maximum power in kW
-
getMaxAvailablePowerAtSpeed
public double getMaxAvailablePowerAtSpeed(double speed) Get the maximum available power at a specific speed.If a tabular max power curve has been set using
setMaxPowerSpeedCurve(double[], double[], String), the power will be linearly interpolated from the curve data.Alternatively, if polynomial coefficients have been configured using
setMaxPowerCurveCoefficients(double, double, double), the max power will vary with speed according to: P_max(N) = maxPower * (a + b*(N/N_rated) + c*(N/N_rated)²)For gas turbines, ambient temperature derating is also applied.
- Parameters:
speed- current speed in RPM- Returns:
- maximum power in kW at the given speed
-
interpolateMaxPower
private double interpolateMaxPower(double speed) Interpolates max power from the tabular curve data.- Parameters:
speed- current speed in RPM- Returns:
- interpolated max power in kW
-
canDeliverPowerAtSpeed
public boolean canDeliverPowerAtSpeed(double requiredPower, double speed) Check if the driver can deliver the required power at a specific speed.- Parameters:
requiredPower- required power in kWspeed- current speed in RPM- Returns:
- true if power can be delivered at this speed
-
getPowerMarginAtSpeed
public double getPowerMarginAtSpeed(double currentPower, double speed) Get the power margin (remaining power capacity) at a specific speed.- Parameters:
currentPower- current power demand in kWspeed- current speed in RPM- Returns:
- power margin in kW
-
getEfficiencyAtSpeed
public double getEfficiencyAtSpeed(double speed) Calculate driver efficiency at given speed.- Parameters:
speed- current speed in RPM- Returns:
- efficiency as ratio (0-1)
-
getRequiredDriverPower
public double getRequiredDriverPower(double shaftPower, double speed) Calculate required driver power for given compressor shaft power.- Parameters:
shaftPower- compressor shaft power in kWspeed- current speed in RPM- Returns:
- required driver power in kW
-
canDeliverPower
public boolean canDeliverPower(double requiredPower) Check if the driver can deliver the required power.- Parameters:
requiredPower- required power in kW- Returns:
- true if power can be delivered
-
getPowerMargin
public double getPowerMargin(double currentPower) Get the power margin (remaining power capacity).- Parameters:
currentPower- current power demand in kW- Returns:
- power margin in kW
-
getPowerMarginRatio
public double getPowerMarginRatio(double currentPower) Get the power margin as a ratio.- Parameters:
currentPower- current power demand in kW- Returns:
- power margin ratio (available/max)
-
getMaxAccelerationAtConditions
public double getMaxAccelerationAtConditions(double currentSpeed, double currentPower) Calculate the maximum acceleration at current speed considering torque limits.- Parameters:
currentSpeed- current speed in RPMcurrentPower- current power in kW- Returns:
- maximum acceleration in RPM/s
-
calculateSpeedChange
public double calculateSpeedChange(double currentSpeed, double targetSpeed, double currentPower, double timeStep) Calculate speed change over a time step.- Parameters:
currentSpeed- current speed in RPMtargetSpeed- target speed in RPMcurrentPower- current power demand in kWtimeStep- time step in seconds- Returns:
- new speed in RPM
-
checkOverloadTrip
public boolean checkOverloadTrip(double currentPower, double timeStep) Update overload tracking and check for trip.- Parameters:
currentPower- current power in kWtimeStep- time step in seconds- Returns:
- true if driver should trip due to overload
-
resetOverloadTimer
public void resetOverloadTimer()Reset the overload timer. -
getDriverType
-
setDriverType
Set the driver type.- Parameters:
driverType- the driver type
-
getRatedPower
public double getRatedPower()Get the rated power.- Returns:
- rated power in kW
-
setRatedPower
public void setRatedPower(double ratedPower) Set the rated power.- Parameters:
ratedPower- rated power in kW
-
getMaxPower
public double getMaxPower()Get the maximum power.- Returns:
- maximum power in kW
-
setMaxPower
public void setMaxPower(double maxPower) Set the maximum power.- Parameters:
maxPower- maximum power in kW
-
getMinPower
public double getMinPower()Get the minimum power.- Returns:
- minimum power in kW
-
setMinPower
public void setMinPower(double minPower) Set the minimum power.- Parameters:
minPower- minimum power in kW
-
getDriverEfficiency
public double getDriverEfficiency()Get the driver efficiency.- Returns:
- efficiency as ratio (0-1)
-
setDriverEfficiency
public void setDriverEfficiency(double driverEfficiency) Set the driver efficiency.- Parameters:
driverEfficiency- efficiency as ratio (0-1)
-
getResponseTime
public double getResponseTime()Get the response time.- Returns:
- response time in seconds
-
setResponseTime
public void setResponseTime(double responseTime) Set the response time.- Parameters:
responseTime- response time in seconds
-
getInertia
public double getInertia()Get the combined inertia.- Returns:
- inertia in kg⋅m²
-
setInertia
public void setInertia(double inertia) Set the combined inertia.- Parameters:
inertia- inertia in kg⋅m²
-
getMaxAcceleration
public double getMaxAcceleration()Get the maximum acceleration.- Returns:
- max acceleration in RPM/s
-
setMaxAcceleration
public void setMaxAcceleration(double maxAcceleration) Set the maximum acceleration.- Parameters:
maxAcceleration- max acceleration in RPM/s
-
getMaxDeceleration
public double getMaxDeceleration()Get the maximum deceleration.- Returns:
- max deceleration in RPM/s
-
setMaxDeceleration
public void setMaxDeceleration(double maxDeceleration) Set the maximum deceleration.- Parameters:
maxDeceleration- max deceleration in RPM/s
-
getAmbientTemperature
public double getAmbientTemperature()Get the ambient temperature.- Returns:
- temperature in K
-
setAmbientTemperature
public void setAmbientTemperature(double ambientTemperature) Set the ambient temperature.- Parameters:
ambientTemperature- temperature in K
-
getAmbientPressure
public double getAmbientPressure()Get the ambient pressure.- Returns:
- pressure in bara
-
setAmbientPressure
public void setAmbientPressure(double ambientPressure) Set the ambient pressure.- Parameters:
ambientPressure- pressure in bara
-
isOverloadProtectionEnabled
public boolean isOverloadProtectionEnabled()Check if overload protection is enabled.- Returns:
- true if enabled
-
setOverloadProtectionEnabled
public void setOverloadProtectionEnabled(boolean enabled) Set overload protection enabled.- Parameters:
enabled- true to enable
-
getOverloadTripDelay
public double getOverloadTripDelay()Get the overload trip delay.- Returns:
- delay in seconds
-
setOverloadTripDelay
public void setOverloadTripDelay(double delay) Set the overload trip delay.- Parameters:
delay- delay in seconds
-
getMinSpeed
public double getMinSpeed()Get the minimum speed.- Returns:
- minimum speed in RPM
-
setMinSpeed
public void setMinSpeed(double minSpeed) Set the minimum speed.- Parameters:
minSpeed- minimum speed in RPM
-
getMaxSpeed
public double getMaxSpeed()Get the maximum speed.- Returns:
- maximum speed in RPM
-
setMaxSpeed
public void setMaxSpeed(double maxSpeed) Set the maximum speed.- Parameters:
maxSpeed- maximum speed in RPM
-
getRatedSpeed
public double getRatedSpeed()Get the rated speed.- Returns:
- rated speed in RPM
-
setRatedSpeed
public void setRatedSpeed(double ratedSpeed) Set the rated speed.- Parameters:
ratedSpeed- rated speed in RPM
-
setVfdEfficiencyCoefficients
public void setVfdEfficiencyCoefficients(double a, double b, double c) Set VFD efficiency curve coefficients.- Parameters:
a- constant termb- linear term coefficientc- quadratic term coefficient
-
setTemperatureDerateFactor
public void setTemperatureDerateFactor(double factor) Set gas turbine temperature derate factor.- Parameters:
factor- power reduction per K above ISO (typically 0.003-0.007)
-
setMaxPowerCurveCoefficients
public void setMaxPowerCurveCoefficients(double a, double b, double c) Set max power curve coefficients for speed-dependent max power.The max power at a given speed is calculated as: P_max(N) = maxPower * (a + b*(N/N_rated) + c*(N/N_rated)²)
Example coefficients:
- Constant power: a=1.0, b=0.0, c=0.0 (default)
- Linear increase: a=0.5, b=0.5, c=0.0 (50% at 0 speed, 100% at rated)
- Typical VFD motor: a=0.0, b=1.0, c=0.0 (power proportional to speed)
- With torque limit: a=0.0, b=0.8, c=0.2 (slight curve)
- Parameters:
a- constant term (dimensionless)b- linear term coefficient (dimensionless)c- quadratic term coefficient (dimensionless)
-
getMaxPowerCurveCoefficients
public double[] getMaxPowerCurveCoefficients()Get the max power curve coefficients.- Returns:
- array of coefficients [a, b, c] or null if not set
-
isMaxPowerCurveEnabled
public boolean isMaxPowerCurveEnabled()Check if speed-dependent max power curve is enabled.- Returns:
- true if max power varies with speed
-
disableMaxPowerCurve
public void disableMaxPowerCurve()Disable the speed-dependent max power curve.After calling this method,
getMaxAvailablePowerAtSpeed(double)will return constant max power regardless of speed. -
enableMaxPowerCurve
public void enableMaxPowerCurve()Enable the speed-dependent max power curve.This method enables the curve if coefficients have been set. Use
setMaxPowerCurveCoefficients(double, double, double)first. -
setMaxPowerSpeedCurve
Set the max power vs speed curve using tabular data with linear interpolation.This method allows specifying discrete data points for the max power curve. The power at any speed is determined by linear interpolation between the provided points. For speeds outside the data range, the boundary values are used.
Example usage for a typical VFD electric motor:
double[] speeds = {4922, 5500, 6000, 6500, 7000, 7383}; // RPM double[] powers = {21.8, 27.5, 32.0, 37.0, 42.0, 44.4}; // MW driver.setMaxPowerSpeedCurve(speeds, powers, "MW");- Parameters:
speeds- array of speed values in RPM (must be in ascending order)powers- array of max power values (same length as speeds)powerUnit- unit of power values: "kW", "MW", or "W"- Throws:
IllegalArgumentException- if arrays have different lengths or speeds not in order
-
isMaxPowerCurveTableEnabled
public boolean isMaxPowerCurveTableEnabled()Check if tabular max power curve is enabled.- Returns:
- true if using tabular interpolation for max power
-
disableMaxPowerCurveTable
public void disableMaxPowerCurveTable()Disable the tabular max power curve. -
toString
-