Class FlowAssuranceRunner
java.lang.Object
neqsim.mcp.runners.FlowAssuranceRunner
Stateless flow assurance runner for MCP integration.
Supports hydrate risk mapping, wax appearance temperature, asphaltene stability screening, CO2/H2S corrosion prediction, scale prediction, erosion analysis, pipeline cooldown, and emulsion viscosity calculations.
- Version:
- 1.0
- Author:
- Even Solbraa
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.gson.Gson -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor — all methods are static. -
Method Summary
Modifier and TypeMethodDescriptionprivate static SystemInterfacecreateFluid(String model, double tempK, double pBara) Creates a fluid system for the given EOS model.private static SystemInterfacecreateFluidFromInput(com.google.gson.JsonObject input) Creates a fluid system from the JSON input.private static StringCreates a standard error JSON string.Returns the list of supported flow assurance analysis types.private static doubleparsePressure(com.google.gson.JsonElement element) Parses a pressure specification from JSON.private static doubleparseTemperature(com.google.gson.JsonElement element) Parses a temperature specification from JSON.static StringRuns a flow assurance analysis from a JSON input string.private static com.google.gson.JsonObjectrunAsphalteneStability(com.google.gson.JsonObject input) Runs asphaltene stability assessment.private static com.google.gson.JsonObjectrunCO2Corrosion(com.google.gson.JsonObject input) Runs CO2 corrosion rate prediction.private static com.google.gson.JsonObjectrunEmulsionViscosity(com.google.gson.JsonObject input) Runs emulsion viscosity calculation.private static com.google.gson.JsonObjectrunErosion(com.google.gson.JsonObject input) Runs erosion prediction calculation.private static com.google.gson.JsonObjectrunHydrateRiskMap(com.google.gson.JsonObject input) Runs hydrate risk mapping along a pipeline profile.private static com.google.gson.JsonObjectrunPipelineCooldown(com.google.gson.JsonObject input) Runs pipeline cooldown calculation.private static com.google.gson.JsonObjectrunScalePrediction(com.google.gson.JsonObject input) Runs scale prediction calculation.private static com.google.gson.JsonObjectrunWaxAppearance(com.google.gson.JsonObject input) Runs wax appearance temperature calculation.private static com.google.gson.JsonArraytoJsonArray(double[] arr) Converts a double array to a JSON array.
-
Field Details
-
GSON
private static final com.google.gson.Gson GSON -
SUPPORTED_ANALYSES
-
-
Constructor Details
-
FlowAssuranceRunner
private FlowAssuranceRunner()Private constructor — all methods are static.
-
-
Method Details
-
getSupportedAnalyses
-
run
-
runHydrateRiskMap
private static com.google.gson.JsonObject runHydrateRiskMap(com.google.gson.JsonObject input) Runs hydrate risk mapping along a pipeline profile.- Parameters:
input- the JSON input with fluid and profile data- Returns:
- JSON object with hydrate risk results
-
runWaxAppearance
private static com.google.gson.JsonObject runWaxAppearance(com.google.gson.JsonObject input) Runs wax appearance temperature calculation.- Parameters:
input- the JSON input with fluid definition- Returns:
- JSON object with WAT results
-
runAsphalteneStability
private static com.google.gson.JsonObject runAsphalteneStability(com.google.gson.JsonObject input) Runs asphaltene stability assessment.- Parameters:
input- the JSON input with fluid and reservoir conditions- Returns:
- JSON object with asphaltene stability results
-
runCO2Corrosion
private static com.google.gson.JsonObject runCO2Corrosion(com.google.gson.JsonObject input) Runs CO2 corrosion rate prediction.- Parameters:
input- the JSON input with operating conditions- Returns:
- JSON object with corrosion rate results
-
runScalePrediction
private static com.google.gson.JsonObject runScalePrediction(com.google.gson.JsonObject input) Runs scale prediction calculation.- Parameters:
input- the JSON input with water chemistry- Returns:
- JSON object with scale saturation indices
-
runErosion
private static com.google.gson.JsonObject runErosion(com.google.gson.JsonObject input) Runs erosion prediction calculation.- Parameters:
input- the JSON input with flow conditions- Returns:
- JSON object with erosion results
-
runPipelineCooldown
private static com.google.gson.JsonObject runPipelineCooldown(com.google.gson.JsonObject input) Runs pipeline cooldown calculation.- Parameters:
input- the JSON input with pipeline thermal parameters- Returns:
- JSON object with cooldown results
-
runEmulsionViscosity
private static com.google.gson.JsonObject runEmulsionViscosity(com.google.gson.JsonObject input) Runs emulsion viscosity calculation.- Parameters:
input- the JSON input with emulsion parameters- Returns:
- JSON object with emulsion viscosity results
-
createFluidFromInput
Creates a fluid system from the JSON input.- Parameters:
input- the JSON object containing components, model, temperature, pressure- Returns:
- the configured fluid system
-
createFluid
Creates a fluid system for the given EOS model.- Parameters:
model- EOS model nametempK- temperature in KelvinpBara- pressure in bara- Returns:
- the fluid system
-
parseTemperature
private static double parseTemperature(com.google.gson.JsonElement element) Parses a temperature specification from JSON.- Parameters:
element- the JSON element- Returns:
- temperature in Kelvin
-
parsePressure
private static double parsePressure(com.google.gson.JsonElement element) Parses a pressure specification from JSON.- Parameters:
element- the JSON element- Returns:
- pressure in bara
-
toJsonArray
private static com.google.gson.JsonArray toJsonArray(double[] arr) Converts a double array to a JSON array.- Parameters:
arr- the double array- Returns:
- the JSON array
-
errorJson
-