Abstract
A surrogate model is a fast statistical stand-in for an expensive simulation: trained on solved cases, it predicts new ones almost instantly. It is tested here, for a process engineer, on the stirred reactor of the previous issue. The pitched blade turbine of reactor R-101 was solved with the same OpenFOAM model at its coarse mesh level for 54 geometries, varying blade angle (30° to 60°), D/T (0.25 to 0.50) and C/T (0.20 to 0.50); seven cases did not settle and were set aside. A Gaussian process, a quadratic response surface and a small neural network were compared with published values. On held-out cases the surrogates predicted the pumping number within 2.9% RMS against 12.3% for the published value, but the power number only within 5.4% against 10.5%. The Gaussian process's error bars were too narrow: 75% of leave-one-out power numbers fell within two standard deviations. Outside the training range errors reached 56%, and the worst was missed by the band. Active learning gave no clear gain once the kernel and the number of cases were held equal. A field surrogate built on proper orthogonal decomposition reproduced the flow pattern only roughly. An optimization on the surrogate predicted a 15% power saving; one CFD check found the optimum needed 5% to 11% more power than the Issue 24 geometry: no saving. A prediction took 0.1 ms against about 11 minutes of CFD, but the surrogate learns the coarse-mesh CFD, which reads about 13% low, and its gaps.
Keywords: surrogate model; Gaussian process regression; machine learning; computational fluid dynamics; stirred tank; pitched blade turbine; active learning; proper orthogonal decomposition
1. Introduction
The previous issue solved reactor R-101 of the Chmltech equipment sizing series with three impellers in OpenFOAM and compared the power and pumping numbers with published values [1]. Each solution took between half an hour and an hour and a half of one processor core. That is cheap for one answer and expensive for a design study: a sweep of blade angle, diameter and clearance at five values each is 125 cases, and an optimizer may ask for hundreds.
A surrogate model, also called a metamodel or response surface, is a fast approximation of an expensive simulation, trained on a set of solved cases [2]. Once trained it returns an answer in milliseconds. The idea is old in engineering design, where kriging, the geostatistical name for Gaussian process regression, has been used to stand in for simulations since the 1990s [3, 4]. It is now often sold as artificial intelligence. How many CFD runs does a useful surrogate need? How accurate is it inside the range it was trained on? Does it say when it is guessing? What does it cost, and when does it pay? And what does it actually learn: the physics, or the simulation, errors included?
This paper answers those questions for one well-defined problem: the power number and pumping number of a four-blade pitched blade turbine in R-101 as functions of three geometric choices. It follows the journal's earlier work on AI in engineering calculations, which found that the risk lies less in the arithmetic than in the inputs and the framing [5], and on hybrid digital twins, which found that a data model is only as good as the range of its data [6].
2. The CFD Dataset
2.1 The model
Every case was solved with the stirred-reactor model of Issue 24, unchanged: reactor R-101 (T = H = 2.34 m, four baffles of width T/12, a water-like liquid at 84 rpm), steady multiple-reference-frame flow with the standard k–ε model and wall functions in OpenFOAM v1912, a 90° periodic sector, and the same convergence test, which stops a case when the power number from the impeller torque, the power number from the torque on the tank walls and the pumping number have each changed by less than 0.5% between two samples 750 iterations apart, after at least 1,500 iterations [1]. The test compares only those two samples, so a quantity can still swing between them: six settled cases varied by 0.8% to 2.1% within that span, small against the surrogates' errors in Section 4. Only the impeller changes. It is a four-blade pitched blade turbine with flat blades of width D/5, pumping down, and three of its dimensions are varied (Table 1). Everything the Issue 24 model ties to the impeller, the rotating zone, the refinement zone around the blades and the blade proportions, moves with it, and the background mesh keeps the same cell size, so a change of clearance does not change the resolution.
| Input | Symbol | Range | Issue 24 value |
|---|---|---|---|
| Blade angle from the horizontal | θ | 30° to 60° | 45° |
| Impeller diameter over tank diameter | D/T | 0.25 to 0.50 | 0.377 (D = 0.88 m) |
| Clearance over tank diameter (to blade mid-height) | C/T | 0.20 to 0.50 | 0.333 |
To keep the dataset affordable on two processor cores, every case uses the coarse mesh of the Issue 24 mesh study, 62,300 to 87,647 cells in the 90° sector. A first case at the Issue 24 geometry reproduced the Issue 24 coarse-mesh result exactly: Np = 1.1369 against 1.1369, Nq = 0.8282 against 0.8282, on 72,891 cells in 2,500 iterations. The coarse mesh has a cost, discussed in Section 8: it reads the power number low.
The speed was held at 84 rpm. The impeller Reynolds number ρND²/μ runs from about 0.5 to 1.9 million across the training range (2.3 million for the largest extrapolation), where the power and pumping numbers of a baffled tank no longer depend on it [7], so a change of speed would add cost but no information.
2.2 The cases
The training set is the first 32 points of a scrambled Sobol sequence over the three inputs [8, 9], of which 28 settled (Section 2.3). Taken in order, any leading part of a Sobol sequence is itself spread evenly through the space, which allows a learning curve to be drawn from one set of runs. A common rule of thumb asks for about ten cases per input [10]. A separate Latin hypercube of eight points inside the central 90% of each range is the held-out test set [11], and the Issue 24 geometry joins it as a ninth. Four extrapolation cases each take one input outside its range: blades at 70°, a 90° flat-blade turbine (radial flow, a different kind of impeller), D/T = 0.55 and C/T = 0.15. Eight more cases were chosen by active learning (Section 6), and one checks an optimum found with the surrogate (Section 7). Figure 1 shows the design.
2.3 Cases that did not settle
Seven of the 54 cases (4 training, 2 active-learning, 1 extrapolation) did not meet the stopping test within the limit of 5,000 iterations. Their monitors over the last 1,000 iterations, measured as the swing from lowest to highest value as a percentage of the mean, show three kinds of behaviour. Four (60°, D/T 0.26, C/T 0.49; 47°, D/T 0.43, C/T 0.42; 53°, D/T 0.38, C/T 0.46; 55°, D/T 0.45, C/T 0.36) swung by 5% to 9% in the impeller power number and by 16% to 24% in the wall torque: the signature of a steady solver alternating between circulation patterns. One (60°, D/T 0.33, C/T 0.49) held its impeller torque within 2%, but its wall torque swung by 19% and its pumping number by 14%. One (30°, D/T 0.48, C/T 0.50) did not oscillate but drifted slowly, by about 1% in power number over the last 1,000 iterations, and might have settled with more iterations. The last is the 90° flat-blade extrapolation case, a radial impeller: its power number swung by 8%, and its pumping number, defined as the downward flow under the blades, has little meaning for a radial discharge and swung far more. That extrapolation therefore has no CFD answer to test against. All six rejected pitched blade cases have the impeller high in the tank, C/T of 0.36 or more. Pitched blade turbines are known to change their circulation pattern with clearance, from a stream that reaches the bottom to one that turns outwards towards the wall, and near the change the flow can switch between the two [12]. The cases were set aside, not averaged: a steady model has no right answer to give where the flow switches, and a surrogate trained on a forced average would smooth over a real change in behaviour. The line between settled and rejected is not sharp, though: some settled cases also varied by 0.8% to 2.1% (Section 2.1).
The 47 settled cases took 1,750 to 5,000 iterations and 6 to 20 minutes of one processor core each, 9.7 core-hours in all including the rejected cases. Their wall and impeller torques agree within 0.5% in the median and 4.2% at worst, and every equation was forced to solve at least once in every iteration. Across the training and test sets the power number runs from 0.51 to 2.01 and the pumping number from 0.52 to 0.98: blade angle and diameter change the power number almost fourfold.
3. Surrogate Models
Four ways of predicting Np and Nq from (θ, D/T, C/T) were compared, each with the inputs scaled to the unit cube.
A Gaussian process treats the unknown function as a random function whose values at any set of points are jointly normal, with a covariance that falls off with distance [4]. Trained on n cases with outputs y, it predicts at a new point x* a mean and a variance, Eq. (1) and Eq. (2):
where K holds the covariances between training cases, k* those between the new point and the training cases, and σn² is a small noise term. The covariance here is a squared exponential with a separate length scale for each input, Eq. (3), whose amplitude, length scales and noise were fitted by maximizing the marginal likelihood, with ten restarts [13]:
The variance is what makes the Gaussian process attractive: it is the model's own estimate of its error, small near training cases and growing away from them. Whether that estimate can be trusted is tested in Section 5.
A quadratic response surface fits the ten terms of a full second-order polynomial in the three inputs by least squares; it is the classical tool of design of experiments. A neural network, a multilayer perceptron with two hidden layers of 16 units and smooth activation, was trained by quasi-Newton optimization with light weight decay; the prediction is the average of five networks started from different random weights. Finally, published values: Np = 1.27 for a four-blade 45° turbine [7], scaled with blade angle by the factor \((2\theta/\pi)^{0.9}\sin^{1.6}\theta\) of Hiraoka and co-workers' correlation for pitched paddles [14], in its fully baffled form; R-101's baffles are narrower than the fully baffled condition, so the scaling is an approximation, and Nq = 0.79 [7]. The published values have no dependence on D/T or clearance, although the power number of a pitched blade turbine is known to depend on both [15]; they stand for what an engineer would use with no CFD at all.
4. Accuracy Inside the Training Range
Figure 2 lets the reader explore the trained models. Table 2 gives the errors. Each model was scored two ways: by 8-fold cross-validation on the training set, in which each case is predicted by a model trained on the others, and on the held-out cases, which no model saw.
- Gaussian process
- 95% band
- Response surface
- Neural network
- Published values
- CFD, training
- CFD, held out
- CFD, extrapolation
- CFD, active learning
- CFD, optimum check
| Model | Np, cross-validation | Np, held out | Nq, cross-validation | Nq, held out |
|---|---|---|---|---|
| Gaussian process | 13.3% | 6.9% (15.7%) | 6.8% | 2.9% (7.4%) |
| Quadratic response surface | 18.3% | 6.6% (12.3%) | 10.3% | 3.8% (8.3%) |
| Neural network | 8.6% | 5.4% (14.2%) | 5.3% | 3.7% (8.3%) |
| Published values | 12.9% | 10.5% (15.1%) | 18.3% | 12.3% (23.9%) |
For the power number the surrogates beat the published values on the held-out cases (Figure 3), but not by much: RMS errors of 6.9%, 6.6% and 5.4% for the Gaussian process, the response surface and the network, against 10.5% for the published values. Cross-validation, which also tests cases near the edges and corners of the range, is less kind: 13.3%, 18.3% and 8.6% against 12.9% for the published values, so the Gaussian process and the quadratic response surface did no better than the published values over the whole range. The power number is the harder quantity here: it changes almost fourfold across the range, and the cross-validation errors show its CFD values scattering more about a smooth trend than the pumping number's. For the pumping number the surrogates are clearly better: 2.9%, 3.8% and 3.7% held out, and 6.8%, 10.3% and 5.3% in cross-validation, against 12.3% and 18.3% for the single published value, which cannot follow the strong effect of diameter and clearance on the pumping number that the dataset shows (Figure 2 and Table 2). The lowest errors came from the neural network on both counts for the power number, and from the neural network in cross-validation and the Gaussian process on the held-out cases for the pumping number. With a few dozen cases the differences between the surrogates are modest. The Gaussian process's own figure depends on which of several almost equally likely sets of hyperparameters the fit lands on: twenty fits from different starting points gave held-out power-number errors of 6.0% to 6.9%, so a difference of a point between the surrogates is not meaningful. What separates the Gaussian process is not accuracy but its error estimate.
5. Does the Uncertainty Tell the Truth?
A surrogate that says how sure it is can be used safely: trust the answer where the band is narrow, run the CFD where it is wide. That only works if the band is honest. In leave-one-out validation, each training case was predicted by a Gaussian process trained on all the others, with its hyperparameters refitted, and the error was compared with the predicted standard deviation. For a calibrated model about 68% of errors should lie within one standard deviation and 95% within two. For the power number 54% of the leave-one-out errors fell within one standard deviation and 75% within two; for the pumping number 54% and 86%. The band is therefore too narrow: the model is more confident than it should be, a common failing of Gaussian processes fitted to small datasets, whose length scales are estimated from the same few cases [4]. The worst power-number case lay 5.1 standard deviations from its prediction; the seven power-number misses beyond two standard deviations are spread through the range, four of them with blades steeper than 55°, where the power number rises fastest. On the held-out cases, which lie in the centre of the range, 8 of 9 power numbers and 8 of 9 pumping numbers fell within two standard deviations of the prediction.
The extrapolation cases are the harder test (Table 3 and Figure 4). Each takes one input beyond the edge of the training range while the others stay at the Issue 24 values; the 90° flat-blade case did not settle (Section 2.3), which leaves three. Errors grow well beyond those inside the range, to 56% at worst, for the pumping number at D/T = 0.55. The Gaussian process's ±2σ band missed the CFD value for Nq at D/T = 0.55: the model was confidently wrong. Elsewhere its band did widen enough to cover large errors (Np at 70° blades; Np at D/T = 0.55), but only by becoming wide: bands of ±14% to ±27% of the value, which are a warning, not an answer. The worst miss is instructive. With D/T = 0.55 the CFD pumping number fell to 0.398, far below every training case, and all three surrogates were too high: the Gaussian process and the response surface continued the gentle trend inside the range (+56% and +53%), and the network turned down but not nearly far enough (+25%). Why the flow drops so sharply was not examined here; the point is that nothing in the training set shows the change beginning, so no model trained on it could anticipate it. At 70° the published values, scaled with blade angle by Hiraoka's correlation, were 46% off for the power number, further than any surrogate; the response surface, whose quadratic terms happened to curve the right way, was closest at +8%. The response surface and the network have no band at all, so nothing in their output says that a case is outside their range.
| Case | Quantity | CFD | Gaussian process (±2σ) | Response surface | Neural network | Published values |
|---|---|---|---|---|---|---|
| 70° blades | Np | 2.04 | −22% (±27%) | +8% | −21% | +46% |
| Nq | 0.990 | −2% (±12%) | +2% | −1% | −20% | |
| D/T = 0.55 | Np | 1.66 | −10% (±14%) | −9% | +1% | −23% |
| Nq | 0.398 | +56% (±32%) | +53% | +25% | +98% | |
| C/T = 0.15 | Np | 1.31 | +2% (±17%) | +6% | −12% | −3% |
| Nq | 0.711 | −1% (±12%) | +3% | +2% | +11% |
6. How Many CFD Runs?
Figure 5 shows the error on the held-out cases as the training set grows through the Sobol sequence. The training cases are taken in Sobol order, settled cases only. With the first 8 the Gaussian process predicted the held-out power numbers within 14.9% RMS, worse than the published values' 10.5%; with 28 it reached 6.9%. The curve is not smooth: its lowest point, 5.8%, came at 12 cases, and adding cases after that first made it worse before it improved again. With nine held-out cases, one or two difficult training cases entering the set move the error by several points. The pumping number settled faster: 11.9% with 8 cases, then about 3.0% from 12 cases on. The response surface cannot be fitted with fewer cases than its ten terms, and is shown from 12. For this three-input problem a few tens of settled cases were enough to beat the published values; more cases improved the pumping number little and the power number unevenly.
Active learning chooses the next cases where the model is least sure, instead of following a fixed design [2, 3]. Starting from the first 16 Sobol cases, eight new geometries were picked one at a time from 4,096 candidates, each where the larger of the two Gaussian processes' scaled standard deviations was greatest, and the pick was then treated as observed at its predicted value so that the next pick went elsewhere. The eight picks all lie at or near corners of the range (Figure 1), where the model had no cases. Two of them, both with the impeller high in the tank, did not settle; one of those oscillated and the other drifted slowly (Section 2.3). The first comparison is between a Gaussian process trained on the 14 settled cases among the first 16 Sobol points plus the six settled picks, and one trained on the 22 settled cases among the first 24 Sobol points, each with its hyperparameters fitted to its own cases, both evaluated on 15 cases that neither used: the held-out set and the settled cases among Sobol points 25 to 32. Active learning gave RMS errors of 12.9% for Np and 5.6% for Nq, the space-filling design 10.0% and 4.3%, and the largest predicted standard deviation of Np over the range fell from 0.203 to 0.075. That comparison mixes three things: the choice of cases, the number of cases and the refitted hyperparameters. With the corner cases the fit chose almost no noise for both quantities, and, for Np, longer length scales in blade angle and D/T (shorter in C/T), which by itself shrinks the predicted uncertainty. Two controls separate them. With the same kernel, held fixed, for both designs, the mean predicted standard deviation of Np did not fall: 0.139 for the active design against 0.103 with the kernel fitted to the space-filling design, and 0.129 against 0.095 with the kernel fitted to all training cases; the errors were 8.2% against 10.0% and 8.3% against 8.5% for Np, and 4.8% against 4.3% for Nq. With equal numbers of cases, 20 each and hyperparameters refitted, the errors on the evaluation cases were 12.9% for the active design and 12.0% for the first 20 settled Sobol cases, and on the nine held-out cases alone 7.3% and 9.5%. Taken together, the result is inconclusive: once the kernel and the number of cases are held equal, active learning shows no clear gain in either accuracy or uncertainty, and the drop in predicted uncertainty in the first comparison came from the refitted hyperparameters, not from the design. With a budget of a few tens of runs a good space-filling design did as well.
7. Cost, and When a Surrogate Pays
A Gaussian process trained on the training cases predicts one geometry in 0.1 ms, and 100,000 geometries in 0.05 s; fitting it, with ten restarts, takes 0.2 s. One coarse-mesh CFD case took about 11 minutes of one core, so a prediction is millions of times faster (the exact ratio depends on the machine and varies from run to run). The speed is not the cost, though. The cost is the training set: 9.7 core-hours for this paper's 54 cases, of which the 32 training cases took 5.6 core-hours, plus the engineer's time to set up, check and reject cases. A surrogate pays when it will be asked many more questions than it took cases to build: a design sweep, an optimization, a sensitivity study, or a tool for colleagues who will never run CFD themselves. For a single question, one CFD run is cheaper than a surrogate [16].
As a worked example, the post's duty for R-101 was taken: the impeller flow of its pitched blade turbine at 84 rpm, 0.754 m³/s [17]. For an impeller of a given diameter the speed that delivers a flow Q is Q/(Nq D³), and the shaft power at that speed follows from Eq. (4):
With D held at 0.88 m, the surrogate searched 3,721 combinations of blade angle and clearance in under a second. The surrogate's lowest power for the duty (Figure 6) is at a blade angle of 32° and C/T = 0.39, where it predicts Np = 0.48 ± 0.17 and Nq = 0.677 ± 0.053 (±2σ), a speed of 98 rpm and 1.11 kW, against 1.32 kW that it predicts for the Issue 24 geometry at the same duty, a saving of 15%. The optimum sits near the low-angle edge of the range: the surrogate's trend says that a shallower blade pumps more per unit of power, and an optimizer working on a surrogate pushes towards the edge of the range whenever the trend points that way, which is where the surrogate has fewest cases. A CFD run at the optimum gave Np = 0.59 and Nq = 0.645: the surrogate's power number was −18% off and its pumping number +5%, both inside its ±2σ band. Because the power for a given flow goes as Np/Nq³, those errors compound: the CFD power for the duty at the optimum is 1.58 kW at 103 rpm, against 1.43 kW from the coarse-mesh CFD of the Issue 24 geometry. Checked by CFD, on the same coarse mesh, the surrogate's optimum needs 5% to 11% more power than the geometry it was meant to improve on (the range is between the impeller and the wall torque, which differ by 4.2% at this geometry, the largest imbalance of any settled case), not 15% less: no saving. The band was honest here, but it was wide. Carried through Np/Nq³, the surrogate's own ±2σ on the power at the optimum was about ±42%, larger than the 15% saving it predicted, so the answer was never one to act on without the check.
8. What the Surrogate Learned: The Mesh Bias
A surrogate learns the simulation it was trained on, errors included, so the simulation needs the same checks as any CFD result [18]. Every case here used the coarse mesh, and the Issue 24 mesh study of the pitched blade turbine at its own geometry gave power numbers of 1.14, 1.18 and 1.20 on the coarse, medium and fine meshes, with an extrapolated value of 1.28 and a grid convergence index of 8% on the fine mesh [1, 19]. The surrogate's power numbers are therefore about 6% below the fine-mesh values and about 13% below the extrapolated value, at least near the Issue 24 geometry. The pumping number changed less, from 0.828 to 0.844 (2%).
The obvious correction is to multiply the surrogate's power numbers by the ratio of fine to coarse, 1.060, or of extrapolated to coarse, 1.127. That is a one-point correction: it assumes the mesh error is the same fraction everywhere in the design space, and nothing here tests that. The proper tool is a multi-fidelity model, which learns the difference between coarse and fine solutions from a few fine-mesh cases spread through the space [20]; that would need several fine cases of about two and a half hours each on this hardware, which was beyond this study.
9. A Surrogate of the Flow Field
A common way to build a surrogate of a field is proper orthogonal decomposition (POD): the fields of the training cases are decomposed into a mean and a set of orthogonal modes ranked by the share of variance they capture, and a regression model predicts the weight of each mode from the inputs [21–23]. Here the field is the radial and axial velocity on the vertical plane midway between baffles, as a fraction of the tip speed, on a fixed 32 × 32 grid. 18 modes captured 99% of the variance of the training fields (the first alone 63%, the first three 81%), and a Gaussian process was fitted to each mode's weight.
Figure 7 compares predicted and solved fields. The error of a field is measured as its relative error over the whole plane. On the held-out cases the median of that error was 19%, against 36% for simply taking the average training field and 22% for the field of the nearest training case; leave-one-out on the training set gave a median of 34%. Even a perfect regression on the retained modes could not do better than 9%, the error left by projecting the true field onto them. The reason is the moving impeller. As the diameter and clearance change, the impeller stream moves across the fixed grid, and POD, which builds every field from the same fixed shapes, can only represent a moving feature by blending several modes, which smears it. On the extrapolation cases the median error rose to 33%, up to 69%. The field surrogate is good enough to show the kind of circulation a geometry will have, but not to read velocities from.
10. Limits of the Study
The study has limits. It covers one impeller type, three inputs and one tank. All cases used the coarse mesh, steady multiple-reference-frame flow and the standard k–ε model of Issue 24, whose own limits apply [1]. The test set is small, eight cases and the Issue 24 geometry, so the held-out errors are themselves uncertain by a percentage point or more. The rejected cases leave a gap at high clearance where the surrogate is trained on fewer cases. The field surrogate used one plane, not the whole tank. And the worked optimization used only the power for a given impeller flow; a real choice would weigh solids suspension, gas dispersion or shear, which the dataset does not contain.
11. Conclusions
- A three-input surrogate of a stirred-reactor CFD model was built from 47 settled coarse-mesh cases, 9.7 core-hours in all. On held-out cases its pumping-number error was about a quarter of the published value's (2.9% RMS for the Gaussian process against 12.3%). For the power number the gain was smaller (5.4% for the best surrogate against 10.5%), and in cross-validation two of the three surrogates did no better than the published values.
- The Gaussian process, the response surface and a small neural network were similar in accuracy; the network was slightly the most accurate for the power number. The Gaussian process's value is its error estimate, but that estimate was too narrow inside the range (75% of leave-one-out power numbers within ±2σ against the 95% it should be) and must be checked by cross-validation before it is trusted.
- Outside the training range the surrogates failed by up to 56%. The Gaussian process's band covered some of those errors only by becoming very wide, and missed the worst one, the pumping number of the largest impeller, outright. A range check on every input is essential.
- The CFD itself had holes: seven cases did not settle, most of them oscillating with the impeller high in the tank, one drifting slowly, and the flat-blade extrapolation could not be tested at all. The line between settled and rejected is not sharp: some settled cases still varied by 0.8% to 2.1%. A surrogate built on CFD inherits those gaps, and they tend to lie where the flow pattern changes.
- Active learning looked better on the model's own uncertainty and worse on accuracy, but both differences shrank or reversed once the kernel or the number of cases was held equal: the result is inconclusive, and a quarter of its picks did not settle.
- A POD field surrogate showed the kind of circulation a geometry has but smeared the moving impeller stream: over the held-out cases, the median relative error over the plane was 19%.
- An optimization on the surrogate predicted a 15% power saving. One CFD check found the optimum needed 5% to 11% more power than the Issue 24 geometry: no saving. The surrogate's own power uncertainty at the optimum, about ±42%, had already said the saving was not established: check every surrogate optimum with CFD.
- A surrogate copies its simulation, mesh error included: these power numbers inherit the coarse mesh's bias of about 13% against the extrapolated mesh limit. Its error bars describe how well it copies the CFD, not how well the CFD describes the reactor.
12. Appendix: Reproduction
The CFD cases are reproduced with the scripts in the model download: design.py writes the design, batch.py runs the cases (sim.py meshes and solves one case with the Issue 24 model), active.py picks the active-learning cases, analyse.py and pod.py fit and test the surrogates. The appendix script loads the trained Gaussian processes, which are included in the download as plain JSON, and predicts Np and Nq with their uncertainty for any geometry, warning when an input lies outside the training range.
"""Np and Nq of a four-blade pitched blade turbine in reactor R-101 from the trained
Gaussian processes of Chmltech Online Journal Vol. 106, Issue 25, with the 2-sigma
band and a range check. Needs Python 3 and NumPy. The model file gp_models.json
(in the model download) holds each process's kernel, training inputs and weights.
Usage: python3 surrogate_appendix.py 40 0.30 0.30 (angle deg, D/T, C/T)
"""
import json, math, os, sys
import numpy as np
HERE = os.path.dirname(os.path.abspath(__file__))
M = json.load(open(os.path.join(HERE, "gp_models.json")))
LO, HI = np.array(M["lo"]), np.array(M["hi"])
def predict(model, x):
"""Mean and standard deviation of one Gaussian process at x."""
s = (np.asarray(x, float) - LO) / (HI - LO)
X = np.array(model["X"])
d2 = (((s - X) / np.array(model["l"])) ** 2).sum(1)
k = model["c"] * np.exp(-0.5 * d2)
mu = k @ np.array(model["alpha"])
var = model["c"] + model["w"] - k @ np.array(model["Kinv"]) @ k
sd = math.sqrt(max(var, 0.0))
return mu * model["ys"] + model["ym"], sd * model["ys"]
def main(angle, d_t, c_t):
x = [angle, d_t, c_t]
out = [n for n, v, lo, hi in zip(("blade angle", "D/T", "C/T"), x, LO, HI)
if not lo <= v <= hi]
for t in ("Np", "Nq"):
mu, sd = predict(M["models"][t], x)
print(f"{t} = {mu:.3f} +/- {2 * sd:.3f} (2 sigma)")
if out:
print("WARNING: outside the training range in " + ", ".join(out)
+ "; the answer is an extrapolation.")
print("Coarse-mesh CFD: power numbers read low; see Section 8 of the paper.")
if __name__ == "__main__":
if len(sys.argv) == 4:
main(*map(float, sys.argv[1:]))
else:
main(45.0, 0.377, 0.333)References
- Lee, Q. F. (2026). CFD of a stirred reactor: Three impellers against textbook power and pumping numbers. Chmltech Online Journal, 106(24). www.chmltech.com/post/cfd-of-a-stirred-reactor-three-impellers-against-textbook-
- Forrester, A. I. J., Sóbester, A., & Keane, A. J. (2008). Engineering design via surrogate modelling: A practical guide. Wiley. 10.1002/9780470770801
- Jones, D. R., Schonlau, M., & Welch, W. J. (1998). Efficient global optimization of expensive black-box functions. Journal of Global Optimization, 13(4), 455–492. 10.1023/A:1008306431147
- Rasmussen, C. E., & Williams, C. K. I. (2006). Gaussian processes for machine learning. MIT Press. http://gaussianprocess.org/gpml/
- Lee, Q. F. (2026). Can an AI agent do process engineering calculations? A benchmark of three models, with and without code. Chmltech Online Journal, 106(22). www.chmltech.com/post/can-an-ai-agent-do-process-engineering-calculations-a-benc
- Lee, Q. F. (2026). Hybrid digital twins for heat exchanger fouling: Physics, machine learning and the combination tested on a steam preheater. Chmltech Online Journal, 106(23). www.chmltech.com/post/hybrid-digital-twins-for-heat-exchanger-fouling-physics-ma
- Hemrajani, R. R., & Tatterson, G. B. (2004). Mechanically stirred vessels. In E. L. Paul, V. A. Atiemo-Obeng, & S. M. Kresta (Eds.), Handbook of industrial mixing: Science and practice (pp. 345–390). Wiley. 10.1002/0471451452.ch6
- Sobol’, I. M. (1967). On the distribution of points in a cube and the approximate evaluation of integrals. USSR Computational Mathematics and Mathematical Physics, 7(4), 86–112. 10.1016/0041-5553(67)90144-9
- Virtanen, P., Gommers, R., Oliphant, T. E., et al. (2020). SciPy 1.0: Fundamental algorithms for scientific computing in Python. Nature Methods, 17, 261–272. 10.1038/s41592-019-0686-2
- Loeppky, J. L., Sacks, J., & Welch, W. J. (2009). Choosing the sample size of a computer experiment: A practical guide. Technometrics, 51(4), 366–376. 10.1198/TECH.2009.08040
- McKay, M. D., Beckman, R. J., & Conover, W. J. (1979). A comparison of three methods for selecting values of input variables in the analysis of output from a computer code. Technometrics, 21(2), 239–245. 10.1080/00401706.1979.10489755
- Kresta, S. M., & Wood, P. E. (1993). The mean flow field produced by a 45° pitched blade turbine: Changes in the circulation pattern due to off bottom clearance. The Canadian Journal of Chemical Engineering, 71(1), 42–53. 10.1002/cjce.5450710107
- Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, É. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830. jmlr.org/papers/v12/pedregosa11a.html
- Hiraoka, S., Kamei, N., Kato, Y., Tada, Y., Cheon, H. G., & Yamaguchi, T. (1997). Power correlation for pitched blade paddle impeller in agitated vessels with and without baffles. Kagaku Kogaku Ronbunshu, 23(6), 969–975. 10.1252/kakoronbunshu.23.969
- Chapple, D., Kresta, S. M., Wall, A., & Afacan, A. (2002). The effect of impeller and tank geometry on power number for a pitched blade turbine. Chemical Engineering Research and Design, 80(4), 364–372. 10.1205/026387602317446407
- Lee, Q. F. (2026). Buy, outsource or build: What CFD costs a small company. Chmltech Insights (CFD series, Part 6). www.chmltech.com/post/buy-outsource-or-build-what-cfd-costs-a-small-company.html
- Lee, Q. F. (2026). Sizing an agitator: Impeller types, flow patterns and power. Chmltech Insights. www.chmltech.com/post/sizing-an-agitator-impeller-types-flow-patterns-and-power.
- Lee, Q. F. (2026). Can you trust it? Checking CFD against hand calculations. Chmltech Insights (CFD series, Part 5). www.chmltech.com/post/can-you-trust-cfd-checking-it-against-hand-calculations.ht
- Celik, I. B., Ghia, U., Roache, P. J., Freitas, C. J., Coleman, H., & Raad, P. E. (2008). Procedure for estimation and reporting of uncertainty due to discretization in CFD applications. Journal of Fluids Engineering, 130(7), 078001. 10.1115/1.2960953
- Kennedy, M. C., & O’Hagan, A. (2000). Predicting the output from a complex computer code when fast approximations are available. Biometrika, 87(1), 1–13. 10.1093/biomet/87.1.1
- Berkooz, G., Holmes, P., & Lumley, J. L. (1993). The proper orthogonal decomposition in the analysis of turbulent flows. Annual Review of Fluid Mechanics, 25, 539–575. 10.1146/annurev.fl.25.010193.002543
- Guo, M., & Hesthaven, J. S. (2019). Data-driven reduced order modeling for time-dependent problems. Computer Methods in Applied Mechanics and Engineering, 345, 75–99. 10.1016/j.cma.2018.10.029
- Ortali, G., Demo, N., & Rozza, G. (2022). A Gaussian process regression approach within a data-driven POD framework for engineering problems in fluid dynamics. Mathematics in Engineering, 4(3). 10.3934/mine.2022021
How to cite this article
Lee, Q. F. (2026). AI Surrogate Models for CFD: Answers in Milliseconds Instead of Hours, and Where They Fail. Chmltech Online Journal, 106(25). https://www.chmltech.com/post/ai-surrogate-models-for-cfd-answers-in-milliseconds-and-where-they-fail
