Class FermentationReactor

All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, ProcessElementInterface, SimulationInterface, NamedInterface

public class FermentationReactor extends Fermenter
Fermentation reactor with Monod and Contois kinetics for bio-chemical conversion.

Extends Fermenter with mechanistic kinetic models (Monod, Contois) for microbial growth, substrate consumption, and product formation. Supports substrate inhibition, product inhibition, and fed-batch operation modes. Suitable for modelling ethanol fermentation, organic acid production, and other biofuel/bioproduct pathways.

Kinetic Models

Supported kinetic model types
Model Equation Typical Use
MONOD mu = muMax * S / (Ks + S) Dilute substrates, wastewater
CONTOIS mu = muMax * S / (Ksx * X + S) High-solids, solid-state fermentation
SUBSTRATE_INHIBITED mu = muMax * S / (Ks + S + S^2/Ki) High-concentration substrates
PRODUCT_INHIBITED mu = muMax * S / (Ks + S) * (1 - P/Pmax)^n Ethanol fermentation

Operation Modes

  • CONTINUOUS - steady-state CSTR with constant dilution rate
  • BATCH - closed system, time-integrated kinetics
  • FED_BATCH - batch with periodic substrate feeding

Usage example:

FermentationReactor reactor = new FermentationReactor("EtOH-R1");
reactor.setKineticModel(FermentationReactor.KineticModel.PRODUCT_INHIBITED);
reactor.setOperationMode(FermentationReactor.OperationMode.CONTINUOUS);
reactor.setMaxSpecificGrowthRate(0.40); // 1/hr
reactor.setMonodConstant(2.0); // g/L
reactor.setYieldBiomass(0.05); // g cells / g substrate
reactor.setYieldProduct(0.46); // g ethanol / g glucose (stoichiometric ~0.51)
reactor.setProductInhibitionConcentration(90.0); // g/L
reactor.setSubstrateConcentration(180.0); // g/L glucose
reactor.setBiomassConcentration(2.0); // g/L inoculum
reactor.setVesselVolume(200.0); // m3
reactor.setResidenceTime(48.0, "hr");
reactor.setReactorTemperature(32.0, "C");
reactor.run();

double substrateConversion = reactor.getSubstrateConversion();
double productConcentration = reactor.getProductConcentrationGPerL();
double productivity = reactor.getProductivity();
Version:
1.0
Author:
Even Solbraa
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 instance.
    • kineticModel

      private FermentationReactor.KineticModel kineticModel
      Selected kinetic model.
    • operationMode

      private FermentationReactor.OperationMode operationMode
      Operation mode.
    • muMax

      private double muMax
      Maximum specific growth rate in 1/hr.
    • monodConstant

      private double monodConstant
      Monod half-saturation constant (Ks) in g/L.
    • contoisConstant

      private double contoisConstant
      Contois constant (Ksx) in g substrate / g biomass, used with CONTOIS model.
    • substrateInhibitionConstant

      private double substrateInhibitionConstant
      Substrate inhibition constant (Ki) in g/L, used with SUBSTRATE_INHIBITED model.
    • productInhibitionConcentration

      private double productInhibitionConcentration
      Product inhibition concentration (Pmax) in g/L, used with PRODUCT_INHIBITED model.
    • productInhibitionExponent

      private double productInhibitionExponent
      Product inhibition exponent, used with PRODUCT_INHIBITED model.
    • yieldBiomass

      private double yieldBiomass
      Biomass yield (g cells / g substrate consumed).
    • yieldProduct

      private double yieldProduct
      Product yield (g product / g substrate consumed).
    • maintenanceCoeff

      private double maintenanceCoeff
      Maintenance coefficient (g substrate / (g cells * hr)).
    • substrateConcentration

      private double substrateConcentration
      Initial / feed substrate concentration in g/L.
    • biomassConcentration

      private double biomassConcentration
      Initial / feed biomass concentration in g/L.
    • initialProductConcentration

      private double initialProductConcentration
      Initial product concentration in g/L.
    • feedingRate

      private double feedingRate
      Feeding rate in L/hr for fed-batch mode.
    • feedSubstrateConcentration

      private double feedSubstrateConcentration
      Feed substrate concentration in g/L for fed-batch mode.
    • batchTime

      private double batchTime
      Batch time in hours for BATCH and FED_BATCH modes.
    • productComponentName

      private String productComponentName
      Name of the main fermentation product for NeqSim component mapping.
    • substrateComponentName

      private String substrateComponentName
      Name of the substrate component for NeqSim component mapping.
    • gasProductName

      private String gasProductName
      Name of the gas product component.
    • gasYieldMolPerMol

      private double gasYieldMolPerMol
      Gas product yield per substrate consumed (mol gas / mol substrate).
    • liquidOutStream

      private StreamInterface liquidOutStream
      Liquid product outlet stream.
    • gasOutStream

      private StreamInterface gasOutStream
      Gas product outlet stream (CO2, etc.).
    • finalBiomassConc

      private double finalBiomassConc
      Final biomass concentration in g/L.
    • finalSubstrateConc

      private double finalSubstrateConc
      Final substrate concentration in g/L.
    • finalProductConc

      private double finalProductConc
      Final product concentration in g/L.
    • substrateConversion

      private double substrateConversion
      Substrate conversion (0-1).
    • specificGrowthRate

      private double specificGrowthRate
      Specific growth rate achieved in 1/hr.
    • productivity

      private double productivity
      Volumetric productivity in g/(L*hr).
    • substrateConsumedKgPerHr

      private double substrateConsumedKgPerHr
      Total substrate consumed in kg/hr.
    • productFormedKgPerHr

      private double productFormedKgPerHr
      Total product formed in kg/hr.
    • hasRun

      private boolean hasRun
      Whether the reactor has been run.
  • Constructor Details

    • FermentationReactor

      public FermentationReactor(String name)
      Creates a fermentation reactor with the given name.
      Parameters:
      name - equipment name
    • FermentationReactor

      public FermentationReactor(String name, StreamInterface inletStream)
      Creates a fermentation reactor with inlet stream.
      Parameters:
      name - equipment name
      inletStream - feed stream
  • Method Details

    • setKineticModel

      public void setKineticModel(FermentationReactor.KineticModel model)
      Sets the kinetic model.
      Parameters:
      model - kinetic model type
    • getKineticModel

      public FermentationReactor.KineticModel getKineticModel()
      Gets the kinetic model.
      Returns:
      kinetic model type
    • setOperationMode

      public void setOperationMode(FermentationReactor.OperationMode mode)
      Sets the operation mode.
      Parameters:
      mode - operation mode
    • getOperationMode

      public FermentationReactor.OperationMode getOperationMode()
      Gets the operation mode.
      Returns:
      operation mode
    • setMaxSpecificGrowthRate

      public void setMaxSpecificGrowthRate(double muMax)
      Sets the maximum specific growth rate.
      Parameters:
      muMax - maximum specific growth rate in 1/hr
    • getMaxSpecificGrowthRate

      public double getMaxSpecificGrowthRate()
      Gets the maximum specific growth rate.
      Returns:
      maximum specific growth rate in 1/hr
    • setMonodConstant

      public void setMonodConstant(double ks)
      Sets the Monod half-saturation constant.
      Parameters:
      ks - half-saturation constant in g/L
    • getMonodConstant

      public double getMonodConstant()
      Gets the Monod constant.
      Returns:
      half-saturation constant in g/L
    • setContoisConstant

      public void setContoisConstant(double ksx)
      Sets the Contois constant.
      Parameters:
      ksx - Contois constant in g/g
    • getContoisConstant

      public double getContoisConstant()
      Gets the Contois constant.
      Returns:
      Contois constant in g/g
    • setSubstrateInhibitionConstant

      public void setSubstrateInhibitionConstant(double ki)
      Sets the substrate inhibition constant.
      Parameters:
      ki - substrate inhibition constant in g/L
    • getSubstrateInhibitionConstant

      public double getSubstrateInhibitionConstant()
      Gets the substrate inhibition constant.
      Returns:
      substrate inhibition constant in g/L
    • setProductInhibitionConcentration

      public void setProductInhibitionConcentration(double pmax)
      Sets the product inhibition concentration threshold.
      Parameters:
      pmax - product concentration threshold in g/L
    • getProductInhibitionConcentration

      public double getProductInhibitionConcentration()
      Gets the product inhibition concentration.
      Returns:
      product inhibition concentration in g/L
    • setProductInhibitionExponent

      public void setProductInhibitionExponent(double n)
      Sets the product inhibition exponent.
      Parameters:
      n - product inhibition exponent
    • getProductInhibitionExponent

      public double getProductInhibitionExponent()
      Gets the product inhibition exponent.
      Returns:
      product inhibition exponent
    • setYieldBiomass

      public void setYieldBiomass(double yxs)
      Sets the biomass yield coefficient.
      Parameters:
      yxs - biomass yield in g cells / g substrate
    • getYieldBiomass

      public double getYieldBiomass()
      Gets the biomass yield coefficient.
      Returns:
      biomass yield in g cells / g substrate
    • setYieldProduct

      public void setYieldProduct(double yps)
      Sets the product yield coefficient.
      Parameters:
      yps - product yield in g product / g substrate
    • getYieldProduct

      public double getYieldProduct()
      Gets the product yield coefficient.
      Returns:
      product yield in g product / g substrate
    • setMaintenanceCoefficient

      public void setMaintenanceCoefficient(double ms)
      Sets the maintenance coefficient.
      Overrides:
      setMaintenanceCoefficient in class Fermenter
      Parameters:
      ms - maintenance coefficient in g substrate / (g cells * hr)
    • getMaintenanceCoefficient

      public double getMaintenanceCoefficient()
      Gets the maintenance coefficient.
      Overrides:
      getMaintenanceCoefficient in class Fermenter
      Returns:
      maintenance coefficient
    • setSubstrateConcentration

      public void setSubstrateConcentration(double concGPerL)
      Sets the feed substrate concentration.
      Parameters:
      concGPerL - substrate concentration in g/L
    • getSubstrateConcentration

      public double getSubstrateConcentration()
      Gets the substrate concentration.
      Returns:
      substrate concentration in g/L
    • setBiomassConcentration

      public void setBiomassConcentration(double concGPerL)
      Sets the biomass inoculum concentration.
      Parameters:
      concGPerL - biomass concentration in g/L
    • getBiomassConcentration

      public double getBiomassConcentration()
      Gets the biomass concentration.
      Returns:
      biomass concentration in g/L
    • setInitialProductConcentration

      public void setInitialProductConcentration(double concGPerL)
      Sets the initial product concentration.
      Parameters:
      concGPerL - initial product concentration in g/L
    • setFeedingRate

      public void setFeedingRate(double rateL_hr)
      Sets the feeding rate for fed-batch mode.
      Parameters:
      rateL_hr - feeding rate in L/hr
    • setFeedSubstrateConcentration

      public void setFeedSubstrateConcentration(double concGPerL)
      Sets the feed substrate concentration for fed-batch mode.
      Parameters:
      concGPerL - feed substrate concentration in g/L
    • setBatchTime

      public void setBatchTime(double hours)
      Sets the batch time for batch or fed-batch modes.
      Parameters:
      hours - batch time in hours
    • getBatchTime

      public double getBatchTime()
      Gets the batch time.
      Returns:
      batch time in hours
    • setProductComponentName

      public void setProductComponentName(String componentName)
      Sets the NeqSim component name for the fermentation product.
      Parameters:
      componentName - NeqSim component name (e.g. "ethanol", "methanol")
    • getProductComponentName

      public String getProductComponentName()
      Gets the product component name.
      Returns:
      product component name
    • setSubstrateComponentName

      public void setSubstrateComponentName(String componentName)
      Sets the NeqSim component name for the substrate surrogate.
      Parameters:
      componentName - NeqSim component name (e.g. "n-hexane" as glucose surrogate)
    • getSubstrateComponentName

      public String getSubstrateComponentName()
      Gets the substrate component name.
      Returns:
      substrate component name
    • setGasProductName

      public void setGasProductName(String componentName)
      Sets the gas product component name.
      Parameters:
      componentName - gas product name (e.g. "CO2")
    • setGasYieldMolPerMol

      public void setGasYieldMolPerMol(double yieldMolPerMol)
      Sets the gas yield per substrate consumed.
      Parameters:
      yieldMolPerMol - moles of gas per mole of substrate
    • getLiquidOutStream

      public StreamInterface getLiquidOutStream()
      Returns the liquid product outlet stream.
      Returns:
      liquid outlet stream, or null if not yet run
    • getGasOutStream

      public StreamInterface getGasOutStream()
      Returns the gas product outlet stream.
      Returns:
      gas outlet stream, or null if not yet run
    • getFinalBiomassConcentration

      public double getFinalBiomassConcentration()
      Returns the final biomass concentration.
      Returns:
      biomass concentration in g/L
    • getFinalSubstrateConcentration

      public double getFinalSubstrateConcentration()
      Returns the final substrate concentration.
      Returns:
      substrate concentration in g/L
    • getProductConcentrationGPerL

      public double getProductConcentrationGPerL()
      Returns the final product concentration.
      Returns:
      product concentration in g/L
    • getSubstrateConversion

      public double getSubstrateConversion()
      Returns the substrate conversion.
      Returns:
      substrate conversion fraction (0-1)
    • getSpecificGrowthRate

      public double getSpecificGrowthRate()
      Returns the specific growth rate achieved.
      Returns:
      specific growth rate in 1/hr
    • getProductivity

      public double getProductivity()
      Returns the volumetric productivity.
      Returns:
      productivity in g/(L*hr)
    • getSubstrateConsumedKgPerHr

      public double getSubstrateConsumedKgPerHr()
      Returns the total substrate consumed.
      Returns:
      substrate consumed in kg/hr
    • getProductFormedKgPerHr

      public double getProductFormedKgPerHr()
      Returns the total product formed.
      Returns:
      product formed in kg/hr
    • getOutletStreams

      public List<StreamInterface> getOutletStreams()
      Returns all outlet streams produced by this equipment. Subclasses override to report their specific outlets. Used by graph builders, DEXPI export, and auto-instrumentation to discover topology without instanceof checks.
      Specified by:
      getOutletStreams in interface ProcessEquipmentInterface
      Overrides:
      getOutletStreams in class TwoPortEquipment
      Returns:
      unmodifiable list of outlet streams (empty by default)
    • computeGrowthRate

      public double computeGrowthRate(double s, double x, double p)
      Computes the specific growth rate using the selected kinetic model.
      Parameters:
      s - substrate concentration in g/L
      x - biomass concentration in g/L
      p - product concentration in g/L
      Returns:
      specific growth rate in 1/hr
    • run

      public void run(UUID id)
      Runs the fermentation reactor simulation.
      Specified by:
      run in interface SimulationInterface
      Overrides:
      run in class Fermenter
      Parameters:
      id - UUID for this run
    • runContinuous

      private void runContinuous(UUID id, double volL)
      Runs continuous CSTR simulation solving steady-state mass balances.
      Parameters:
      id - UUID for this run
      volL - reactor volume in liters
    • runBatch

      private void runBatch(UUID id, double volL)
      Runs batch or fed-batch simulation using time integration.
      Parameters:
      id - UUID for this run
      volL - reactor volume in liters
    • solveSteadyStateSubstrate

      private double solveSteadyStateSubstrate(double dilutionRate)
      Solves for steady-state substrate concentration in CSTR from kinetic model.
      Parameters:
      dilutionRate - dilution rate in 1/hr (= 1/tau)
      Returns:
      steady-state substrate concentration in g/L
    • solveSubstrateInhibited

      private double solveSubstrateInhibited(double d)
      Solves substrate-inhibited kinetics for steady-state S.
      Parameters:
      d - dilution rate
      Returns:
      steady-state substrate concentration
    • solveIterative

      private double solveIterative(double d)
      Iterative solver for steady-state substrate in complex kinetic models.
      Parameters:
      d - dilution rate
      Returns:
      steady-state substrate concentration
    • buildOutputStreams

      private void buildOutputStreams(UUID id, double volumetricFlowLPerHr)
      Creates the liquid and gas output streams from fermentation results.
      Parameters:
      id - UUID for this run
      volumetricFlowLPerHr - volumetric flow in L/hr
    • getResults

      public Map<String,Object> getResults()
      Returns a results map for JSON output.
      Returns:
      map of result names to values
    • 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 StirredTankReactor
      Returns:
      json string.