-
-
July 26, 2020 at 7:23 pm
ursen
SubscriberHi!
I would like to write UDF code for a drop on a surface for which I want to change contact angle every few seconds.
In my first try I write this UDF - but the contact angle begins changing even before the first second runs out. Where did I go wrong?Â
To summon up - I want the inicial contact angle 90°, then I would like it to change (for example to 110°
and stay that way for a second and then change to for example 130°.
Thanks for your help
DEFINE_PROFILE(take_sest,t,i)
{
face_t f;
real current_time;
current_time = CURRENT_TIME;
begin_f_loop(f,t)
{
if(CURRENT_TIME <= 1.0)
F_PROFILE(f,t,i) = 90.0;
else if(CURRENT_TIME >1.0 && CURRENT_TIME <= 2.0)
F_PROFILE(f,t,i) = 110.0;
else if (CURRENT_TIME > 3.0)
F_PROFILE(f,t,i) = 130.0;
}
end_f_loop(f,t);
} -
August 27, 2020 at 7:53 am
ursen
SubscriberI still haven't figure it out. Please some help.nI've also tried this code:nDEFINE_PROFILE(take_sedem,t,i)n{nntface_t f;ntreal current_time;ntcurrent_time = CURRENT_TIME;nntbegin_f_loop(f,t)nt{nntif(CURRENT_TIME <= 0.2)ntF_PROFILE(f,t,i) = 90;ntelse if(CURRENT_TIME > 0.2 && CURRENT_TIME <= 0.4)ntF_PROFILE(f,t,i) = 110;ntelsentF_PROFILE(f,t,i) = 130;nnt}nend_f_loop(f,t);n}nnWith this code and the one from upper post, drop at some point completely spreads - it doesn't stays at 90? angle at the begining, for some reason stays at 110?, but than just completely spreads. It even begins to climb up on the edges of domena. nI've also tried this:nDEFINE_PROFILE(take_devet, t, i)n{ntreal con;ntreal the_current_time;ntface_t f;nntthe_current_time = CURRENT_TIME;nnif ((the_current_time >= 0) && (the_current_time < 0.2))n{ncon = 90;n}nelse if ((the_current_time >= 0.2) && (the_current_time < 0.4))n{ncon = 100;n}nelse if ((the_current_time >= 0.4) && (the_current_time < 0.6))n{ncon = 110;n}nelsen{ncon = 120;n}begin_f_loop(f,t)n{nF_PROFILE(f,t,i) = con;n}nend_f_loop(f,t)n} nnBut in this case the drop begins to move - (as always in the begining it doesn't stay at 90?), when reaches 110? it begins to move right to the edge of domena, and eventually hits the edge.As far as I'm concerned all the above codes are OK from the C language point. I don't know what am I doing wrong so that the calculation fails. nI have a time step 1e-5, which sould be small enough.Thanks for your helpn -
August 27, 2020 at 12:12 pm
DrAmine
Ansys EmployeeAre you using a recent Fluent release? If yes please use Fluent Expression for this simple task.n -
August 27, 2020 at 12:16 pm
DrAmine
Ansys EmployeeThe return value should be in Radians.n
-
Viewing 3 reply threads
- The topic ‘UDF for contact angle’ is closed to new replies.
Ansys Innovation Space
Trending discussions
Top Contributors
-
3597
-
1243
-
1092
-
1068
-
953
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.