A sample box is a series of pipe, valves and fittings located on a pressure vessel or storage tank that is used to manually determine the height of the liquid or where the interface between oil and water resides. It is common in the upstream oil and gas industry when water is removed from the process stream during the dehydration process.
The way it works is there are several ports installed on the vessel at known elevations. These are generally 3/4" to 1" couplings, depending on the designer's preference. These are couplings so that they can be easily removed and cleaned out in the event they get plugged. For sandy service or heavy oil service, a larger connection is usually preferrable.
During operation of the vessel, an operator may want to verify the location of the oil/water interface or may want to check the height of an oil pad. By opening the valves at the set locations, the operator can determine the level.
It should be noted that these are generally used for low pressure tanks and vessels. While they can be used for higher pressure vessels, care needs to be taken to ensure that the operator and other personnel do not get exposed to high pressure or high temperature process fluids.
Additionally, if there are poisonous gasses, such as Hydrogen Sulfide, there should be provisions (such as a fan) to blow the gasses away from the operator. The sample box will need a receptacle to collect the production fluids. Often times, this is sent to a gravity drain system. If there is no system available, the drainbox should have enough volume to hole the fluid so it can be removed with a vacuum truck or a series of buckets.