Hi, Higashi here.
In the last experiment, I gave my U-bend flow model more training examples by changing just the inlet temperature. That brought the temperature inside the duct closer to the CFD result, but the model still struggled to predict when warm air would reach the outlet. I covered that experiment in the previous post on adding inlet-temperature training data.
That got me thinking about how far the model could see. My 3D CNN could read the flow field only 1.5 mm away from the target cell along each coordinate axis. If a cell knew more about what was happening upstream, would it have a better idea of what was coming next?
To find out, I built two versions of MeshGraphNets in Python and trained them on the same data as the CNN. Let’s compare them with the CFD cross sections, first to see how the air takes the turn, then to see where the warm air ends up.
Passing information along the mesh of a U-bend
The inlet is at the lower left and the outlet at the upper left. They look close on the page, but there’s a wall between them. Air has to travel all the way to the right, around the bend and back again to reach the outlet.
I represented each fluid cell as a node and linked two nodes whenever their cells shared a face that air could pass through. Those nodes and links make up the graph. A neural network uses the states of two neighboring cells, including their velocities and temperatures, and their positions relative to each other to work out what information to pass along. Each cell then gathers its incoming messages and updates its internal features. I tried two versions of this mesh graph network (MGN).
- Single-scale MGN. Each cell exchanges information with its neighbors three times on the original 0.5 mm mesh.
- Multiscale MGN. I group nearby cells that connect through open faces and pass information on the coarser graphs as well. In the standard U-bend, the 19,872 cells form 318 groups and then 10 larger groups. The model makes eight passes on the coarsest graph before sending the information back to the fine cells.

I adapted the original architecture and its multiscale extension to the cell-centered data from my CFD solver. The two papers are Learning Mesh-Based Simulation with Graph Networks and MultiScale MeshGraphNets.
What does a cell need from its neighbors to predict the next 0.1 seconds?
Imagine a pocket of warm air one cell away. Whether that air is moving toward our cell or away from it matters for the temperature an instant later. The network learns what information to pass between neighbors by comparing its prediction with the CFD field 0.1 s later.

Inputs. Each cell starts with seven quantities at the current instant: three velocity components (u, v, w), static pressure p, temperature T, turbulent kinetic energy k and its dissipation rate ε. The model also receives the cell-center coordinates, the fraction of the cell occupied by fluid, which faces meet an inlet, outlet or wall, and the cell’s proximity to a wall. All cells receive the prescribed inlet speed and temperature at 11 instants, from the present to 0.1 s ahead in 0.01 s increments. Inlet cells also receive k and ε derived from inlet speed. The outlet uses atmospheric pressure and prescribed temperature and turbulence conditions for backflow.
Messages from neighbors. To send a message from a green cell to the orange target in the diagram, the network uses the features of both cells, the displacement between their centers and the open area of their shared face. The message is a set of numbers the network learns to calculate. The target averages the incoming messages and combines the result with its own features. A warm neighbor can therefore affect the target differently depending on which way the air is moving. The operation is more than a simple average of two cell temperatures.
Outputs. After message passing, the model predicts all seven quantities 0.1 s ahead for every cell. All eight passes on the coarse graph take place within that one prediction. For example, after predicting the flow from 0.2 to 0.3 s, I feed the seven predicted fields at 0.3 s back into the model, switch to the inlet conditions for 0.3–0.4 s, and advance again.
How far can one inlet cell reach at each scale?
At what point can the outlet receive information from the inlet? I picked one cell near the center of the inlet in the standard U-bend and traced its possible paths during a single 0.1 s prediction. I set the number of exchanges at each scale when I built the model, and used those same counts for training and prediction.

- Fine graph, one exchange. One face of the source cell is at the inlet, so it shares open faces with five other fluid cells. Including itself, that makes six cells.
- Middle graph, one exchange. Those six cells belong to the same group. One exchange with its neighbors brings the source information to six groups, covering 384 of the original fine cells. At this stage it’s the six groups whose features are updated.
- Coarse graph, eight exchanges. The signal can move farther along the duct with each pass. By pass seven, it can reach all ten groups, including the one at the outlet. The eighth pass updates information within that same area again.
Each intermediate group then receives information from its own coarse parent. Each fine cell, in turn, receives information from its intermediate parent. An outlet cell can therefore combine what it has learned locally with information gathered from the inlet side. The single-scale model stops after three fine-mesh exchanges. From the same starting point, that gives it a reach of up to three hops, or 44 cells. The colored regions show possible paths. How much an inlet signal actually changes the outlet prediction depends on the learned weights.
For the CNN comparison, I used the model from the last post, trained with the extra temperature data. All three models used the same inputs and outputs and trained for 24 epochs on the same 12 conditions. For testing, I started with still air at 300 K and fed each prediction back into the model ten times to cover one second.
Do all three models turn the flow around?
First, let’s look at the case with inlet peaks of 2 m/s and 325 K. At 0.9 s, the inlet speed has just reached 2 m/s. In the figure, orange means air is moving to the right and purple means it’s moving to the left. Compare the three predictions with CFD in the top-left panel. They all get the direction right: orange in the lower leg on the way in, purple in the upper leg on the way back.

How close is the velocity in the straight return leg? I took a volume-weighted average over the outlet-side straight section where x is below 20 mm, including the full depth. The horizontal velocities were −2.00 m/s for CFD, −1.95 m/s for the 3D CNN, −2.45 m/s for the single-scale MGN and −2.10 m/s for the multiscale MGN. At this location and time, the CNN from the previous post came closest.
Now look at the short stretch joining the two legs on the right. The graph below shows how speed changes as we cross from the inner wall toward the outer wall. Here I used all three velocity components, including the one perpendicular to the page.

In CFD, the air moves at 1.26 m/s just 0.75 mm from the inner wall and at 2.82 m/s at 2.75 mm from it. The multiscale MGN gives 2.60 and 2.63 m/s at those same two points. Its mean velocity in the return leg was close, yet it flattened out the slowdown on the inside of the bend.
Warm air stays in the return leg after the inlet cools
For temperature, the differences are easier to see with inlet peaks of 1.5 m/s and 350 K. That speed falls between the 1 m/s and 2 m/s used for training. Here we’re looking at 1.0 s, just as the inlet speed returns to zero and its temperature drops back to 300 K.

Look at the upper half of the duct. In CFD, warm air that entered earlier is still on its way back to the outlet. The mean temperature in the straight return leg of this slice was 341.5 K for CFD, 332.9 K for the CNN, 330.9 K for the single-scale MGN and 337.4 K for the multiscale MGN. The multiscale model comes closest to how warm that returning air is.
Why does the multiscale temperature field look blocky?
Look at the return leg in the bottom-right panel. The color changes in steps. All four plots color the original 0.5 mm cells individually. In the multiscale model, fine cells in the same group receive common information when the coarse features are passed back down. Each cell combines those features with its own to predict temperature, so a group boundary can show up as a temperature step.
I measured the temperature difference between neighboring cells on the same slice at 1.0 s. Within the coarsest groups, which use 8 mm blocks, the mean absolute difference was 0.35 K. Across their boundaries, it was 2.88 K. For CFD at the same locations I got 0.53 K within groups and 0.31 K across them. In the multiscale result, the unusually large jumps line up with the group boundaries.
I tried one more check. Taking each of the 112 neighboring pairs across a boundary in turn, I changed the final 0.1 s prediction for that pair. I averaged the two coarse messages from the 8 mm graph and passed the same average to both sides, while preserving each cell’s fine-scale features. The mean temperature jump fell from 2.88 K to 0.92 K, a reduction of about 68%. That gives us a direct indication that the coarse graph contributes to the block pattern in this slice. The percentage measures how much the boundary jump shrank in this test. Measuring the coarse graph’s contribution to the entire temperature field would require a different test.
When does the warm air reach the outlet?
The lower panel below shows the same 1.5 m/s case. From 0.9 to 1.0 s, the CFD outlet temperature climbed from about 321.1 K to 334.1 K, a rise of about 13 K. The CNN predicted a 2.36 K rise, the single-scale model 3.78 K and the multiscale model 9.76 K. For this particular peak, the model with the longest information path tracked CFD most closely.

The top panel tells a different story. At 2 m/s and 325 K, CFD rose by 2.91 K over the final 0.1 s, while the multiscale MGN rose by only about 0.21 K. Capturing one peak well didn’t carry over to the other inlet condition.
Which model was closest to CFD over the full second?
The plots above are from one representative training run. I also trained each model with three random seeds. For each run, I calculated the root mean square error (RMSE) against CFD across the ten output times from 0.1 to 1.0 s, then averaged the three RMSEs. Lower is better. All three tests use the standard U-bend. The two 2 m/s cases use a familiar inlet speed with different temperature conditions. The 1.5 m/s case also tests a speed the models hadn’t seen in training.
| Inlet peaks | Quantity | 3D CNN | Single-scale MGN | Multiscale MGN |
|---|---|---|---|---|
| 2 m/s, 325 K | Velocity (m/s) | 0.438 | 0.570 | 0.399 |
| 2 m/s, 330 K | Velocity (m/s) | 0.428 | 0.570 | 0.398 |
| 1.5 m/s, 350 K | Velocity (m/s) | 0.313 | 0.494 | 0.369 |
| 2 m/s, 325 K | Temperature (K) | 6.78 | 4.32 | 3.72 |
| 2 m/s, 330 K | Temperature (K) | 5.84 | 4.19 | 3.41 |
| 1.5 m/s, 350 K | Temperature (K) | 10.67 | 8.06 | 6.63 |
Velocity error uses all three components, and temperature error covers the whole duct. Both account for the volume of each cell. The multiscale model had the lowest whole-duct temperature error in all three cases. The CNN gave the closest velocity field at the unseen inlet speed. The ranking changes again if we look only at the outlet temperature. At 325 K, for example, its RMSE was 7.19 K for the CNN, 6.76 K for the single-scale MGN and 7.38 K for the multiscale MGN.
With those numbers in mind, it’s worth another look at the cross sections. The multiscale MGN does a better job than the CNN of keeping warm air in the return leg after it has rounded the bend. I can still see coarse groups in that temperature field, though, and the air on the inside of the bend ought to be moving more slowly than the model predicts. The table tells me which model came closest on average. The cross sections show me which parts of the flow it actually learned.


コメント