Desulfurization digital twin (5/5): following the metal. Runge–Kutta, virtual dye and dead zones
How to draw a streamline without drifting off, how to carry a dye with four-second steps without blowing up, and which part of the metal barely moves. The end of the series.
The previous posts gave a kinetic model, a 3D CFD of the ladle and a measure of how far to trust it. What is missing is what matters most to the process: where does the metal travel, and which part does the powder not reach? To answer it I use the CFD mean flow in three ways: streamlines, a virtual dye and a dead-zone map. Each has its own numerical problem, and each problem has a neat solution.
The twin’s 3D explorer: vertical section, horizontal slice and argon plume.
1. Streamlines with Runge–Kutta
A streamline is the curve that is tangent to the velocity at every point. It is the solution of a differential equation:
dsdx=∣uˉ(x)∣uˉ(x)
I divide by the speed to advance by distance, not by time: that way the line is drawn with the same resolution in the fast jet as at the slow bottom. The step is 3 cm in 3D.
First, knowing the velocity between nodes
The CFD gives velocity on a grid. To know it at any point I use trilinear interpolation: inside the grid cube containing the point, with local coordinates a,b,c∈[0,1], each corner weighs according to how close it is:
The eight weights add up to 1. It is the same interpolation the viewer uses to show the speed under the cursor.
Then, stepping without drifting
The simplest method, Euler, moves in a straight line with the velocity at the starting point: xn+1=xn+hf(xn). On a curve it always drifts outward. Fourth-order Runge–Kutta measures the slope four times within the step and averages them:
To see how the ladle mixes, I release a dye at one point and let the mean flow carry it. The dye obeys the advection equation:
∂t∂c+uˉ⋅∇c=0
Solving it the direct way, finite differences on a fixed grid, has the same Courant limit we saw in the third post: the dye cannot cross more than one cell per step. For the dye to advance in the browser at about 75 seconds of flow per second on screen, that is not enough.
The way out is to look backwards. The equation says c does not change along the path of a metal particle. So the dye at node xi at the end of the step is what was, at the start of the step, at the point that particle came from:
cn+1(xi)=cn(xi−uˉ(xi)Δt)
The departure point almost never falls on a node, so the value is taken with the same trilinear interpolation. Since the result is always an average of values that already existed, it never grows or oscillates: the method is stable for any Δt. It is the idea Jos Stam made famous in 1999 for real-time smoke.
One limitation to keep in mind: the dye travels with the mean flow and does not see the turbulent fluctuations u′, which also mix the real ladle. The smoothing from interpolation imitates some of that mixing, but not in a controlled way. The dye shows where the metal travels; it does not measure a mixing time.
In the twin you can release the dye with a click on any section; this link releases it next to the wall.
Mixing test: the dye starts next to the wall and travels with the mean flow; the streamlines are integrated with Runge–Kutta. Click on a cut to release more dye. · Open full screen
3. Dead zones
The last question is the most direct: which part of the metal barely moves? I define as dead zone the metal where the mean-flow speed is below 1 cm/s:
fdead=Vol(metal)Vol{x∈metal:∣uˉ(x)∣<0.01m/s}
With the nine sweep cases (medium mesh):
Flow \ Lance
1.5 m
2.0 m
2.5 m
0.5 ×
60.0 %
47.1 %
38.8 %
1 ×
39.7 %
34.6 %
31.3 %
2 ×
36.4 %
28.9 %
21.5 %
Two readings come out of the table:
Below the lance tip, almost all the metal is dead: between 86 and 98 % depending on the case. The plume rises; the metal below the nozzles barely notices.
That is why depth matters so much. With the lance at 1.5 m, 43 % of the metal sits below the tip; at 2.5 m, less than 5 %. Lowering the lance from 1.5 to 2.5 m cuts the dead zone more than doubling the gas: at the paper’s flow it goes from 39.7 % to 31.3 %, while doubling the gas with the lance at 1.5 m only brings it to 36.4 %. That explains the h1.14 exponent from the fourth post, which energy alone did not.
This map also has its power-law fit in the interactive sweep: fdead∝Q−0.38h−0.78, with R2=0.958.
In five posts the twin went from one formula to a full ladle:
The kinetic model: a chain of four equations from bubble to sulfur curve, checked 10 out of 10 against the paper.
Mixtures: a mixture’s constant is weighted by moles, and using kilograms can be off by 12 %.
The CFD: two interpenetrating fluids, Schiller–Naumann drag, k-ε and a time average.
Verification: the GCI says the plume is reliable to 1 % and the speeds need more mesh; the sweep gives vˉ∝Q1/3, as theory says.
The flow: RK4, semi-Lagrangian advection and a dead-zone map that explains why lance depth matters more than gas.
Credit for the kinetic model goes to its authors, Barrón, Hilerio and Medina (2015), who published it under an open licence. The CFD, the visualizations and the twin are what I built on top of that model. Everything is in the full twin.