Class ExergyAnalysisReport

java.lang.Object
neqsim.process.util.exergy.ExergyAnalysisReport
All Implemented Interfaces:
Serializable

public class ExergyAnalysisReport extends Object implements Serializable
Structured result of an exergy analysis over a ProcessSystem or ProcessModel. Contains one row per unit operation with its exergy change across material streams and its exergy destruction rate, plus convenience aggregation / ranking / reporting helpers suitable for large flowsheets.

All energies are stored internally in Joules (J). For steady-state process simulations in NeqSim, stream enthalpy/entropy are per-second quantities so "J" is equivalent to "W" and may be reported as such via toString(String).

Version:
1.0
Author:
esol
See Also:
  • Field Details

  • Constructor Details

    • ExergyAnalysisReport

      public ExergyAnalysisReport(double surroundingTemperatureK)
      Create an empty report.
      Parameters:
      surroundingTemperatureK - surrounding ("dead-state") temperature in K used when computing exergy
  • Method Details

    • addEntry

      public void addEntry(ExergyAnalysisReport.Entry entry)
      Append an entry to the report.
      Parameters:
      entry - row to add
    • getSurroundingTemperatureK

      public double getSurroundingTemperatureK()
      Returns:
      surrounding temperature used for exergy calculations (K)
    • getEntries

      public List<ExergyAnalysisReport.Entry> getEntries()
      Returns:
      an unmodifiable view of all entries in insertion order
    • size

      public int size()
      Returns:
      number of rows in the report
    • getTopDestructionHotspots

      public List<ExergyAnalysisReport.Entry> getTopDestructionHotspots(int n)
      Returns the top-N entries with the largest exergy destruction. Useful for hot-spot identification on large processes.
      Parameters:
      n - number of entries to return; values <= 0 return the full list sorted
      Returns:
      a new list of entries sorted by descending destruction
    • getTotalExergyDestruction

      public double getTotalExergyDestruction(String unit)
      Parameters:
      unit - energy unit ("J", "kJ", "MJ", "W", "kW", "MW")
      Returns:
      total exergy destruction summed over all entries
    • getTotalExergyChange

      public double getTotalExergyChange(String unit)
      Parameters:
      unit - energy unit
      Returns:
      total exergy change summed over all entries
    • getDestructionByArea

      public Map<String,Double> getDestructionByArea(String unit)
      Groups the total exergy destruction by process area. Returns an empty map when no entries carry an area.
      Parameters:
      unit - energy unit
      Returns:
      map from area name to total destruction in the requested unit
    • getDestructionByType

      public Map<String,Double> getDestructionByType(String unit)
      Groups the total exergy destruction by unit type (simple class name).
      Parameters:
      unit - energy unit
      Returns:
      map from class name to total destruction
    • toString

      public String toString(String unit)
      Pretty-print the report as a plain-text table ranked by exergy destruction.
      Parameters:
      unit - energy unit to display
      Returns:
      a human-readable table
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toJson

      public String toJson()
      Serialize the report to JSON. Output contains surrounding temperature, totals and an array of per-unit rows.
      Returns:
      a JSON string
    • convert

      private static double convert(double valueJ, String unit)
      Convert Joules to the requested unit.
      Parameters:
      valueJ - value in Joules
      unit - target unit ("J", "kJ", "MJ", "W", "kW", "MW")
      Returns:
      converted value
    • repeat

      private static String repeat(char c, int n)
      Java-8 compatible string repeat.
      Parameters:
      c - character to repeat
      n - number of repetitions
      Returns:
      the resulting string
    • clip

      private static String clip(String s, int max)
      Truncate s to at most max characters.
      Parameters:
      s - input string (may be null)
      max - maximum length
      Returns:
      truncated string, never null
    • escape

      private static String escape(String s)
      Escape a string for inclusion in a JSON literal.
      Parameters:
      s - input
      Returns:
      escaped string