Class ReactorAxialProfile
java.lang.Object
neqsim.process.equipment.reactor.ReactorAxialProfile
- All Implemented Interfaces:
Serializable
Container for axial profiles from plug flow reactor simulation.
Stores temperature, pressure, conversion, molar flow, and reaction rate profiles along the reactor length. Provides interpolation and export methods for post-processing and visualization.
Usage example:
PlugFlowReactor pfr = new PlugFlowReactor("PFR", feed);
pfr.run();
ReactorAxialProfile profile = pfr.getAxialProfile();
double[] temps = profile.getTemperatureProfile();
String json = profile.toJson();
- Version:
- 1.0
- Author:
- esol
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]Component names corresponding to molarFlows columns.private double[]Conversion profile of key component [-].private double[][]Molar flow profiles [mol/s] indexed as [step][component].private intNumber of axial steps stored.private double[]Axial positions [m].private double[]Pressure profile [bara].private double[]Total reaction rate at each position [mol/(m3*s)].private static final longSerialization version UID.private double[]Temperature profile [K]. -
Constructor Summary
ConstructorsConstructorDescriptionReactorAxialProfile(int numberOfSteps, int numberOfComponents, String[] componentNames) Constructor for ReactorAxialProfile. -
Method Summary
Modifier and TypeMethodDescriptionprivate StringarrayToJson(double[] arr) Convert a double array to JSON array string.String[]Get the component names.doublegetConversionAt(double z) Get interpolated conversion at a given axial position.double[]Get the conversion profile.double[][]Get the molar flow profiles.intGet the number of axial steps.double[]Get the position array.doublegetPressureAt(double z) Get interpolated pressure at a given axial position.double[]Get the pressure profile.double[]Get the reaction rate profile.doublegetTemperatureAt(double z) Get interpolated temperature at a given axial position.double[]Get the temperature profile.private doubleinterpolate(double[] xArr, double[] yArr, double x) Linear interpolation helper.voidsetData(int step, double z, double temp, double press, double conv, double rate, double[] flows) Set data at a specific axial step.toCSV()Export profile data as CSV string.toJson()Export profile data as JSON string.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
position
private double[] positionAxial positions [m]. -
temperature
private double[] temperatureTemperature profile [K]. -
pressure
private double[] pressurePressure profile [bara]. -
conversion
private double[] conversionConversion profile of key component [-]. -
molarFlows
private double[][] molarFlowsMolar flow profiles [mol/s] indexed as [step][component]. -
reactionRate
private double[] reactionRateTotal reaction rate at each position [mol/(m3*s)]. -
componentNames
Component names corresponding to molarFlows columns. -
numberOfSteps
private int numberOfStepsNumber of axial steps stored.
-
-
Constructor Details
-
ReactorAxialProfile
Constructor for ReactorAxialProfile.- Parameters:
numberOfSteps- number of axial discretization pointsnumberOfComponents- number of chemical componentscomponentNames- names of components
-
-
Method Details
-
setData
public void setData(int step, double z, double temp, double press, double conv, double rate, double[] flows) Set data at a specific axial step.- Parameters:
step- step index (0-based)z- axial position [m]temp- temperature [K]press- pressure [bara]conv- conversion of key component [-]rate- total reaction rate [mol/(m3*s)]flows- molar flows for each component [mol/s]
-
getTemperatureAt
public double getTemperatureAt(double z) Get interpolated temperature at a given axial position.- Parameters:
z- axial position [m]- Returns:
- interpolated temperature [K]
-
getConversionAt
public double getConversionAt(double z) Get interpolated conversion at a given axial position.- Parameters:
z- axial position [m]- Returns:
- interpolated conversion [-]
-
getPressureAt
public double getPressureAt(double z) Get interpolated pressure at a given axial position.- Parameters:
z- axial position [m]- Returns:
- interpolated pressure [bara]
-
interpolate
private double interpolate(double[] xArr, double[] yArr, double x) Linear interpolation helper.- Parameters:
xArr- independent variable arrayyArr- dependent variable arrayx- target interpolation point- Returns:
- interpolated y value
-
toJson
Export profile data as JSON string.- Returns:
- JSON representation of the axial profile
-
toCSV
Export profile data as CSV string.- Returns:
- CSV representation with header row
-
arrayToJson
Convert a double array to JSON array string.- Parameters:
arr- the array to convert- Returns:
- JSON array string
-
getPositionProfile
public double[] getPositionProfile()Get the position array.- Returns:
- axial position array [m]
-
getTemperatureProfile
public double[] getTemperatureProfile()Get the temperature profile.- Returns:
- temperature array [K]
-
getPressureProfile
public double[] getPressureProfile()Get the pressure profile.- Returns:
- pressure array [bara]
-
getConversionProfile
public double[] getConversionProfile()Get the conversion profile.- Returns:
- conversion array [-]
-
getReactionRateProfile
public double[] getReactionRateProfile()Get the reaction rate profile.- Returns:
- reaction rate array [mol/(m3*s)]
-
getMolarFlowProfiles
public double[][] getMolarFlowProfiles()Get the molar flow profiles.- Returns:
- 2D array [step][component] of molar flows [mol/s]
-
getComponentNames
-
getNumberOfSteps
public int getNumberOfSteps()Get the number of axial steps.- Returns:
- number of steps
-