Class HeatMaterialBalance
java.lang.Object
neqsim.process.util.report.HeatMaterialBalance
- All Implemented Interfaces:
Serializable
Generates industry-standard Heat and Material Balance (HMB) reports from a ProcessSystem.
Produces two main sections:
- Stream Table: All stream conditions (T, P, flow, composition) in a tabular format
- Equipment Summary: Duties, power, pressure changes for all equipment
Usage:
ProcessSystem process = ...; process.run(); HeatMaterialBalance hmb = new HeatMaterialBalance(process); String json = hmb.toJson(); String csv = hmb.streamTableToCSV();
- Version:
- 1.0
- Author:
- Even Solbraa
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringUnit for mass flow display.private static final org.apache.logging.log4j.LoggerLogger object for class.private StringUnit for pressure display.private final ProcessSystemThe process system to report on.private static final longSerialization version.private StringUnit for temperature display. -
Constructor Summary
ConstructorsConstructorDescriptionHeatMaterialBalance(ProcessSystem process) Creates an HMB report generator for the given process. -
Method Summary
Modifier and TypeMethodDescriptionCollects all unique streams from the process system.Creates an equipment summary for one unit operation.getStreamData(StreamInterface stream) Creates a stream data map for one stream.private static doubleround(double value, int places) Rounds a double to the specified number of decimal places.setFlowUnit(String unit) Sets the mass flow unit for display.setPressureUnit(String unit) Sets the pressure unit for display.setTemperatureUnit(String unit) Sets the temperature unit for display.Generates a CSV-formatted stream table.toJson()Generates the complete HMB report as a JSON string.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version.- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger object for class. -
process
The process system to report on. -
temperatureUnit
Unit for temperature display. -
pressureUnit
Unit for pressure display. -
flowUnit
Unit for mass flow display.
-
-
Constructor Details
-
HeatMaterialBalance
Creates an HMB report generator for the given process.- Parameters:
process- the process system (must have been run)
-
-
Method Details
-
setTemperatureUnit
Sets the temperature unit for display.- Parameters:
unit- temperature unit (e.g., "C", "K", "F")- Returns:
- this for chaining
-
setPressureUnit
Sets the pressure unit for display.- Parameters:
unit- pressure unit (e.g., "bara", "barg", "psi", "kPa")- Returns:
- this for chaining
-
setFlowUnit
Sets the mass flow unit for display.- Parameters:
unit- flow unit (e.g., "kg/hr", "kg/sec", "lb/hr")- Returns:
- this for chaining
-
getAllStreams
Collects all unique streams from the process system.- Returns:
- ordered list of all streams
-
getStreamData
Creates a stream data map for one stream.- Parameters:
stream- the stream to extract data from- Returns:
- map of property name to value
-
getEquipmentData
Creates an equipment summary for one unit operation.- Parameters:
unit- the equipment to summarize- Returns:
- map of property name to value, or null if no relevant data
-
toJson
Generates the complete HMB report as a JSON string.- Returns:
- JSON representation of the HMB
-
streamTableToCSV
Generates a CSV-formatted stream table.Columns: Stream Name, Temperature (C), Pressure (bara), Mass Flow (unit), Molar Mass, Density, Vapour Fraction, then one column per component.
- Returns:
- CSV string of the stream table
-
round
private static double round(double value, int places) Rounds a double to the specified number of decimal places.- Parameters:
value- the value to roundplaces- number of decimal places- Returns:
- rounded value
-