Class PropertyTableRunner

java.lang.Object
neqsim.mcp.runners.PropertyTableRunner

public class PropertyTableRunner extends Object
Stateless property table runner for MCP integration.

Sweeps temperature or pressure over a range and returns a table of thermodynamic and transport properties at each point. This is the "one-shot engineering answer" tool that external agents need most often — no process flowsheet construction required.

Input JSON Format:

{ "model": "SRK", "components": {"methane": 0.85, "ethane": 0.10, "propane": 0.05},
"mixingRule": "classic", "sweep": "temperature", "sweepFrom": {"value": -40.0, "unit": "C"},
"sweepTo": {"value": 80.0, "unit": "C"}, "points": 25, "fixedPressure": {"value": 50.0, "unit":
"bara"}, "fixedTemperature": {"value": 25.0, "unit": "C"}, "properties": ["density", "viscosity",
"Cp", "Z", "enthalpy", "entropy", "thermalConductivity", "molarMass", "soundSpeed"] } 
Author:
Even Solbraa @version 1.0
  • Field Details

    • GSON

      private static final com.google.gson.Gson GSON
    • AVAILABLE_PROPERTIES

      private static final List<String> AVAILABLE_PROPERTIES
  • Constructor Details

    • PropertyTableRunner

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

    • run

      public static String run(String json)
      Runs a property table calculation from a JSON input string.
      Parameters:
      json - the JSON property table specification
      Returns:
      a JSON string with the property table or errors
    • getAvailableProperties

      public static List<String> getAvailableProperties()
      Returns the list of available properties that can be requested.
      Returns:
      the available property names
    • addProperty

      private static void addProperty(com.google.gson.JsonObject row, SystemInterface fluid, String property)
      Adds a named property value to a JSON row object.
      Parameters:
      row - the JSON row to add to
      fluid - the fluid system to read from
      property - the property name
    • errorJson

      private static String errorJson(String code, String message, String remediation)
      Creates a standard error JSON response.
      Parameters:
      code - the error code
      message - the error message
      remediation - the fix suggestion
      Returns:
      JSON error string