Class ReactorAxialProfile

java.lang.Object
neqsim.process.equipment.reactor.ReactorAxialProfile
All Implemented Interfaces:
Serializable

public class ReactorAxialProfile extends Object implements 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 Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • position

      private double[] position
      Axial positions [m].
    • temperature

      private double[] temperature
      Temperature profile [K].
    • pressure

      private double[] pressure
      Pressure profile [bara].
    • conversion

      private double[] conversion
      Conversion profile of key component [-].
    • molarFlows

      private double[][] molarFlows
      Molar flow profiles [mol/s] indexed as [step][component].
    • reactionRate

      private double[] reactionRate
      Total reaction rate at each position [mol/(m3*s)].
    • componentNames

      private String[] componentNames
      Component names corresponding to molarFlows columns.
    • numberOfSteps

      private int numberOfSteps
      Number of axial steps stored.
  • Constructor Details

    • ReactorAxialProfile

      public ReactorAxialProfile(int numberOfSteps, int numberOfComponents, String[] componentNames)
      Constructor for ReactorAxialProfile.
      Parameters:
      numberOfSteps - number of axial discretization points
      numberOfComponents - number of chemical components
      componentNames - 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 array
      yArr - dependent variable array
      x - target interpolation point
      Returns:
      interpolated y value
    • toJson

      public String toJson()
      Export profile data as JSON string.
      Returns:
      JSON representation of the axial profile
    • toCSV

      public String toCSV()
      Export profile data as CSV string.
      Returns:
      CSV representation with header row
    • arrayToJson

      private String arrayToJson(double[] arr)
      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

      public String[] getComponentNames()
      Get the component names.
      Returns:
      array of component names
    • getNumberOfSteps

      public int getNumberOfSteps()
      Get the number of axial steps.
      Returns:
      number of steps