-
Notifications
You must be signed in to change notification settings - Fork 32
Compressor curves
The setCurves
method initializes the compressor performance curves, including speed, flow, head, and polytropic efficiency. It takes various inputs to initialize internal variables for different performance parameters, normalize them, and calculate reduced values.
The method also fits polynomial functions to represent relationships between the reduced parameters, which are later used for compressor performance analysis.
-
chartConditions (
double[]
): An array of conditions used for the compressor chart. (Currently unused) -
speed (
double[]
): An array representing the compressor speed values. -
flow (
double[][]
): A 2D array representing the flow rates at different speeds. -
head (
double[][]
): A 2D array representing the head values at different speeds. -
polyEff (
double[][]
): A 2D array representing the polytropic efficiency values at different speeds.
-
Initialize Variables: The method starts by assigning the input values to the class-level variables for speed, flow, head, and polytropic efficiency.
-
Determine Maximum Length: It then determines the maximum length among the
flow
,head
, andpolytropic efficiency
arrays to dynamically initialize arrays (redhead
,redpolytropicEfficiency
,redflow
) for storing reduced values. -
Iterate Through Speed Values:
- For each speed, it creates a
CompressorCurve
object representing the compressor's performance at that speed, and adds it to thechartValues
list. - It computes the reduced values (
redflow
,redhead
,redpolytropicEfficiency
) by normalizing the original values with respect to speed. These reduced values are used to add data points to curve fitters (reducedHeadFitter
,reducedPolytropicEfficiencyFitter
,fanLawCorrectionFitter
). - A fan law correction is also computed, but a TODO note indicates that the current implementation may require adjustment.
The reduced values are computed using the following equations:
-
Reduced Flow:
Q_red = Q / N
Where:
- Q is the flow rate at a given speed.
- N is the speed.
-
Reduced Head:
H_red = H / N^2
Where:
- H is the head at a given speed.
- N is the speed.
-
Fan Law Correction:
Q_fanlaw = Q * (N / N_0)
Where:
- Q_fanlaw is the flow rate corrected by the fan law.
- N_0 is the reference speed.
- For each speed, it creates a
-
Fill Remaining Slots: If any of the original arrays (
flow
,head
,polyEff
) have fewer elements than the maximum length, the remaining slots are filled with default values (e.g.,0
). -
Calculate Reference Speed: The reference speed is calculated as the average of the maximum and minimum speed values.
N_ref = (N_max + N_min) / 2
-
Fit Polynomial Functions: Polynomial functions are fitted to the reduced head, polytropic efficiency, and fan law correction data using a second-degree polynomial curve fitter (
PolynomialCurveFitter
). -
Enable Compressor Chart: Finally, the use of the compressor chart is enabled by calling
setUseCompressorChart(true)
.
The setCurves
method is typically used to set up compressor performance charts, which are critical for analyzing the performance of compressors under different operating conditions. This is useful in both simulation and optimization tasks.
- Getting started with NeqSim and GitHub
- Getting started as a NeqSim developer
- The NeqSim parameter database
- Example of setting up a fluid and running simple flash calculations
- Select thermodynamic model and mixing rule
- Flash calculations and phase envelope calculations using NeqSim
- Calculation of thermodynamic and physical properties using NeqSim
- Oil Characterization in NeqSim
- Aqueous fluids and NeqSim
- Electrolytes and NeqSim
- Process Calculations in NeqSim