Class RateBasedPackedColumn
java.lang.Object
neqsim.util.NamedBaseClass
neqsim.process.SimulationBaseClass
neqsim.process.equipment.ProcessEquipmentBaseClass
neqsim.process.equipment.distillation.RateBasedPackedColumn
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, ProcessElementInterface, SimulationInterface, NamedInterface
Counter-current rate-based packed column for non-reactive absorption and stripping.
The column is divided into axial segments. In each segment, NeqSim phase-equilibrium calculations
provide the interfacial equilibrium driving force, PhysicalProperties provides effective
diffusivities, and PackingHydraulicsCalculator provides packing hydraulics, wetted area,
and film mass-transfer coefficients. Component transfer is bidirectional, so the same equipment
can model gas-to-liquid absorption and liquid-to-gas stripping.
- Version:
- 1.0
- Author:
- NeqSim
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classJSON report DTO.private static classInternal residual evaluation container for the equation-oriented column solver.static enumColumn-level profile solver options.private static classInternal column state reconstructed from equation-oriented unknowns.private static classInternal counter-current solution container.static enumFilm-model options for component transfer across the gas-liquid interface.static enumHeat-transfer options for gas-liquid heat exchange in the packed section.private static classInterface equilibrium data for one segment.static enumMass-transfer correlation options for the packed-column film coefficients.private static classInternal segment computation container.private static classInternal residual evaluation container for the simultaneous segment solver.static classSegment result data for a rate-based packed column.static enumSegment-level coupling options.private static classInternal sparse Jacobian assembled by the equation-oriented column solver.private static classInternal transport-property snapshot. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleColumn internal diameter in metres.private intNumber of homotopy continuation steps for the equation-oriented solver.private doubleNormalized residual tolerance for the column-wide equation-oriented solver.Column-level profile solver used for counter-current coupling.Last calculated component transfer totals, positive for gas-to-liquid transfer.private doubleOutlet convergence tolerance in mol/s.private static final doubleDefault gas diffusivity fallback in square metres per second.private static final doubleDefault gas heat capacity in joules per kilogram kelvin.private static final doubleDefault gas thermal conductivity in watts per metre kelvin.private static final doubleDefault liquid diffusivity fallback in square metres per second.private static final doubleDefault liquid heat capacity in joules per kilogram kelvin.private static final doubleDefault liquid thermal conductivity in watts per metre kelvin.private static final doubleDefault liquid surface tension in newtons per metre.private RateBasedPackedColumn.FilmModelMulticomponent film model used for component-transfer calculations.private StreamInterfaceGas inlet stream entering the bottom of the packed section.private StreamInterfaceGas outlet stream leaving the top of the packed section.private doubleGlobal correction factor for interphase heat-transfer coefficients.Heat-transfer model used for interphase heat exchange.private doubleLast maximum column energy-balance residual in W-equivalent stream basis.private intLast equation-oriented Newton iteration count.private doubleLast equation-oriented residual norm.private doubleLast convergence residual in mol/s.private doubleLast maximum gas component-balance residual in mol/s.private intNumber of iterations used by the last run.private doubleLast maximum liquid component-balance residual in mol/s.private StreamInterfaceLiquid inlet stream entering the top of the packed section.private StreamInterfaceLiquid outlet stream leaving the bottom of the packed section.private doubleGlobal correction factor for film mass-transfer coefficients.Mass-transfer correlation used by the segment calculations.private intMaximum Newton iterations for the column-wide equation-oriented solver.private doubleMaximum fraction of the available thermal approach transferred in one segment.private intMaximum profile iterations for counter-current convergence.private intMaximum Newton iterations for the simultaneous segment residual solve.private doubleMaximum fraction of available component moles transferred in one segment.private static final doubleMinimum finite gas diffusivity used when a physical-property model is unavailable.private static final doubleMinimum finite liquid diffusivity used when a physical-property model is unavailable.private intNumber of axial calculation segments.private doublePacked height in metres.private PackingSpecificationPacking specification used in all segments.private doubleNormalized residual tolerance for the simultaneous segment solver.private final List<RateBasedPackedColumn.SegmentResult> Last calculated segment results from bottom to top.Segment solver used for heat, mass, and interface-equilibrium coupling.private static final longSerialization version UID.private doubleTotal absolute molar transfer in the last converged profile.Optional transfer component whitelist.Fields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionRateBasedPackedColumn(String name) Create a rate-based packed column.RateBasedPackedColumn(String name, StreamInterface gasInStream, StreamInterface liquidInStream) Create a rate-based packed column with inlet streams. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidAccept a profile solution as the last calculated result.private voidaddComponentDelta(SystemInterface system, String component, double deltaMoles) Add a bounded component delta to a system.voidaddGasInStream(StreamInterface gasInStream) Add the gas inlet stream.voidaddLiquidInStream(StreamInterface liquidInStream) Add the liquid or solvent inlet stream.voidaddSolventInStream(StreamInterface solventInStream) Add the solvent inlet stream.private voidaddSystemComponents(SystemInterface target, SystemInterface source) Add all positive-mole components from a source system to a target system.private double[]applyColumnResidualStep(double[] unknowns, Jama.Matrix step, double damping, SystemInterface gasIn, SystemInterface liquidIn, List<String> components) Apply a damped column residual step and clamp to physical bounds.private voidapplyComponentTransfer(String component, double transfer, SystemInterface gas, SystemInterface liquid) Apply a component transfer to gas and liquid systems.private voidapplyEnthalpyTarget(SystemInterface system, double targetEnthalpy) Apply a total enthalpy target by pressure-enthalpy flash.private doubleapplyInterphaseHeatTransfer(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot) Apply interphase heat transfer to gas and liquid segment systems.private double[]applyResidualStep(double[] unknowns, Jama.Matrix step, double damping, SystemInterface gas, SystemInterface liquid, List<String> components) Apply a damped residual step and clamp the unknowns to physical bounds.private doubleaverageDiffusivity(PhaseInterface phase, boolean gasPhase) Estimate average diffusivity for a phase.private doublebinaryDiffusivity(PhaseInterface phase, int firstComponent, int secondComponent, double referenceDiffusivity, boolean gasPhase) Get a binary diffusion coefficient from NeqSim physical properties.private doublebinaryFilmCoefficient(PhaseInterface phase, int firstComponent, int secondComponent, double baseCoefficient, double referenceDiffusivity, boolean gasPhase) Calculate a binary film coefficient by diffusivity scaling.buildColumnState(SystemInterface gasIn, SystemInterface liquidIn, List<String> components, double[] unknowns) Build gas and liquid segment states from column-wide flux and temperature unknowns.private Jama.MatrixcalculateColumnResidualStep(SystemInterface gasIn, SystemInterface liquidIn, List<String> components, double[] unknowns, RateBasedPackedColumn.ColumnResidualEvaluation evaluation, double homotopyFactor) Calculate one sparse-pattern Newton step for the column residual equations.private doublecalculateComponentTransfer(String component, SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, RateBasedPackedColumn.InterfaceEquilibrium interfaceEquilibrium) Calculate component transfer rate for a component in one segment.private doublecalculateFilmCoefficient(PhaseInterface phase, String component, double baseCoefficient, double referenceDiffusivity, boolean gasPhase) Calculate the active film coefficient for one component.calculateInterfaceEquilibrium(SystemInterface gas, SystemInterface liquid, double interfaceTemperatureK) Calculate interface equilibrium at a specified temperature.calculateInterfaceEquilibrium(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot) Calculate interface equilibrium compositions for the mixed segment fluids.private doublecalculateInterfaceTemperature(double gasTemperature, double liquidTemperature, double gasCoefficient, double liquidCoefficient) Calculate an interfacial temperature estimate from heat-transfer resistances.private doublecalculateOutletResidual(SystemInterface previousGas, SystemInterface currentGas, SystemInterface previousLiquid, SystemInterface currentLiquid) Calculate residual between previous and current outlets.private Jama.MatrixcalculateResidualStep(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, List<String> components, double[] unknowns, RateBasedPackedColumn.SegmentResidualEvaluation evaluation) Calculate a Newton step for normalized segment residuals.calculateSegment(int segment, SystemInterface gasIn, SystemInterface liquidIn) Calculate one rate-based segment.calculateSimultaneousResidualSegment(int segment, SystemInterface gas, SystemInterface liquid, double segmentHeight) Calculate one segment using simultaneous flux and interfacial energy residuals.calculateTransportSnapshot(SystemInterface gas, SystemInterface liquid, double segmentHeight) Calculate transport properties and packing coefficients for one segment.private doublecalculateUnboundedComponentTransfer(String component, SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, RateBasedPackedColumn.InterfaceEquilibrium interfaceEquilibrium) Calculate the unbounded Maxwell-Stefan film transfer rate for one component.private doublecalculateVolumetricHeatTransferCoefficient(double massTransferCoefficient, double density, double heatCapacity, double viscosity, double diffusivity, double thermalConductivity) Calculate a volumetric heat-transfer coefficient from the Chilton-Colburn analogy.private doubleclamp(double value, double min, double max) Clamp a value between lower and upper bounds.private voidclampColumnTemperatureUnknown(double[] unknowns, int index, SystemInterface gasIn, SystemInterface liquidIn) Clamp one column temperature unknown.private double[]clampColumnUnknowns(double[] unknowns, SystemInterface gasIn, SystemInterface liquidIn, List<String> components) Clamp column unknowns to inventory and temperature limits.private double[]clampResidualUnknowns(double[] unknowns, SystemInterface gas, SystemInterface liquid, List<String> components) Clamp residual unknowns to available component inventory and temperature bounds.private intcolumnFluxIndex(int segment, int componentIndex, List<String> components) Get the unknown index for a segment component flux.private intcolumnGasOutletTemperatureIndex(int segment, List<String> components) Get the unknown index for a segment gas outlet temperature.private intcolumnInterfaceTemperatureIndex(int segment, List<String> components) Get the unknown index for a segment interface temperature.private intcolumnLiquidOutletTemperatureIndex(int segment, List<String> components) Get the unknown index for a segment liquid outlet temperature.private doublecolumnResidualVariableStep(double[] unknowns, int variable, int componentCount) Calculate finite-difference step size for a column unknown.private intcolumnUnknownBlockSize(List<String> components) Get the column unknown block size per segment.private doublecombineFilmFluxes(double gasFluxDensity, double liquidFluxDensity) Combine gas- and liquid-side volumetric flux densities with a rate-limiting harmonic mean.private doublecombineHeatTransferCoefficients(double gasCoefficient, double liquidCoefficient) Combine gas and liquid heat-transfer coefficients as series resistances.private intcomponentIndex(PhaseInterface phase, String component) Find a component index in a phase.componentInventoryMap(SystemInterface system, List<String> components) Build a component inventory map for active components.private doublecomponentMolarEnthalpy(PhaseInterface phase, String component, double temperature, double fallback) Get component molar enthalpy at an interface temperature.private doublecomponentMoles(SystemInterface system, String component) Get total component moles in a system.private double[]createColumnUnknowns(RateBasedPackedColumn.CounterCurrentSolution seed, List<String> components) Create a column-wide unknown vector from an existing profile solution.private double[]createInitialResidualUnknowns(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, List<String> components) Create initial guesses for component transfers and interface temperature.voiddisplayResult.private doubleestimateSurfaceTension(SystemInterface gas, SystemInterface liquid) Estimate surface tension between the segment gas and liquid phases.private doubleestimateTemperatureForTargetEnthalpy(SystemInterface system, double targetEnthalpy) Estimate a temperature for an enthalpy target if PH flash fails.evaluateColumnResidual(SystemInterface gasIn, SystemInterface liquidIn, List<String> components, double[] unknowns, double homotopyFactor, int iterations) Evaluate the full column residual vector for the equation-oriented solver.evaluateSegmentResidual(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, List<String> components, double[] unknowns, int iterations) Evaluate normalized residuals for the simultaneous segment equations.private doublefiniteNonNegative(double value, double fallback) Replace invalid or negative values with a fallback.private doublefinitePositive(double value, double fallback) Replace invalid values with a fallback.private voidflashAndInitialize(SystemInterface system) Flash and initialize a thermodynamic system including physical properties.doubleGet the column internal diameter.intGet the number of homotopy continuation steps for the equation-oriented solver.doubleGet the normalized residual tolerance for the column-wide equation-oriented solver.Get the active column-level profile solver.getComponentNames(SystemInterface system) Get component names from a thermodynamic system.Get the last calculated component transfer totals.doubleGet the convergence tolerance.Get the active gas-liquid film model.Get the gas inlet stream.Get the gas outlet stream.private PhaseInterfacegetGasPhase(SystemInterface system) Get the gas phase from a system.doubleGet the global interphase heat-transfer correction factor.Get the active interphase heat-transfer model.Returns all inlet streams connected to this equipment.doubleGet the maximum column energy-balance residual from the last equation-oriented solve.intGet the last column-wide Newton iteration count.doubleGet the last column-wide equation-oriented residual norm.doubleGet the last convergence residual.doubleGet the maximum gas component-balance residual from the last equation-oriented solve.intGet the last profile iteration count.doubleGet the maximum liquid component-balance residual from the last equation-oriented solve.Get the liquid inlet stream.Get the liquid outlet stream.private PhaseInterfacegetLiquidPhase(SystemInterface system) Get the liquid phase from a system.private intgetLiquidPhaseNumber(SystemInterface system) Get the first liquid-like phase number in a system.doubleGet the global mass-transfer correction factor.Get the mass-transfer correlation.intGet the maximum Newton iterations for the column-wide equation-oriented solver.doubleGet the maximum thermal approach transferred in one segment.intGet the maximum number of profile iterations.intGet the maximum iterations for the simultaneous segment residual solver.doubleGet the maximum component transfer fraction per segment.intGet the number of axial calculation segments.Returns all outlet streams produced by this equipment.doubleGet the packed height.Get the active packing specification.doubleGet the normalized residual tolerance for the simultaneous segment solver.Get the last calculated segment profile.Get the active segment solver.getThermoSystem.doubleGet total absolute molar transfer in the last profile.getTransferComponentList(SystemInterface gas, SystemInterface liquid) Get the active transfer component list.Get explicitly configured transfer components.private doubleheatCapacityMass(PhaseInterface phase, double fallback) Get heat capacity on a mass basis.private doubleheatCapacityRate(PhaseInterface phase, double heatCapacity) Calculate phase heat-capacity rate.private doubleheatResidualScale(double gasSensibleHeat, double liquidSensibleHeat, double gasMassEnthalpy, double liquidMassEnthalpy) Calculate heat residual scaling.private List<SystemInterface> initializeLiquidProfile(SystemInterface liquidIn) Initialize all liquid segment inlets from the fresh liquid inlet.private booleanisFinitePositive(double value) Check whether a double is positive and finite.private doublelimitTransfer(String component, double proposedTransfer, SystemInterface gas, SystemInterface liquid) Limit transfer to available component inventory and configured stability fraction.private doublemaxwellStefanFilmCoefficient(PhaseInterface phase, String component, double baseCoefficient, double referenceDiffusivity, boolean gasPhase) Calculate a Maxwell-Stefan matrix-corrected film coefficient for one component.private doublemixtureDiffusivityForComponent(PhaseInterface phase, int componentIndex, double referenceDiffusivity, boolean gasPhase) Calculate a mixture diffusivity for one component.private doublemolarConcentration(PhaseInterface phase) Calculate phase molar concentration.private doublemoleFraction(PhaseInterface phase, int componentIndex) Get a component mole fraction by component index.private doublemoleFraction(PhaseInterface phase, String component) Get a component mole fraction in a phase.private doublephaseMolarEnthalpy(PhaseInterface phase) Get phase molar enthalpy.private voidRefresh database and mixing-rule matrices after adding components to a cloned system.private voidReset column-wide residual diagnostics for non-equation-oriented profile solves.private doubleresidualNorm(double[] residuals) Calculate infinity norm of normalized residuals.private doubleresidualVariableStep(double[] unknowns, int variable, int componentCount) Calculate finite-difference step size for a residual unknown.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.runOneProfileIteration(SystemInterface gasIn, SystemInterface liquidIn, List<SystemInterface> liquidEntering) Run one bottom-to-top gas pass against the current counter-current liquid profile.private doublescaleFilmCoefficient(double baseCoefficient, double diffusivity, double referenceDiffusivity) Scale a film coefficient by diffusivity relative to a reference value.voidsetColumnDiameter(double columnDiameter) Set the column internal diameter.voidsetColumnHomotopySteps(int columnHomotopySteps) Set the number of homotopy continuation steps for the equation-oriented solver.voidsetColumnResidualTolerance(double columnResidualTolerance) Set the normalized residual tolerance for the column-wide equation-oriented solver.voidsetColumnSolver(RateBasedPackedColumn.ColumnSolver columnSolver) Set the column-level profile solver.voidsetConvergenceTolerance(double convergenceTolerance) Set the convergence tolerance.voidsetFilmModel(RateBasedPackedColumn.FilmModel filmModel) Set the gas-liquid film model used for component transfer.voidsetGasInStream(StreamInterface gasInStream) Set the gas inlet stream.voidsetHeatTransferCorrectionFactor(double correctionFactor) Set the global interphase heat-transfer correction factor.voidsetHeatTransferModel(RateBasedPackedColumn.HeatTransferModel heatTransferModel) Set the interphase heat-transfer model.voidsetLiquidInStream(StreamInterface liquidInStream) Set the liquid inlet stream.voidsetMassTransferCorrectionFactor(double correctionFactor) Set a global mass-transfer correction factor.voidsetMassTransferCorrelation(RateBasedPackedColumn.MassTransferCorrelation massTransferCorrelation) Set the mass-transfer correlation.voidsetMaxColumnResidualIterations(int maxColumnResidualIterations) Set the maximum Newton iterations for the column-wide equation-oriented solver.voidsetMaxHeatTransferFractionPerSegment(double fraction) Set the maximum thermal approach transferred in one segment.voidsetMaxIterations(int maxIterations) Set the maximum number of profile iterations.voidsetMaxSegmentResidualIterations(int maxSegmentResidualIterations) Set the maximum iterations for the simultaneous segment residual solver.voidsetMaxTransferFractionPerSegment(double fraction) Set the maximum component transfer fraction per segment.voidsetNumberOfSegments(int numberOfSegments) Set the number of axial calculation segments.voidsetPackedHeight(double packedHeight) Set the packed height.voidsetPackingSpecification(PackingSpecification packingSpecification) Set the packing specification directly.voidsetPackingType(String packingName) Set the packing by name or alias.voidsetSegmentResidualTolerance(double segmentResidualTolerance) Set the normalized residual tolerance for the simultaneous segment solver.voidsetSegmentSolver(RateBasedPackedColumn.SegmentSolver segmentSolver) Set the segment solver used for heat and mass coupling.voidsetTransferComponents(String... componentNames) Set transfer components explicitly.solveColumnResiduals(SystemInterface gasIn, SystemInterface liquidIn, List<String> components, double[] initialUnknowns, double homotopyFactor) Solve the column-wide residual equations at one homotopy continuation factor.solveCounterCurrentProfile(SystemInterface gasIn, SystemInterface liquidIn) Solve the counter-current segment profile by fixed-point iteration.solveEquationOrientedProfile(SystemInterface gasIn, SystemInterface liquidIn) Solve the full packed section with a column-wide equation-oriented residual system.solveFixedPointProfile(SystemInterface gasIn, SystemInterface liquidIn) Solve the counter-current profile by fixed-point liquid profile iteration.solveSegmentResiduals(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, List<String> components) Solve the simultaneous residual equations for a segment.private doublethermalConductivity(PhaseInterface phase, double fallback) Get phase thermal conductivity.toJson()Convert the last run results to JSON.private double[]toPrimitiveArray(List<Double> values) Convert a boxed residual list to a primitive array.private doubletransferResidualScale(String component, double predictedTransfer, SystemInterface gas, SystemInterface liquid) Calculate the transfer residual scaling for one component.private List<SystemInterface> updateLiquidProfile(SystemInterface liquidIn, List<SystemInterface> liquidLeaving) Shift liquid leaving one segment into the segment below for the next iteration.private voidvalidateNonNegative(double value, String name) Validate a non-negative finite value.private voidvalidatePositive(double value, String name) Validate a positive finite value.private voidValidate runtime setup and throw an exception on blocking errors.Validate the process equipment before execution.Methods inherited from class ProcessEquipmentBaseClass
addCapacityConstraint, addController, copy, equals, getAvailableMargin, getAvailableMarginPercent, getBottleneckConstraint, getCapacityConstraints, getConditionAnalysisMessage, getConstraintEvaluationReport, getController, getController, getControllers, getEffectiveCapacityFactor, getEnergyStream, getEntropyProduction, getExergyChange, getFailureMode, getMassBalance, getMassBalance, getMaxUtilization, getMaxUtilizationPercent, getMechanicalDesign, getMinimumFlow, getPressure, getPressure, getProperty, getReferenceDesignation, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getUtilizationSummary, hashCode, initElectricalDesign, initializeDefaultConstraints, initInstrumentDesign, initMechanicalDesign, isActive, isActive, isCapacityAnalysisEnabled, isCapacityExceeded, isFailed, isHardLimitExceeded, isNearCapacityLimit, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setReferenceDesignation, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solved, toJsonMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagNumber, setName, setTagNumberMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, getTagNumber, setName, setTagName, setTagNumberMethods inherited from interface ProcessEquipmentInterface
getCapacityDuty, getCapacityMax, getElectricalDesign, getEquipmentState, getExergyChange, getExergyDestruction, getExergyDestruction, getFluid, getInstrumentDesign, getOperatingEnvelopeViolation, getOutletFlowRate, getOutletPressure, getOutletTemperature, getReferenceDesignationString, getRestCapacity, getSimulationValidationErrors, isSimulationValid, isWithinOperatingEnvelope, needRecalculationMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
MIN_GAS_DIFFUSIVITY
private static final double MIN_GAS_DIFFUSIVITYMinimum finite gas diffusivity used when a physical-property model is unavailable.- See Also:
-
MIN_LIQUID_DIFFUSIVITY
private static final double MIN_LIQUID_DIFFUSIVITYMinimum finite liquid diffusivity used when a physical-property model is unavailable.- See Also:
-
DEFAULT_GAS_DIFFUSIVITY
private static final double DEFAULT_GAS_DIFFUSIVITYDefault gas diffusivity fallback in square metres per second.- See Also:
-
DEFAULT_LIQUID_DIFFUSIVITY
private static final double DEFAULT_LIQUID_DIFFUSIVITYDefault liquid diffusivity fallback in square metres per second.- See Also:
-
DEFAULT_SURFACE_TENSION
private static final double DEFAULT_SURFACE_TENSIONDefault liquid surface tension in newtons per metre.- See Also:
-
DEFAULT_GAS_THERMAL_CONDUCTIVITY
private static final double DEFAULT_GAS_THERMAL_CONDUCTIVITYDefault gas thermal conductivity in watts per metre kelvin.- See Also:
-
DEFAULT_LIQUID_THERMAL_CONDUCTIVITY
private static final double DEFAULT_LIQUID_THERMAL_CONDUCTIVITYDefault liquid thermal conductivity in watts per metre kelvin.- See Also:
-
DEFAULT_GAS_HEAT_CAPACITY
private static final double DEFAULT_GAS_HEAT_CAPACITYDefault gas heat capacity in joules per kilogram kelvin.- See Also:
-
DEFAULT_LIQUID_HEAT_CAPACITY
private static final double DEFAULT_LIQUID_HEAT_CAPACITYDefault liquid heat capacity in joules per kilogram kelvin.- See Also:
-
gasInStream
Gas inlet stream entering the bottom of the packed section. -
liquidInStream
Liquid inlet stream entering the top of the packed section. -
gasOutStream
Gas outlet stream leaving the top of the packed section. -
liquidOutStream
Liquid outlet stream leaving the bottom of the packed section. -
columnDiameter
private double columnDiameterColumn internal diameter in metres. -
packedHeight
private double packedHeightPacked height in metres. -
numberOfSegments
private int numberOfSegmentsNumber of axial calculation segments. -
maxIterations
private int maxIterationsMaximum profile iterations for counter-current convergence. -
convergenceTolerance
private double convergenceToleranceOutlet convergence tolerance in mol/s. -
maxTransferFractionPerSegment
private double maxTransferFractionPerSegmentMaximum fraction of available component moles transferred in one segment. -
massTransferCorrectionFactor
private double massTransferCorrectionFactorGlobal correction factor for film mass-transfer coefficients. -
packingSpecification
Packing specification used in all segments. -
transferComponents
-
segmentResults
Last calculated segment results from bottom to top. -
componentTransferTotals
-
lastIterationCount
private int lastIterationCountNumber of iterations used by the last run. -
lastConvergenceResidual
private double lastConvergenceResidualLast convergence residual in mol/s. -
totalAbsoluteMolarTransfer
private double totalAbsoluteMolarTransferTotal absolute molar transfer in the last converged profile. -
massTransferCorrelation
Mass-transfer correlation used by the segment calculations. -
filmModel
Multicomponent film model used for component-transfer calculations. -
heatTransferModel
Heat-transfer model used for interphase heat exchange. -
segmentSolver
Segment solver used for heat, mass, and interface-equilibrium coupling. -
columnSolver
Column-level profile solver used for counter-current coupling. -
heatTransferCorrectionFactor
private double heatTransferCorrectionFactorGlobal correction factor for interphase heat-transfer coefficients. -
maxHeatTransferFractionPerSegment
private double maxHeatTransferFractionPerSegmentMaximum fraction of the available thermal approach transferred in one segment. -
maxSegmentResidualIterations
private int maxSegmentResidualIterationsMaximum Newton iterations for the simultaneous segment residual solve. -
segmentResidualTolerance
private double segmentResidualToleranceNormalized residual tolerance for the simultaneous segment solver. -
maxColumnResidualIterations
private int maxColumnResidualIterationsMaximum Newton iterations for the column-wide equation-oriented solver. -
columnHomotopySteps
private int columnHomotopyStepsNumber of homotopy continuation steps for the equation-oriented solver. -
columnResidualTolerance
private double columnResidualToleranceNormalized residual tolerance for the column-wide equation-oriented solver. -
lastColumnResidualNorm
private double lastColumnResidualNormLast equation-oriented residual norm. -
lastColumnResidualIterations
private int lastColumnResidualIterationsLast equation-oriented Newton iteration count. -
lastGasComponentBalanceResidual
private double lastGasComponentBalanceResidualLast maximum gas component-balance residual in mol/s. -
lastLiquidComponentBalanceResidual
private double lastLiquidComponentBalanceResidualLast maximum liquid component-balance residual in mol/s. -
lastColumnEnergyBalanceResidual
private double lastColumnEnergyBalanceResidualLast maximum column energy-balance residual in W-equivalent stream basis.
-
-
Constructor Details
-
RateBasedPackedColumn
Create a rate-based packed column.- Parameters:
name- equipment name
-
RateBasedPackedColumn
public RateBasedPackedColumn(String name, StreamInterface gasInStream, StreamInterface liquidInStream) Create a rate-based packed column with inlet streams.- Parameters:
name- equipment namegasInStream- gas inlet stream entering the bottom of the packingliquidInStream- liquid inlet stream entering the top of the packing
-
-
Method Details
-
setGasInStream
Set the gas inlet stream.- Parameters:
gasInStream- gas inlet stream entering the bottom of the packing
-
addGasInStream
Add the gas inlet stream.- Parameters:
gasInStream- gas inlet stream entering the bottom of the packing
-
setLiquidInStream
Set the liquid inlet stream.- Parameters:
liquidInStream- liquid inlet stream entering the top of the packing
-
addLiquidInStream
Add the liquid or solvent inlet stream.- Parameters:
liquidInStream- liquid inlet stream entering the top of the packing
-
addSolventInStream
Add the solvent inlet stream.- Parameters:
solventInStream- solvent inlet stream entering the top of the packing
-
getGasInStream
-
getLiquidInStream
Get the liquid inlet stream.- Returns:
- liquid inlet stream
-
getGasOutStream
Get the gas outlet stream.- Returns:
- gas outlet stream leaving the top of the packing
-
getLiquidOutStream
Get the liquid outlet stream.- Returns:
- liquid outlet stream leaving the bottom of the packing
-
getInletStreams
Returns all inlet streams connected to this equipment. Subclasses override to report their specific inlets. Used by graph builders, DEXPI export, and auto-instrumentation to discover topology withoutinstanceofchecks.- Returns:
- unmodifiable list of inlet streams (empty by default)
-
getOutletStreams
Returns all outlet streams produced by this equipment. Subclasses override to report their specific outlets. Used by graph builders, DEXPI export, and auto-instrumentation to discover topology withoutinstanceofchecks.- Returns:
- unmodifiable list of outlet streams (empty by default)
-
setColumnDiameter
public void setColumnDiameter(double columnDiameter) Set the column internal diameter.- Parameters:
columnDiameter- column internal diameter in metres, must be positive- Throws:
IllegalArgumentException- if the diameter is not positive
-
getColumnDiameter
public double getColumnDiameter()Get the column internal diameter.- Returns:
- column diameter in metres
-
setPackedHeight
public void setPackedHeight(double packedHeight) Set the packed height.- Parameters:
packedHeight- packed height in metres, must be non-negative- Throws:
IllegalArgumentException- if the packed height is negative
-
getPackedHeight
public double getPackedHeight()Get the packed height.- Returns:
- packed height in metres
-
setNumberOfSegments
public void setNumberOfSegments(int numberOfSegments) Set the number of axial calculation segments.- Parameters:
numberOfSegments- number of segments, must be at least one- Throws:
IllegalArgumentException- if the segment count is below one
-
getNumberOfSegments
public int getNumberOfSegments()Get the number of axial calculation segments.- Returns:
- number of segments
-
setMaxIterations
public void setMaxIterations(int maxIterations) Set the maximum number of profile iterations.- Parameters:
maxIterations- maximum iterations, must be at least one- Throws:
IllegalArgumentException- if the iteration count is below one
-
getMaxIterations
public int getMaxIterations()Get the maximum number of profile iterations.- Returns:
- maximum iterations
-
setConvergenceTolerance
public void setConvergenceTolerance(double convergenceTolerance) Set the convergence tolerance.- Parameters:
convergenceTolerance- outlet residual tolerance in mol/s, must be positive- Throws:
IllegalArgumentException- if the tolerance is not positive
-
getConvergenceTolerance
public double getConvergenceTolerance()Get the convergence tolerance.- Returns:
- convergence tolerance in mol/s
-
setMaxTransferFractionPerSegment
public void setMaxTransferFractionPerSegment(double fraction) Set the maximum component transfer fraction per segment.- Parameters:
fraction- maximum fraction from zero to one- Throws:
IllegalArgumentException- if the fraction is outside zero to one
-
getMaxTransferFractionPerSegment
public double getMaxTransferFractionPerSegment()Get the maximum component transfer fraction per segment.- Returns:
- maximum component transfer fraction
-
setMassTransferCorrectionFactor
public void setMassTransferCorrectionFactor(double correctionFactor) Set a global mass-transfer correction factor.- Parameters:
correctionFactor- correction factor, must be positive- Throws:
IllegalArgumentException- if the correction factor is not positive
-
getMassTransferCorrectionFactor
public double getMassTransferCorrectionFactor()Get the global mass-transfer correction factor.- Returns:
- mass-transfer correction factor
-
setPackingType
Set the packing by name or alias.- Parameters:
packingName- packing name or alias fromPackingSpecificationLibrary
-
setPackingSpecification
Set the packing specification directly.- Parameters:
packingSpecification- packing specification to use- Throws:
IllegalArgumentException- if the specification is null
-
getPackingSpecification
Get the active packing specification.- Returns:
- packing specification
-
setMassTransferCorrelation
public void setMassTransferCorrelation(RateBasedPackedColumn.MassTransferCorrelation massTransferCorrelation) Set the mass-transfer correlation.- Parameters:
massTransferCorrelation- correlation to use- Throws:
IllegalArgumentException- if the correlation is null
-
getMassTransferCorrelation
Get the mass-transfer correlation.- Returns:
- active mass-transfer correlation
-
setFilmModel
Set the gas-liquid film model used for component transfer.- Parameters:
filmModel- film model to use- Throws:
IllegalArgumentException- if the film model is null
-
getFilmModel
Get the active gas-liquid film model.- Returns:
- active film model
-
setHeatTransferModel
Set the interphase heat-transfer model.- Parameters:
heatTransferModel- heat-transfer model to use- Throws:
IllegalArgumentException- if the heat-transfer model is null
-
getHeatTransferModel
Get the active interphase heat-transfer model.- Returns:
- active heat-transfer model
-
setSegmentSolver
Set the segment solver used for heat and mass coupling.- Parameters:
segmentSolver- segment solver to use- Throws:
IllegalArgumentException- if the segment solver is null
-
getSegmentSolver
Get the active segment solver.- Returns:
- active segment solver
-
setColumnSolver
Set the column-level profile solver.- Parameters:
columnSolver- column solver to use- Throws:
IllegalArgumentException- if the column solver is null
-
getColumnSolver
Get the active column-level profile solver.- Returns:
- active column solver
-
setHeatTransferCorrectionFactor
public void setHeatTransferCorrectionFactor(double correctionFactor) Set the global interphase heat-transfer correction factor.- Parameters:
correctionFactor- correction factor, must be positive- Throws:
IllegalArgumentException- if the correction factor is not positive
-
getHeatTransferCorrectionFactor
public double getHeatTransferCorrectionFactor()Get the global interphase heat-transfer correction factor.- Returns:
- heat-transfer correction factor
-
setMaxHeatTransferFractionPerSegment
public void setMaxHeatTransferFractionPerSegment(double fraction) Set the maximum thermal approach transferred in one segment.- Parameters:
fraction- maximum fraction from zero to one- Throws:
IllegalArgumentException- if the fraction is outside zero to one
-
getMaxHeatTransferFractionPerSegment
public double getMaxHeatTransferFractionPerSegment()Get the maximum thermal approach transferred in one segment.- Returns:
- maximum heat-transfer fraction
-
setMaxSegmentResidualIterations
public void setMaxSegmentResidualIterations(int maxSegmentResidualIterations) Set the maximum iterations for the simultaneous segment residual solver.- Parameters:
maxSegmentResidualIterations- maximum residual iterations, must be at least one- Throws:
IllegalArgumentException- if the iteration count is below one
-
getMaxSegmentResidualIterations
public int getMaxSegmentResidualIterations()Get the maximum iterations for the simultaneous segment residual solver.- Returns:
- maximum residual iterations
-
setSegmentResidualTolerance
public void setSegmentResidualTolerance(double segmentResidualTolerance) Set the normalized residual tolerance for the simultaneous segment solver.- Parameters:
segmentResidualTolerance- normalized tolerance, must be positive- Throws:
IllegalArgumentException- if the tolerance is not positive
-
getSegmentResidualTolerance
public double getSegmentResidualTolerance()Get the normalized residual tolerance for the simultaneous segment solver.- Returns:
- normalized residual tolerance
-
setMaxColumnResidualIterations
public void setMaxColumnResidualIterations(int maxColumnResidualIterations) Set the maximum Newton iterations for the column-wide equation-oriented solver.- Parameters:
maxColumnResidualIterations- maximum Newton iterations, must be at least one- Throws:
IllegalArgumentException- if the iteration count is below one
-
getMaxColumnResidualIterations
public int getMaxColumnResidualIterations()Get the maximum Newton iterations for the column-wide equation-oriented solver.- Returns:
- maximum Newton iterations
-
setColumnHomotopySteps
public void setColumnHomotopySteps(int columnHomotopySteps) Set the number of homotopy continuation steps for the equation-oriented solver.- Parameters:
columnHomotopySteps- number of continuation steps, must be at least one- Throws:
IllegalArgumentException- if the step count is below one
-
getColumnHomotopySteps
public int getColumnHomotopySteps()Get the number of homotopy continuation steps for the equation-oriented solver.- Returns:
- homotopy continuation steps
-
setColumnResidualTolerance
public void setColumnResidualTolerance(double columnResidualTolerance) Set the normalized residual tolerance for the column-wide equation-oriented solver.- Parameters:
columnResidualTolerance- normalized tolerance, must be positive- Throws:
IllegalArgumentException- if the tolerance is not positive
-
getColumnResidualTolerance
public double getColumnResidualTolerance()Get the normalized residual tolerance for the column-wide equation-oriented solver.- Returns:
- normalized column residual tolerance
-
getLastColumnResidualNorm
public double getLastColumnResidualNorm()Get the last column-wide equation-oriented residual norm.- Returns:
- last normalized column residual norm
-
getLastColumnResidualIterations
public int getLastColumnResidualIterations()Get the last column-wide Newton iteration count.- Returns:
- last column residual iterations
-
getLastGasComponentBalanceResidual
public double getLastGasComponentBalanceResidual()Get the maximum gas component-balance residual from the last equation-oriented solve.- Returns:
- gas component-balance residual in mol/s
-
getLastLiquidComponentBalanceResidual
public double getLastLiquidComponentBalanceResidual()Get the maximum liquid component-balance residual from the last equation-oriented solve.- Returns:
- liquid component-balance residual in mol/s
-
getLastColumnEnergyBalanceResidual
public double getLastColumnEnergyBalanceResidual()Get the maximum column energy-balance residual from the last equation-oriented solve.- Returns:
- energy-balance residual in W-equivalent stream basis
-
setTransferComponents
Set transfer components explicitly.When no components are supplied, all components in the inlet streams are considered.
- Parameters:
componentNames- component names to include in transfer calculations
-
getTransferComponents
-
getSegmentResults
Get the last calculated segment profile.- Returns:
- unmodifiable segment results from bottom to top
-
getComponentTransferTotals
-
getLastIterationCount
public int getLastIterationCount()Get the last profile iteration count.- Returns:
- number of iterations used by the last run
-
getLastConvergenceResidual
public double getLastConvergenceResidual()Get the last convergence residual.- Returns:
- convergence residual in mol/s
-
getTotalAbsoluteMolarTransfer
public double getTotalAbsoluteMolarTransfer()Get total absolute molar transfer in the last profile.- Returns:
- total absolute transfer in mol/s
-
getThermoSystem
getThermoSystem.
- Specified by:
getThermoSystemin interfaceProcessEquipmentInterface- Overrides:
getThermoSystemin classProcessEquipmentBaseClass- Returns:
- a
SystemInterfaceobject
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Parameters:
id- UUID
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classProcessEquipmentBaseClass
-
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
- Returns:
- validation result with errors and warnings
-
toJson
Convert the last run results to JSON.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classProcessEquipmentBaseClass- Returns:
- JSON report with configuration, hydraulics, transfer totals, and segment profiles
-
validateRuntimeSetup
private void validateRuntimeSetup()Validate runtime setup and throw an exception on blocking errors.- Throws:
IllegalStateException- if the equipment setup is invalid
-
solveCounterCurrentProfile
private RateBasedPackedColumn.CounterCurrentSolution solveCounterCurrentProfile(SystemInterface gasIn, SystemInterface liquidIn) Solve the counter-current segment profile by fixed-point iteration.- Parameters:
gasIn- gas inlet systemliquidIn- liquid inlet system- Returns:
- converged counter-current solution
-
solveFixedPointProfile
private RateBasedPackedColumn.CounterCurrentSolution solveFixedPointProfile(SystemInterface gasIn, SystemInterface liquidIn) Solve the counter-current profile by fixed-point liquid profile iteration.- Parameters:
gasIn- gas inlet systemliquidIn- liquid inlet system- Returns:
- converged counter-current solution
-
resetColumnResidualDiagnostics
private void resetColumnResidualDiagnostics()Reset column-wide residual diagnostics for non-equation-oriented profile solves. -
solveEquationOrientedProfile
private RateBasedPackedColumn.CounterCurrentSolution solveEquationOrientedProfile(SystemInterface gasIn, SystemInterface liquidIn) Solve the full packed section with a column-wide equation-oriented residual system.- Parameters:
gasIn- gas inlet systemliquidIn- liquid inlet system- Returns:
- equation-oriented counter-current solution
-
createColumnUnknowns
private double[] createColumnUnknowns(RateBasedPackedColumn.CounterCurrentSolution seed, List<String> components) Create a column-wide unknown vector from an existing profile solution.- Parameters:
seed- seed profile solutioncomponents- active transfer components- Returns:
- unknown vector containing segment fluxes, interface temperatures, and outlet temperatures
-
solveColumnResiduals
private RateBasedPackedColumn.ColumnResidualEvaluation solveColumnResiduals(SystemInterface gasIn, SystemInterface liquidIn, List<String> components, double[] initialUnknowns, double homotopyFactor) Solve the column-wide residual equations at one homotopy continuation factor.- Parameters:
gasIn- gas inlet systemliquidIn- liquid inlet systemcomponents- active transfer componentsinitialUnknowns- initial unknown vectorhomotopyFactor- continuation factor from zero to one- Returns:
- best residual evaluation found
-
evaluateColumnResidual
private RateBasedPackedColumn.ColumnResidualEvaluation evaluateColumnResidual(SystemInterface gasIn, SystemInterface liquidIn, List<String> components, double[] unknowns, double homotopyFactor, int iterations) Evaluate the full column residual vector for the equation-oriented solver.- Parameters:
gasIn- gas inlet systemliquidIn- liquid inlet systemcomponents- active transfer componentsunknowns- column unknown vectorhomotopyFactor- continuation factor from zero to oneiterations- iteration count represented by this evaluation- Returns:
- column residual evaluation
-
calculateColumnResidualStep
private Jama.Matrix calculateColumnResidualStep(SystemInterface gasIn, SystemInterface liquidIn, List<String> components, double[] unknowns, RateBasedPackedColumn.ColumnResidualEvaluation evaluation, double homotopyFactor) Calculate one sparse-pattern Newton step for the column residual equations.- Parameters:
gasIn- gas inlet systemliquidIn- liquid inlet systemcomponents- active transfer componentsunknowns- current column unknown vectorevaluation- current residual evaluationhomotopyFactor- continuation factor from zero to one- Returns:
- Newton step, or null if the least-squares solve fails
-
applyColumnResidualStep
private double[] applyColumnResidualStep(double[] unknowns, Jama.Matrix step, double damping, SystemInterface gasIn, SystemInterface liquidIn, List<String> components) Apply a damped column residual step and clamp to physical bounds.- Parameters:
unknowns- current unknown vectorstep- Newton stepdamping- damping factor from zero to onegasIn- gas inlet systemliquidIn- liquid inlet systemcomponents- active transfer components- Returns:
- bounded candidate unknowns
-
buildColumnState
private RateBasedPackedColumn.ColumnState buildColumnState(SystemInterface gasIn, SystemInterface liquidIn, List<String> components, double[] unknowns) Build gas and liquid segment states from column-wide flux and temperature unknowns.- Parameters:
gasIn- gas inlet systemliquidIn- liquid inlet systemcomponents- active transfer componentsunknowns- bounded column unknown vector- Returns:
- reconstructed column state
-
clampColumnUnknowns
private double[] clampColumnUnknowns(double[] unknowns, SystemInterface gasIn, SystemInterface liquidIn, List<String> components) Clamp column unknowns to inventory and temperature limits.- Parameters:
unknowns- column unknown vectorgasIn- gas inlet systemliquidIn- liquid inlet systemcomponents- active transfer components- Returns:
- clamped unknown vector
-
clampColumnTemperatureUnknown
private void clampColumnTemperatureUnknown(double[] unknowns, int index, SystemInterface gasIn, SystemInterface liquidIn) Clamp one column temperature unknown.- Parameters:
unknowns- unknown vector to updateindex- temperature unknown indexgasIn- gas inlet systemliquidIn- liquid inlet system
-
componentInventoryMap
-
addComponentDelta
Add a bounded component delta to a system.- Parameters:
system- system to updatecomponent- component namedeltaMoles- component delta in mol/s stream basis
-
columnUnknownBlockSize
-
columnFluxIndex
-
columnInterfaceTemperatureIndex
-
columnGasOutletTemperatureIndex
-
columnLiquidOutletTemperatureIndex
-
columnResidualVariableStep
private double columnResidualVariableStep(double[] unknowns, int variable, int componentCount) Calculate finite-difference step size for a column unknown.- Parameters:
unknowns- current unknown vectorvariable- variable indexcomponentCount- number of component flux unknowns per segment- Returns:
- finite-difference step
-
toPrimitiveArray
-
initializeLiquidProfile
Initialize all liquid segment inlets from the fresh liquid inlet.- Parameters:
liquidIn- fresh liquid inlet system- Returns:
- list of liquid entering systems for each segment
-
runOneProfileIteration
private RateBasedPackedColumn.CounterCurrentSolution runOneProfileIteration(SystemInterface gasIn, SystemInterface liquidIn, List<SystemInterface> liquidEntering) Run one bottom-to-top gas pass against the current counter-current liquid profile.- Parameters:
gasIn- gas inlet systemliquidIn- liquid inlet systemliquidEntering- liquid systems entering each segment- Returns:
- one profile iteration solution
-
updateLiquidProfile
private List<SystemInterface> updateLiquidProfile(SystemInterface liquidIn, List<SystemInterface> liquidLeaving) Shift liquid leaving one segment into the segment below for the next iteration.- Parameters:
liquidIn- fresh liquid inlet systemliquidLeaving- liquid systems leaving each segment from the previous iteration- Returns:
- updated segment liquid inlet profile
-
acceptSolution
Accept a profile solution as the last calculated result.- Parameters:
solution- solution to accept
-
calculateSegment
private RateBasedPackedColumn.SegmentComputation calculateSegment(int segment, SystemInterface gasIn, SystemInterface liquidIn) Calculate one rate-based segment.- Parameters:
segment- segment index from bottom, zero basedgasIn- gas system entering the segmentliquidIn- liquid system entering the segment- Returns:
- segment computation with outlet systems and result data
-
calculateTransportSnapshot
private RateBasedPackedColumn.TransportSnapshot calculateTransportSnapshot(SystemInterface gas, SystemInterface liquid, double segmentHeight) Calculate transport properties and packing coefficients for one segment.- Parameters:
gas- gas system in the segmentliquid- liquid system in the segmentsegmentHeight- segment height in metres- Returns:
- transport snapshot for the segment
-
calculateComponentTransfer
private double calculateComponentTransfer(String component, SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, RateBasedPackedColumn.InterfaceEquilibrium interfaceEquilibrium) Calculate component transfer rate for a component in one segment.- Parameters:
component- component namegas- gas systemliquid- liquid systemsnapshot- transport snapshot for the segmentinterfaceEquilibrium- interface equilibrium data- Returns:
- transfer rate in mol/s, positive from gas to liquid
-
calculateUnboundedComponentTransfer
private double calculateUnboundedComponentTransfer(String component, SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, RateBasedPackedColumn.InterfaceEquilibrium interfaceEquilibrium) Calculate the unbounded Maxwell-Stefan film transfer rate for one component.- Parameters:
component- component namegas- gas systemliquid- liquid systemsnapshot- transport snapshot for the segmentinterfaceEquilibrium- interface equilibrium data- Returns:
- unbounded transfer rate in mol/s, positive from gas to liquid
-
calculateSimultaneousResidualSegment
private RateBasedPackedColumn.SegmentComputation calculateSimultaneousResidualSegment(int segment, SystemInterface gas, SystemInterface liquid, double segmentHeight) Calculate one segment using simultaneous flux and interfacial energy residuals.- Parameters:
segment- segment index from bottom, zero basedgas- gas system entering the segmentliquid- liquid system entering the segmentsegmentHeight- segment height in metres- Returns:
- segment computation with outlet systems and residual diagnostics
-
solveSegmentResiduals
private RateBasedPackedColumn.SegmentResidualEvaluation solveSegmentResiduals(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, List<String> components) Solve the simultaneous residual equations for a segment.- Parameters:
gas- gas system entering the segmentliquid- liquid system entering the segmentsnapshot- transport snapshot for the segmentcomponents- active transfer components- Returns:
- best residual evaluation found
-
createInitialResidualUnknowns
private double[] createInitialResidualUnknowns(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, List<String> components) Create initial guesses for component transfers and interface temperature.- Parameters:
gas- gas systemliquid- liquid systemsnapshot- transport snapshotcomponents- active transfer components- Returns:
- residual unknown vector
-
evaluateSegmentResidual
private RateBasedPackedColumn.SegmentResidualEvaluation evaluateSegmentResidual(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, List<String> components, double[] unknowns, int iterations) Evaluate normalized residuals for the simultaneous segment equations.- Parameters:
gas- gas systemliquid- liquid systemsnapshot- transport snapshotcomponents- active transfer componentsunknowns- residual unknown vectoriterations- iteration count represented by the evaluation- Returns:
- residual evaluation
-
calculateResidualStep
private Jama.Matrix calculateResidualStep(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot, List<String> components, double[] unknowns, RateBasedPackedColumn.SegmentResidualEvaluation evaluation) Calculate a Newton step for normalized segment residuals.- Parameters:
gas- gas systemliquid- liquid systemsnapshot- transport snapshotcomponents- active transfer componentsunknowns- current unknown vectorevaluation- current residual evaluation- Returns:
- Newton step, or null if the linear solve fails
-
applyResidualStep
private double[] applyResidualStep(double[] unknowns, Jama.Matrix step, double damping, SystemInterface gas, SystemInterface liquid, List<String> components) Apply a damped residual step and clamp the unknowns to physical bounds.- Parameters:
unknowns- current unknownsstep- Newton stepdamping- damping factor from zero to onegas- gas systemliquid- liquid systemcomponents- active transfer components- Returns:
- bounded candidate unknowns
-
clampResidualUnknowns
private double[] clampResidualUnknowns(double[] unknowns, SystemInterface gas, SystemInterface liquid, List<String> components) Clamp residual unknowns to available component inventory and temperature bounds.- Parameters:
unknowns- unknown vector to clampgas- gas systemliquid- liquid systemcomponents- active transfer components- Returns:
- clamped unknown vector
-
residualVariableStep
private double residualVariableStep(double[] unknowns, int variable, int componentCount) Calculate finite-difference step size for a residual unknown.- Parameters:
unknowns- current unknown vectorvariable- variable indexcomponentCount- number of component transfer unknowns- Returns:
- finite-difference step
-
transferResidualScale
private double transferResidualScale(String component, double predictedTransfer, SystemInterface gas, SystemInterface liquid) Calculate the transfer residual scaling for one component.- Parameters:
component- component namepredictedTransfer- predicted transfer rate in mol/sgas- gas systemliquid- liquid system- Returns:
- positive residual scaling in mol/s
-
heatResidualScale
private double heatResidualScale(double gasSensibleHeat, double liquidSensibleHeat, double gasMassEnthalpy, double liquidMassEnthalpy) Calculate heat residual scaling.- Parameters:
gasSensibleHeat- gas-side sensible heat rate in WliquidSensibleHeat- liquid-side sensible heat rate in WgasMassEnthalpy- gas-side transferred component enthalpy rate in WliquidMassEnthalpy- liquid-side transferred component enthalpy rate in W- Returns:
- positive residual scaling in W
-
residualNorm
private double residualNorm(double[] residuals) Calculate infinity norm of normalized residuals.- Parameters:
residuals- normalized residual array- Returns:
- maximum absolute residual
-
applyEnthalpyTarget
Apply a total enthalpy target by pressure-enthalpy flash.- Parameters:
system- thermodynamic system to flashtargetEnthalpy- target total enthalpy in J or W-equivalent stream basis
-
estimateTemperatureForTargetEnthalpy
Estimate a temperature for an enthalpy target if PH flash fails.- Parameters:
system- thermodynamic systemtargetEnthalpy- target total enthalpy in J or W-equivalent stream basis- Returns:
- estimated temperature in kelvin
-
applyComponentTransfer
private void applyComponentTransfer(String component, double transfer, SystemInterface gas, SystemInterface liquid) Apply a component transfer to gas and liquid systems.- Parameters:
component- component nametransfer- transfer rate in mol/s, positive from gas to liquidgas- gas system to updateliquid- liquid system to update
-
limitTransfer
private double limitTransfer(String component, double proposedTransfer, SystemInterface gas, SystemInterface liquid) Limit transfer to available component inventory and configured stability fraction.- Parameters:
component- component nameproposedTransfer- proposed transfer in mol/s, positive from gas to liquidgas- gas systemliquid- liquid system- Returns:
- bounded transfer in mol/s
-
calculateInterfaceEquilibrium
private RateBasedPackedColumn.InterfaceEquilibrium calculateInterfaceEquilibrium(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot) Calculate interface equilibrium compositions for the mixed segment fluids.- Parameters:
gas- gas systemliquid- liquid systemsnapshot- transport snapshot containing the interfacial temperature estimate- Returns:
- interface equilibrium data
-
calculateInterfaceEquilibrium
private RateBasedPackedColumn.InterfaceEquilibrium calculateInterfaceEquilibrium(SystemInterface gas, SystemInterface liquid, double interfaceTemperatureK) Calculate interface equilibrium at a specified temperature.- Parameters:
gas- gas systemliquid- liquid systeminterfaceTemperatureK- interface temperature in kelvin- Returns:
- interface equilibrium data
-
calculateFilmCoefficient
private double calculateFilmCoefficient(PhaseInterface phase, String component, double baseCoefficient, double referenceDiffusivity, boolean gasPhase) Calculate the active film coefficient for one component.- Parameters:
phase- phase to inspectcomponent- component namebaseCoefficient- scalar packed-bed film coefficientreferenceDiffusivity- reference effective diffusivity in m2/sgasPhase- true when the phase is gas- Returns:
- component film coefficient in 1/s
-
maxwellStefanFilmCoefficient
private double maxwellStefanFilmCoefficient(PhaseInterface phase, String component, double baseCoefficient, double referenceDiffusivity, boolean gasPhase) Calculate a Maxwell-Stefan matrix-corrected film coefficient for one component.- Parameters:
phase- phase to inspectcomponent- component namebaseCoefficient- scalar packed-bed film coefficientreferenceDiffusivity- reference effective diffusivity in m2/sgasPhase- true when the phase is gas- Returns:
- Maxwell-Stefan corrected film coefficient in 1/s
-
combineFilmFluxes
private double combineFilmFluxes(double gasFluxDensity, double liquidFluxDensity) Combine gas- and liquid-side volumetric flux densities with a rate-limiting harmonic mean.- Parameters:
gasFluxDensity- gas-side flux density in mol/(m3 s)liquidFluxDensity- liquid-side flux density in mol/(m3 s)- Returns:
- combined transfer density in mol/(m3 s)
-
applyInterphaseHeatTransfer
private double applyInterphaseHeatTransfer(SystemInterface gas, SystemInterface liquid, RateBasedPackedColumn.TransportSnapshot snapshot) Apply interphase heat transfer to gas and liquid segment systems.- Parameters:
gas- gas system to updateliquid- liquid system to updatesnapshot- transport snapshot for the segment- Returns:
- heat-transfer rate in W, positive from gas to liquid
-
calculateVolumetricHeatTransferCoefficient
private double calculateVolumetricHeatTransferCoefficient(double massTransferCoefficient, double density, double heatCapacity, double viscosity, double diffusivity, double thermalConductivity) Calculate a volumetric heat-transfer coefficient from the Chilton-Colburn analogy.- Parameters:
massTransferCoefficient- volumetric mass-transfer coefficient in 1/sdensity- phase density in kg/m3heatCapacity- phase heat capacity in J/(kg K)viscosity- phase viscosity in kg/(m s)diffusivity- phase diffusivity in m2/sthermalConductivity- thermal conductivity in W/(m K)- Returns:
- volumetric heat-transfer coefficient in W/(m3 K)
-
combineHeatTransferCoefficients
private double combineHeatTransferCoefficients(double gasCoefficient, double liquidCoefficient) Combine gas and liquid heat-transfer coefficients as series resistances.- Parameters:
gasCoefficient- gas-side volumetric heat-transfer coefficient in W/(m3 K)liquidCoefficient- liquid-side volumetric heat-transfer coefficient in W/(m3 K)- Returns:
- overall volumetric heat-transfer coefficient in W/(m3 K)
-
calculateInterfaceTemperature
private double calculateInterfaceTemperature(double gasTemperature, double liquidTemperature, double gasCoefficient, double liquidCoefficient) Calculate an interfacial temperature estimate from heat-transfer resistances.- Parameters:
gasTemperature- gas bulk temperature in KliquidTemperature- liquid bulk temperature in KgasCoefficient- gas-side heat-transfer coefficient in W/(m3 K)liquidCoefficient- liquid-side heat-transfer coefficient in W/(m3 K)- Returns:
- estimated interface temperature in K
-
heatCapacityMass
Get heat capacity on a mass basis.- Parameters:
phase- phase to inspectfallback- fallback heat capacity in J/(kg K)- Returns:
- heat capacity in J/(kg K)
-
phaseMolarEnthalpy
Get phase molar enthalpy.- Parameters:
phase- phase to inspect- Returns:
- molar enthalpy in J/mol
-
componentMolarEnthalpy
private double componentMolarEnthalpy(PhaseInterface phase, String component, double temperature, double fallback) Get component molar enthalpy at an interface temperature.- Parameters:
phase- phase to inspectcomponent- component nametemperature- temperature in kelvinfallback- fallback molar enthalpy in J/mol- Returns:
- component molar enthalpy in J/mol
-
thermalConductivity
Get phase thermal conductivity.- Parameters:
phase- phase to inspectfallback- fallback thermal conductivity in W/(m K)- Returns:
- thermal conductivity in W/(m K)
-
heatCapacityRate
Calculate phase heat-capacity rate.- Parameters:
phase- phase to inspectheatCapacity- heat capacity in J/(kg K)- Returns:
- heat-capacity rate in W/K
-
componentIndex
Find a component index in a phase.- Parameters:
phase- phase to inspectcomponent- component name- Returns:
- component index, or minus one if absent
-
moleFraction
Get a component mole fraction by component index.- Parameters:
phase- phase to inspectcomponentIndex- component index- Returns:
- mole fraction, or zero if unavailable
-
binaryFilmCoefficient
private double binaryFilmCoefficient(PhaseInterface phase, int firstComponent, int secondComponent, double baseCoefficient, double referenceDiffusivity, boolean gasPhase) Calculate a binary film coefficient by diffusivity scaling.- Parameters:
phase- phase to inspectfirstComponent- first component indexsecondComponent- second component indexbaseCoefficient- scalar packed-bed film coefficientreferenceDiffusivity- reference diffusivity in m2/sgasPhase- true for gas fallback diffusivity- Returns:
- binary film coefficient in 1/s
-
scaleFilmCoefficient
private double scaleFilmCoefficient(double baseCoefficient, double diffusivity, double referenceDiffusivity) Scale a film coefficient by diffusivity relative to a reference value.- Parameters:
baseCoefficient- scalar packed-bed film coefficientdiffusivity- component or binary diffusivity in m2/sreferenceDiffusivity- reference diffusivity in m2/s- Returns:
- scaled film coefficient in 1/s
-
mixtureDiffusivityForComponent
private double mixtureDiffusivityForComponent(PhaseInterface phase, int componentIndex, double referenceDiffusivity, boolean gasPhase) Calculate a mixture diffusivity for one component.- Parameters:
phase- phase to inspectcomponentIndex- component indexreferenceDiffusivity- reference diffusivity in m2/sgasPhase- true for gas fallback diffusivity- Returns:
- mixture diffusivity in m2/s
-
binaryDiffusivity
private double binaryDiffusivity(PhaseInterface phase, int firstComponent, int secondComponent, double referenceDiffusivity, boolean gasPhase) Get a binary diffusion coefficient from NeqSim physical properties.- Parameters:
phase- phase to inspectfirstComponent- first component indexsecondComponent- second component indexreferenceDiffusivity- reference diffusivity in m2/sgasPhase- true for gas fallback diffusivity- Returns:
- binary diffusivity in m2/s
-
calculateOutletResidual
private double calculateOutletResidual(SystemInterface previousGas, SystemInterface currentGas, SystemInterface previousLiquid, SystemInterface currentLiquid) Calculate residual between previous and current outlets.- Parameters:
previousGas- previous gas outlet, or null on the first iterationcurrentGas- current gas outletpreviousLiquid- previous liquid outlet, or null on the first iterationcurrentLiquid- current liquid outlet- Returns:
- maximum absolute component residual in mol/s
-
flashAndInitialize
Flash and initialize a thermodynamic system including physical properties.- Parameters:
system- thermodynamic system to initialize
-
getGasPhase
Get the gas phase from a system.- Parameters:
system- thermodynamic system- Returns:
- gas phase if present, otherwise phase zero
-
getLiquidPhase
Get the liquid phase from a system.- Parameters:
system- thermodynamic system- Returns:
- liquid-like phase if present, otherwise phase zero
-
averageDiffusivity
Estimate average diffusivity for a phase.- Parameters:
phase- phase to inspectgasPhase- true for gas fallback values, false for liquid fallback values- Returns:
- finite diffusivity in m2/s
-
estimateSurfaceTension
Estimate surface tension between the segment gas and liquid phases.- Parameters:
gas- gas systemliquid- liquid system- Returns:
- surface tension in N/m
-
addSystemComponents
Add all positive-mole components from a source system to a target system.- Parameters:
target- target system receiving component molessource- source system providing component moles
-
refreshComponentDatabase
Refresh database and mixing-rule matrices after adding components to a cloned system.- Parameters:
system- thermodynamic system to refresh
-
getLiquidPhaseNumber
Get the first liquid-like phase number in a system.- Parameters:
system- thermodynamic system- Returns:
- liquid phase number, or minus one if no liquid-like phase exists
-
molarConcentration
Calculate phase molar concentration.- Parameters:
phase- phase to inspect- Returns:
- molar concentration in mol/m3
-
moleFraction
Get a component mole fraction in a phase.- Parameters:
phase- phase to inspectcomponent- component name- Returns:
- mole fraction, or zero if the component is absent
-
componentMoles
Get total component moles in a system.- Parameters:
system- thermodynamic systemcomponent- component name- Returns:
- component moles in the system
-
getComponentNames
Get component names from a thermodynamic system.- Parameters:
system- thermodynamic system- Returns:
- component names in insertion order
-
getTransferComponentList
Get the active transfer component list.- Parameters:
gas- gas systemliquid- liquid system- Returns:
- active component names
-
validatePositive
Validate a positive finite value.- Parameters:
value- numeric valuename- field name for error messages- Throws:
IllegalArgumentException- if the value is not positive and finite
-
validateNonNegative
Validate a non-negative finite value.- Parameters:
value- numeric valuename- field name for error messages- Throws:
IllegalArgumentException- if the value is negative or not finite
-
isFinitePositive
private boolean isFinitePositive(double value) Check whether a double is positive and finite.- Parameters:
value- value to check- Returns:
- true if the value is finite and positive
-
finitePositive
private double finitePositive(double value, double fallback) Replace invalid values with a fallback.- Parameters:
value- value to checkfallback- fallback value- Returns:
- value if positive and finite, otherwise fallback
-
finiteNonNegative
private double finiteNonNegative(double value, double fallback) Replace invalid or negative values with a fallback.- Parameters:
value- value to checkfallback- fallback value- Returns:
- value if non-negative and finite, otherwise fallback
-
clamp
private double clamp(double value, double min, double max) Clamp a value between lower and upper bounds.- Parameters:
value- value to clampmin- lower boundmax- upper bound- Returns:
- clamped value
-