Class StirredTankReactor

All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, ProcessElementInterface, SimulationInterface, NamedInterface
Direct Known Subclasses:
EnzymeTreatment, Fermenter

public class StirredTankReactor extends TwoPortEquipment
Stirred tank reactor (CSTR) for bio-processing and chemical operations.

Models a continuous stirred-tank reactor (CSTR) or batch reactor with one or more stoichiometric reactions. The reactor applies each reaction in sequence to the feed, then performs a flash calculation at the specified outlet conditions.

Usage example:

StirredTankReactor cstr = new StirredTankReactor("Reactor", feedStream);
cstr.setReactorTemperature(273.15 + 37.0); // 37 C
cstr.setResidenceTime(24.0, "hr");
cstr.setVesselVolume(50.0); // m3
cstr.addReaction(ethanolFermentation);
cstr.run();
Version:
1.0
Author:
NeqSim team
See Also:
  • Field Details

    • serialVersionUID

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

      private static final org.apache.logging.log4j.Logger logger
      Logger object for class.
    • reactions

      private List<StoichiometricReaction> reactions
      Reactions to apply in this reactor.
    • reactorTemperature

      private double reactorTemperature
      Reactor temperature in Kelvin. If NaN, uses feed temperature (isothermal to feed).
    • reactorPressure

      private double reactorPressure
      Reactor pressure in bara. If NaN, uses feed pressure.
    • vesselVolume

      private double vesselVolume
      Vessel volume in m3.
    • residenceTime

      private double residenceTime
      Residence time in hours.
    • agitatorPowerPerVolume

      private double agitatorPowerPerVolume
      Agitator power per unit volume in kW/m3.
    • pressureDrop

      private double pressureDrop
      Pressure drop across reactor in bar.
    • heatDuty

      private double heatDuty
      Heat duty calculated from energy balance in Watts.
    • isothermal

      private boolean isothermal
      Whether to operate in isothermal mode (fix temperature).
  • Constructor Details

    • StirredTankReactor

      public StirredTankReactor(String name)
      Constructor for StirredTankReactor.
      Parameters:
      name - name of the reactor
    • StirredTankReactor

      public StirredTankReactor(String name, StreamInterface inletStream)
      Constructor for StirredTankReactor with inlet stream.
      Parameters:
      name - name of the reactor
      inletStream - inlet feed stream
  • Method Details

    • addReaction

      public void addReaction(StoichiometricReaction reaction)
      Add a stoichiometric reaction to the reactor.
      Parameters:
      reaction - a StoichiometricReaction to apply
    • getReactions

      public List<StoichiometricReaction> getReactions()
      Get the list of reactions.
      Returns:
      list of reactions
    • clearReactions

      public void clearReactions()
      Clear all reactions.
    • setReactorTemperature

      public void setReactorTemperature(double temperatureK)
      Set the reactor operating temperature in Kelvin.
      Parameters:
      temperatureK - temperature in Kelvin
    • setReactorTemperature

      public void setReactorTemperature(double temperature, String unit)
      Set the reactor operating temperature with unit.
      Parameters:
      temperature - temperature value
      unit - temperature unit ("K", "C", "F")
    • getReactorTemperature

      public double getReactorTemperature()
      Get the reactor temperature in Kelvin.
      Returns:
      reactor temperature in K
    • setReactorPressure

      public void setReactorPressure(double pressureBara)
      Set the reactor pressure in bara.
      Parameters:
      pressureBara - pressure in bara
    • getReactorPressure

      public double getReactorPressure()
      Get the reactor pressure in bara.
      Returns:
      reactor pressure in bara
    • setVesselVolume

      public void setVesselVolume(double volumeM3)
      Set the vessel volume.
      Parameters:
      volumeM3 - vessel volume in cubic meters
    • getVesselVolume

      public double getVesselVolume()
      Get the vessel volume in m3.
      Returns:
      vessel volume
    • setResidenceTime

      public void setResidenceTime(double time, String unit)
      Set residence time.
      Parameters:
      time - residence time value
      unit - time unit ("hr", "min", "s")
    • getResidenceTime

      public double getResidenceTime()
      Get residence time in hours.
      Returns:
      residence time in hours
    • setAgitatorPowerPerVolume

      public void setAgitatorPowerPerVolume(double powerPerVolume)
      Set the agitator power per unit volume.
      Parameters:
      powerPerVolume - agitator power in kW/m3
    • getAgitatorPowerPerVolume

      public double getAgitatorPowerPerVolume()
      Get the agitator power per unit volume.
      Returns:
      agitator power in kW/m3
    • getAgitatorPower

      public double getAgitatorPower()
      Get total agitator power in kW.
      Returns:
      total agitator power
    • setPressureDrop

      public void setPressureDrop(double dP)
      Set the pressure drop across the reactor.
      Parameters:
      dP - pressure drop in bar
    • getPressureDrop

      public double getPressureDrop()
      Get the pressure drop in bar.
      Returns:
      pressure drop
    • getHeatDuty

      public double getHeatDuty()
      Get the heat duty calculated from energy balance in Watts.
      Returns:
      heat duty in W (positive = heat added, negative = removed)
    • getHeatDuty

      public double getHeatDuty(String unit)
      Get the heat duty in specified unit.
      Parameters:
      unit - unit for heat duty ("W", "kW", "MW")
      Returns:
      heat duty in specified unit
    • setIsothermal

      public void setIsothermal(boolean isothermal)
      Set whether reactor operates isothermally.
      Parameters:
      isothermal - true for isothermal, false for adiabatic
    • isIsothermal

      public boolean isIsothermal()
      Check if reactor is isothermal.
      Returns:
      true if isothermal
    • run

      public void run(UUID id)

      In this method all thermodynamic and unit operations will be calculated in a steady state calculation.

      Parameters:
      id - UUID
    • toJson

      public String toJson()

      Serializes the Process Equipment along with its state to a JSON string.

      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class TwoPortEquipment
      Returns:
      json string.
    • toMap

      private Map<String,Object> toMap()
      Get a map representation of the reactor state.
      Returns:
      map of reactor properties