Class Tank
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, SimulationInterface, NamedInterface
Tank class.
- Version:
- $Id: $Id
- Author:
- Even Solbraa
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate double(package private) Stream(package private) SystemInterface(package private) double(package private) double(package private) Mixerprivate doubleprivate double(package private) Stream(package private) SystemInterface(package private) double(package private) static org.apache.logging.log4j.LoggerLogger object for class.private TankMechanicalDesignMechanical design for the tank.private int(package private) double(package private) doubleprivate static final longSerialization version UID.(package private) double(package private) double(package private) double(package private) double(package private) SystemInterface(package private) SystemInterfaceprivate double(package private) SystemInterfaceFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for Tank.Tank(String name, StreamInterface inletStream) Constructor for Tank. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStream(StreamInterface newStream) addStream.voiddisplayResult.doubleGetter for the fieldefficiency.getGas()getGas.doubleGetter for the fieldgasCarryunderFraction.Getter for the fieldgasOutStream.getLiquid.doubleGetter for the fieldliquidCarryoverFraction.doubleGetter for the fieldliquidLevel.Getter for the fieldliquidOutStream.doublegetMassBalance(String unit) getMassBalance.Get amechanicalDesignfor the equipment.doubleGetter for the fieldvolume.voidInitialize ainitMechanicalDesignfor the equipment.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunTransient(double dt, UUID id) runTransientvoidsetEfficiency(double efficiency) Setter for the fieldefficiency.voidsetGasCarryunderFraction(double gasCarryunderFraction) Setter for the fieldgasCarryunderFraction.voidsetInletStream(StreamInterface inletStream) setInletStream.voidsetLiquidCarryoverFraction(double liquidCarryoverFraction) Setter for the fieldliquidCarryoverFraction.voidsetOutComposition(SystemInterface thermoSystem) setOutComposition.voidsetTempPres(double temp, double pres) setTempPres.voidsetVolume(double volume) Setter for the fieldvolume.toJson()Serializes the Process Equipment along with its state to a JSON string.toJson(ReportConfig cfg) Serializes the Process Equipment with configurable level of detail.Validate the process equipment before execution.Methods inherited from class ProcessEquipmentBaseClass
copy, equals, getConditionAnalysisMessage, getController, getEnergyStream, getEntropyProduction, getExergyChange, getMassBalance, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, hashCode, isActive, isActive, isSetEnergyStream, reportResults, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFlowValveController, setMinimumFlow, setPressure, setRegulatorOutSignal, setSpecification, setTemperature, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
getCapacityDuty, getCapacityMax, getExergyChange, getFluid, getRestCapacity, needRecalculationMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
mechanicalDesign
Mechanical design for the tank. -
thermoSystem
SystemInterface thermoSystem -
gasSystem
SystemInterface gasSystem -
waterSystem
SystemInterface waterSystem -
liquidSystem
SystemInterface liquidSystem -
thermoSystemCloned
SystemInterface thermoSystemCloned -
gasOutStream
Stream gasOutStream -
liquidOutStream
Stream liquidOutStream -
numberOfInputStreams
private int numberOfInputStreams -
inletStreamMixer
Mixer inletStreamMixer -
efficiency
private double efficiency -
liquidCarryoverFraction
private double liquidCarryoverFraction -
gasCarryunderFraction
private double gasCarryunderFraction -
volume
private double volume -
steelWallTemperature
double steelWallTemperature -
steelWallMass
double steelWallMass -
steelWallArea
double steelWallArea -
heatTransferNumber
double heatTransferNumber -
steelCp
double steelCp -
separatorLength
double separatorLength -
separatorDiameter
double separatorDiameter -
liquidVolume
double liquidVolume -
gasVolume
double gasVolume -
liquidLevel
private double liquidLevel
-
-
Constructor Details
-
Tank
-
Tank
Constructor for Tank.
- Parameters:
name- aStringobjectinletStream- aStreamInterfaceobject
-
-
Method Details
-
getMechanicalDesign
Get a
mechanicalDesignfor the equipment.- Specified by:
getMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
getMechanicalDesignin classProcessEquipmentBaseClass- Returns:
- a
MechanicalDesignobject
-
initMechanicalDesign
public void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment.- Specified by:
initMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
initMechanicalDesignin classProcessEquipmentBaseClass
-
setInletStream
setInletStream.
- Parameters:
inletStream- aStreamInterfaceobject
-
addStream
addStream.
- Parameters:
newStream- aStreamInterfaceobject
-
getLiquidOutStream
Getter for the field
liquidOutStream.- Returns:
- a
Streamobject
-
getGasOutStream
Getter for the field
gasOutStream.- Returns:
- a
Streamobject
-
getGas
-
getLiquid
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
Calculates the following properties:
- steelWallTemperature
- gasOutStream
- liquidOutStream
thermoSystemincluding properties- liquidLevel
- liquidVolume
- gasVolume
- Parameters:
id- UUID
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classProcessEquipmentBaseClass
-
runTransient
runTransient
This method calculates thermodynamic and unit operations using difference equations if available and calculateSteadyState is true. Use setCalculateSteadyState to set the parameter. Sets calc identifier UUID.- Parameters:
dt- Delta time [s]id- Calculation identifier
-
setOutComposition
setOutComposition.
- Parameters:
thermoSystem- aSystemInterfaceobject
-
setTempPres
public void setTempPres(double temp, double pres) setTempPres.
- Parameters:
temp- a doublepres- a double
-
getEfficiency
public double getEfficiency()Getter for the field
efficiency.- Returns:
- a double
-
setEfficiency
public void setEfficiency(double efficiency) Setter for the field
efficiency.- Parameters:
efficiency- a double
-
getLiquidCarryoverFraction
public double getLiquidCarryoverFraction()Getter for the field
liquidCarryoverFraction.- Returns:
- a double
-
setLiquidCarryoverFraction
public void setLiquidCarryoverFraction(double liquidCarryoverFraction) Setter for the field
liquidCarryoverFraction.- Parameters:
liquidCarryoverFraction- a double
-
getGasCarryunderFraction
public double getGasCarryunderFraction()Getter for the field
gasCarryunderFraction.- Returns:
- a double
-
setGasCarryunderFraction
public void setGasCarryunderFraction(double gasCarryunderFraction) Setter for the field
gasCarryunderFraction.- Parameters:
gasCarryunderFraction- a double
-
getLiquidLevel
public double getLiquidLevel()Getter for the field
liquidLevel.- Returns:
- a double
-
getVolume
public double getVolume()Getter for the field
volume.- Returns:
- a double
-
setVolume
public void setVolume(double volume) Setter for the field
volume.- Parameters:
volume- a double
-
getMassBalance
getMassBalance.
- Specified by:
getMassBalancein interfaceProcessEquipmentInterface- Overrides:
getMassBalancein classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classProcessEquipmentBaseClass- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classProcessEquipmentBaseClass- Parameters:
cfg- report configuration- Returns:
- json string
-
validateSetup
Validate the process equipment before execution.Checks for common setup errors:
- Equipment has a valid name
- Input streams connected
- Operating parameters in valid ranges
Validates the tank setup before execution. Checks that:
- Equipment has a valid name
- At least one inlet stream is connected
- Tank volume is positive
- Liquid level is within valid range
- Returns:
- validation result with errors and warnings
-