Class CompressorChartJsonReader
java.lang.Object
neqsim.process.equipment.compressor.CompressorChartJsonReader
Reader for compressor chart data from JSON files.
Expected JSON format:
{
"compressorName": "Compressor Name",
"headUnit": "kJ/kg",
"maxDesignPower_kW": 16619.42,
"speedCurves": [
{
"speed_rpm": 2000.0,
"flow_m3h": [9598.75, 10892.21, ...],
"head_kJkg": [33.36, 32.15, ...],
"polytropicEfficiency_pct": [78.30, 78.20, ...]
},
...
]
}
- Version:
- 1.0
- Author:
- esol
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCompressorChartJsonReader(Reader reader) Constructor for CompressorChartJsonReader from Reader.CompressorChartJsonReader(String jsonFilePath) Constructor for CompressorChartJsonReader.CompressorChartJsonReader(String jsonString, boolean isJsonString) Constructor for CompressorChartJsonReader from JSON string. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Get choke flow for each speed curve.double[]Get choke head for each speed curve.Get the compressor name from JSON.double[][]Get the flow lines for each speed curve.double[][]Get the head lines for each speed curve.Get the head unit from JSON.doubleGet the max design power from JSON.double[][]Get the polytropic efficiency lines for each speed curve.double[]Get the speed values.double[]Get surge flow for each speed curve.double[]Get surge head for each speed curve.private intmaxIndex(double[] array) private intminIndex(double[] array) private voidprivate voidparseJsonObject(com.google.gson.JsonObject root) private voidparseJsonString(String jsonString) voidsetCurvesToCompressor(Compressor compressor) Apply the loaded chart data to a compressor.
-
Field Details
-
speeds
private double[] speeds -
flowLines
private double[][] flowLines -
headLines
private double[][] headLines -
polyEffLines
private double[][] polyEffLines -
surgeFlow
private double[] surgeFlow -
surgeHead
private double[] surgeHead -
chokeFlow
private double[] chokeFlow -
chokeHead
private double[] chokeHead -
headUnit
-
compressorName
-
maxDesignPower
private double maxDesignPower
-
-
Constructor Details
-
CompressorChartJsonReader
-
CompressorChartJsonReader
-
CompressorChartJsonReader
Constructor for CompressorChartJsonReader from JSON string.- Parameters:
jsonString- JSON string containing chart dataisJsonString- flag to indicate this is a JSON string (not file path)- Throws:
Exception- if JSON cannot be parsed
-
-
Method Details
-
parseJson
-
parseJsonString
-
parseJsonObject
-
minIndex
private int minIndex(double[] array) -
maxIndex
private int maxIndex(double[] array) -
setCurvesToCompressor
Apply the loaded chart data to a compressor.- Parameters:
compressor- the compressor to configure
-
getCompressorName
-
getMaxDesignPower
public double getMaxDesignPower()Get the max design power from JSON.- Returns:
- max design power in kW
-
getHeadUnit
-
getSpeeds
public double[] getSpeeds()Get the speed values.- Returns:
- array of speeds in RPM
-
getFlowLines
public double[][] getFlowLines()Get the flow lines for each speed curve.- Returns:
- 2D array of flow values in m3/h
-
getHeadLines
public double[][] getHeadLines()Get the head lines for each speed curve.- Returns:
- 2D array of head values
-
getPolyEffLines
public double[][] getPolyEffLines()Get the polytropic efficiency lines for each speed curve.- Returns:
- 2D array of efficiency values in %
-
getSurgeFlow
public double[] getSurgeFlow()Get surge flow for each speed curve.- Returns:
- array of surge flow values
-
getSurgeHead
public double[] getSurgeHead()Get surge head for each speed curve.- Returns:
- array of surge head values
-
getChokeFlow
public double[] getChokeFlow()Get choke flow for each speed curve.- Returns:
- array of choke flow values
-
getChokeHead
public double[] getChokeHead()Get choke head for each speed curve.- Returns:
- array of choke head values
-