# Blowdown valve (BDV)

Depressuring valve: full-bore trunnion ball valve with a red spring-return scotch-yoke actuator that fails open, normally closed. Same accessories as the ESDV: limit switch box, solenoid, quick exhaust, filter-regulator and tubing. `open` turns the ball and the indicator.

**Standards:** API 6D, API 521, IEC 61508 / 61511, ASME B16.10, ASME B16.5, ISO 5211

## Installation

```bash
npx -y https://decktwin.com/cli/deck-twin-0.2.2.tgz add blowdown-valve
```

Copies `valves/blowdown-valve.tsx`, any helper files it imports and the shared `lib/` into `src/components/deck-twin/`. Needs `three`, `@react-three/fiber` and `@react-three/drei`.

## Usage

```tsx
import { Canvas } from '@react-three/fiber'
import { OrbitControls } from '@react-three/drei'
import { Stage } from './components/deck-twin/lib/stage'
import { BlowdownValve } from './components/deck-twin/valves/blowdown-valve'

export default function Scene() {
  return (
    <Canvas shadows camera={{ position: [8, 5, 9], fov: 35 }}>
      <Stage>
        <BlowdownValve tag="BDV-2201" />
      </Stage>
      <OrbitControls makeDefault />
    </Canvas>
  )
}
```

## Props

| Prop | Type | Default | Range |
| --- | --- | --- | --- |
| `nps` | `number (NPS, in)` | `4` |  |
| `rating` | `150 \| 300 \| 600 \| 900 \| 1500 \| 2500` | `900` |  |
| `open` | `number` | `0` | 0 – 1 |
| `tag` | `string` | `""` |  |
| `...group` | position, rotation, scale… |  |  |

## Ports

Flange faces in the component's local frame, metres. Origin: pipe centreline, flow along X.

| Id | Label | Position | Direction | Size | Class |
| --- | --- | --- | --- | --- | --- |
| `A` | End A | -0.229, 0.000, 0.000 | -1, 0, 0 | 4" | 900 |
| `B` | End B | 0.229, 0.000, 0.000 | 1, 0, 0 | 4" | 900 |

## P&ID

Actuated ball valve like an ESDV (rectangular spring-return actuator, solenoid box) but marked FO, usually drawn black-filled or marked NC because it is normally closed. It sits on a line from the vessel or compressor to the flare header, often followed by a restriction orifice (RO).

tag BDV · ISA BDV · ISA XV · ISA ZSO · ISA ZSC · ISA 5.1 (actuator) on an ISO 10628-2 ball valve body; API 521 depressuring

Tell it from an ESDV by the FO mark, the flare (FL / BD) line it sits on and the BDV tag. The restriction orifice downstream is drawn as a pair of short bars across the line (like an orifice plate) tagged RO.

Blowdown valve datasheet (API 6D + actuator sheet, API 521 depressuring case) fields and the props they set:

| Field | Prop |
| --- | --- |
| Size | `nps` |
| Pressure class | `rating` |
| Tag number | `tag` |

## Typical suppliers

Emerson Bettis · Cameron (SLB). The geometry is generic and sized from public standards. It is not vendor CAD.

## Source

`valves/blowdown-valve.tsx`. This is the component file only: it imports shared code, so install it with the command above rather than pasting it alone. https://decktwin.com/r/blowdown-valve.json has every file.

```tsx
// Blowdown valve (BDV): full-bore trunnion ball valve, spring-return fail-open scotch-yoke actuator, solenoid, QEV, limit switches. API 6D, IEC 61508/61511 final element.
import { KitMesh, type GroupProps } from '../lib/mesh'
import type { MatKey } from '../lib/kit'
import { port, type Port } from '../lib/ports'
import type { Rating } from '../lib/standards'
import { clamp, useKit2 } from './_body'
import { buildEsd, esdLength } from './_esd'

export interface BlowdownValveProps {
  /** nominal pipe size, inches */
  nps?: number
  rating?: Rating
  /** 0 closed … 1 open (quarter turn); fails open (normally closed) */
  open?: number
  body?: MatKey
  actuator?: MatKey
  tag?: string
}

export const defaults = { nps: 4, rating: 900 as Rating, open: 0, body: 'valveBody' as MatKey, actuator: 'actuatorRed' as MatKey, tag: '' }

export function ports(p: BlowdownValveProps = {}): Port[] {
  const { nps, rating } = { ...defaults, ...p }
  const L = esdLength(nps, rating)
  return [port('A', 'End A', [-L / 2, 0, 0], [-1, 0, 0], nps, rating), port('B', 'End B', [L / 2, 0, 0], [1, 0, 0], nps, rating)]
}

export function BlowdownValve(props: BlowdownValveProps & GroupProps) {
  const { nps, rating, open, body, actuator, tag, ...group } = { ...defaults, ...props }
  const [fixed, moving] = useKit2((k, mv) => buildEsd(k, mv, { nps, rating, body, actuator, failOpen: true, tag }), [nps, rating, body, actuator, tag])
  return (
    <group {...group}>
      <KitMesh data={fixed} />
      <KitMesh data={moving} rotation-y={-(1 - clamp(open, 0, 1)) * (Math.PI / 2)} />
    </group>
  )
}

export default BlowdownValve
```
