Navier-Stokes equations and CFD modelling

Here are our CFD links and discussions about aerodynamics, suspension, driver safety and tyres. Please stick to F1 on this forum.
trinidefender
272
Joined: Fri Apr 19, 2013 7:37 pm

Navier-Stokes equations and CFD modelling

Post by trinidefender » Fri Jan 12, 2018 7:40 am

So while it is understood that CFD modelling hasn't yet caught up to wind tunnel testing in terms of accuracy it has gotten quite close.

The article basically says that in certain odd conditions, Navier-Stokes equations don't output values even remotely close to what they should throwing off a whole model.

In light of that, this is an interesting read. It isn't math heavy and isn't very hard to understand so will make a good read for all interested in trying to understand more about CFD work.

While I am not sure if this has any applications directly to Formula 1, it is interesting all the same.

https://www.quantamagazine.org/mathemat ... -20171221/

Vyssion
138
User avatar
Joined: Sun Jun 10, 2012 1:40 pm

Re: Navier-Stokes equations and CFD modelling

Post by Vyssion » Fri Jan 12, 2018 10:07 am

trinidefender wrote:
Fri Jan 12, 2018 7:40 am
The article basically says that in certain odd conditions, Navier-Stokes equations don't output values even remotely close to what they should throwing off a whole model.
In order to pretty much guaruntee that what you are calculating and seeing in your CFD matches what the real flow would do, the number of Cells you would need must be larger than the Reynolds Number raised to the power of 9/4. So for example, if you took a 1m chord wing and flew it through normal air at about 16m/s, your Reynolds number would be about 1.06 Million. So in order to perform a DNS simulation and capture all possible flow eddies, you would need 3.6x10^13 cells (36,000,000,000,000 cells)!!!! Given that the largest simulation that I know of was solved over a million cores with a total cell count of 1.4 trillion (1.4x10^12 cells) we are still a long way off having enough computational power to know exactly what is happening...

Its a bit algebra and physics heavy, but I'll do my best to explain where this figure comes from:

DNS directly solves the Navier-Stokes equations capturing all eddies from the length scale of the geometry, right down to the Kolmogorov length scales (relating to the smallest eddies within the flow). The cell wall sizes dx, dy, and dz (or "dL" for simplicity sake) of the mesh needs to be small enough to capture these smallest eddies and their flow behaviour with more than one cell.

The "proof" so to speak for the cell resolution is along these lines here... If we let:
L = Computational box of length
N = Number of grid points in one direction (x, y or z)
dL = Grid spacing
"eta" = Kolmogorov length scale
"mu" = Molecular viscosity
"epsilon" = Energy dissipation rate
u' = RMS turbulent velocity scale
For a box of length L, the number of points depends on dL:
Number of Points = Length of Domain / dL
dL must be small enough to resolve the smallest eddies, which have the length scale "eta".
dL= eta is the maximum value for dL in order to capture the smallest eddies without their flow (which may be a small vortex for example) being fully contained within one cell. If resolved properly, then you should have cells which have some sort of velocity/pressure gradient which would indicate that there was some turbulent dissipation present in that region, rather than having the whole cell kind of smudged over in one colour when you try and visualize it in a post-processor. Ideally, you would want to have dL = 0.5 * "eta" or better.
N(minimum) = L / dL(max) = L / "eta"
Now "eta" itself is defined as:
"eta" = ( "mu"^3 / "epsilon" )^(1/4)
And "epsilon" is defined as:
"epsilon" = (u' ^3 ) / L
Substituting "eta" and "epsilon" into the equation for N(minimum) gives:
N = ( u' * L / "mu" )^(3/4)
If we look closely, we can see that "u'L/mu" is a form of Reynolds Number which then means that we can extract out this relationship
N = Re^(3/4)
Which if we cube both sides to go from a single dimension to three dimensions;
N^3 = Re^(9/4)
Since we stated at the start that "N" was the number of cells in one direction, N^3 can be assumed to denote the total number of cells in a domain. Hence if we know the Reynolds Number and the geometry size, we can make a rough estimate for the maximum size that dL can be and still capture all the Kolmogorov Scale flow patterns.

So from all that, essentially, CFD is always going to have some innacuracy to the "real world" flow. It then becomes a game of making sure that your set up for your simulation is correct for the job. Often in CFD for simple flows, we can get so close to reality that it doesn't really matter. However, for complex flows (such as a rotating F1 tyre) it becomes an absolute nightmare to deal with the 6 shedding vortices, 2 of which can alternate from clockwise or counter-clockwise rotations. (see below)
Image

Numerical instabilities often appear due to a badly defined problem, a poor quality mesh and/or the wrong solver settings. The instabilities can mean diverging residuals occur, or it can mean that they just kind of "hover" and get stuck. Diverging residuals often imply that there is an increasing amount of imbalance in the conservation equations (mass, momentum, etc.) Basically, you put crap in, you get crap out.

The reason for the Navier-Stokes equations basically falling apart is that when they are used in a RANS simulation (i.e. a Reynolds Averaged Navier-Stokes sim) you end up with a term at the end of the equation often called the "Reynolds Stress Tensor" which is the Reynolds-Average of the Fluctuations in Velocity in all directions. Now this term is a pain, because there is no way to cancel it out or transform it into something else we can quantify; but it has a big impact on results. This means that we cannot ignore it; and this term is what most of the turbulence equations out there try and predict with varying degrees of accuracy. General rule of thumb is DNS > LES > RANS with the number of equations used to predict this term being higher implying a greater degree of accuracy, but longer compute time (only in general!! This is a case by case thing)

To give you an example of one quite well known turbulence equation, the standard k-eps model has been shown experimentally to break down when measured next to complex gemetries with strong adverse pressure gradients (i.e. wings in ground effect). So work was done to try and improve the model and what came out of it was the realizable k-eps model. It is slightly different in that it uses a changeable variable for the C(mu) value rather than a constant. It also has a new transport equation for the dissipation rate which comes from an exact differential equation derviation; these two things means that it is substantially better at modelling complex geometries, boundary layer shear/flows, strong adverse pressure gradients, etc, than its standard version.

Hopefully this helps put some perspective on the article and CFD in general for people :D
If you can't explain it simply, then you don't understand it well enough.
- Albert Einstein


The great thing about facts is that they are true, whether or not you believe them.
- Neil deGrasse Tyson


Vyssion Scribd - Aerodynamics Papers

TwanV
23
Joined: Mon Sep 28, 2015 4:41 pm

Re: Navier-Stokes equations and CFD modelling

Post by TwanV » Fri Jan 12, 2018 11:50 am

Nice work, but I think the original post is referring to an article about the fundamental properties of the set of equations; it's one of the Millennium Problems:
This is the equation which governs the flow of fluids such as water and air. However, there is no proof for the most basic questions one can ask: do solutions exist, and are they unique? Why ask for a proof? Because a proof gives not only certitude, but also understanding.
The Navier-Stokes equations themselves should not be confused with the numerical methods of trying to solve them, which is CFD; the NS equations should describe reality, while CFD uses models such as you describe to find some closure in solving these equations within reasonable approximation.

Nonserviam85
6
Joined: Fri May 17, 2013 10:21 am

Re: Navier-Stokes equations and CFD modelling

Post by Nonserviam85 » Fri Jan 12, 2018 12:23 pm

TwanV wrote:
Fri Jan 12, 2018 11:50 am
Nice work, but I think the original post is referring to an article about the fundamental properties of the set of equations; it's one of the Millennium Problems:
This is the equation which governs the flow of fluids such as water and air. However, there is no proof for the most basic questions one can ask: do solutions exist, and are they unique? Why ask for a proof? Because a proof gives not only certitude, but also understanding.
The Navier-Stokes equations themselves should not be confused with the numerical methods of trying to solve them, which is CFD; the NS equations should describe reality, while CFD uses models such as you describe to find some closure in solving these equations within reasonable approximation.
Direct Numerical Simulation (DNS) differs from conventional CFD in that the turbulence is explicitly resolved, rather than modeled by a relevant approximation method (Reynolds-averaged Navier-Stokes (RANS)). DNS can thus be viewed as a numerical experiment producing a series of non-empirical solutions, from first principles, for a virtual turbulent flow. Its great strength is the ability to provide complete knowledge, unaffected by approximations, at all points within the flow, at all times within the simulation period. As mentioned above the computational power required is huge, so it is restricted in basic flows and objects. But basically you are solving a complete Navier-Stokes equation.

Vyssion
138
User avatar
Joined: Sun Jun 10, 2012 1:40 pm

Re: Navier-Stokes equations and CFD modelling

Post by Vyssion » Fri Jan 12, 2018 12:38 pm

TwanV wrote:
Fri Jan 12, 2018 11:50 am
Nice work, but I think the original post is referring to an article about the fundamental properties of the set of equations; it's one of the Millennium Problems:
This is the equation which governs the flow of fluids such as water and air. However, there is no proof for the most basic questions one can ask: do solutions exist, and are they unique? Why ask for a proof? Because a proof gives not only certitude, but also understanding.
The Navier-Stokes equations themselves should not be confused with the numerical methods of trying to solve them, which is CFD; the NS equations should describe reality, while CFD uses models such as you describe to find some closure in solving these equations within reasonable approximation.
They base their mathematical reasoning for why the solution blows up and therefore the equations arent "smooth" on purposefully working with "weaker vector fields that don't provide as much detail". It is the same thing I mentioned briefly in the above post in that "if you put crap in, you will get crap out". There will be tiny fluctuations within that weak vector field which simply wont be captured. And so depending on little nuances and changes in decimal points etc, there could exist a time where (during the millions and millions of calculations being executed to compute a solution) there is a slight discrepancy introduced which, given the weak field, may end up affecting the overall solution. If the field was stronger and better resolved, this little discrepancy may be ironed out within a few iterations. "False Diffusion" which is a type of error observed when the upwind scheme is used to approximate the convection term in convection–diffusion equations, springs to mind as a potential source of altering solutions calculated from weak fields.

Image

The term "blow up" is kind of subjective as well - they loosely define it as a particle having an infinite value of some parameter which is derivated within the NS Equations (i.e. velocity) and since taking the derivative of inifinity would most liekly yield a floating point error, it would "crash" your equations. But this may come about from a severly sharp gradient which, if resolved in finer details, may not even exist.
If you can't explain it simply, then you don't understand it well enough.
- Albert Einstein


The great thing about facts is that they are true, whether or not you believe them.
- Neil deGrasse Tyson


Vyssion Scribd - Aerodynamics Papers