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

Access level-set function in UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2014, 22:49
Default Access level-set function in UDF
  #1
New Member
 
Join Date: Sep 2009
Posts: 19
Rep Power: 17
tinhtt is on a distinguished road
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.
tinhtt is offline   Reply With Quote

Old   November 26, 2014, 04:10
Default
  #2
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
hi friend
use this : C_LSF(c,t)
it returns level set function in cell
good luck
HyperNova is offline   Reply With Quote

Old   November 26, 2014, 04:14
Default
  #3
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
by the way there are some functions too like C_LSF_M1(c,t) or C_LSF_RG(c,t)
HyperNova is offline   Reply With Quote

Old   November 26, 2014, 05:59
Default
  #4
New Member
 
Join Date: Sep 2009
Posts: 19
Rep Power: 17
tinhtt is on a distinguished road
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
tinhtt is offline   Reply With Quote

Old   November 26, 2014, 16:51
Default
  #5
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
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 is offline   Reply With Quote

Old   November 26, 2014, 16:57
Default
  #6
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
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
HyperNova is offline   Reply With Quote

Old   November 27, 2014, 00:24
Default
  #7
New Member
 
Join Date: Sep 2009
Posts: 19
Rep Power: 17
tinhtt is on a distinguished road
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
tinhtt is offline   Reply With Quote

Old   November 27, 2014, 02:11
Default
  #8
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
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
HyperNova is offline   Reply With Quote

Old   November 30, 2014, 02:26
Default
  #9
New Member
 
Join Date: Sep 2009
Posts: 19
Rep Power: 17
tinhtt is on a distinguished road
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.
tinhtt is offline   Reply With Quote

Old   November 30, 2014, 03:15
Default
  #10
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
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
Attached Images
File Type: jpg velocity1.jpg (35.3 KB, 45 views)
File Type: jpg velocity2.jpg (55.4 KB, 38 views)
HyperNova is offline   Reply With Quote

Old   November 30, 2014, 04:28
Default
  #11
New Member
 
Join Date: Sep 2009
Posts: 19
Rep Power: 17
tinhtt is on a distinguished road
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!
tinhtt is offline   Reply With Quote

Old   November 30, 2014, 04:39
Default
  #12
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
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
HyperNova is offline   Reply With Quote

Old   November 30, 2014, 04:50
Default
  #13
New Member
 
Join Date: Sep 2009
Posts: 19
Rep Power: 17
tinhtt is on a distinguished road
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.
tinhtt is offline   Reply With Quote

Old   November 30, 2014, 15:10
Default
  #14
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
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

Last edited by wyldckat; November 30, 2014 at 15:39. Reason: posted few minutes apart
HyperNova is offline   Reply With Quote

Old   December 3, 2014, 02:12
Default
  #15
New Member
 
Join Date: Sep 2009
Posts: 19
Rep Power: 17
tinhtt is on a distinguished road
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!
tinhtt is offline   Reply With Quote

Old   December 4, 2014, 04:42
Default
  #16
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
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
HyperNova is offline   Reply With Quote

Old   December 5, 2014, 08:44
Default
  #17
New Member
 
Join Date: Sep 2009
Posts: 19
Rep Power: 17
tinhtt is on a distinguished road
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!
tinhtt is offline   Reply With Quote

Old   June 10, 2018, 02:47
Default
  #18
New Member
 
YIN
Join Date: Apr 2018
Posts: 1
Rep Power: 0
ys123 is on a distinguished road
Quote:
Originally Posted by tinhtt View Post
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~
ys123 is offline   Reply With Quote

Old   June 12, 2018, 04:36
Default
  #19
Senior Member
 
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12
HyperNova is on a distinguished road
Quote:
Originally Posted by ys123 View Post
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
HyperNova is offline   Reply With Quote

Reply

Tags
level set function, 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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 18:22
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
[snappyHexMesh] Snap the mesh from a level set function instead of a STL surface ginette OpenFOAM Meshing & Mesh Conversion 2 April 5, 2011 11:21
Env variable not set gruber2 OpenFOAM Installation 5 December 30, 2005 05:27
How to set environment variables kanishka OpenFOAM Installation 1 September 4, 2005 11:15


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