Class PhaseEnvelopeRunner

java.lang.Object
neqsim.mcp.runners.PhaseEnvelopeRunner

public class PhaseEnvelopeRunner extends Object
Stateless phase envelope runner for MCP integration.

Calculates the PT phase envelope (bubble point and dew point curves) for a fluid mixture and returns the data as a JSON array of points. This is one of the most commonly requested single-purpose engineering calculations for agents.

Input JSON Format:

{ "model": "SRK", "components": {"methane": 0.85, "ethane": 0.10, "propane": 0.05},
"mixingRule": "classic" } 
Author:
Even Solbraa @version 1.0
  • Field Details

    • GSON

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

    • PhaseEnvelopeRunner

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

    • run

      public static String run(String json)
      Calculates the phase envelope for a fluid from a JSON specification.
      Parameters:
      json - the JSON fluid specification
      Returns:
      a JSON string with the phase envelope data or errors
    • 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