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

UDF VOF model on Fluent

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 14, 2009, 03:19
Default UDF VOF model on Fluent
  #1
New Member
 
baechtelguillaume
Join Date: Apr 2009
Posts: 13
Rep Power: 17
baechtel is on a distinguished road
Hi everybody,

I have just wrote a new UDF to have 2 different contact angles as I am working on blood droplet impact onto inclines. But I can't see if my udf is working, that's why, before continuing my work, I want to have your point of view.
Does my UDF look OK ?

Thanks you very much for answer. I would appreciate to talk to someone who has already work on drop impact models with Fluent.

Guillaume

/* UDF To add advancing receding angles*/

#include <udf.h>
DEFINE_PROFILE(contact_angle,thread, position)
{
real r[ND_ND]; /* this will hold the position vector */
real x;
face_t f ;
begin_f_loop(f,thread)
{
F_CENTROID(r,f,thread);
x = r[0];
if (y <= 17.03862) /* center of my droplet */
{
F_PROFILE(f, thread, position) = 44; /* advancing angle */
}
F_PROFILE(f, thread, position) = 34; /* receding angle */
}
end_f_loop(f,t)
}
baechtel is offline   Reply With Quote

Old   July 14, 2009, 20:05
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Hi,

Your UDF seems to have several bugs.

1) You use "y <= 17.03862" but the variable y is not defined anywhere. This should give a compilation error about undeclared variables.
2) Your line "F_PROFILE(f, thread, position) = 34;" is done regardless of whether it is in the drop or not - so all faces will have this applied and nothing will get the 44 value set previously.

Glenn Horrocks
ghorrocks is offline   Reply With Quote

Old   July 14, 2009, 20:41
Default
  #3
New Member
 
baechtelguillaume
Join Date: Apr 2009
Posts: 13
Rep Power: 17
baechtel is on a distinguished road
Hi,

Thank you for answer, I had forgotten to change some parameters. Do you think it is alright now ?

Thaks a lot for answer,

/* UDF To add advancing and receding angles*/
#include <udf.h>
DEFINE_PROFILE(contact_angle,thread, position)
{
real r[ND_ND]; /* this will hold the position vector */
real y;
face_t f ;
begin_f_loop(f,thread)
{
F_CENTROID(r,f,thread);
y = r[0];
if (y <= 17.03862) /* center of my droplet */
{
F_PROFILE(f, thread, position) = 44; /* advancing angle */
}
else
F_PROFILE(f, thread, position) = 34; /* receding angle */
}
end_f_loop(f,t)
}
baechtel is offline   Reply With Quote

Old   July 14, 2009, 21:27
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You have fixed the obvious errors. The only thing now is to try it and test it works!

I recommend you test it using a wide range in contact angles (maybe 30 and 150) so it will be obvious that the contact angles you nominate are being correctly set.
ghorrocks is offline   Reply With Quote

Old   July 14, 2009, 22:02
Default
  #5
New Member
 
baechtelguillaume
Join Date: Apr 2009
Posts: 13
Rep Power: 17
baechtel is on a distinguished road
Ok, thank you for help Glenn. I'll do it as soon as possible.

Guillaume
baechtel is offline   Reply With Quote

Old   March 29, 2011, 18:59
Default udf working
  #6
Member
 
rose
Join Date: Dec 2010
Posts: 30
Rep Power: 16
rubis is on a distinguished road
where we can see udf working ????????

thank you
rubis is offline   Reply With Quote

Old   February 19, 2013, 01:56
Default
  #7
New Member
 
Josy
Join Date: Mar 2009
Location: India
Posts: 29
Rep Power: 17
Josyula is on a distinguished road
Guillaume,
What is the radius of the droplet you have used?
Josyula is offline   Reply With Quote

Old   January 20, 2016, 19:13
Default
  #8
SMD
New Member
 
SMD
Join Date: Jan 2016
Posts: 1
Rep Power: 0
SMD is on a distinguished road
Hello everyone
I'm trying to simulate a multi phase (evaporation & condensation) in a Thermosyphone/heatpipe using VOF model. I wrote UDF for mass and energy source.
the question is i can see evaperation, but condensation doesn't happen (even in some regeion we have temperature below the Phase change temperature) until we consider an exaggerated boundary condition in condenser section of thermosyphone, e.g. set a tempreature for condenser wall, 500K lower than Phase change temperature. and in this case instead of seeing a film condensation we see pool condensation!
if someone could help regarding this i really appreciate it.
here is the UDF :

#include "udf.h"
#include "sg_mphase.h"
#define T_SAT 633
#define LAT_HT 234700

/* vapour phase */

DEFINE_SOURCE(vap, cell, pri_th, dS, eqn)
{
Thread *mix_th;
Thread *sec_th;
real m_dot_v;

mix_th = THREAD_SUPER_THREAD(pri_th);
sec_th = THREAD_SUB_THREAD(mix_th, 1);

if (C_T(cell, mix_th) <= T_SAT)
{
m_dot_v = -0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*fabs(C_T(cell, mix_th) - T_SAT)/T_SAT;
dS[eqn] = -0.1*C_R(cell, pri_th)*fabs(C_T(cell, mix_th) - T_SAT)/T_SAT;
}
else
{
m_dot_v = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th) * fabs(T_SAT-C_T(cell,mix_th))/T_SAT;
dS[eqn] = 0.;
}
return m_dot_v;
}

/* liquid phase */

DEFINE_SOURCE(liq, cell, sec_th, dS, eqn)
{

Thread *mix_th;
Thread *pri_th;
real m_dot_l;

mix_th = THREAD_SUPER_THREAD(sec_th);
pri_th = THREAD_SUB_THREAD(mix_th, 0);

if (C_T(cell, mix_th)<=T_SAT)
{
m_dot_l = 0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*fabs(C_T(cell, mix_th) - T_SAT)/T_SAT;
dS[eqn] = 0.;
}
else
{
m_dot_l = -0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*fabs(T_SAT-C_T(cell,mix_th))/T_SAT;
dS[eqn] = -0.1*C_R(cell, sec_th)* fabs(C_T(cell, mix_th) - T_SAT)/T_SAT;
}

return m_dot_l;
}

/* energy */

DEFINE_SOURCE(enrg, cell, mix_th, dS, eqn)
{
Thread *pri_th;
Thread *sec_th;
real e_dot;

pri_th = THREAD_SUB_THREAD(mix_th, 0);
sec_th = THREAD_SUB_THREAD(mix_th, 1);

if (C_T(cell, mix_th)<=T_SAT)
{
e_dot = LAT_HT*0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*fabs(C_T(cell, mix_th) - T_SAT)/T_SAT;
dS[eqn] = LAT_HT*0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)/T_SAT;
}
else
{
e_dot = -0.1*LAT_HT*C_VOF(cell, sec_th)*C_R(cell, sec_th)*fabs(T_SAT-C_T(cell,mix_th))/T_SAT;
dS[eqn] = -0.1*LAT_HT*C_VOF(cell, sec_th)*C_R(cell, sec_th)/T_SAT;
}

return e_dot;
}
SMD is offline   Reply With Quote

Reply


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
Two questions on Fluent UDF Steven Fluent UDF and Scheme Programming 7 March 23, 2018 04:22
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
HELP! UDF sinusoidal wave, VOF model, porous face! A8anato_psofimi FLUENT 2 November 10, 2009 15:42
Film formation in VOF model using fluent Ajay FLUENT 0 September 6, 2007 06:57
about VOF model rey FLUENT 5 August 13, 2002 07:02


All times are GMT -4. The time now is 12:24.