Class DistillationColumn.Builder

java.lang.Object
neqsim.process.equipment.distillation.DistillationColumn.Builder
Enclosing class:
DistillationColumn

public static class DistillationColumn.Builder extends Object
Builder class for creating DistillationColumn instances with a fluent API.

Provides a readable and maintainable way to construct complex distillation columns. All configuration options available through setters on DistillationColumn are accessible via builder methods.

Version:
1.0
Author:
NeqSim
  • Field Details

    • name

      private final String name
    • numberOfTrays

      private int numberOfTrays
    • hasCondenser

      private boolean hasCondenser
    • hasReboiler

      private boolean hasReboiler
    • topPressure

      private double topPressure
    • bottomPressure

      private double bottomPressure
    • temperatureTolerance

      private double temperatureTolerance
    • massBalanceTolerance

      private double massBalanceTolerance
    • enthalpyBalanceTolerance

      private double enthalpyBalanceTolerance
    • maxIterations

      private int maxIterations
    • solverType

      private DistillationColumn.SolverType solverType
    • relaxationFactor

      private double relaxationFactor
    • internalDiameter

      private double internalDiameter
    • doMultiPhaseCheck

      private boolean doMultiPhaseCheck
    • feedStreams

  • Constructor Details

    • Builder

      public Builder(String name)
      Creates a new Builder with the specified column name.
      Parameters:
      name - the name of the distillation column
  • Method Details

    • numberOfTrays

      public DistillationColumn.Builder numberOfTrays(int numberOfTrays)
      Sets the number of trays (excluding condenser and reboiler).
      Parameters:
      numberOfTrays - number of simple trays
      Returns:
      this builder for chaining
    • withCondenser

      public DistillationColumn.Builder withCondenser()
      Configures the column with a condenser at the top.
      Returns:
      this builder for chaining
    • withReboiler

      public DistillationColumn.Builder withReboiler()
      Configures the column with a reboiler at the bottom.
      Returns:
      this builder for chaining
    • withCondenserAndReboiler

      public DistillationColumn.Builder withCondenserAndReboiler()
      Configures the column with both condenser and reboiler.
      Returns:
      this builder for chaining
    • topPressure

      public DistillationColumn.Builder topPressure(double pressure, String unit)
      Sets the top tray pressure.
      Parameters:
      pressure - pressure value
      unit - pressure unit (e.g., "bara", "barg", "psia")
      Returns:
      this builder for chaining
    • bottomPressure

      public DistillationColumn.Builder bottomPressure(double pressure, String unit)
      Sets the bottom tray pressure.
      Parameters:
      pressure - pressure value
      unit - pressure unit (e.g., "bara", "barg", "psia")
      Returns:
      this builder for chaining
    • pressure

      public DistillationColumn.Builder pressure(double pressure, String unit)
      Sets both top and bottom pressure to the same value (isobaric column).
      Parameters:
      pressure - pressure value
      unit - pressure unit
      Returns:
      this builder for chaining
    • temperatureTolerance

      public DistillationColumn.Builder temperatureTolerance(double tolerance)
      Sets the temperature convergence tolerance.
      Parameters:
      tolerance - temperature tolerance in Kelvin
      Returns:
      this builder for chaining
    • massBalanceTolerance

      public DistillationColumn.Builder massBalanceTolerance(double tolerance)
      Sets the mass balance convergence tolerance.
      Parameters:
      tolerance - relative mass balance tolerance
      Returns:
      this builder for chaining
    • enthalpyBalanceTolerance

      public DistillationColumn.Builder enthalpyBalanceTolerance(double tolerance)
      Sets the enthalpy balance convergence tolerance.
      Parameters:
      tolerance - relative enthalpy balance tolerance
      Returns:
      this builder for chaining
    • tolerance

      public DistillationColumn.Builder tolerance(double tolerance)
      Sets all tolerances to the same value.
      Parameters:
      tolerance - tolerance value for all convergence checks
      Returns:
      this builder for chaining
    • maxIterations

      public DistillationColumn.Builder maxIterations(int maxIterations)
      Sets the maximum number of solver iterations.
      Parameters:
      maxIterations - maximum iterations
      Returns:
      this builder for chaining
    • solverType

      Sets the solver type.
      Parameters:
      solverType - the solver algorithm to use
      Returns:
      this builder for chaining
    • directSubstitution

      public DistillationColumn.Builder directSubstitution()
      Configures the solver to use direct substitution (default).
      Returns:
      this builder for chaining
    • dampedSubstitution

      public DistillationColumn.Builder dampedSubstitution()
      Configures the solver to use damped substitution.
      Returns:
      this builder for chaining
    • insideOut

      public DistillationColumn.Builder insideOut()
      Configures the solver to use inside-out method.
      Returns:
      this builder for chaining
    • relaxationFactor

      public DistillationColumn.Builder relaxationFactor(double factor)
      Sets the relaxation factor for damped solvers.
      Parameters:
      factor - relaxation factor (0 < factor <= 1)
      Returns:
      this builder for chaining
    • internalDiameter

      public DistillationColumn.Builder internalDiameter(double diameter)
      Sets the internal diameter of the column.
      Parameters:
      diameter - diameter in meters
      Returns:
      this builder for chaining
    • multiPhaseCheck

      public DistillationColumn.Builder multiPhaseCheck(boolean enable)
      Enables or disables multi-phase checking.
      Parameters:
      enable - true to enable multi-phase check
      Returns:
      this builder for chaining
    • addFeedStream

      public DistillationColumn.Builder addFeedStream(StreamInterface stream, int trayNumber)
      Adds a feed stream to the specified tray.
      Parameters:
      stream - the feed stream
      trayNumber - the tray number (0-based) for the feed
      Returns:
      this builder for chaining
    • build

      public DistillationColumn build()
      Builds and returns the configured DistillationColumn.
      Returns:
      the constructed DistillationColumn