Class PipelineRunner

java.lang.Object
neqsim.mcp.runners.PipelineRunner

public class PipelineRunner extends Object
Stateless pipeline simulation runner for MCP integration.

Supports multiphase pipeline flow calculations using Beggs and Brill correlation, including pressure drop, liquid holdup, flow regime, and temperature profile along a pipeline.

Version:
1.0
Author:
Even Solbraa
  • Field Details

    • GSON

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

    • PipelineRunner

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

    • run

      public static String run(String json)
      Runs a pipeline simulation from a JSON input string.
      Parameters:
      json - the JSON pipeline specification
      Returns:
      a JSON string with status and pipeline results
    • createFluidFromInput

      private static SystemInterface createFluidFromInput(com.google.gson.JsonObject input)
      Creates a fluid system from the JSON input.
      Parameters:
      input - the JSON object containing components, model, temperature, pressure
      Returns:
      the configured fluid system
    • createFluid

      private static SystemInterface createFluid(String model, double tempK, double pBara)
      Creates a fluid system for the given EOS model.
      Parameters:
      model - EOS model name
      tempK - temperature in Kelvin
      pBara - pressure in bara
      Returns:
      the fluid system
    • parseTemperature

      private static double parseTemperature(com.google.gson.JsonElement element)
      Parses temperature from JSON element.
      Parameters:
      element - the JSON element
      Returns:
      temperature in Kelvin
    • parsePressure

      private static double parsePressure(com.google.gson.JsonElement element)
      Parses pressure from JSON element.
      Parameters:
      element - the JSON element
      Returns:
      pressure in bara
    • errorJson

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