Class ProcessValidator
java.lang.Object
neqsim.process.util.report.ProcessValidator
- All Implemented Interfaces:
Serializable
Validates a process system for mass balance closure, energy balance closure, and operating limit
violations.
Scans all equipment in a ProcessSystem and checks:
- Mass balance closure around each equipment (inlet vs outlet mass flow)
- Extreme temperatures or pressures that may indicate errors
- Negative flow rates
- Streams with zero flow
- Overall process mass balance
Usage example:
ProcessValidator validator = new ProcessValidator(process);
validator.setMassBalanceTolerance(0.001); // 0.1%
validator.validate();
boolean passed = validator.isValid();
List<ValidationIssue> issues = validator.getIssues();
String json = validator.toJson();
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSeverity level for a validation issue.static classRepresents a single validation issue found during process validation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ProcessValidator.ValidationIssue> (package private) static org.apache.logging.log4j.LoggerLogger object for class.private doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate final ProcessSystemprivate static final longprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionProcessValidator(ProcessSystem processSystem) Creates a process validator for the given process system. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidChecks mass balance around equipment with multiple inlets/outlets.private voidcheckStream(StreamInterface stream) Checks a single stream for issues.private voidChecks all streams for extreme conditions.intGets the number of errors found.Gets only error-level issues.intGets the total number of issues found.Gets all validation issues.intGets the number of warnings found.booleanisValid()Checks if the process passed all validation checks (no errors).voidsetMassBalanceTolerance(double tolerance) Sets the mass balance closure tolerance.voidsetPressureLimits(double min, double max) Sets acceptable pressure range.voidsetTemperatureLimits(double min, double max) Sets acceptable temperature range.toJson()Returns the validation results as a JSON string.voidvalidate()Runs the validation checks.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
processSystem
-
massBalanceTolerance
private double massBalanceTolerance -
minPressure
private double minPressure -
maxPressure
private double maxPressure -
minTemperature
private double minTemperature -
maxTemperature
private double maxTemperature -
issues
-
validated
private boolean validated
-
-
Constructor Details
-
ProcessValidator
Creates a process validator for the given process system.- Parameters:
processSystem- the process system to validate
-
-
Method Details
-
setMassBalanceTolerance
public void setMassBalanceTolerance(double tolerance) Sets the mass balance closure tolerance.- Parameters:
tolerance- relative tolerance (e.g. 0.01 for 1%)
-
setPressureLimits
public void setPressureLimits(double min, double max) Sets acceptable pressure range.- Parameters:
min- minimum pressure in baramax- maximum pressure in bara
-
setTemperatureLimits
public void setTemperatureLimits(double min, double max) Sets acceptable temperature range.- Parameters:
min- minimum temperature in Kmax- maximum temperature in K
-
validate
public void validate()Runs the validation checks. -
checkStreamConditions
private void checkStreamConditions()Checks all streams for extreme conditions. -
checkStream
Checks a single stream for issues.- Parameters:
stream- the stream to check
-
checkMassBalance
private void checkMassBalance()Checks mass balance around equipment with multiple inlets/outlets. -
isValid
public boolean isValid()Checks if the process passed all validation checks (no errors).- Returns:
- true if no ERROR-level issues were found
-
getIssueCount
public int getIssueCount()Gets the total number of issues found.- Returns:
- issue count
-
getErrorCount
public int getErrorCount()Gets the number of errors found.- Returns:
- error count
-
getWarningCount
public int getWarningCount()Gets the number of warnings found.- Returns:
- warning count
-
getIssues
Gets all validation issues.- Returns:
- unmodifiable list of issues
-
getErrors
Gets only error-level issues.- Returns:
- list of errors
-
toJson
Returns the validation results as a JSON string.- Returns:
- JSON representation of validation results
-