CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Access level-set function in UDF (https://www.cfd-online.com/Forums/fluent/144991-access-level-set-function-udf.html)

tinhtt November 25, 2014 21:49

Access level-set function in UDF
 
Hi Experts,
For multiphase problem in Ansys Fluent, if the coupling of volume-of-fluid and level-set methods is used, I wonder how to access the value of level-set function in User-Defined Functions. Thank you!
Actually, VOF can be accessed by using function C_VOF(c,t) as mentioned in UDF manual, but I can't find similar thing for level-set function.

HyperNova November 26, 2014 03:10

hi friend
use this : C_LSF(c,t)
it returns level set function in cell
good luck

HyperNova November 26, 2014 03:14

by the way there are some functions too like C_LSF_M1(c,t) or C_LSF_RG(c,t)

tinhtt November 26, 2014 04:59

Hi HyperNova,
Thank you very much for your help! It works perfectly.

One note for who has same problem: beside of "udf.h", the "sg_ls.h" header file need to be included in source file.
More information of "sg_ls.h" header file can be found in the install folder, for ex. C:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.0\src

HyperNova November 26, 2014 15:51

yes my friend , before i answer your quastion i looked there to find it , i beilive that there is access to any kind of data that fluent produces , i am happy that your problem is solved , wish you luck , forgive my bad english

HyperNova November 26, 2014 15:57

let me ask you a quastion my friend , when you turn on level set function does it increase the accuracy in interface capturing ? what does it do exactly ? i will be thankfull if you explain it

tinhtt November 26, 2014 23:24

Hi HyperNova,
In my test case with bubble bursting, the coupling VOF and LS gives "better" results than just using VOF (in comparison the interface evolution with the other results in literature). I have just finished one test case, so I can't comment which one gives better results in general.
I found from literature that: VOF is good at mass conservation, while LS has advantage in precise gradient calculation of curvature. So the coupling VOF and LS will combine both of their advantages.
Some papers talk about this subject, if you are interested, can be found from internet, for ex.:
Nichita et al., A level set method coupled with a volume of fluid method for modeling of gas-liquid interface in bubbly flow, J. of Fluids Eng., August 2010, Vol. 132, 081302

HyperNova November 27, 2014 01:11

hi my friend , i am working on modelling bubble plume too , so interesting that we are working the same problem , so i think it is better that i turn on level set too for better free surface capturing , actually i have problem in free surface, after some time steps artificial velocity at free surface become bigger and bigger , i dont know why :( i tried scalable wall function but it didnt help , if you mind i send photos of my solution, you may have idea to solve it , thank you

tinhtt November 30, 2014 01:26

Hi HyperNova,
Did you solve your problem by coupling VOF and LS?
3 mesh layers are used for interface description. You can reduce time step value and refine mesh.

HyperNova November 30, 2014 02:15

2 Attachment(s)
Hi my dear friend
actually not :(
i think there is bug in fluent when modelling bubble plume with vof coupled dpm , when the flow rate of air injecting to water (dpm flowrate) is small fluent produce false results ! but this deos not happen when the flow rate is bigger of my test case , my flow rate is 4.0833e-06 kg/s , i sent 2 photos of my problem , i will appreciate if you take a look to them , thanks

tinhtt November 30, 2014 03:28

Hi HyperNova,
Sorry. I have no ideas, no experience on your problem. Let's waiting comments from the other members. Or consulting some other studies like:
http://e-collection.library.ethz.ch/...h-26091-02.pdf
Good luck!

HyperNova November 30, 2014 03:39

hi tinhhtt,
i wanna ask what your works about ? you've mentioned before your works about bubble bursting at free surface , are you modelling the behavior of fluid ? i would appreciate if you give me a little detail , because i am working on bubble plume too , thanks

tinhtt November 30, 2014 03:50

My test case is quite simple: bubble bursting at free surface. Just one bubble is considered. Simulation is carried out from the moment that small hole have been formed on the top of bubble.

HyperNova November 30, 2014 14:10

does bubble bursting at free surface has significant impact on surrounding fluid ? in my work i delete bubble when the arrive to free surface , is this your MSc thesis ? or research work or PhD ? thanks

i wanna confess your work is very interesting for me ;)

tinhtt December 3, 2014 01:12

Hi,
I'm not sure if are there any relation between your 2 attached figs with the "spurious currents".
But for the VOF method, if the surface tension force computation is inaccurate, the spurious currents can be generated at the interface. Hope that point could be useful!

HyperNova December 4, 2014 03:42

hi tinhtt,
i think you are right and they are ''spurious currents'' , at the first they do not exist but after interface starts to move they generate and may become bigger and bigger , especially near walls , i use 0.072 N/m for surface tension and here is my setting for vof

/solve/set> surface-tension
Use node based smoothing [yes]
Number of smoothings [25] ''( default value is 1 )''
Smoothing relaxation Factor [1]
Use vof gradients at the nodes for curvature calculation? [yes]

i do not know any else setting exist that i should change ? by default fluent compute vof every time step , i made it every iteration but it slows computation very much and i am not sure it really helps :(
share your idea please , thank you very much

tinhtt December 5, 2014 07:44

Hi,
If VOF could not give good results, your problem likely needs further tools. I recommend to combine all of these factors:
- Use defaut parameters of VOF
- Activate LS (in Multiphase model panel, select VOF model, and enable Coupling LS+VOF)
- Refine mesh
- Reduce time step
Hope that could help!

ys123 June 10, 2018 01:47

Quote:

Originally Posted by tinhtt (Post 521158)
Hi HyperNova,
Thank you very much for your help! It works perfectly.

One note for who has same problem: beside of "udf.h", the "sg_ls.h" header file need to be included in source file.
More information of "sg_ls.h" header file can be found in the install folder, for ex. C:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.0\src

Hi,

I am trying to store the level set function to a UDS. So I used "C_UDSI(c,t,1)=C_LSF(c,t);" in my DEFINE_ADJUST macro.

But when I run the calculation in Fluent. It showed "received a fatal signal (segmentation fault)".

So do you know what is wrong? Thank you very much~

HyperNova June 12, 2018 03:36

Quote:

Originally Posted by ys123 (Post 695359)
Hi,

I am trying to store the level set function to a UDS. So I used "C_UDSI(c,t,1)=C_LSF(c,t);" in my DEFINE_ADJUST macro.

But when I run the calculation in Fluent. It showed "received a fatal signal (segmentation fault)".

So do you know what is wrong? Thank you very much~

to the best of my knowledge inorder to save a parameter u need to use UDM


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