|
[Sponsors] |
May 14, 2020, 11:52 |
reconstruct gradient of UDS
|
#1 |
New Member
Join Date: Mar 2020
Posts: 23
Rep Power: 6 |
Hello, my dears,
I want to obtain the gradient of one uds. Using the C_UDSI_G macro, I find the deviation is too large in the near-wall region. In the help document, it is described that "The gradients stored in variables with the _G suffix are non-limited values and if used to reconstruct values within the cell (at faces, for example), may potentially result in values that are higher (or lower) than values in the surrounding cells". However, when I try to program C_UDSI_RG, error is reported, indicating there is no such a function. Is there any method to get a more accurate gradient and a second-order gradient? |
|
May 14, 2020, 12:14 |
Scalar Gradient
|
#2 |
Senior Member
|
Reconstruction gradient for UDS is not defined. If you need that, you have to calculate it yourself. The reason for high (or unphysical) gradient near a wall is absence of wall treatment for the UDS.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 14, 2020, 12:43 |
Reply to Vinerm
|
#3 |
New Member
Join Date: Mar 2020
Posts: 23
Rep Power: 6 |
Dear Vinerm
Thanks for your reply! I have learnt the absence of C_UDSI_RG macro and the reason for the high (or unphysical) gradient near-wall with your help. However, I've no idea how to calculate the gradient using central difference method or how to give a wall treatment on the uds. Could you give me more suggestions? |
|
May 14, 2020, 16:23 |
Uds bc
|
#4 |
Senior Member
|
What boundary condition are you using for UDS? If your boundary condition is appropriate, the C_UDSI_G should return correct gradient. Is the gradient in the rest of the domain alright and bad only in the wall boundary region?
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 16, 2020, 00:08 |
Reply to Vinerm
|
#5 |
New Member
Join Date: Mar 2020
Posts: 23
Rep Power: 6 |
Thanks for your patience and apologize for replying so late!
It took me some time to confirm these things. The boundary condition for the uds is set as zero flux because the local gradient is zero. The discretization scheme is first order upwind for the uds. The result seems to be reasonable. So I check the C_UDSI_G in the center of computational domain. The higher gradient is also observed in the center region. It may be 3 or 4 times of the reconstruction gradient. It seems that I have to obtain the reconstruction gradient of uds. How to program on it? Could you give me any suggestions? |
|
May 16, 2020, 07:17 |
Gradient
|
#6 |
Senior Member
|
First, use second-order scheme. Secondly, how do you know that the gradient is 3-4 times higher than reconstruction gradients when you don't even have reconstructed gradient field?
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 17, 2020, 01:05 |
reply to Vinerm
|
#7 |
New Member
Join Date: Mar 2020
Posts: 23
Rep Power: 6 |
Thanks for your reply.
I use a uds to store the value of C_T and don't solve this uds. Then I can get the values of C_UDSI_G and C_T_RG and compare them. I have tried the second-order scheme, but the value of C_UDSI_G shows oscillation (between positive and negative, actually it should be positive). Besides, there is a still large difference between the values of C_UDSI_G and C_T_RG. Thus, I've tried the first-order scheme and found it may work better relatively. If using second-order scheme, how to deal with the problems of oscilliation and difference? |
|
May 17, 2020, 05:41 |
UDS gradient
|
#8 |
Senior Member
|
The values stored in C_UDSI_G are junk if you are not solving for UDS.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 17, 2020, 21:54 |
Reply to Vinerm
|
#9 |
New Member
Join Date: Mar 2020
Posts: 23
Rep Power: 6 |
I'm sorry that I did not describe my problem properly.
I want to get the second-order gradient of volume fraction in my udf. So I store the value of C_VOF_RG in a uds. And then I use C_UDSI_G to obtain the second-order gradient. I perform these procedures with cell loops in ADJUST macro. That is the reason why the ude is not solved. |
|
May 18, 2020, 05:20 |
UDS Gradient
|
#10 |
Senior Member
|
The usage is not important. Fluent solves for gradients to determine flux of the field at the faces and diffusion in the cells. If the conservation equation is not being solved, Fluent does not require flux calculation, hence, no gradient calculation is done. So, the solution is to write a code to determine gradient instead of using UDS. You can use any of the gradient calculation approaches.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 18, 2020, 09:39 |
Reply to Vinerm
|
#11 |
New Member
Join Date: Mar 2020
Posts: 23
Rep Power: 6 |
Thanks for your suggestions and patience.
I will try to write a code to obtain the local gradient. Best wishes. |
|
Tags |
c_udsi_g, gradient, second-order gradient, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pisoFOAM (LES) - internal pipe flow - convergence | gu1 | OpenFOAM Running, Solving & CFD | 0 | January 11, 2018 17:39 |
question regarding LES of pipe flow - pimpleFoam | Dan1788 | OpenFOAM Running, Solving & CFD | 37 | December 26, 2017 15:42 |
Periodic flow using Cyclic - comparison with Fluent | nusivares | OpenFOAM Running, Solving & CFD | 30 | December 12, 2017 06:35 |
Gradient of UDS | gemini | Fluent UDF and Scheme Programming | 2 | December 24, 2013 01:24 |
UDS gradient ?? | akm | Fluent UDF and Scheme Programming | 0 | April 23, 2012 15:49 |