Oil storage tank calculation algorithm