CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

reconstruct gradient of UDS

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By loving_cfd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2020, 10:52
Default reconstruct gradient of UDS
  #1
New Member
 
Join Date: Mar 2020
Posts: 23
Rep Power: 6
loving_cfd is on a distinguished road
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?
loving_cfd is offline   Reply With Quote

Old   May 14, 2020, 11:14
Default Scalar Gradient
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   May 14, 2020, 11:43
Default Reply to Vinerm
  #3
New Member
 
Join Date: Mar 2020
Posts: 23
Rep Power: 6
loving_cfd is on a distinguished road
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?
loving_cfd is offline   Reply With Quote

Old   May 14, 2020, 15:23
Default Uds bc
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   May 15, 2020, 23:08
Default Reply to Vinerm
  #5
New Member
 
Join Date: Mar 2020
Posts: 23
Rep Power: 6
loving_cfd is on a distinguished road
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?
loving_cfd is offline   Reply With Quote

Old   May 16, 2020, 06:17
Default Gradient
  #6
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   May 17, 2020, 00:05
Default reply to Vinerm
  #7
New Member
 
Join Date: Mar 2020
Posts: 23
Rep Power: 6
loving_cfd is on a distinguished road
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?
DaveD! likes this.
loving_cfd is offline   Reply With Quote

Old   May 17, 2020, 04:41
Default UDS gradient
  #8
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   May 17, 2020, 20:54
Default Reply to Vinerm
  #9
New Member
 
Join Date: Mar 2020
Posts: 23
Rep Power: 6
loving_cfd is on a distinguished road
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.
loving_cfd is offline   Reply With Quote

Old   May 18, 2020, 04:20
Default UDS Gradient
  #10
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   May 18, 2020, 08:39
Default Reply to Vinerm
  #11
New Member
 
Join Date: Mar 2020
Posts: 23
Rep Power: 6
loving_cfd is on a distinguished road
Thanks for your suggestions and patience.

I will try to write a code to obtain the local gradient.

Best wishes.
loving_cfd is offline   Reply With Quote

Reply

Tags
c_udsi_g, gradient, second-order gradient, udf


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
pisoFOAM (LES) - internal pipe flow - convergence gu1 OpenFOAM Running, Solving & CFD 0 January 11, 2018 16:39
question regarding LES of pipe flow - pimpleFoam Dan1788 OpenFOAM Running, Solving & CFD 37 December 26, 2017 14:42
Periodic flow using Cyclic - comparison with Fluent nusivares OpenFOAM Running, Solving & CFD 30 December 12, 2017 05:35
Gradient of UDS gemini Fluent UDF and Scheme Programming 2 December 24, 2013 00:24
UDS gradient ?? akm Fluent UDF and Scheme Programming 0 April 23, 2012 14:49


All times are GMT -4. The time now is 11:03.