Class FlashRequest
java.lang.Object
neqsim.mcp.model.FlashRequest
Typed request model for flash calculations.
Represents the input for a flash calculation with all parameters as typed fields. Supports
deserialization from JSON via the fromJson(JsonObject) factory, or direct construction
via the builder pattern.
JSON format:
{ "model": "SRK", "temperature": {"value": 25.0, "unit": "C"}, "pressure": {"value":
50.0, "unit": "bara"}, "flashType": "TP", "components": {"methane": 0.85, "ethane": 0.10,
"propane": 0.05}, "mixingRule": "classic" } - Author:
- Even Solbraa @version 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ValueWithUnitprivate ValueWithUnitprivate Stringprivate Stringprivate Stringprivate ValueWithUnitprivate ValueWithUnitprivate ValueWithUnit -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddComponent(String name, double moleFraction) Adds a component with mole fraction.static FlashRequestfromJson(com.google.gson.JsonObject root) Parses a FlashRequest from a parsed JsonObject.Gets the component map (name to mole fraction).Gets the enthalpy specification (for PH flash).Gets the entropy specification (for PS flash).Gets the flash type.Gets the mixing rule.getModel()Gets the thermodynamic model name.Gets the pressure specification.Gets the temperature specification.Gets the volume specification (for TV flash).setComponents(Map<String, Double> components) Sets the component map.setEnthalpy(ValueWithUnit enthalpy) Sets the enthalpy specification.setEntropy(ValueWithUnit entropy) Sets the entropy specification.setFlashType(String flashType) Sets the flash type.setMixingRule(String mixingRule) Sets the mixing rule.Sets the thermodynamic model name.setPressure(ValueWithUnit pressure) Sets the pressure specification.setTemperature(ValueWithUnit temperature) Sets the temperature specification.setVolume(ValueWithUnit volume) Sets the volume specification.
-
Field Details
-
model
-
temperature
-
pressure
-
flashType
-
components
-
mixingRule
-
enthalpy
-
entropy
-
volume
-
-
Constructor Details
-
FlashRequest
public FlashRequest()Default constructor. Creates a request with default values (SRK, TP, 15C, 1 atm, classic).
-
-
Method Details
-
fromJson
Parses a FlashRequest from a parsed JsonObject.- Parameters:
root- the parsed JSON- Returns:
- the populated FlashRequest
-
getModel
Gets the thermodynamic model name.- Returns:
- the model (e.g., "SRK", "PR", "CPA")
-
setModel
Sets the thermodynamic model name.- Parameters:
model- the model name- Returns:
- this request for chaining
-
getTemperature
Gets the temperature specification.- Returns:
- the temperature with unit
-
setTemperature
Sets the temperature specification.- Parameters:
temperature- the temperature with unit- Returns:
- this request for chaining
-
getPressure
-
setPressure
Sets the pressure specification.- Parameters:
pressure- the pressure with unit- Returns:
- this request for chaining
-
getFlashType
-
setFlashType
Sets the flash type.- Parameters:
flashType- the flash type- Returns:
- this request for chaining
-
getComponents
-
setComponents
Sets the component map.- Parameters:
components- the component map- Returns:
- this request for chaining
-
addComponent
Adds a component with mole fraction.- Parameters:
name- the component namemoleFraction- the mole fraction- Returns:
- this request for chaining
-
getMixingRule
-
setMixingRule
Sets the mixing rule.- Parameters:
mixingRule- the mixing rule- Returns:
- this request for chaining
-
getEnthalpy
Gets the enthalpy specification (for PH flash).- Returns:
- the enthalpy with unit, or null if not set
-
setEnthalpy
Sets the enthalpy specification.- Parameters:
enthalpy- the enthalpy with unit- Returns:
- this request for chaining
-
getEntropy
Gets the entropy specification (for PS flash).- Returns:
- the entropy with unit, or null if not set
-
setEntropy
Sets the entropy specification.- Parameters:
entropy- the entropy with unit- Returns:
- this request for chaining
-
getVolume
Gets the volume specification (for TV flash).- Returns:
- the volume with unit, or null if not set
-
setVolume
Sets the volume specification.- Parameters:
volume- the volume with unit- Returns:
- this request for chaining
-