Transports fluid from one point to another. Has a finite capacity. Optionally can contain some initial fluid located at the input end.
Once the pipeline gets filled, it stays filled forever, gaps are not allowed in pipelines (if gaps or condensed sections are needed, consider using BulkConveyor). All fluid in the pipeline moves at the same rate, therefore, when the pipeline is full, its input rate is always equal to the output rate. While the pipeline is not full, its input rate is only limited by the pipeline own rate (if required, set the Limited rate option and define the upper limit for the rate in the parameter Maximum rate).
The specified rate cannot be lower than the value of Utils.RATE_TOLERANCE constant, i.e. 1.0e-9. If rate value falls below this value after recalculation, it will be snapped to 0.
Pipeline transfers batches in FIFO order. You can specify the batch of the fluid initially contained in the pipeline.
The Pipeline block allows you to define actions associated with the pipeline getting completely filled, and with new batches appearing at the input or at the output.
Demo model: Pipeline
double amount()
- Returns the amount currently contained in the pipeline (total of all batches). If the amount is less than the value of
Utils.TOLERANCE, returns 0.
double amount(AmountUnits units) - Returns the amount of fluid (in given units) currently contained in the pipeline (total of all batches). If the amount is less than the value of Utils.TOLERANCE, returns 0.
double amountPassedIn() - Returns the total amount passed through the input port of the pipeline since the start of the simulation.
double amountPassedIn(AmountUnits units) - Returns the total amount of fluid (in given units) passed through the in port of the pipeline since the start of the simulation.
double amountPassedOut() - Returns the total amount passed through the output port of the pipeline since the start of the simulation.
double amountPassedOut(AmountUnits units) - Returns the total amount of fluid (in given units) passed through the out port of the pipeline since the start of the simulation.
boolean isFull() - Tests if the pipeline is full, i.e. the amount equals the pipeline capacity. Returns true if the pipeline is full, and false otherwise.
boolean isEmpty() - Tests if the pipeline is empty. Returns true if the pipeline is empty, and false otherwise.Note that there can still be a zero-size batch in an empty pipeline in case it has appeared at the input, but has not actually started flowing in.
double utilization() - Returns the currently utilized fraction of the pipeline bandwidth, namely the current input rate / maximum input rate. If the current maximum rate is not limited or equals 0, returns 0.
double utilizationTotal() - Returns the average utilization of the pipeline bandwidth throughout the total operating time, namely, the amount passed through the pipeline input divided by the maximum amount that could pass, subject to the (possibly changing) maximum rate. If the rate has been set to unlimited even once, the function will return zero.
double averageRateIn() - Returns the average rate through the input of the pipeline throughout the total operating time in cubic meters per second
double currentRate() - Returns the current flow rate of fluid at the pipeline input. (The flow rate at the output is either zero if the pipeline is not full, or the same as at the input.)
double currentRate(FlowRateUnits units) - Returns the current flow rate (in given units) of fluid at the pipeline input. (The flow rate at the output is either zero if the pipeline is not full, or the same as at the input.)
void resetStats() - Resets statistics collected for this block, including the statistics collected for its ports.
int numberOfBatches() - Returns the number of batches currently present in the pipeline, including possible zero-length batches.
Object getBatch(int index) - Returns the batch with the specified index. Batch with index 0 is the closest to the pipeline output, batch with the index numberOfBatches()-1 is the last batch at the input.
double getBatchSize(int index) - Returns the size of the batch with the specified index.Batch with index 0 is the closest to the pipeline output, batch with the index numberOfBatches()-1 is the last batch at the input.
double getBatchSize(int index, AmountUnits units) - Returns the size of the batch (in given units) with the specified index.
double getBatchOffset(int index) - Returns the sum of sizes of all batches closer to the pipeline input than the batch with a given index. Intended use is custom animation.