Originally shared on the public FactorioPrints / Factorio School archive (factorioprints.com · factorio.school). Authorship preserved from the public catalog.
This setup produces lubricant until the threshold of 20k is reached. If 20k lubricant are stored in the tank, crack heavy oil instead of producing more lubricant. This ensures, that lubricant is replaced upon dipping below 20k. Outputs are only petroleum and lubricant.