Tesla valves under a pressure gradient
Nils Berglund Nils Berglund
49.5K subscribers
722 views
0

 Published On Apr 27, 2023

This simulation implements a suggestions from a comment, namely to impose a pressure difference between the two sides of Tesla valves. Maintaining a constant pressure difference between the left and right boundaries turns out to lead to numerical blow-up, at least with the periodic boundary conditions used here. Thus this simulation uses a softer method, that consists in pushing the current pressure and velocity towards prescribed values in the pipes near the boundary. As a result of the pressure difference and imposed speed, the difference between the forward and backward directions is a bit less extreme than in the simulation    • Several Tesla valves in series   which only imposed the initial state, with a flow to the right and no pressure difference.
A Tesla valve is a clever one-way fluid valve without moving parts, that was invented (and patented) by Nikola Tesla in 1920. The design used here features two conduits attached to the main pipe, and folded back on it. When used in the forward direction, the fluid can easily flow along the main pipe. When used in the backward direction, however, the back-folded conduits make the fluid interact with the flow in the main pipe, slowing it down or even stopping it altogether.
In this simulation, there are two parallel set-ups of 4 Tesla valves in series, allowing to compare the forward and the backward flows more easily. The figures at the left show the average horizontal components of the velocity, for the upper and lower half. The set-up used here increases the chances that the fluid follows the blocking path in the backward direction, increasing the efficiency of the valves.
The boundary conditions are imposed by multiplying the fields with a cut-off function, that smoothly interpolates between 0 and 1 when moving across the boundary of the valve, effectively introducing a boundary layer. In addition, there is a repulsive force orthogonal to the boundary, proportional to the gradient of the cut-off function. The pressure is driven to a higher value at the left boundary, and to a lower value of the right boundary, but only quite weakly, to avoid numerical blow-up.
The video has four parts, showing the same simulation with two different color schemes, and at two different speeds:
Pressure: 0:00
Speed: 2:01
Pressure (time lapse): 4:03
Speed (time lapse): 4:44
In the first and third part, the color hue shows the pressure of the fluid, which is proportional to its density. In the second and fourth part, it shows its speed (norm of the velocity vector). The velocity field of the fluid is materialized by 1000 tracer particles, whose initial position is distributed randomly over the simulation region. There are periodic boundary conditions, which is why vortices can be seen wrap around the displayed rectangular region.
The compressible Euler equations are partial differential equations for the density and the velocity field of the fluid. The system as such is not closed, because the right-hand side of the velocity equation involves the pressure, which has to be linked to known quantities by a thermodynamic relation. I assumed here that the fluid is an ideal gas, so that the pressure is proportional to the density.
In a sense, the compressible Euler equations are easier to simulate than the incompressible ones, because one does not have to impose a zero divergence condition on the velocity field. However, they appear to be a bit more unstable numerically, and I had to add a smoothing mechanism to avoid blow-up. This mechanism is equivalent to adding a small viscosity, making the equations effectively a version of the Navier-Stokes equations.

Render time: 1 hour 53 minutes
Color scheme: Parts 1 and 3 - Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing
Parts 2 and 4 - Inferno, by Nathaniel J. Smith and Stefan van der Walt
https://github.com/BIDS/colormap

Music: "A Trip Around The Moon" by the Unicorn Heads@UnicornHeads

See also https://images.math.cnrs.fr/Des-ondes... for more explanations (in French) on a few previous simulations of wave equations.

The simulation solves the 2D compressible Euler equation by discretization (finite differences).

C code: https://github.com/nilsberglund-orlea...
https://www.idpoisson.fr/berglund/sof...
Many thanks to Marco Mancini and Julian Kauth for helping me to accelerate my code!

show more

Share/Embed