Class PinchAnalysis

java.lang.Object
neqsim.process.equipment.heatexchanger.heatintegration.PinchAnalysis
All Implemented Interfaces:
Serializable

public class PinchAnalysis extends Object implements Serializable
Pinch analysis engine for heat integration of process streams.

Performs classical pinch analysis (Linnhoff method) to determine minimum heating and cooling utility requirements, the pinch temperature, and composite curves for a set of hot and cold process streams.

Algorithm

  1. Collect all unique temperatures from hot and cold streams
  2. Shift cold stream temperatures up by deltaT_min (minimum approach)
  3. Create temperature intervals and compute heat balances
  4. Cascade heat surplus/deficit to find pinch point and utility targets

Usage Example

PinchAnalysis pinch = new PinchAnalysis(10.0);
pinch.addHotStream("H1", 180, 80, 30);
pinch.addHotStream("H2", 150, 50, 15);
pinch.addColdStream("C1", 30, 140, 20);
pinch.addColdStream("C2", 60, 120, 25);
pinch.run();

double Qh = pinch.getMinimumHeatingUtility();
double Qc = pinch.getMinimumCoolingUtility();
double Tpinch = pinch.getPinchTemperatureC();

Integration with ProcessSystem

// Auto-extract heating/cooling duties from a process
PinchAnalysis pinch = PinchAnalysis.fromProcessSystem(process, 10.0);
pinch.run();

// Or add streams from a MultiStreamHeatExchanger2
PinchAnalysis pinch2 = new PinchAnalysis(10.0);
pinch2.addStreamsFromHeatExchanger(multiStreamHX);
pinch2.run();
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.
    • hotStreams

      private List<HeatStream> hotStreams
    • coldStreams

      private List<HeatStream> coldStreams
    • deltaTmin

      private double deltaTmin
    • minimumHeatingUtility

      private double minimumHeatingUtility
    • minimumCoolingUtility

      private double minimumCoolingUtility
    • pinchTemperatureHot

      private double pinchTemperatureHot
    • pinchTemperatureCold

      private double pinchTemperatureCold
    • hasRun

      private boolean hasRun
    • hotCompositeQ

      private double[] hotCompositeQ
    • hotCompositeT

      private double[] hotCompositeT
    • coldCompositeQ

      private double[] coldCompositeQ
    • coldCompositeT

      private double[] coldCompositeT
    • grandCompositeQ

      private double[] grandCompositeQ
    • grandCompositeT

      private double[] grandCompositeT
  • Constructor Details

    • PinchAnalysis

      public PinchAnalysis(double deltaTmin_C)
      Constructor for PinchAnalysis.
      Parameters:
      deltaTmin_C - minimum approach temperature in Celsius (or K since it is a difference)
  • Method Details

    • addHotStream

      public void addHotStream(String name, double supplyTemp_C, double targetTemp_C, double mCp)
      Add a hot stream (needs cooling).
      Parameters:
      name - stream name
      supplyTemp_C - supply temperature in Celsius
      targetTemp_C - target temperature in Celsius
      mCp - heat capacity flow rate in kW/K
    • addColdStream

      public void addColdStream(String name, double supplyTemp_C, double targetTemp_C, double mCp)
      Add a cold stream (needs heating).
      Parameters:
      name - stream name
      supplyTemp_C - supply temperature in Celsius
      targetTemp_C - target temperature in Celsius
      mCp - heat capacity flow rate in kW/K
    • addStream

      public void addStream(HeatStream stream)
      Add a HeatStream object directly.
      Parameters:
      stream - the heat stream to add
    • addProcessStream

      public void addProcessStream(String name, StreamInterface stream, double outletTemperature_C)
      Add a process stream by extracting its inlet and outlet temperatures and computing the average heat capacity flow rate (MCp = duty / deltaT). The stream must have been run so that its fluid properties are available.

      The stream is classified as hot (needs cooling) or cold (needs heating) based on whether the inlet temperature is higher or lower than the specified target temperature.

      Parameters:
      name - display name for this stream in the pinch analysis
      stream - the NeqSim process stream (must have been run)
      outletTemperature_C - the outlet/target temperature in Celsius
    • addStreamsFromHeatExchanger

      public void addStreamsFromHeatExchanger(HeatExchanger heatExchanger)
      Add streams from a two-stream HeatExchanger. The hot side and cold side are extracted from the exchanger's inlet and outlet streams.
      Parameters:
      heatExchanger - a two-stream HeatExchanger (must have been run)
    • addStreamsFromHeatExchanger

      public void addStreamsFromHeatExchanger(MultiStreamHeatExchanger2 mshe)
      Add streams from a MultiStreamHeatExchanger2 (or LNGHeatExchanger). Each internal stream in the exchanger is added as either a hot or cold stream based on its type classification.
      Parameters:
      mshe - the multi-stream heat exchanger (must have been run)
    • fromProcessSystem

      public static PinchAnalysis fromProcessSystem(ProcessSystem process, double deltaTmin_C)
      Create a PinchAnalysis from a ProcessSystem by scanning all Heater, Cooler, HeatExchanger, and MultiStreamHeatExchanger2 equipment. Each utility (heater/cooler) is added as a stream representing the process-side heating or cooling requirement.

      The ProcessSystem must have been run before calling this method so that all stream temperatures and duties are available.

      Parameters:
      process - the ProcessSystem to scan (must have been run)
      deltaTmin_C - minimum approach temperature in Celsius
      Returns:
      a new PinchAnalysis populated with streams from the process
    • run

      public void run()
      Run the pinch analysis calculation.
    • buildCompositeCurves

      private void buildCompositeCurves()
      Build hot and cold composite curves for plotting.
    • buildCompositeTemperatures

      private double[] buildCompositeTemperatures(List<HeatStream> streams, boolean isCold)
      Build sorted temperature array for composite curve.
      Parameters:
      streams - list of streams
      isCold - true if cold streams
      Returns:
      sorted temperature array in Kelvin (descending)
    • buildCompositeEnthalpy

      private double[] buildCompositeEnthalpy(List<HeatStream> streams, double[] tempArray, boolean isCold)
      Build cumulative enthalpy array for composite curve.
      Parameters:
      streams - list of streams
      tempArray - sorted temperature array (descending)
      isCold - true if cold streams
      Returns:
      cumulative enthalpy array in kW
    • getMinimumHeatingUtility

      public double getMinimumHeatingUtility()
      Get minimum heating utility requirement.
      Returns:
      minimum hot utility in kW
    • getMinimumCoolingUtility

      public double getMinimumCoolingUtility()
      Get minimum cooling utility requirement.
      Returns:
      minimum cold utility in kW
    • getMaximumHeatRecovery

      public double getMaximumHeatRecovery()
      Get the maximum heat recovery possible between hot and cold streams.
      Returns:
      maximum heat recovery in kW
    • getPinchTemperatureHot

      public double getPinchTemperatureHot()
      Get pinch temperature on the hot side in Kelvin.
      Returns:
      hot-side pinch temperature in Kelvin
    • getPinchTemperatureCold

      public double getPinchTemperatureCold()
      Get pinch temperature on the cold side in Kelvin.
      Returns:
      cold-side pinch temperature in Kelvin
    • getPinchTemperatureC

      public double getPinchTemperatureC()
      Get pinch temperature (hot side) in Celsius.
      Returns:
      hot-side pinch temperature in Celsius
    • getHotCompositeCurve

      public Map<String,double[]> getHotCompositeCurve()
      Get the hot composite curve data.
      Returns:
      map with "Q_kW" and "T_K" arrays
    • getColdCompositeCurve

      public Map<String,double[]> getColdCompositeCurve()
      Get the cold composite curve data.
      Returns:
      map with "Q_kW" and "T_K" arrays
    • getGrandCompositeCurve

      public Map<String,double[]> getGrandCompositeCurve()
      Get the grand composite curve data.
      Returns:
      map with "Q_kW" and "T_K" arrays
    • getNumberOfHotStreams

      public int getNumberOfHotStreams()
      Get the number of hot streams.
      Returns:
      number of hot streams
    • getNumberOfColdStreams

      public int getNumberOfColdStreams()
      Get the number of cold streams.
      Returns:
      number of cold streams
    • toJson

      public String toJson()
      Get full results as JSON string.
      Returns:
      JSON representation of pinch analysis results
    • checkHasRun

      private void checkHasRun()
      Check that analysis has been run.
      Throws:
      IllegalStateException - if run() has not been called