PO.WI.Barrier.Rating


Description

A well's integrity category from the status of its two well barriers. NORSOK D-010 requires two independent barriers, the primary and the secondary, during every well activity; how far the well is from losing both sets how urgently it needs attention. The categories are the four colours of the Norwegian Oil and Gas well-integrity classification: - 1, green: both barriers intact. - 2, yellow: one barrier degraded, the other intact. - 3, orange: one barrier failed and the other intact, or both degraded, so one more failure leaves a single weak barrier. - 4, red: one barrier failed and the other degraded or failed: one further failure, or none, opens a path to surface. Each status is a code, as `PO.WI.Barrier.Status` returns it: 0 intact, 1 degraded or not verified, 2 failed. The rating is symmetric: it does not matter which barrier is the weaker one.

Formula

=LAMBDA(Primary, Secondary, LET( worst, MAX(Primary, Secondary), best, MIN(Primary, Secondary), IF(worst <= 0, 1, IF(worst = 1, IF(best <= 0, 2, 3), IF(best <= 0, 3, 4)))))

Parameters

Parameter Unit Description
Primary - Primary barrier status: 0 intact, 1 degraded or not verified, 2 failed
Secondary - Secondary barrier status: 0 intact, 1 degraded or not verified, 2 failed

Examples

Invocation Expected
=PO.WI.Barrier.Rating(0, 0) 1
=PO.WI.Barrier.Rating(1, 0) 2
=PO.WI.Barrier.Rating(0, 1) 2
=PO.WI.Barrier.Rating(1, 1) 3
=PO.WI.Barrier.Rating(2, 0) 3
=PO.WI.Barrier.Rating(0, 2) 3
=PO.WI.Barrier.Rating(2, 1) 4
=PO.WI.Barrier.Rating(1, 2) 4
=PO.WI.Barrier.Rating(2, 2) 4

Need a custom LAMBDA? Suggest a New Lambda