# Initial engineering tools — methods and limits

Six tools are implemented as independent, pure calculations plus a small DOM
adapter. `js/engineering/units.js` owns conversion factors, supported units, signal
endpoints, and the user-requested sensor ranges. `calculations.js` contains no DOM
or simulator dependencies. `ui.js` handles forms and result presentation only.
FCU algorithms, thermal models, and tuning are unchanged.

All computation stays in page memory. No external scripts, requests, account,
storage, framework, build step, or server is required. External source links open
only when followed. Invalid edits hide previous results until recalculated; errors
never masquerade as a valid old result. Display rounding does not affect selection
or reverse conversion. Unit changes in Cv, valve authority and damper inputs retain physical values.

## Valve Cv

`Cv = Q_US_gpm * sqrt(SG / deltaP_psi)` for non-choked turbulent liquid flow.
Flow, pressure drop across the valve, and SG must be finite and strictly positive.
Water's default SG = 1 is explicit and editable. Supported flow inputs are US gpm,
L/s, L/min, and m³/h; pressure inputs are psi, kPa, and bar.

This is not a gas/steam equation, a full valve sizing procedure, or a valve/actuator
selector. It omits viscosity, fitting effects, pressure recovery, flashing,
cavitation, rangeability, close-off, and equipment compatibility checks.
Example: 10 US gpm, 4 psi, SG 1 -> Cv 5.

Source: [Swagelok, Valve Sizing, liquid flow equation](https://www.swagelok.com/downloads/webcatalogs/en/MS-06-84.pdf).

## Valve authority

`a = deltaPv / (deltaPv + deltaPrest)`. Both losses refer to the same design flow,
with the valve fully open. Constant differential pressure across the selected
series circuit is assumed. The second input excludes the valve. UI supports
independent kPa/psi/bar units; results report ratio, percent and total loss in kPa.
Valve loss must be positive; remaining loss may be zero (authority 1). Blank,
negative, nonfinite or numerically unresolvable inputs are rejected. No universal
acceptance threshold or PICV assessment is assigned.

Source: [Belimo Electronic Valve Application Guide, printed pp. 11 and 14](https://www.belimo.com/mam/americas/technical_documents/Support%20material/belimo_electronic-valve-application_guide_en-us.pdf).

## Motor current and current sensor range

Single-phase: `I = shaftHP * hpW / (V * efficiency * PF)`.
Balanced three-phase: `I = shaftHP * hpW / (sqrt(3) * V_line_to_line * efficiency * PF)`.
The entered efficiency percentage is divided by 100. Mechanical HP is used, with
`hpW = 745.6998715822702 W`, rather than metric horsepower. Shaft HP describes the
evaluated output load. Efficiency and PF must describe that operating point.
Default 90% efficiency and user-approved PF 0.85 are editable example inputs.

Source: [ABB/Baldor, power factor and motor efficiency](https://www.baldor.com/our-profile/news/company-news/detail?id=%7B0585DDBC-9DF7-49BC-A1C3-9BDAE434D06A%7D).
Its motor formula uses rounded 746 W/HP and 1.732; this implementation uses the
mechanical horsepower conversion and `Math.sqrt(3)`.

Choose the smallest maximum in `[10,20,50,100,150] A` that contains the unrounded
estimate (inclusive upper bound). This is the user's requested range list, not a
standard or a manufacturer's catalog. No margin is silently added. Above 150 A,
return `rangeA: null` and show that no listed range fits; never cap at 150 A.

10 HP, 90%, 460 V, three-phase, PF 0.85 -> 12.234442 A -> 0–20 A.
No starting/inrush, protection/conductor sizing, waveform, VFD efficiency or
compatibility, sensor overload capability, or measurement accuracy is inferred.
Actual nameplate/measured current and sensor data take precedence over the estimate.

## Rectangular damper torque

`Area_ft2 = width_in * height_in / 144`; `T_lbf_in = Area_ft2 * loading`.
Metric dimensions convert with exactly 25.4 mm/in. Output includes m², ft²,
lbf·in, and N·m. 1 lbf·in = 0.1129848290276167 N·m.

The user requested a sourced very-low-leakage example rather than the original
generic 5 lbf·in/ft² suggestion. The default is now **7 lbf·in/ft²**, editable.
[Siemens, Damper Actuators Selection and Sizing, Engineering G-25, Table 1](https://sid.siemens.com/api/khub/documents/~wjID6cGmc1kr9RGf8DU4A/content)
lists that interim estimate for very low leakage at approach velocities no higher
than 1200 fpm. That table describes very low leakage as less than 5 CFM/ft² at
1 inH₂O static pressure drop. These are conditions from that guide, not a universal
AMCA class definition or a claim that this tool verifies leakage performance.

24 x 24 in = 4 ft² -> 28 lbf·in -> 3.163575 N·m with this example.
The guide calls for manufacturer data for actual conditions. The UI estimates
damper torque only; it does not choose an actuator model, minimum catalog rating,
quantity, or safety factor. Manufacturer-specific minimum ratings, breakaway,
seals, linkage, multi-section behavior, installation, velocity, and pressure remain
application checks. The example is not a guarantee for every low-leakage damper.

## Bidirectional linear scaling

`y = y0 + (x - x0) * (y1 - y0) / (x1 - x0)`.
Each side can be 4–20mA, 0–10V, or custom engineering endpoints and a unit label.
Reverse-acting spans are valid. Zero input or output spans are rejected so the
mapping remains reversible. Outside-span values are extrapolated and explicitly
identified; they are never clamped. No sensor-fault threshold is invented.
Swap uses the full computed value and exchanges both endpoints and units.

Example: 12mA -> 50°C on 0–100°C, or 5V on 0–10V; 5V -> 12mA.
This is numerical mapping, not an electrical conversion circuit. Nonlinear
transducers and square-root extraction are outside scope.
Reference: [Omega SYNC manual, scaling operations](https://assets.omega.com/manuals/SYNC%20M6746_0223.pdf).

## BMS unit converter

Supported quantities: volumetric flow, temperature, temperature difference, volume,
pressure, length, area, air velocity, power/heat rate, energy, and torque.
Each unit converts through one reference scale; temperature alone has offsets.
Absolute temperature below 0 K is rejected. Signed differences are allowed.
Changing quantity clears the previous input to avoid transferring unrelated values.

Conventions: US gallon = 0.003785411784 m³; Imperial gallon = 0.00454609 m³;
inch = 0.0254 m; foot = 0.3048 m; conventional inH₂O = 249.08891 Pa;
conventional mmH₂O = 9.80665 Pa; psi = 6894.757293168 Pa;
Btu IT = 1055.05585262 J; refrigeration ton = 12000 Btu IT/h.
Factors with published limited precision remain approximate.

The converter does not change gauge/absolute pressure reference, convert actual
to standard airflow, apply fluid density, or conflate power and energy. It does
not convert resistance to temperature or perform psychrometric calculations.
Reference: [NIST SP 811 conversion factors](https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b9).

## Voltage drop

The added Voltage Drop Calculator supports a two-wire copper cable and single end
load, DC A/W and single-phase AC A/VA. AWG/mm² material estimates or manufacturer
20°C resistance, m/ft distance and conductor temperature feed the pure calculation.
AC uses lagging PF with cable reactance excluded; power inputs infer fixed current.
See [complete equations, references and limits](voltage-drop-calculator.md).
Run `node tests/voltage-drop-tests.cjs` for 24 additional numerical/DOM checks.

## Temperature Sensor and Relay Selectors

Both specification guides are implemented. Temperature selection compares exact
input/sensor profiles, installation, range, accuracy, conductors and transmitter
power. Relay selection separates DDC/coil supply and demand from contact load
and arrangement. Unknown ratings remain unresolved; manufacturer applicability
must be confirmed before relay current comparisons. No SKU database is included.
See [selection rules and examples](selection-tools.md). Run
`node tests/selection-tools-tests.cjs` for 39 pure/actual-page DOM tests.

## Verification

Run `node tests/engineering-tests.cjs` for numerical examples, invalid inputs,
sensor boundaries, equivalent units, temperature offsets, reverse scaling,
unit-pair round trips, and actual-page DOM interactions. Run `node tests/run-node.cjs`
for the existing FCU tests, FCU wiring, website links, and directory checks.
Current result: 78 engineering/actual-page DOM cases and 91 FCU cases pass, with
website and FCU wiring checks also passing.
These do not establish physical validation. Actual browser rendering/console
inspection remains pending because file-URL navigation was rejected by the browser
security policy in this task; no alternate surface or server bypass is used.
