Class EquipmentSizingRunner

java.lang.Object
neqsim.mcp.runners.EquipmentSizingRunner

public final class EquipmentSizingRunner extends Object
Quick equipment sizing runner for MCP integration.

Performs approximate sizing for common process equipment based on thermodynamic flash results. Supports separators (API 12J approach) and compressors (polytropic head / power). Results include dimensions, duty/power, and design basis summary.

Version:
1.0
Author:
Even Solbraa
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final com.google.gson.Gson
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Private constructor — all methods are static.
  • Method Summary

    Modifier and Type
    Method
    Description
    private static SystemInterface
    buildFluid(com.google.gson.JsonObject input)
    Builds a fluid from JSON input.
    private static String
    errorJson(String message)
    Creates an error JSON response.
    private static double
    extractFlowRate(com.google.gson.JsonObject input)
    Extracts flow rate from input JSON.
    private static double
    round(double value, int decimals)
    Rounds a value to the specified number of decimal places.
    static String
    run(String json)
    Runs an equipment sizing calculation from a JSON definition.
    private static String
    sizeCompressor(com.google.gson.JsonObject input)
    Sizes a compressor using polytropic calculations.
    private static String
    sizeSeparator(com.google.gson.JsonObject input)
    Sizes a separator vessel using flash results and retention time approach.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • GSON

      private static final com.google.gson.Gson GSON
  • Constructor Details

    • EquipmentSizingRunner

      private EquipmentSizingRunner()
      Private constructor — all methods are static.
  • Method Details

    • run

      public static String run(String json)
      Runs an equipment sizing calculation from a JSON definition.
      Parameters:
      json - JSON with equipmentType, components, conditions, and sizing parameters
      Returns:
      JSON string with sizing results
    • sizeSeparator

      private static String sizeSeparator(com.google.gson.JsonObject input)
      Sizes a separator vessel using flash results and retention time approach.
      Parameters:
      input - JSON input with fluid definition and sizing parameters
      Returns:
      JSON string with separator dimensions
    • sizeCompressor

      private static String sizeCompressor(com.google.gson.JsonObject input)
      Sizes a compressor using polytropic calculations.
      Parameters:
      input - JSON input with fluid definition and compressor parameters
      Returns:
      JSON string with compressor sizing results
    • buildFluid

      private static SystemInterface buildFluid(com.google.gson.JsonObject input)
      Builds a fluid from JSON input.
      Parameters:
      input - JSON object with model, temperature, pressure, components
      Returns:
      configured SystemInterface
    • extractFlowRate

      private static double extractFlowRate(com.google.gson.JsonObject input)
      Extracts flow rate from input JSON.
      Parameters:
      input - JSON with flowRate field
      Returns:
      flow rate in kg/hr
    • round

      private static double round(double value, int decimals)
      Rounds a value to the specified number of decimal places.
      Parameters:
      value - the value to round
      decimals - number of decimal places
      Returns:
      rounded value
    • errorJson

      private static String errorJson(String message)
      Creates an error JSON response.
      Parameters:
      message - the error message
      Returns:
      JSON string with status error