|
[Sponsors] |
March 29, 2020, 10:19 |
Numerical Diffusion
|
#1 |
Senior Member
Join Date: Mar 2009
Posts: 157
Rep Power: 17 |
Hey,
So normally in textbooks on CFD the standard example of numerical diffusion is to do a oblique flow scalar transport on a square mesh with quad cells. I have not seen any text book examples of momentum numerical diffusion (numerical viscosity). Does anyone have any references for this? I have made a simple setup for pressure driven flow between two parallel plates. The idea is that a triangular mesh should increase the numerical viscosity and thus affect the mass flow rate. But this case seems too simplistic and produces near identical results for triangular and quad meshes. I have kept the boundary layers identical and the number of cells similar. Any suggestions? Attaching high Re and low Re cases.
__________________
"Trying is the first step to failure." - Homer Simpson |
|
March 29, 2020, 13:02 |
|
#2 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
Quote:
If I understand, you want to evaluate the effects of the numerical viscosity for a real solution of the NSE, right? First, you have to consider that the numerical viscosity is due to the upwind discretization of the convection, that means you have to solve a high Re number flow and a case where the convection plays a relevant role. I suggest to use the backward facing step flow at Re=100-400 and check the reattachment lenght. |
||
March 29, 2020, 14:49 |
|
#3 |
Senior Member
Join Date: Mar 2009
Posts: 157
Rep Power: 17 |
Thank you for the suggestion.
Is circulating flow really a good measure of numerical diffusion effects? A flow that is aligned with the quad mesh is naturally free of numerical diffusion. However, with a backward facing step and quad mesh it seems like a rather large part of the important zone is actually not aligned with the flow. So how do I assess numerical diffusion in the triangle mesh when I compare it to the quad mesh that also has numerical diffusion in this case? I have used first order upwind to make sure the effect of numerical diffusion is as large as possible, for the triangular mesh. For the quad mesh it does not matter since the flow is aligned with the mesh and therefore does not have any numerical diffusion (in space at least). Many (most) numerical results on backward facing step use higher order approximations and although they surely also have numerical diffusion it is far less. This makes it difficult to use such studies. There are a few approximate analytical solutions to the backward facing step, but comparing against those, how can you tell how much of the error is actually due to numerical diffusion?
__________________
"Trying is the first step to failure." - Homer Simpson |
|
March 29, 2020, 15:03 |
|
#4 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
Quote:
1) the numerical diffusion appears also on structured homogenous grid. Just think to the 1D example where the first order upwind (with first order Euler in time) starts producing numerical viscosity at cfl <1. 2) you can estimate the numerical diffusion by evaluating the modified equation, of course in a 2d NSE case that requires some long manipulation. 3) a further test could be the 2D inviscid flow in a periodic box where you have that the total kinetic energy must be constant. The numerical diffusion will dissipate it in time |
||
March 29, 2020, 16:08 |
|
#5 |
Senior Member
Join Date: Mar 2009
Posts: 157
Rep Power: 17 |
1) Yes and no. Isn't this more of a phase error problem? If we look at the steady-state solution of my test case there are no such errors. This is similar to having zero space derivatives (a domain where the velocity is constant in space will not have any numerical viscosity).
2) Yes, this is done in some textbooks. I would like to test it. The only numerical test I've seen is the common oblique scalar transport case I mentioned. This case is constructed to maximize numerical diffusion on quad meshes. It is fully possible to construct a case with zero (visible) numerical diffusion, using triangular mesh and first order upwind for that particular test case (by aligning the triangle hypotenuse with the flow direction, cutting the two regions of different scalar value). 3) This may be a good test! This ensures that we can have a flow that is aligned with the mesh for comparison! However, as mentioned above, we must probably ensure that a velocity gradient exist, otherwise numerical diffusion should not happen.
__________________
"Trying is the first step to failure." - Homer Simpson |
|
March 29, 2020, 16:23 |
|
#6 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
Quote:
1) That is not correct. If you see the modified wavenumber for the upwind formula you see both a real and an imaginary part. To undestand the result, just integrate analytically the equation df/dt +u * d_s f /h = 0 using the Fourier component with the modified wavenumber. Furthermore, if you use the first order Euler scheme in time, using u=constant, you see that the numerical diffusion appears immediatly when cfl<1. 2) the construction of the modified equation analysis is different, you have to start fro the discrete scheme and, using the Taylor expansion, write the PDE that the numerical solution really satisfies. |
||
March 30, 2020, 00:55 |
|
#7 |
Senior Member
Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 220
Rep Power: 19 |
If you are interested in the topic of numerical diffusion, you may also want to take a look at "vorticity confinement" techniques in CFD. These methods have been developed and applied in aerodynamic applications specifically to the counteract numerical diffusion which undesirably causes spreading of vortical structures shed from lifting surfaces.
|
|
March 30, 2020, 04:07 |
|
#8 | |
Senior Member
Join Date: Mar 2009
Posts: 157
Rep Power: 17 |
Quote:
But the CFL number has little meaning in steady state flows. Anyways, for the first order Euler scheme in time using u=constant, it is fully possible to have zero numerical diffusion in space-time. If your initial field is constant then there will be no change. This may seem trivial but it is very relevant in the incompressible steady-state example I gave above, where the flow will be more or less fully developed within one solution of the pressure Poisson equation (steady state or not does not matter). This will be true in all cases where we have no gradients, so in the standard test case (attached), if we are to measure the numerical diffusion in the lower right or top left corners it will likely be zero. You will only see the effect in the vicinity of the main diagonal. Perhaps we can argue that there is always numerical diffusion even when the field is constant, but it is not measurable since the cell-to-cell differences are zero if the field is constant. @tas38, thank you for the suggestion. Could you point to any test case where numerical diffusion can be measured for the momentum equations?
__________________
"Trying is the first step to failure." - Homer Simpson |
||
March 30, 2020, 04:26 |
|
#9 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
Quote:
Coming back to the steady Poiseulle flow, the numerical diffusion would act due to the du/dy gradient. But the convective term is v*du/dy and v=0 in such a case. Thus, the only way to let the numerical diffusion acting is to solve the unsteady flow, starting from an initial condition having a superimposition of the non-vanishing v velocity and check the final steady state to compare using the anlytical Poiseulle solution. But, again, that is not the best test to check what you want. A test you can find in literature is the 2D inviscid flow where the numerical dissipation of kinetic energy can be measured https://en.wikipedia.org/wiki/Taylor...93Green_vortex |
||
March 30, 2020, 07:13 |
|
#10 |
Senior Member
Join Date: Mar 2009
Posts: 157
Rep Power: 17 |
Good suggestion!
You have suggested this test many times before, for instance to verify new codes. Do you know if the pressure interpolation method in OpenFOAM admits conservation of the kinetic energy (I rather use a verified code as opposed to my own codes for this)? I guess we can test that by using your previous suggestion with inviscid flow with periodic boundaries. So basically, if we know that it conserves kinetic energy for a non-rotational case then we can be fairly certain that it is numerical diffusion that causes dissipation in the Taylor-Green vortex case, right? I could setup a quad mesh and triangular mesh and compare the rate of decay between them.
__________________
"Trying is the first step to failure." - Homer Simpson |
|
March 30, 2020, 07:35 |
|
#11 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
yes, for a 2d periodic box and inviscid condition the total kinetic energy is constant and that is the way you can evaluate in a quantitative way the presence of the numerical dissipation at any time.
|
|
March 30, 2020, 08:36 |
|
#12 |
Senior Member
Join Date: Mar 2009
Posts: 157
Rep Power: 17 |
I doubt the inviscid test case in 2d. We really need to have a velocity gradient in the flow in that case, right? With uniform velocity there will be no numerical diffusion, regardless of the mesh and/or numerical scheme. Or do you propose to set the initial velocity to say 1 everywhere and then run the simulation for a long time and see if the magnitude changes?
__________________
"Trying is the first step to failure." - Homer Simpson |
|
March 30, 2020, 08:40 |
|
#13 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
TGV for vanishing viscosity has all the gradient a you need
|
|
March 30, 2020, 09:00 |
|
#14 |
Senior Member
Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 220
Rep Power: 19 |
I second the suggestion of Filippo to examine the Taylor-Green vortex.
See the following paper... https://arxiv.org/abs/2003.00173 Note that in Fig. 2 the vortex kinetic energy loss (due to numerical diffusion) is explicitly plotted. Although implemented in MATLAB, the same case can be setup in OpenFOAM. |
|
March 30, 2020, 11:03 |
|
#15 |
Senior Member
Join Date: Mar 2009
Posts: 157
Rep Power: 17 |
Yes, agreed, that is a better test case than the inviscid 2d flow case with cyclic boundaries. @tas38, thank you for the reference.
__________________
"Trying is the first step to failure." - Homer Simpson |
|
March 30, 2020, 11:54 |
|
#16 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
||
March 31, 2020, 16:38 |
|
#17 | |
Senior Member
Join Date: Mar 2009
Posts: 157
Rep Power: 17 |
Quote:
Perhaps I misunderstood. It seemed to me that you talked about an inviscid version similar to the case I showed, but with cyclic boundaries instead of inlet and outlet. Anyhow, you mentioned TGV later so that is one example that might be useful here.
__________________
"Trying is the first step to failure." - Homer Simpson |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difference between diffusion, dissipation and dispersion in physical and numerical | TurbJet | Main CFD Forum | 9 | October 6, 2018 19:15 |
Why numerical diffusion is related to the advection term | Houthuys | Main CFD Forum | 6 | January 28, 2017 23:01 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Numerical Diffusion in CFX | John S. | CFX | 4 | August 17, 2008 20:47 |
Estimation of numerical diffusion | varghese | FLUENT | 0 | March 24, 2003 06:02 |