Automation

From level to litres: tank geometry, level transmitters and scaling

A transmitter reports a height and the plant wants litres: the geometry of vertical, horizontal and dished tanks; hydrostatic, ultrasonic, radar, float and capacitance transmitters and where each fails; PLC scaling by formula or strapping table; alarms, overfill protection and installation details.

Author
Ahmedonics Engineering
Published
Last updated
Cutaway illustration of a horizontal cylindrical tank on saddles, partly filled with liquid, a level transmitter on top and a panel with a bar display showing the fill

Every tank in a plant has the same small gap in it: the instrument on the tank measures a height, and everyone who looks at the screen wants a quantity. For a tall vertical tank the two are the same number in different units. For the horizontal cylinder that holds the diesel, the water or the acid, they are not, and a PLC that treats them as if they were is 7 % out at 40 % of the level and 6 % of the tank out at the worst point. This guide covers the geometry, the transmitters that measure the level and what each of them actually senses, how to turn the reading into litres in the PLC, and the alarms and installation details around it.

Level is what you measure, volume is what you want

No common transmitter measures volume. A hydrostatic transmitter measures pressure; an ultrasonic or radar transmitter measures a distance from its own face to the surface; a float measures where it floats. Each of them, after its own arithmetic, reports a level, usually as 4–20 mA over a range from empty to full, and the loop guide covers how that signal travels and how the PLC reads it. Turning the level into a volume is a second calculation that belongs to the tank, not to the instrument, and it is where the mistakes live.

The questions the volume must answer decide how good it has to be. "Is there enough diesel for tonight's load-shedding?" tolerates a few per cent. A batch recipe that adds 2 000 L of one liquid to 3 000 L of another wants better than 1 %. A monthly stock reconciliation against deliveries and consumption wants the maker's strapping table, temperature correction and a calibrated instrument, and at that point the tank is a measuring vessel and ISO 12917 applies. Decide which of these you are doing before choosing the transmitter, because the transmitter is the cheap part.

The geometry: vertical, horizontal and the awkward ends

A vertical cylinder or a rectangular tank with a flat bottom is the easy case: every centimetre of level is the same number of litres, the volume is the base area times the level, and a linear scaling block with the right capacity is exact. A conical or sloped bottom adds a non-linear term below the cone's top, which matters for hoppers and for silos but not for the tanks that hold liquids.

A horizontal cylinder is not linear. The liquid surface is a chord across the circular end, short near the bottom, the full diameter at the centreline, short again near the top. The wetted end area is a circular segment, the sector cut by the chord minus the triangle between the chord and the centre:

A = r² × acos((r − h) ÷ r) − (r − h) × √(2 r h − h²) V = A × L

with r the inside radius, h the level from the bottom and L the shell length. The result, as a fraction of capacity against the level as a fraction of the diameter, is an S-curve: 14 % of the volume at 20 % of the diameter, 37 % at 40 %, exactly half at half, 86 % at 80 %. The straight line and the curve meet only at empty, half and full, and between those points a linear scaling is up to 5.8 % of the capacity wrong, in one direction below the centreline and the other above it. The tank volume calculator evaluates the formula and prints a strapping table for it.

Then there are the ends. A flat-ended horizontal tank is a drawing convention; real pressure-rated tanks have dished heads, and dished heads hold liquid. A 2:1 semi-elliptical head holds π D³ ÷ 24, which is 1.05 m³ each on a 2 m tank, so a 3 m long tank with two of them holds 11.5 m³ rather than the 9.42 m³ of the shell, and the heads fill on their own curve, not the cylinder's. Torispherical heads hold less, and a tank with a sump or an internal heating coil is different again. For anything beyond an operator's indication, get the maker's table or calibrate the tank. Finally, the tank is not perfectly level: 1° of tilt along a 3 m tank moves the surface 5.2 cm from one end to the other, which is 2.6 % of a 2 m diameter, and the transmitter reads at its own position. Check the saddles with a spirit level when you commission, and again after a year.

End view of the horizontal tank D = 2 m, L = 3 m, level h = 0.8 m r = 1 m r − h = 0.2 m A = 1.1735 m² V = A × L = 3.52 m³ 37.4 % full D = 2 m h = 0.8 m A = sector r²θ − triangle (r − h) √(2rh − h²) θ = acos((r − h) ÷ r) = 78.5° Volume % against level % horizontal cylinder: the S-curve a strapping table encodes linear scaling: volume ∝ level true volume: segment formula 020406080100 020406080100 level, % of diameter volume, % of capacity largest gap: 5.8 % of capacity (544 L) near 20 % and 80 % at 40 % of the diameter true: 37.4 % = 3 520 L linear: 40 % = 3 770 L gap 249 L, 7.1 % of the reading volume fraction = [acos(1 − 2ℓ) − 2(1 − 2ℓ)√(ℓ − ℓ²)] ÷ π, ℓ = level ÷ D
A horizontal cylinder does not fill in proportion to its level: at 40 % of the diameter it holds 37 % of its volume, and a PLC that scales level straight into litres is about 250 L out on this 9 400 L tank. The S-curve on the right is what the strapping table encodes.

Level transmitters: hydrostatic, ultrasonic, radar, float, capacitance

Hydrostatic. A pressure transmitter at the bottom of the tank, or a submersible probe hung from the top, measures the pressure of the liquid column, p = ρ g h, and divides by the density it has been told. It is the cheapest and most robust option, indifferent to foam, vapour, dust and agitation, and accurate to about 0.1–0.25 % of span in good instruments. Its weakness is the ρ: a transmitter set up for water reads 16 % low on diesel, and a liquid whose density changes with temperature or composition changes the reported level with it. A vented tank needs a gauge-referenced transmitter; a closed or pressurised tank needs a differential transmitter with its second port on the vapour space. A stock of 10 m of water is 98 kPa, so the transmitter's range is small and its zero must be trimmed with the tank empty.

Ultrasonic. A transducer on top of the tank sends a pulse, times the echo from the surface and converts the time to a distance using the speed of sound, about 343 m/s in air at 20 °C and rising 0.17 % per degree, which the transmitter compensates with its own temperature sensor. It touches nothing and mounts through a nozzle, which makes it the default for water and waste-water tanks. It fails where the echo fails: foam absorbs the pulse, heavy vapour or a change of gas changes the speed of sound, an agitated or filling surface scatters the reflection, dust and condensation on the face attenuate it, and the first 25–50 cm below the face is a blocking distance in which nothing can be measured. It also does not work in vacuum or at high pressure. Accuracy is typically 0.25 % of range or a few millimetres, which is adequate for a level and marginal for stock.

Radar. A free-space radar transmitter works like the ultrasonic one but with a microwave pulse or a swept frequency at 26 or 80 GHz, and the speed of light does not care about temperature, pressure, vapour or the gas above the liquid. It reads through most foam, the 80 GHz instruments have a narrow beam that ignores nozzle walls and ladders, and accuracy of ±2 mm is normal. Radar was the expensive option; it now costs little more than ultrasonic and has replaced it as the first choice for anything that is not a plain water tank. Its limits are liquids with a very low dielectric constant, which reflect weakly (light hydrocarbons, some solvents), and small tanks where the blocking distance is a large fraction of the height. Guided-wave radar runs the pulse down a rod or cable into the liquid, so the signal is strong regardless of the dielectric, foam and turbulence matter less, and it can find an interface between two liquids; the probe must reach the bottom and must be kept clear of the tank wall and any coil.

Float. A magnetic float sliding on a stem with a reed-switch chain or a magnetostrictive sensor gives a level with no electronics in the liquid and no dependence on density beyond the float's design. It is simple, needs no power for a switch version, and is unaffected by foam and vapour. It sticks in viscous or dirty liquids, its stem collects sludge, and it wears. Float switches for high and low alarm, as opposed to continuous measurement, are the most common level device in the world and the right choice for an independent alarm.

Capacitance. A probe in the tank forms a capacitor with the wall, and the capacitance rises as the liquid, with its higher dielectric constant, replaces the air around the probe. It handles pressure, temperature and small tanks well, and it is common in the food and pharmaceutical industries. It needs calibrating to the liquid, build-up on the probe reads as level, and a change of product or a mixture changes the reading. It is a point-level (switch) technology first and a continuous one second.

The pattern is that each technology measures something other than the level and computes the level from it, and each one has a physical property it depends on: density, the speed of sound, the dielectric constant, the float's buoyancy. Ask what will change in the tank, and choose the transmitter whose property will not.

Scaling in the PLC: linear, formula or strapping table

The 4–20 mA arriving at the PLC is a level: 4 mA at the transmitter's zero, 20 mA at its span, whatever the tank shape. The PLC's analogue input turns it into a raw count and a scaling block turns the count into metres, and the scaling calculator handles that step. Litres come next, and there are three ways to get them.

Linear: multiply the level fraction by the capacity. Correct for a vertical cylinder or a rectangular tank with a flat bottom, and for nothing else. It is also what happens by default when someone types "0–9 425 L" into a scaling block that was expecting "0–2 m", which is how a horizontal tank ends up reading 3 770 L when it holds 3 520.

Formula: evaluate the segment area in structured text. Every IEC 61131-3 controller with a floating-point unit has acos and sqrt, and the whole calculation is two lines:

A := R*R*ACOS((R − H)/R) − (R − H)*SQRT(2.0*R*H − H*H);
V := A*L + V_ENDS(H);

where V_ENDS is zero for a flat-ended tank and a separate function for dished heads. Clamp H to the range 0 to 2R first, because a transmitter that overshoots by a centimetre will otherwise hand acos a value outside −1 to 1 and the block will return a non-number.

Strapping table: store the volume at a series of levels and interpolate linearly between the two rows that bracket the reading. This is the method for a tank with a maker's table, for a tank calibrated by filling, and for a small PLC without trigonometry. It is also more accurate than it looks: on the example tank, eleven rows at 0.2 m steps are never more than 70 L (0.7 % of capacity) from the exact formula, and twenty-one rows never more than 26 L (0.3 %), both well inside the transmitter's own error. Keep the table in retentive memory or in a recipe, with the tank's name and the date it was made, so that it survives a CPU replacement and can be checked against the tank it belongs to. Display the level next to the volume: when the two disagree with what the operator sees in the sight glass, the level tells you whether the fault is the instrument or the table.

Alarms and overfill

A level system carries at least four alarms. High stops the filling pump or closes the inlet valve and tells the operator. High-high, set above it, is the last line before liquid comes out of the vent, and it must not depend on the same transmitter, the same cable or the same PLC input as the high alarm; a float switch or a vibrating-fork switch wired to its own relay, or to a separate safety input, is the usual answer. API 2350, written for petroleum storage but sound for any tank whose overflow would be dangerous or expensive, requires exactly this: an automatic overfill prevention system independent of the tank gauging, with levels of concern defined for each tank and the time between the high-high level and the actual overflow known, so that the response can happen inside it. A pump filling a 9 400 L tank at 200 L/min fills the top 5 % in under two and a half minutes; a delivery tanker at 800 L/min fills it in about 35 seconds, which is not enough time for anyone to walk to a valve.

Low protects the pump that draws from the tank: a centrifugal pump run dry loses its seal in minutes. Low-low trips it. The fourth alarm is on the measurement itself. A reading that does not change while the pump runs, or changes faster than any pump could fill or empty the tank, or sits at exactly 4.00 or 20.00 mA, or leaves the 3.8–20.5 mA band of NAMUR NE 43, is a stuck, saturated or failed transmitter, and it should be flagged as such rather than displayed as a level. A rate-of-change check and a comparison with the pump's running time cost a few lines of logic and catch most instrument faults before they become process faults.

Installation details that ruin the reading

  • Nozzles and blocking distance. An ultrasonic or radar transmitter in a tall, narrow nozzle sees the nozzle wall and its own blocking distance before it sees the liquid. Keep the nozzle short and wide, or fit the transmitter on a flange that brings its face into the tank, and check that the highest level to be measured is below the blocking distance from the face. Mount at least a quarter of the tank's radius away from the wall, never over the inlet stream.
  • Stilling wells. In an agitated tank, or one filled by a splashing inlet, a vertical pipe with holes along its length calms the surface for an ultrasonic, radar or float transmitter. The pipe must be straight, smooth inside and open at the bottom; a weld bead or a joint inside a stilling well produces a false echo at a fixed level that looks exactly like a stuck reading.
  • Isolation for hydrostatic transmitters. A transmitter on a bottom nozzle needs an isolation valve so it can be replaced with the tank full, and the valve must be open when the level is being trusted. A transmitter that reads a constant plausible level with the valve shut has caught more than one plant out. Its zero should be trimmed with the tank empty and the vent open, and the impulse line must not trap air or freeze.
  • Density and temperature. For a hydrostatic transmitter, set the density to the liquid actually in the tank and correct it for temperature if the product changes with the seasons: diesel at 40 °C in a Karachi summer is about 1.7 % less dense than at 20 °C, and a fixed density reads the level 1.7 % high. For stock purposes, correct the volume itself to a reference temperature (ISO 91 and the API MPMS tables do this for petroleum).
  • Condensation and build-up. Water droplets on an ultrasonic face, product film on a radar antenna, sludge on a float stem and coating on a capacitance probe all shift the reading slowly, which is the hardest kind of fault to notice. A purge, a PTFE-coated antenna or a scheduled clean solves it; a comparison against the dip or the delivery volume detects it.
  • Cable and earthing. The transmitter's loop follows the rules in the current-loop guide: a screened pair, the screen earthed at the panel end only, and no sharing of a conduit with motor cables. Radar and ultrasonic transmitters on top of an outdoor steel tank are lightning targets; surge protection at the panel is cheap.

The example in numbers

A horizontal diesel day tank: inside diameter 2.0 m, shell length 3.0 m, flat ends. A hydrostatic transmitter scaled 0–2 m reads 0.8 m.

  1. r = 1.0 m, (r − h) ÷ r = 0.2, acos(0.2) = 1.3694 rad. 2 r h − h² = 0.96, √0.96 = 0.9798, (r − h) × 0.9798 = 0.1960.
  2. Segment area A = 1.3694 − 0.1960 = 1.1735 m². Volume V = 1.1735 × 3.0 = 3.520 m³ = 3 520 L. Capacity π × 1² × 3 = 9.425 m³ = 9 425 L, so the tank is 37.4 % full at 40 % of its diameter.
  3. The transmitter, scaled to level, gives 4 + 16 × 0.40 = 10.40 mA. A PLC scaled to volume would show 4 + 16 × 0.3735 = 9.98 mA for the same liquid; the two are not interchangeable.
  4. A linear scaling reports 0.40 × 9 425 = 3 770 L, which is 249 L (7.1 %) more than is there. The worst case on this tank is 544 L, near 20 % and 80 % of the diameter.
  5. The strapping table at 0.2 m steps runs 0, 491, 1 342, 2 378, 3 520, 4 712, 5 904, 7 047, 8 083, 8 934, 9 425 L; a PLC interpolating between those rows is within 70 L everywhere.
  6. At SG 0.84 the 3 520 L of diesel weighs 2 957 kg, and a transmitter that had been set up for water would have reported the level as 0.8 × 0.84 = 0.672 m, which the table would have turned into 2 780 L: an error of 740 L, or 21 %, from one wrong parameter.

The tank volume calculator reproduces these figures and prints the table for any tank of the three shapes.

Verifying the whole chain

A level system is verified end to end, not instrument by instrument. Dip the tank with a calibrated rod or tape, read the level on the PLC, and compare; do it at two levels at least, one low and one high, because a zero error and a span error look the same at one point. Then check the volume: fill from a known level with a known quantity, from a flow meter, a delivery note or a weighbridge, and compare the increase the PLC shows with what went in. On a horizontal tank do this near the bottom, where the S-curve is steepest and a linear scaling shows its error most clearly.

On the electrical side, measure the loop current with a meter in series at the two levels and check that the PLC's raw count matches what the scaling calculator predicts for that current; a wrong module range or a scaling block set to 0–20 mA instead of 4–20 mA shows up here and nowhere else. Then test the alarms by simulating the current with a loop calibrator, and test the high-high switch by lifting its float or, better, by filling the tank to it once under supervision. Write the results down with the date, the dip readings and the table version. Ahmedonics designs and commissions tank monitoring and filling control as part of its automation work, and the commissioning record is the part that gets asked for a year later.

References

  • ISO 12917-1:2002, Petroleum and liquid petroleum products — Calibration of horizontal cylindrical tanks — Part 1: Manual methods — also API MPMS Chapter 2.2E; strapping, head volumes, tilt and deadwood corrections
  • API Manual of Petroleum Measurement Standards, Chapter 2: Tank Calibration — calibration tables for upright and horizontal tanks
  • API Standard 2350, Overfill Prevention for Storage Tanks in Petroleum Facilities, 5th edition, 2020 — independent overfill prevention, levels of concern and response time
  • IEC 61511-1:2016, Functional safety — Safety instrumented systems for the process industry sector — where the high-high trip is a safety instrumented function
  • NAMUR NE 43 (2003), Standardization of the signal level for the failure information of digital transmitters
  • ISO 91:2017, Petroleum and related products — Temperature and pressure volume correction factors (petroleum measurement tables) — volume correction to a reference temperature
  • Manufacturer's operating instructions for the level transmitter installed — blocking distance, nozzle and mounting rules, density setting, linearisation table capacity