# VORVIEW / VORLAX

## Save a source to Aero Model

**Save to Lift/Drag Model** publishes available coefficients, reference geometry,
conditions and plotted samples to the active aircraft's Aero Model library. Open
VORVIEW from Main and keep Main open; project identity, current source inputs and
read-only protection are checked before saving. Newly completed runs retain their
solve-time geometry signature; older unsigned results remain unverified.

VORVIEW's polar contains **induced drag only**. Aero Model labels that basis and
rejects averaging it with total-drag sources. Its highest sampled lift is not a
demonstrated stall limit. Select an Official source in the
[Aero Model widget](widgets/aero-model.md); that selection does not yet change
downstream mission, performance or simulator calculations.

VORVIEW is a draggable thumbnail launcher in the CFD pane, after OpenVSP. It passes
a detached snapshot of the currently loaded JET JSON through the shared IndexedDB
page handoff to `Pages/VORVIEW.html`. There is no new default-aircraft fallback.
Saved layouts gain the widget automatically; AE210 keeps the CFD pane hidden.
Completed results return to the opening Main aircraft under `VorView`, through the
host-owned results binding. Save results exports aircraft JSON with that dictionary.
Only coefficients, plotted samples, execution references and plot presentation are
saved there; solver logs and native decks remain separate downloads. Reopening the
widget or loading the saved aircraft restores plots without running VORLAX.

The browser page is a JETcentral VORVIEW-style interface. Numerical execution uses
the genuine older VORLAX 2017 Fortran source in `JETcentral/vendor/vorlax`, pinned to
upstream commit `0c8f8180ce871ded9e0c200b4edfe3fe42f78945`. The original VORVIEW desktop
GUI is not bundled. ASU's newer Windows-only VORLAX release is a separate distribution.
See the vendor README for provenance and checksum. Source remains unmodified.

Each result plot has a Save Plot action using the shared Save As dialog. Formula and
slope annotations are grouped in draggable insets inside each plot; their positions
are retained in saved result JSON and plot exports. Neutral Point Travel vs. Mach
also shows static margin on the right axis, in percent: `(xNP - refX) / chordFt * 100`,
using the moment reference and reference chord of the executed case. Missing neutral
points remain gaps in both curves. These are presentation-only derived values.

## Native Linux or macOS

Install Python 3.10+ and GNU Fortran. On Ubuntu/Debian:

```sh
sudo apt-get install python3 gfortran
python3 JETcentral/scripts/build-vorlax.py --output ./vorlax
python3 JETcentral/scripts/vorlax-server.py --solver ./vorlax --allow-origin https://jetdesign.online
```

On macOS install GNU Fortran, then use the same Python commands. The page shows the
actual origin to allow. The helper binds only to 127.0.0.1:8774 and accepts only
configured origins and per-browser job-owner tokens. No Windows/Wine is required.
The page's Download Helper button offers Windows EXE, Mac helper ZIP and the
source/Python ZIP. All downloads use the shared Save As flow; cancelling saves nothing.
Windows bundles the pinned portable Python runtime and the checksum-verified VORLAX
2017 Windows reference solver, so no separate Python/compiler installation is needed.
The Mac ZIP includes an executable `start-vorlax-helper-mac.command` launcher, the
Fortran source and build script. Install Python 3.10+ and GNU Fortran (Homebrew:
`brew install gcc`), extract the ZIP and open the launcher. It builds natively for
Intel or Apple Silicon on first launch and caches the solver under
`~/Library/Application Support/JETcentral/VORLAXHelper`. Keep Terminal open.

The source/Python ZIP retains the portable source, build script and stdlib-only
service, without Windows binaries. Compile it on the machine that runs the solver.
Run `node JETcentral/scripts/package-vorlax-helper.mjs` to rebuild all downloads.
Windows EXE builds require Windows; normal website builds refresh the packages
before the CFD helper packaging phase. Provenance/checksums are in the vendor README
and `windows-solver.json`. Cloud VPS remains the default and needs no helper.

## Cloud VPS (page default)

Cloud execution uses the same native Linux binary behind the authenticated
`CLOUD/vorlax-api.php` same-origin gateway. Browser users never receive the server
credential. Access control, owner isolation, queued jobs, cancellation and retention
reuse the established solver job service. Payloads are structured, bounded panels;
clients cannot submit shell commands, paths or arbitrary solver decks.

`JETcentral/scripts/deploy-vorlax-cloud.ps1` uploads source and service files, compiles
on the existing Ubuntu VPS, installs a dedicated systemd service, validates a new
`/vorlax/` route while preserving FEA/CFD/OpenVSP routes, verifies authenticated HTTPS,
and merges only `vorlax_endpoint` and `vorlax_token` into private website config.
The installer requires the existing FEA Caddy site. Website upload is separate.
Editing these files does not deploy the VPS or change the live website.

## Analysis model

Dimensions are feet; geometry axes are X aft, Y right, Z up. Reference area is ft².
Enabled wings, tails, winglets, dorsal and additional surfaces become trapezoidal
lifting panels. Multi-section wings retain their joins. The shared wing/strake
blend is sampled into four strips per wing section. The preview also shows the
fuselage top-down profile as amber reference geometry. It is sampled at eight
longitudinal intervals, retains pointed nose/tail vertices and is drawn in the
wing-root plane. The profile is not included in native lifting-panel input:
fuselage thickness/loads, inlets and engine bodies remain excluded. A thin-body
lifting-panel attempt produced unreliable native loads, so it is not used.
The preview explicitly identifies the fuselage as reference-only geometry.

NACA camber is approximated by the shared airfoil zero-lift-angle calculation as
an equivalent incidence slope. Explicit camber coordinates and control-surface
deflections are not modeled. The 2017 source's camber-input branch is incomplete;
the adapter deliberately uses its supported flat-panel path. Twisted/deflected
geometry is not advertised as supported. Symmetry about Y=0 is assumed. The moment
reference defaults to incoming takeoff CG projected onto Y=0; X and Z remain editable.
Positive page beta means wind from the right and maps to negative VORLAX PSI.

The UI allows Mach 0–2.0 and at most 35 alpha cases. Density is bounded
against the source's fixed arrays. Generated cases select the built-in direct solver; this avoids iterative divergence observed on the MASTER aircraft. The default sweep is −10° to 24° in 1° steps. It runs in native batches of at most 16 angles, preserving the upstream fixed arrays. Results include draggable-label CL–α, CDi–CL induced drag polar, Cm–α and neutral-point Mach charts, plus the coefficient table. Multi-batch input decks export together as JSON containing each native input text. The 35-angle sweep requires the updated VPS/helper; older services are detected before submission. Results show native reported CL, CDi, CY, Cm, Cl
and Cn; native output/log are retained and downloadable. CDi is induced drag only.
There is no viscous drag, separation or stall prediction. Results require mesh and
model validation before engineering use. Alternate VORLAX versions may have different
axis/output conventions and must not be substituted without adapting the parser.

## Verification

```sh
node --test JETcentral/tests/vorlax.test.mjs
VORLAX_EXE=/absolute/path/vorlax python3 JETcentral/tests/test_vorlax.py
```

The Python checks run actual numerical jobs through the native solver and HTTP
service, verify job ownership/origin restrictions, and check the original AR6 wing
reference: Mach 0, alpha 5°, CL 0.36340, CDi 0.00729 with its original lattice.
Build tested with GNU Fortran 15 on Ubuntu; macOS source build is documented but
has not been run in this Windows workspace.

Browser acceptance: set `VORLAX_EXE` to a native binary for the host, then run
`node JETcentral/scripts/check-instance-startup.cjs check-vorview.cjs` with
`PLAYWRIGHT_MODULE` pointing to Playwright if it is not installed locally.

Validation limitation: after the direct-solver setting was selected, the Windows
reference executable completed the MASTER browser run. An additional Linux rerun
was blocked by WSL reporting insufficient system resources. The same unmodified
source had already compiled and passed the Linux reference/HTTP checks.

Helper verification: `node JETcentral/scripts/check-vorlax-helper-executable.cjs` extracts the Windows bundle and solves a real case using only bundled components. `node JETcentral/scripts/check-instance-startup.cjs check-vorview-helper-download.cjs` verifies all three Save As choices, cancellation, and cloud default. Mac launcher syntax, ZIP permissions and source checksum are checked here; native macOS launch requires Mac verification.


## Curve labels and neutral-point Mach sweep

The drag polar has CL on X and induced CDi on Y. Curve annotations follow Wind Tunnel Analysis: lift and pitching-moment least-squares fits use alpha -5 to +10 degrees and label CLalpha/CMalpha per degree, zero-lift alpha, sampled CLmax and trim alpha. The drag equation uses valid points in CL -0.25 to +0.50; a convex quadratic minimum inside the observed CL range is labeled CDi,min, with a sampled-minimum fallback. CDi remains induced drag, without a total/parasitic drag estimate. Every annotation is draggable and its normalized position is included in result JSON.

Every new run also requests 20 Mach points from 0.1 through 2.0 in 0.1 steps, using beta=0 and alpha=-2,0,+2 degrees. Each Mach is a separate native deck so the original 16-Mach fixed array is respected. The source's LAX flag uses cosine chordwise spacing below Mach 1 and linear spacing at/above Mach 1. Native lift and pitching-moment slopes give xNP = refX - chord * Cm_alpha / CL_alpha (ft aft from the nose); delta X is relative to Mach 0.1. All Mach points and their status are shown in the chart/table and saved result. Failed, nonfinite or nonpositive/near-zero lift-slope cases retain unavailable values and curve gaps; they are never interpolated. A finite result is not a mesh-convergence claim, especially near Mach 1; linear potential flow does not resolve transonic shocks/separation.

The helper advertises neutralPointMachSweep and maxMach=2. Updated clients check these before submission. Old cases without a neutralPointSweep request remain supported by the service. All alpha and Mach input decks can be exported together. The job bound is 900 seconds, with cancellation still terminating the worker and native process tree. Rebuild/reinstall local helper downloads or update/restart the cloud service to use the new request; workspace changes alone do not deploy it.

Conditions initializes Mach from the aircraft Cruise constraint/shared cruise-speed hint on every aircraft load or handoff (Mach 0.80 compatibility default when missing). Mach remains editable. Panel densities, reference dimensions and moment-reference X/Z live inside More, collapsed initially; they retain the same values, units, validation and request bindings.
