What a surrogate is

A fast model trained on the results of a slow one: from a design to a few numbers, or to the whole field.

Outcome: Say what a surrogate model is, and what it is trained on; tell a scalar surrogate from a full-field one.

An engineer runs a simulation or a test for a handful of designs, and each run can be slow: hours of computational fluid dynamics (CFD, the simulation of gas and liquid flow) or of crash analysis. The surrogate learns how the inputs of those runs relate to their results, then answers for new designs, usually in a small fraction of that time.

y=f(x)≈f^(x)y = f(x) \approx \hat{f}(x)
(1-1)
ff is the simulation, f^\hat{f} the surrogate, xx the inputs and yy the results.

The inputs xx are what the engineer chooses: design parameters (a wing’s sweep, a fin’s thickness), operating conditions (speed, angle of attack, heat load), and sometimes the whole geometry. The outputs yy are what is read from the simulation: a few numbers such as lift or peak temperature, or a whole field such as the pressure at every point of the surface.

The smallest example is a curve. Six CFD runs give the drag of a body at six speeds, from 20 to 70 m/s. A smooth curve fitted through them gives the drag at any speed in between without another solver run. That curve is a surrogate.

Example 1-1. The drag curve as a surrogate, with NumPy
import numpy as np

# Six solver runs: speed in m/s, drag in N.
speed = np.array([20, 30, 40, 50, 60, 70])
drag = np.array([41, 92, 160, 251, 362, 489])

# Fit drag ≈ a v² + b v + c through the six results.
surrogate = np.poly1d(np.polyfit(speed, drag, deg=2))1

# A new speed, without another solver run.
print(f"{surrogate(45):.0f} N")2
# Far outside the six speeds, it still answers.
print(f"{surrogate(150):.0f} N")3
  1. np.polyfit finds the coefficients aa, bb, cc of the degree-2 polynomial closest to the six results in the least-squares sense; np.poly1d wraps them as a function of speed.
  2. One evaluation of the polynomial at 45 m/s, not another solver run.
  3. The same evaluation at 150 m/s, more than twice the fastest run.

Example 1-1 prints 204 N at 45 m/s, and 2233 N at 150 m/s, with no run near it. Far outside its data a fitted model still returns a number, and nothing in the number says so. At best, a surrogate is reliable near the runs it was trained on.

Two kinds of output

A scalar surrogate predicts a few numbers, such as lift, drag or peak temperature, from a handful of design parameters. It can be built from few runs, and some methods also estimate how unsure they are. It does not locate anything on the part: it gives a chip’s hottest temperature, not where the hot spot is.

A full-field surrogate predicts the whole field on the geometry: pressure at every surface point, temperature in every cell. Once tested, this is what can stand in for a simulation’s field output, within its training range, and it is the main subject of this site. Full-field models differ in how they see the geometry: as a regular grid of cells, like the pixels of an image; as the simulation mesh, a graph of nodes joined by edges; or as a cloud of scattered points.

Scalar models are taught in Fitting and testing, which ends with a first field model; neural field models start in Neural network basics.

The running example

The running example is a small aircraft with two inputs: the angle of attack α\alpha (how steeply the wing meets the air, −2° to 8°) and the wing sweep Λ\Lambda (how far the wings are angled back, 20° to 36°). Its output is the pressure coefficient CpC_p (the surface pressure, scaled so that results at different speeds can be compared; see physical fields) over its surface, from a deliberately simple solver that runs in seconds. A small neural network trained on solver runs predicts it (Figure 1-1). From Unit 2 on, the listings load runs of the same solver and build up one file of functions, aircraft.py, that later listings import (from runs to arrays).

Cp -1.5 (suction)+1
Figure 1-1. The course’s running example: the pressure coefficient Cp on a small aircraft at α 4°, sweep 28°, as its surrogate predicts it.

An industrial run takes far longer. A steady CFD run of a NASA high-lift aircraft model took about 55 hours on 576 cores (Zauner et al. 2024), and the full-vehicle crash runs of CarCrashNet took 1.4 to 2.3 hours each on 64 to 128 processes.

Against image or text data, simulation data differs in six ways: physical units, best replaced by non-dimensional quantities (physical fields); labels that carry numerical error (is the training data right?); few examples, since a run of thousands of points is closer to one example than to thousands (overfitting); points that are not independent, so splits are made by run (train, validation and test); non-uniform meshes, where errors are weighted by cell area (measuring error); and physical laws and design-space edges that a model should respect (physics constraints, limits and trust).