## 2 Refinery Process and Short-Term Scheduling  
### Crude Oil Operations in Refinery  
A general oil refinery process contains three stages: (1) crude oil operations; (2) production; and (3) product delivery. Since the whole refinery process is very complex, this paper addresses the short-term scheduling problem for crude oil operations only, which is one of the most challenging scheduling problems in operating a refinery. At the stage of crude oil operations, crude oil is carried to a port by crude oil tankers and is unloaded into storage tanks there. Oil in storage tanks is transported to charging tanks in the refinery plant through a pipeline. Then, from charging tanks, oil is fed into distillers for distillation.  
During crude oil operations, crude oil can only be discharged into an empty storage or charging tank or one that holds the same type of crude oil. To obtain suitable components for distillation, different types of crude oil may be mixed when oil is transported from storage tanks to charging tanks or fed into distillers. If oil is mixed during oil feeding, at least two charging tanks are required to feed a distiller at the same time. As charging tanks are a critical resource and are limited, in general, only one charging tank is used to feed a distiller at a time and crude oil mixing is done during its transportation via a pipeline. Therefore, this paper only considers the case in which only one charging tank is used to feed a distiller at any one time. Moreover, crude oil mixing is not considered here, since a mixture can be simply treated as a new type of oil.  
The brine in crude oil disturbs the distillation process. Thus, crude oil needs to be pretreated to separate brine from oil to ensure the stability, which is implemented by making oil stay in a tank for some time after a storage or charging tank is charged, leading to an oil residency time constraint in both storage and charging tanks. When a tank is required to satisfy such a constraint, we say that the tank operates under the normal mode. Under the normal mode for both storage and charging tanks, it is shown that generally a feasible schedule with maximal production rate can be found if there are three charging tanks for each distiller at any time [21; 22; 25; 26; 27; 28]. Considering that crude oil has already been pretreated in storage tanks, when a refinery does not have enough charging tanks it has to adopt the SCF mode to keep the system in operation. Nevertheless, the SCF is not a desired mode and its use should be minimized to reduce the disturbance to the distillation process. Note that, by the SCF mode, before a charging tank can be used to feed a distiller, the tank should be charged with a certain amount of oil first; this is called the safety stock, also known as the SCF mode constraint.  
Based on the above discussion, we summarize the constraints for scheduling crude oil operations as follows. We have resource constraints: (1) the limited number of storage and charging tanks and their capacities; (2) the limited flow rate of oil unloading and pipeline transportation; and (3) the available volume of various crude oil types in tanks and incoming tankers. We also have process constraints: (1) a distiller should be kept in working uninterruptedly unless a maintenance is needed; (2) at least one charging tank is dedicated to feed a distiller at any time; (3) oil residency time constraint for all storage and charging tanks under the normal mode; and (4) when SCF is applied, the SCF mode constraint should be met.