CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

On the diffusion term discretization on unstructured grids

Register Blogs Community New Posts Updated Threads Search

Like Tree17Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2017, 13:01
Default
  #21
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
The key is to think always in terms of a totally unstructured grid. You need to extend the topology of the grid, that is each centroid of the faces must be associated to a proper simplex (tetrahedron) containing it. Using the four linear shape function you have all you need.
FMDenaro is online now   Reply With Quote

Old   October 11, 2017, 20:39
Default
  #22
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,286
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by sbaffini View Post

Now, to me, there seems that, at least at some point back in the 90's, someone in Fluent was quite sure about this. I still have to try this, and I don't expect great differences (nor convenience in terms of computational costs), but it has a certain consistency. The whole algorithm now requires only face values: those for convection and those in the green gauss procedure for the cross diffusion gradients; both are computed via reconstruction gradients, which are the limited version of the base ones (which in contrast are not anymore needed).
By reading this part i get the impression that you are saying that they are using reconstruction gradients for diffusion terms.

If this is what you meant then I would point out that the quotes from Sanjay Mathur et al. are not saying this.

This is how it shall work:

1. Compute gradients by GG or least square means. Call them unlimited gradients.
2. Limit these gradients - call them reconstruction gradients.
3. Use these gradients and reconstruct face values and compute another gradients by GG. These are the gradients used in diffusion terms. (they are unlimited).

Here are these quote again:


Quote:
Originally Posted by sbaffini View Post



- The gradients used ( step (3)) in the diffusion terms are computed using the reconstructed face values (step 1 grad) \phi_f - Mathur and Murthy, Pressure Boundary Conditions for Incompressible Flow Using Unstructured Meshes, Numerical Heat Transfer B, 1997

- The cell derivatives (step 3) used for the secondary diffusion terms in Eq. 12 are computed by again applying the divergence theorem over the control volume and using the averaged reconstructed values (using grad from step 1) at the faces - Mathur and Murthy, A Pressure Based Method for Unstructured Meshes, Numerical Heat Transfer B, 1997

- The cell derivatives needed to evaluate \left\langle{\nabla \phi}\right\rangle in the secondary diffusion term of equation 23 are computed by applying the Gauss theorem again (using limited grads of (1)) over the cell control volume using the reconstructed face values as follows. - Kim, Mathur, Murthy and Choudhury, A Reynolds-Averaged Navier-Stokes Solver Using Unstructured Mesh-Based Finite-Volume Scheme, AIAA 98-0231

- The gradients used in the diffusion term in Eq. 7 are computed by applying the divergence theorem with the average of reconstructed face values.(using grads of (1))- Mathur and Murthy, All Speed Flows on Unstructured Meshes Using a Pressure Correction Approach, AIAA 99-3365

- When evaluating diffusive fluxes the gradient \nabla Q_j at each face is computed by first considering an average gradient \nabla \overline{Q} composed of gradients within the two cells on either side of the face \nabla \overline{Q} = \left(\nabla Q_L + \nabla Q_R\right)/2 where the cell gradients \nabla Q_L and \nabla Q_R are evaluated using the divergence theorem (see Eq. 8), but are different from the reconstruction gradients appearing in Eq. 7 in that they are computed using an average of the reconstructed values Q_R and Q_L (as opposed to cell-average values), and are not limited. - Weiss, Maruszewski and Smith, Implicit Solution of the Navier-Stokes Equations on Unstructured Meshes, AIAA 97-2103

For your concern about what happens in shock or discontinuity, I would say that once you have gradients of effective viscosity you are no longer bound to using average, you could apply other schemes like upwinding or some other scheme that is used in shock for velocity (what is good enough for goose good enough for gander). The exact same thing is done for density which is normally just used as average or first order upwind.

This all need efforts and cost so people usually avoid it. Seeing all this discussion i would implement this and give user option in wildkatze to switch to different schemes. Who knows to someone it might be useful.
arjun is online now   Reply With Quote

Old   October 12, 2017, 05:00
Default
  #23
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
@Filippo: Thanks, that's the idea. But, in general, I only have access to the two values across a face, L and R.

Besides linear/harmonic interpolation along the face normal coordinate, or taking a simple/harmonic average, I can at most interpolate, still along the connecting line, in the point nearest to the face center, so that I can minimize the error. But not much more.

@arjun: yes, I probably expressed more obscurely than I tought, but that's what I meant. So you also confirm that there is a third gradient, built via GG and using as face values those reconstructed via limited gradients. This third gradient is NOT itself limited again, but only used in the secondary diffusion term.

@michael: at moment I'm just SDed. Do I still qualify?
mprinkey likes this.
sbaffini is offline   Reply With Quote

Old   October 12, 2017, 05:21
Default
  #24
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,286
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by sbaffini View Post



@arjun: yes, I probably expressed more obscurely than I tought, but that's what I meant. So you also confirm that there is a third gradient, built via GG and using as face values those reconstructed via limited gradients. This third gradient is NOT itself limited again, but only used in the secondary diffusion term.

Yes. Not only there but all the other things that need gradient use this gradient. (ie turbulence production etc etc)

I will note down one more thing that many commercial codes when using least square gradients just make a copy of the unlimited gradient and use this (they avoid one more GG application). Then the same gradients are limited and used for reconstruction.

In theory it makes sense but in practice it could be problems in prism type cells so I in wildkatze use extra step of GG and use that as mentioned.
sbaffini likes this.
arjun is online now   Reply With Quote

Old   October 12, 2017, 05:29
Default
  #25
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by sbaffini View Post
@Filippo: Thanks, that's the idea. But, in general, I only have access to the two values across a face, L and R.

Besides linear/harmonic interpolation along the face normal coordinate, or taking a simple/harmonic average, I can at most interpolate, still along the connecting line, in the point nearest to the face center, so that I can minimize the error. But not much more.

@arjun: yes, I probably expressed more obscurely than I tought, but that's what I meant. So you also confirm that there is a third gradient, built via GG and using as face values those reconstructed via limited gradients. This third gradient is NOT itself limited again, but only used in the secondary diffusion term.

@michael: at moment I'm just SDed. Do I still qualify?
Paolo, during the run of the flux computation you have L, R and the node on the face "f". What you need is a subroutine to run before any flow computation that, for each face "f", associates and stores the 4 nodes (two are always L and R) that constitute the tetrahedron. I don't understand why you have only access to L and R...
FMDenaro is online now   Reply With Quote

Old   October 12, 2017, 05:30
Default
  #26
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
And note that the same procedure can be used for computing easily the derivative df/dn ...
FMDenaro is online now   Reply With Quote

Old   October 12, 2017, 05:32
Default
  #27
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,286
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by FMDenaro View Post
Paolo, during the run of the flux computation you have L, R and the node on the face "f". What you need is a subroutine to run before any flow computation that, for each face "f", associates and stores the 4 nodes (two are always L and R) that constitute the tetrahedron. I don't understand why you have only access to L and R...

I believe CFX does what you are mentioning. They work with shape functions.
arjun is online now   Reply With Quote

Old   October 12, 2017, 05:34
Default
  #28
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by arjun View Post
I believe CFX does what you are mentioning. They work with shape functions.
Well that seems to me a straightforward way to work 😉
arjun likes this.
FMDenaro is online now   Reply With Quote

Old   October 12, 2017, 05:38
Default
  #29
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by arjun View Post
Yes. Not only there but all the other things that need gradient use this gradient. (ie turbulence production etc etc)

I will note down one more thing that many commercial codes when using least square gradients just make a copy of the unlimited gradient and use this (they avoid one more GG application). Then the same gradients are limited and used for reconstruction.

In theory it makes sense but in practice it could be problems in prism type cells so I in wildkatze use extra step of GG and use that as mentioned.
At the moment I think I can't really go with another round of GG. I already have three of them to compute, iteratively, the unlimited gradient. But good to know what I should actually do.
sbaffini is offline   Reply With Quote

Old   October 12, 2017, 05:44
Default
  #30
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Yeah, actually I could build such shape functions. What I meant is that I would like to stick just to information available in cells L and R. Otherwise, storing 4 more scalars per face would blow up my memory. There is a tradeoff with respect to gradients but, honestly, I also don't want to compute them for properties.
sbaffini is offline   Reply With Quote

Old   October 12, 2017, 05:48
Default
  #31
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by sbaffini View Post
Yeah, actually I could build such shape functions. What I meant is that I would like to stick just to information available in cells L and R. Otherwise, storing 4 more scalars per face would blow up my memory. There is a tradeoff with respect to gradients but, honestly, I also don't want to compute them for properties.
You need to store just 2 nodes, not 4. And the shape functions can be computed out of the flow computation
FMDenaro is online now   Reply With Quote

Old   November 10, 2017, 03:39
Default
  #32
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,286
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
I made some studies about this diffusion term (Poisson Problem) . I got some improvements over the second order method without increasing the cost too much.

For the test problem 1x1x1 m^3 problem with function sin(PI x) . sin( PI y) . sin(PI z)
the following are the results on tetrahydral meshes.
Quote:
Mesh Size ___ starccm ___ NewAlog
36051 ___ 6.42E-06 ___ 4.00E-06
181461
___ 1.17E-06 ___ 7.00E-07
455037
___ 5.71E-07 ___ 4.55E-07
934437 ___ 2.00E-07 ___ 1.40E-07



The results are compared against starccm, the table shows L2 error norm against exact value for computed solution.

The good thing about it is that on uniform meshes the solution shall be much more accurate than 2nd order method, on skewed meshes the worst case is same as second order method.

It is just primary calculation so take it with a grain of salt. So far this is what i got.
sbaffini and FMDenaro like this.
arjun is online now   Reply With Quote

Old   November 10, 2017, 04:15
Default
  #33
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
You refer to the shape function approach you were mentioning in previous posts, right?
sbaffini is offline   Reply With Quote

Old   November 10, 2017, 04:20
Default
  #34
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,286
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by sbaffini View Post
You refer to the shape function approach you were mentioning in previous posts, right?

No.

Basically the idea is to adapt 4rth order finite difference method to unstructured grid. This is why on uniform meshes the results shall be exactly as the 4rth order method will produce.

The locally refined Cartesian mesh type solvers will benefit the most because majority of those meshes are "boxes" where it shal be close to 4rth order.

I will make more tests when i get time and will outline what exactly is done. Nothing complicated is done and your second order descretization is used as it is.
sbaffini likes this.
arjun is online now   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Discretization of the convective term of the N-S equation Donton Main CFD Forum 1 September 1, 2017 13:01
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
FVM discretization of diffusion term on crvlnr gr Michail Main CFD Forum 3 March 14, 2008 07:52
TVD/NVD in unstructured grids m.s. darwish Main CFD Forum 0 August 24, 1999 14:44


All times are GMT -4. The time now is 05:31.