Class TransientWellbore
java.lang.Object
neqsim.util.NamedBaseClass
neqsim.process.SimulationBaseClass
neqsim.process.equipment.ProcessEquipmentBaseClass
neqsim.process.equipment.TwoPortEquipment
neqsim.process.equipment.pipeline.Pipeline
neqsim.process.equipment.pipeline.TransientWellbore
- All Implemented Interfaces:
Serializable, Runnable, CapacityConstrainedEquipment, PipeLineInterface, ProcessEquipmentInterface, TwoPortInterface, ProcessElementInterface, SimulationInterface, NamedInterface
Transient wellbore model for simulating shutdown cooling and depressurization. Models the thermal
equilibration of a wellbore after injection stops, accounting for radial heat conduction to the
formation (geothermal gradient) and the resulting phase behaviour changes.
The model divides the wellbore into vertical segments and computes the temperature profile as the fluid cools toward the formation temperature at each depth. During cooling, flash calculations determine if two-phase conditions develop and track impurity enrichment in the gas phase.
Usage example:
TransientWellbore well = new TransientWellbore("InjWell", feedStream);
well.setWellDepth(1300.0);
well.setTubingDiameter(0.1571);
well.setFormationTemperature(277.15, 316.15); // 4C at top, 43C at bottom
well.setShutdownCoolingRate(5.0); // K/hr exponential decay rate
well.setNumberOfSegments(20);
well.runShutdownSimulation(24.0, 1.0); // 24 hours, 1-hour steps
List<double[]> profiles = well.getTemperatureProfiles();
- Version:
- 1.0
- Author:
- neqsim
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA snapshot of the wellbore state at a single time step. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleCooling time constant for exponential decay toward formation temperature in hours.private doubleDepressurization rate in bar per hour (0 = no depressurization).private doubleFormation temperature at bottom-hole in Kelvin.private doubleFormation temperature at wellhead (top) in Kelvin.private intNumber of vertical segments for discretization.private doubleOverall radial heat transfer coefficient in W/(m2.K).private static final longSerialization version UID.private final List<TransientWellbore.TransientSnapshot> Time step results: list of snapshots, each containing depth vs (T, P, phases, compositions).private doubleTubing inner diameter in meters.private doubleWell measured depth in meters.Fields inherited from class Pipeline
adiabatic, ambientTemperature, angle, burialDepth, buried, coatingConductivity, coatingThickness, corrosionAllowance, designCode, designPressure, designTemperature, diameter, elevation, equilibriumHeatTransfer, equilibriumMassTransfer, fileName, fittings, flowPattern, flowRegime, frictionFactor, heatTransferCoefficient, inletElevation, innerHeatTransferCoefficient, insulationConductivity, insulationThickness, insulationType, legHeights, legPositions, length, liquidHoldup, liquidHoldupProfile, locationClass, logger, materialGrade, mechanicalDesignCalculator, numberOfIncrements, numberOfLegs, numberOfNodesInLeg, outerHeatTransferCoefficient, outerHeatTransferCoeffs, outerTemperature, outletElevation, pipe, pipeDiameters, pipelineMechanicalDesign, pipeMaterial, pipeSchedule, pipeWallConductivity, pipeWallRoughness, pressureDrop, pressureProfile, reynoldsNumber, roughness, soilConductivity, surfaceTemperature, system, temperatureProfile, times, useFittings, velocity, wallHeatTransferCoeffs, wallThicknessFields inherited from class TwoPortEquipment
inStream, outStreamFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionTransientWellbore(String name) Constructor for TransientWellbore.TransientWellbore(String name, StreamInterface inletStream) Constructor for TransientWellbore with inlet stream. -
Method Summary
Modifier and TypeMethodDescriptioncreateSnapshot(double timeHours, double[] depths, double[] temperatures, double[] pressures, SystemInterface baseFluid) Creates a snapshot of the wellbore state at a given time by performing flash calculations at each segment.doubleGets the depressurization rate.doublegetMaxGasPhaseConcentration(String componentName) Returns the maximum H2 concentration in the gas phase across all segments and time steps.intGets the number of segments.doubleGets the radial heat transfer coefficient.doubleGets the cooling time constant.Gets all snapshots from the shutdown simulation.List<double[]> Gets the temperature profiles as a list of double arrays (one per time step).double[]Gets the time points of each snapshot.doubleGets the tubing inner diameter.doubleGets the well depth.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunShutdownSimulation(double totalTimeHours, double timeStepHours) Runs the shutdown transient simulation.voidsetDepressurizationRate(double rateBarPerHour) Sets the wellhead depressurization rate during shutdown.voidsetFormationTemperature(double topTempKelvin, double bottomTempKelvin) Sets the formation temperature at the wellhead and bottom-hole.voidsetNumberOfSegments(int segments) Sets the number of vertical segments.voidsetRadialHeatTransferCoefficient(double coefficient) Sets the radial heat transfer coefficient for heat exchange between wellbore fluid and formation.voidsetShutdownCoolingRate(double timeConstantHours) Sets the exponential cooling time constant.voidsetTubingDiameter(double diameter) Sets the tubing inner diameter.voidsetWellDepth(double depth) Sets the well measured depth.Methods inherited from class Pipeline
addCapacityConstraint, addFitting, addFittingFromDatabase, addFittings, addStandardFitting, addStandardFittings, calculateHoopStress, calculateMAOP, calculateMinimumWallThickness, calculateOverallHeatTransferCoefficient, calculateTestPressure, calculateVonMisesStress, clearCapacityConstraints, clearFittings, displayResult, generateMechanicalDesignReport, getAmbientTemperature, getAngle, getBottleneckConstraint, getBurialDepth, getCapacityConstraints, getCapacityDuty, getCapacityMax, getCoatingConductivity, getCoatingThickness, getCorrosionAllowance, getCorrosionRate, getDesignCode, getDesignPressure, getDesignTemperature, getDiameter, getEffectiveLength, getElevation, getEntropyProduction, getEquivalentLength, getFittings, getFlowRegime, getFrictionFactor, getHeatTransferCoefficient, getInletElevation, getInnerHeatTransferCoefficient, getInsulationConductivity, getInsulationThickness, getInsulationType, getLength, getLiquidHoldup, getLiquidHoldupProfile, getLocationClass, getMAOP, getMaterialGrade, getMaxUtilization, getMechanicalDesign, getMechanicalDesignCalculator, getNumberOfFittings, getNumberOfIncrements, getNumberOfLegs, getOuterHeatTransferCoefficient, getOutletElevation, getOutletPressure, getOutletTemperature, getPipe, getPipeMaterial, getPipeSchedule, getPipeWallConductivity, getPipeWallRoughness, getPressureDrop, getPressureProfile, getRecommendedCorrosionAllowanceMm, getRecommendedMaterial, getReynoldsNumber, getSoilConductivity, getSuperficialVelocity, getSuperficialVelocity, getTemperatureProfile, getTimes, getTotalFittingsLdRatio, getVelocity, getWallThickness, initializeCapacityConstraints, initMechanicalDesign, isAdiabatic, isBuried, isCapacityExceeded, isHardLimitExceeded, isMechanicalDesignSafe, isUseFittings, printFittingsSummary, removeCapacityConstraint, runCorrosionAnalysis, runTransient, setAdiabatic, setAmbientTemperature, setAmbientTemperatures, setAngle, setBurialDepth, setBuried, setCoatingConductivity, setCoatingThickness, setConstantSurfaceTemperature, setCorrosionAllowance, setDesignCode, setDesignLifeYears, setDesignPressure, setDesignPressure, setDesignTemperature, setDiameter, setElevation, setEquilibriumHeatTransfer, setEquilibriumMassTransfer, setGlycolWeightFraction, setHeatTransferCoefficient, setHeightProfile, setInhibitorEfficiency, setInitialFlowPattern, setInletElevation, setInnerHeatTransferCoefficient, setInsulationConductivity, setInsulationThickness, setInsulationType, setLegPositions, setLength, setLocationClass, setMaterialGrade, setNumberOfIncrements, setNumberOfLegs, setNumberOfNodesInLeg, setOuterHeatTransferCoefficient, setOuterHeatTransferCoefficients, setOuterTemperatures, setOutletElevation, setOutletPressure, setOutletTemperature, setOutputFileName, setPipeDiameters, setPipeMaterial, setPipeOuterHeatTransferCoefficients, setPipeSchedule, setPipeSpecification, setPipeWallConductivity, setPipeWallHeatTransferCoefficients, setPipeWallRoughness, setPipeWallRoughness, setSoilConductivity, setTimeSeries, setUseFittings, setWallHeatTransferCoefficients, setWallThickness, toJson, toJsonMethods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletStreams, getInletTemperature, getMassBalance, getOutletPressure, getOutletStream, getOutletStreams, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletPressure, setOutletStream, setOutletTemperature, validateSetupMethods inherited from class ProcessEquipmentBaseClass
addController, copy, equals, getAvailableMargin, getAvailableMarginPercent, getConditionAnalysisMessage, getConstraintEvaluationReport, getController, getController, getControllers, getEffectiveCapacityFactor, getEnergyStream, getExergyChange, getFailureMode, getMassBalance, getMaxUtilizationPercent, getMinimumFlow, getPressure, getPressure, getProperty, getReferenceDesignation, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, getUtilizationSummary, hashCode, initElectricalDesign, initializeDefaultConstraints, initInstrumentDesign, isActive, isActive, isCapacityAnalysisEnabled, isFailed, isNearCapacityLimit, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setReferenceDesignation, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solvedMethods 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 CapacityConstrainedEquipment
disableAllConstraints, enableAllConstraints, getAvailableMargin, getAvailableMarginPercent, getMaxUtilizationPercent, getUtilizationSummary, isCapacityAnalysisEnabled, isNearCapacityLimit, setCapacityAnalysisEnabledMethods inherited from interface NamedInterface
getName, getTagName, getTagNumber, setName, setTagName, setTagNumberMethods inherited from interface PipeLineInterface
setOutPressure, setOutTemperatureMethods inherited from interface ProcessEquipmentInterface
getElectricalDesign, getEquipmentState, getExergyChange, getExergyDestruction, getExergyDestruction, getFluid, getInstrumentDesign, getOperatingEnvelopeViolation, getOutletFlowRate, getReferenceDesignationString, getRestCapacity, getSimulationValidationErrors, isSimulationValid, isWithinOperatingEnvelope, needRecalculationMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface TwoPortInterface
getInletPressure, getInletStream, getInletTemperature, getInStream, getOutletPressure, getOutletStream, getOutletTemperature, getOutStream, setInletPressure, setInletStream, setInletTemperature, setOutletPressure, setOutletStream, setOutletTemperature, setOutPressure, setOutTemperature
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
wellDepth
private double wellDepthWell measured depth in meters. -
tubingDiameter
private double tubingDiameterTubing inner diameter in meters. -
formationTempTop
private double formationTempTopFormation temperature at wellhead (top) in Kelvin. -
formationTempBottom
private double formationTempBottomFormation temperature at bottom-hole in Kelvin. -
numberOfSegments
private int numberOfSegmentsNumber of vertical segments for discretization. -
coolingTimeConstant
private double coolingTimeConstantCooling time constant for exponential decay toward formation temperature in hours. -
radialHeatTransferCoeff
private double radialHeatTransferCoeffOverall radial heat transfer coefficient in W/(m2.K). -
depressurizationRate
private double depressurizationRateDepressurization rate in bar per hour (0 = no depressurization). -
snapshots
Time step results: list of snapshots, each containing depth vs (T, P, phases, compositions).
-
-
Constructor Details
-
TransientWellbore
Constructor for TransientWellbore.- Parameters:
name- the equipment name
-
TransientWellbore
Constructor for TransientWellbore with inlet stream.- Parameters:
name- the equipment nameinletStream- the inlet (feed) stream defining initial fluid conditions
-
-
Method Details
-
setWellDepth
public void setWellDepth(double depth) Sets the well measured depth.- Parameters:
depth- the well depth in meters
-
getWellDepth
public double getWellDepth()Gets the well depth.- Returns:
- the well depth in meters
-
setTubingDiameter
public void setTubingDiameter(double diameter) Sets the tubing inner diameter.- Parameters:
diameter- the inner diameter in meters
-
getTubingDiameter
public double getTubingDiameter()Gets the tubing inner diameter.- Returns:
- the inner diameter in meters
-
setFormationTemperature
public void setFormationTemperature(double topTempKelvin, double bottomTempKelvin) Sets the formation temperature at the wellhead and bottom-hole. A linear geothermal gradient is assumed between these two points.- Parameters:
topTempKelvin- formation temperature at the wellhead in KelvinbottomTempKelvin- formation temperature at the bottom-hole in Kelvin
-
setShutdownCoolingRate
public void setShutdownCoolingRate(double timeConstantHours) Sets the exponential cooling time constant. The fluid temperature at each segment evolves as: T(t) = T_formation + (T_initial - T_formation) * exp(-t / tau). Smaller values mean faster cooling.- Parameters:
timeConstantHours- the cooling time constant in hours
-
getShutdownCoolingRate
public double getShutdownCoolingRate()Gets the cooling time constant.- Returns:
- the cooling time constant in hours
-
setRadialHeatTransferCoefficient
public void setRadialHeatTransferCoefficient(double coefficient) Sets the radial heat transfer coefficient for heat exchange between wellbore fluid and formation.- Parameters:
coefficient- the overall heat transfer coefficient in W/(m2.K)
-
getRadialHeatTransferCoefficient
public double getRadialHeatTransferCoefficient()Gets the radial heat transfer coefficient.- Returns:
- the coefficient in W/(m2.K)
-
setDepressurizationRate
public void setDepressurizationRate(double rateBarPerHour) Sets the wellhead depressurization rate during shutdown.- Parameters:
rateBarPerHour- the pressure decrease rate in bar per hour (0 = constant pressure)
-
getDepressurizationRate
public double getDepressurizationRate()Gets the depressurization rate.- Returns:
- the rate in bar per hour
-
setNumberOfSegments
public void setNumberOfSegments(int segments) Sets the number of vertical segments.- Parameters:
segments- the number of segments
-
getNumberOfSegments
public int getNumberOfSegments()Gets the number of segments.- Returns:
- the number of segments
-
runShutdownSimulation
public void runShutdownSimulation(double totalTimeHours, double timeStepHours) Runs the shutdown transient simulation. Starting from the initial operating conditions in the inlet stream, the wellbore cools toward the formation temperature over the specified duration.- Parameters:
totalTimeHours- the total simulation duration in hourstimeStepHours- the time step size in hours
-
createSnapshot
private TransientWellbore.TransientSnapshot createSnapshot(double timeHours, double[] depths, double[] temperatures, double[] pressures, SystemInterface baseFluid) Creates a snapshot of the wellbore state at a given time by performing flash calculations at each segment.- Parameters:
timeHours- the simulation time in hoursdepths- the depth arraytemperatures- the temperature array in Kelvinpressures- the pressure array in barabaseFluid- the base fluid for cloning- Returns:
- a TransientSnapshot with all segment data
-
getSnapshots
Gets all snapshots from the shutdown simulation.- Returns:
- a list of TransientSnapshot objects, one per time step
-
getTemperatureProfiles
Gets the temperature profiles as a list of double arrays (one per time step).- Returns:
- list of temperature arrays in Kelvin
-
getTimePoints
public double[] getTimePoints()Gets the time points of each snapshot.- Returns:
- array of time values in hours
-
getMaxGasPhaseConcentration
Returns the maximum H2 concentration in the gas phase across all segments and time steps.- Parameters:
componentName- the component to check (e.g., "hydrogen")- Returns:
- the maximum gas phase mole fraction, or 0 if no two-phase conditions
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Overrides:
runin classPipeline- Parameters:
id- UUID
-