Can More Inlet Temperatures Improve a CNN’s Predictions in a U-Bend?

U-bend CFD and CNN models trained with additional inlet temperature histories. AI

Hi, Higashi here.

When I used a 3D CNN to predict the flow through a U-bend, it got the direction of the return flow right. The temperature was another story. The prediction was already off after the first 0.1 seconds.

Lowering the peak inlet temperature from 350 K to 325 K cooled the outlet by 12.9 K in CFD, but the CNN predicted a drop of just 3.4 K. Looking back at the training data, I realized it contained no pair of cases where only temperature changed in the same duct at the same speed. This time I kept the model the same and added those missing examples. The original experiment is in my comparison of a 3D CNN with CFD in a U-bend.

Sponsored Links

Changing only the inlet temperature

The table shows the four original training cases. For each one, I added versions with inlet temperatures peaking at 315 K and 340 K. Duct length and air speed stayed the same within each set.

Flow path length Peak inlet speed Original peak temperature Added peak temperatures
69 mm 2 m/s 350 K 315 K, 340 K
45 mm 2 m/s 350 K 315 K, 340 K
69 mm 1 m/s 350 K 315 K, 340 K
45 mm 1 m/s 325 K 315 K, 340 K

To generate these eight extra conditions, I used a property of this particular CFD model. The air starts at 300 K, the walls are adiabatic, air properties are constant, and temperature has no effect on the flow. Under those conditions, multiplying the inlet temperature rise by a given factor multiplies the rise above 300 K by the same factor in every cell at every time.

For example, turning a 350 K peak into a 340 K peak changes the inlet rise from 50 K to 40 K, so the factor is 0.8. A cell at 330 K in the original run becomes 300 + (330 − 300) × 0.8 = 324 K. I applied that calculation to all cells and times, and scaled the inlet temperature history the same way. Velocity and pressure came directly from the original CFD run.

I checked the shortcut by running fresh one-second CFD simulations at 315 K and 330 K in the 69 mm duct at 2 m/s. Across all 19,872 cells and 101 saved times, the largest difference between the scaled and simulated temperatures was under 0.00002 K in both cases. The 315 K run checked the data-generation method. I kept the 330 K case entirely out of training for a new test.

Sponsored Links

Does the CNN predict the right temperature drop after 0.1 seconds?

The training set grew from four conditions to 12. I kept the 3D CNN from the previous experiment: it reads a 7 × 7 × 7 neighborhood, coordinates and boundary conditions, then predicts seven quantities, including velocity, pressure and temperature, 0.1 seconds ahead. Each epoch still used 364 pairs of times. I cycled through the original temperature, 315 K and 340 K when assigning the pairs. I trained both models from scratch for 24 epochs, with 1,103 weight updates each and the same normalization and learning rate. Training the augmented model took about 12 seconds per run on my setup, excluding data preparation.

First, let’s go back to the 69 mm duct at a peak inlet speed of 2 m/s and lower only the peak temperature from 350 K to 325 K. The 350 K case was in the training set. The model also saw 325 K in the shorter duct at 1 m/s, but 325 K at this duct length and speed was still held out. Both predictions start from still air at 300 K and advance just once. There has been no chance for errors to accumulate from earlier predictions.

Outlet temperature after 0.1 seconds as the peak inlet temperature changes from 350 K to 325 K. CFD, the original CNN and the augmented CNN are compared side by side.
The 350 K and 325 K predictions both start from the same still air at 300 K.

For the same training initialization as in the previous article, the 325 K case gave 312.9 K at the outlet in CFD, 332.7 K with the original CNN and 322.7 K with the extra training data. The model had been almost 20 K too hot. Adding the examples cut that error to about 10 K.

What about the size of the drop? Comparing the two points in each panel, CFD dropped by 12.9 K, the original CNN by 3.4 K and the augmented CNN by 2.9 K. The 350 K prediction also fell, from 336.1 K to 325.6 K. Both predictions shifted down together. The answer at 325 K got closer, but the model still responded too weakly to a change in inlet temperature.

Temperature fields at 0.1 seconds for the 325 K inlet, using the same color scale for CFD and the CNNs trained before and after augmentation.
The slice shows the warm air inside the duct as well as the mean outlet temperature. The inlet is at the lower left and the outlet at the upper left.
Sponsored Links

What happens when we link ten predictions together?

Next I gave the model the initial CFD state just once and advanced it in steps of 0.1 seconds, using its predicted field as the input for the following step. It still receives the known inlet speed and temperature histories each time. Do the peaks and troughs at the outlet line up with CFD over a full second?

CFD and CNN traces of mean outlet temperature from 0 to 1 second for the held-out 325 K and 330 K inlet temperatures, before and after adding training data.
Temperatures in the cells touching the outlet are weighted by their open outlet areas. The points are 0.1 seconds apart.

With the extra temperature examples, the outlet-temperature curves moved closer to CFD in both the 325 K and 330 K cases. There is still something to watch for in the last part of the 325 K trace. From 0.9 to 1.0 seconds, the CFD outlet warmed from 313.7 K to 316.6 K. The augmented CNN predicted that it cooled from 323.5 K to 317.5 K. The final points are only about 1 K apart, yet the temperatures approach them from opposite directions.

Sponsored Links

Do we see the same trend if we train again?

The figures so far show one pair of models. To see how much depended on a particular training run, I repeated the comparison with three different random seeds, pairing the original and augmented runs for each one. The table shows temperature RMSE (root mean square error) across the ten times from 0.1 to 1.0 seconds, averaged over the three runs. At the outlet I used the temperature weighted by open outlet area. Across the duct I weighted the cells by volume. Smaller values are closer to CFD.

Test case
(69 mm duct)
Outlet-temperature RMSE
Original → augmented
Whole-duct temperature RMSE
Original → augmented
2 m/s, 325 K 16.06 → 7.19 K 13.31 → 6.78 K
2 m/s, 330 K 13.75 → 5.29 K 11.29 → 5.84 K
1.5 m/s, 350 K 6.10 → 6.89 K 7.02 → 10.67 K

In both 2 m/s cases, errors fell at the outlet and across the duct in all three training runs. In particular, the model had never seen a 330 K inlet peak, although it had seen this duct and this 2 m/s flow. The last row asks a different question. The 350 K temperature was familiar, but 1.5 m/s was a new inlet speed. Whole-duct temperature error increased in all three runs. The benefit of extra temperatures at a given speed did not carry over to that new speed.

Sponsored Links

How much of the temperature error came from the training data?

Adding examples with different temperatures in the same flow reduced the model’s tendency to overestimate outlet temperature in the cooler cases. Even so, when I cooled the inlet and looked at the first 0.1 seconds, the outlet-temperature drop averaged 3.84 K before adding data and 3.51 K afterward. CFD gave 12.93 K.

For the augmented 325 K model shown in the figures, some cells reached as low as 293.5 K and as high as 346.4 K during the one-second run. The duct started at 300 K, the inlet reached only 325 K and the walls were adiabatic. The lower average error still leaves the CNN free to predict temperatures outside those bounds.

That brings me back to the other possibility from the last article. Is the patch the CNN sees too small to tell where the heat is coming from? I kept that patch the same here, so this experiment cannot settle the question. The next test I’d like to try is to keep the training data fixed, let the model see farther upstream and check when the warm air reaches the outlet.

コメント