CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Smoothing Data in Fluent (http://www.cfd-online.com/Forums/fluent/92178-smoothing-data-fluent.html)

ali hemmati September 5, 2011 08:14

Smoothing Data in Fluent
 
Hi everyone,

I need to have gradient of a scalar (UDS), so I wrote a UDF which returns gradient of that. Specifically speaking, by using macro 'C_UDSI_G' and 'F_UDSI_G'.
By the way, the emerging problem is that because of rough nature of UDS, its gradient becomes very inaccurate. So smoothing data may become a crucial task. I wonder to know whether there is any way to smooth data in Fluent or not.

Thank you.

ali hemmati September 6, 2011 02:18

Smoothing may can be accomplished by another program, such as Tecplot or any other problem, but I do not know how this can be done.

As far as know, Techplot can smooth data, but I wonder if it is possible to use Tecplot output as Fluent input.

Amir September 6, 2011 04:28

Quote:

Originally Posted by ali hemmati (Post 323039)
Smoothing may can be accomplished by another program, such as Tecplot or any other problem, but I do not know how this can be done.

As far as know, Techplot can smooth data, but I wonder if it is possible to use Tecplot output as Fluent input.

Hi Ali,

you're right, you can easily smooth variables in Tecplot; but to export data from Tecplot to fluent you'll need an axillary code. The idea is to use proper .dat file of Tecplot and then by a simple fortran or matlab code change it's format to interpolate file and then read this interpolate file to fluent. I did this procedure few months ago and it worked after many problems encountered; just do it when there won't be any other choices.:rolleyes:

Bests,

ali hemmati September 6, 2011 05:06

Hi Amir,

Thank you for your response. I really need to do so, because as long as there is no way to interpolate and smooth data in each cell in Fluent, using another program for smoothing data may work. But as you said, it is an overwhelming job! If I write a code, can it be used for any mesh, or it will vary for mesh to mesh?

Another thing that I wanted to ask is do you think that is it possible to write a UDF which smooth data? I mean by performing a weighting average of all adjacent cells of each cell, as an approximate value.

Amir September 6, 2011 07:23

Quote:

Originally Posted by ali hemmati (Post 323063)
Thank you for your response. I really need to do so, because as long as there is no way to interpolate and smooth data in each cell in Fluent, using another program for smoothing data may work. But as you said, it is an overwhelming job! If I write a code, can it be used for any mesh, or it will vary for mesh to mesh?

The changes are not considerable; just needed to change dimensions and something like these....
Quote:

Originally Posted by ali hemmati (Post 323063)
Another thing that I wanted to ask is do you think that is it possible to write a UDF which smooth data? I mean by performing a weighting average of all adjacent cells of each cell, as an approximate value.

I think before performing such data transmission or writing UDFs, it's better to think about solving a laplace equation over desired variable; i.e., an unsteady transport equation with zero convective terms; you can change effect of smoothing via diffusion coefficient.

Bests,

ali hemmati September 6, 2011 07:51

Quote:

it's better to think about solving a laplace equation over desired variable; i.e., an unsteady transport equation with zero convective terms; you can change effect of smoothing via diffusion coefficient.
Hi,

I really appreciate you for concerning and pursuing the conversation. Unfortunately, I did not get the point.
My UDS is already is solved by a Laplace equation in 3 dimensions and at steady condition, and I need the \nabla((\nabla\varphi)^{2}) in which \varphi is the scalar. But it leads to a rough contour.

Amir September 6, 2011 09:36

Hi,

I just wanted to elaborate smoothing algorithm which you can perform in FLUENT for any variable:
1) store it in a UDS variable (e.g. C)
2) solve this equation: \partial/\partial t (\rho C) = \nabla . (D \nabla C)
3) Enjoy!

Obviously, you can achieve different smoothing results for different D or run time.

Bests,

ali hemmati September 6, 2011 12:19

Hi Amir,

It seems that the problem has bees solved by using just one unsteady iteration, without an unbearable change in the UDS, and that was never became into reality(!) unless using your trick.

Thanks a lot,
Bests.


All times are GMT -4. The time now is 18:36.