|
[Sponsors] |
What is the difference between gradient and reconstruction gradient vectors ? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 15, 2020, 22:31 |
What is the difference between gradient and reconstruction gradient vectors ?
|
#1 |
Senior Member
Join Date: Dec 2017
Posts: 384
Rep Power: 9 |
What is the difference between gradient and reconstruction gradient vectors ?
You can access gradient and reconstruction gradient vectors (and components) for many of the cell variableslisted in Table 3.8: Macros for Cell Flow Variables Defined in mem.h (p. 183). ANSYS FLUENT calculates thegradient of flow in a cell (based on the divergence theory) and stores this value in the variable identifiedby the suffix _G. For example, cell temperature is stored in the variable C_T, and the temperature gradientof the cell is stored in C_T_G. The gradients stored in variables with the _G suffix are non-limited valuesand if used to reconstruct values within the cell (at faces, for example), may potentially result in values thatare higher (or lower) than values in the surrounding cells. Therefore, if your UDF needs to compute facevalues from cell gradients, you should use the reconstruction gradient (RG) values instead of non-limitedgradient (G) values. Reconstruction gradient variables are identified by the suffix _RG, and use the limitingmethod that you have activated in your ANSYS FLUENT model to limit the cell gradient values. |
|
November 16, 2020, 12:23 |
It is directly borrowed from the udf help document, but I cannot understand the foll
|
#3 | |
Senior Member
Join Date: Dec 2017
Posts: 384
Rep Power: 9 |
Quote:
The gradients stored in variables with the _G suffix are non-limited valuesand if used to reconstruct values within the cell (at faces, for example), may potentially result in values thatare higher (or lower) than values in the surrounding cells. |
||
November 16, 2020, 13:31 |
|
#4 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66 |
The gradients (with suffix _G) are calculated at cell centers and these gradients are unlimited (they're just calculated normally). If you use unlimited gradients to calculate values at cell faces (i.e. reconstruction), you can often end up with cell face values that are non-physical (lower/higher than surrounding cells centers).
To avoid this, you need to limit the amount of the gradient used in the reconstruction and these are called the reconstruction gradients (RG). The reconstruction gradients are limited based on the limiting method you set. I got done writing this text and realized I just re-worded the udf manual definition. |
|
November 16, 2020, 19:05 |
|
#5 |
Senior Member
|
Finite volume (FV) methods are based on the cell average and flux concepts. You know cell average values in cell centers and conservation equations are written, for those cells, that require summing convective and diffusive fluxes over the faces of those cells.
As values are known in the cell centers but needed on the faces, some reconstruction/interpolation is needed which, starting from the former values can give you the latter. Modern high order (>1) FV methods for unstructured grids do this by computing a Taylor series expansion of the variables in the cell centers. So that, the variable value on a face of a cell for a 2nd order code (like Fluent) can be written like the value in the cell center (the one you know) + gradient in cell center times the distance vector from the cell center to the face center (we use centers because the Taylor series then have 0 odd terms). So, you need gradients in cell centers and Fluent, as all similar codes, has some methods to compute them. Unfortunately, what happens if you just use those gradients straight into the Taylor expansion is that the resulting face value might be larger/smaller than the maximum/minimum value from the adjacent cell centers. That is, a new extrema is introduced. Now, if a new extrema is introduced at every iteration, I guess you see that things are not going to end well. In order to avoid this problem, FV codes use, for their Taylor series reconstruction, a limited version of the gradients. Basically, the gradient values are reduced so that no new extrema are introduced when computing face values. Fluent has both standard (G) and limited (RG) gradients available in UDF. That's it, very roughly speaking. |
|
November 16, 2020, 23:45 |
So you mean if we calculate the cells in the center, we use the G, if the cells are i
|
#6 | |
Senior Member
Join Date: Dec 2017
Posts: 384
Rep Power: 9 |
Quote:
|
||
November 16, 2020, 23:46 |
Thank you so much for your reply,Could you tell how to calculate the gradient of volu
|
#7 | |
Senior Member
Join Date: Dec 2017
Posts: 384
Rep Power: 9 |
Quote:
Thank you so much for your reply. As you can see in the image, I need to the gradient of volume fraction , Could you tell how to calculate the gradient of volume fraction on the cells? Last edited by hitzhwan; November 17, 2020 at 11:07. |
||
November 18, 2020, 17:14 |
|
#8 |
Senior Member
|
Fluent computes the gradient for all the user defined scalars, and probably the limited gradients as well. You could copy the variable whose gradient is needed into an uds and let Fluent compute its gradient. You need to be careful on the bc side (because bc enter the gradient computation) and the order of the steps (when you copy your field into an uds, has the uds gradient already been computed?), but seems doable to me.
Still, you might want to check if Fluent already has the model you want (or something similar that can be adapted), because the task is not for the faint of heart, and volume fractions (with related models) are bitches |
|
November 19, 2020, 09:15 |
Hi,thank you for your kindful help, because I am not familar with udf, could you show
|
#9 | |
Senior Member
Join Date: Dec 2017
Posts: 384
Rep Power: 9 |
Quote:
|
||
November 19, 2020, 09:22 |
|
#10 |
Senior Member
|
I can't as I have no more access to Fluent since several years, so I couldn't even try to put it down.
Also, this matter is not going to be solved like that. This sort of UDF use requires a much more disciplined approach, knowledge of how stuff works both at the theory and practice level. Are you sure the model you want to code, or even the gradient you are looking for, isn't already present? That would be a much better route. |
|
November 19, 2020, 09:29 |
Yes,sbaffini,I am quite sure,this is what I see in the published paper, they also udf
|
#11 | |
Senior Member
Join Date: Dec 2017
Posts: 384
Rep Power: 9 |
Quote:
|
||
November 19, 2020, 09:58 |
|
#12 |
Senior Member
|
I can only point to this https://forum.ansys.com/discussion/4...ng-error-crash
It seems that reconstruction gradients might be present (which totally makes sense). Otherwise there is a lot of material out there on computing gradients of scalars by previously copying them into UDS. |
|
November 19, 2020, 13:19 |
|
#13 | |
Senior Member
Join Date: Dec 2017
Posts: 384
Rep Power: 9 |
Quote:
|
||
November 19, 2020, 14:04 |
|
#14 |
Senior Member
|
No, but note that the take home message from the previous link is that, if any, only C_VOF_RG will be available. I noted in my previous post that this would make sense because a non limited vof gradient is going to give you volume fractions outside the 0-1 range if used for reconstructions
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
RECONSTRUCTION GRADIENT | dirk | FLUENT | 4 | July 10, 2019 13:03 |
gradient reconstruction in ghost cells | Joachim | Main CFD Forum | 1 | February 1, 2014 23:45 |
reconstruction gradient of a UDS | gemini | Fluent UDF and Scheme Programming | 0 | June 7, 2009 16:03 |
limiter for gradient reconstruction FVM | harry | Main CFD Forum | 0 | September 18, 2008 03:59 |
reconstruction gradient | richie | Siemens | 0 | May 31, 2007 15:13 |