TAGGED: dynamic-mesh
-
-
December 15, 2020 at 1:04 pm
mirikardn
SubscriberI want my boundary to be oscillating with certain velocity about mean position. I have equation with me. I have written normal c program to generate the motion. But I'm unable to apply it in UDF structure in ansys fluent. The following is the equation needs to be incorporated in UDF.
I'm posting here what I have tried in my UDF
#include "udf.h"
DEFINE_GRID_MOTION(motion,domain,dt,time,dtime)
{
real freq, pi, time, a, b, c, y;
real x[ND_ND];
face_t f;
a = -7.854;
b = -0.005;
c = -0.006;
y = a*pow(x[0],2)+b*x[0]+c;
pi = 3.14159;
freq = 150;
/* calculate y-component of velocity */
begin_f_loop(f,thread)
{
{
F_GRID_MOTION(f, domain,dt,time,dtime) = 4*150(y-0)*cos(2*pi*freq*time);
}
}
end\_f\_loop(f, thread)
}
December 15, 2020 at 1:35 pmRob
Forum ModeratorHave a look in the manual, you're missing some of the code structure to tell the solver you're dealing with walls etc. Its 2.6.4. DEFINE_GRID_MOTION in the 2020R2 UDF manual. nDecember 23, 2020 at 6:31 ammirikardn
SubscriberHi Rob,nThanks for you response. I was able to solve my problem and I'm now able to use the required UDF. The next thing is parallelizing the UDF, sigh. I looked up ansys udf manual as well a few sources on internet but I was not able to understand the structure. Let's see what can be done.nAhh one more thing. Why does the student 2020 R1 version does not open in series mode? When I click on edit setup I go with default values (processes = 1) still it opens in parallel mode. When I try to make processes = 0 ( I read about the same on ansys forum, so tried it), it automatically becomes one again. Can you help me run the Fluent in serial mode? nThanks, appreciate your support.nDecember 23, 2020 at 11:45 amRob
Forum ModeratorSerial is one node (sort of) so don't worry about that. We used to have two builds of the code, serial and parallel, switching to pure parallel allows us to develop more stuff rather than the same stuff twice. nLooking at your UDF, the parallel bit is (usually) to ensure you don't count area/volume etc twice on the partition boundary cells. If you're on one core there is no partition so nothing to worry about. You will see warnings but these shouldn't cause any problems when running the code. nDecember 24, 2020 at 9:46 ammirikardn
SubscriberThanks for your quick response, Rob. nAt this point when I start fluent with 1 core and compile the udf. When I build the udf it shows 'automatically switched to -t1 flag and if you encounter any errors you can go back to -t0 flag'. Then when I click on load it shows error mentioning something similar to 'This udf is not suitable parallelized usage'. nI'm trying to make it parallel so I can also get my work done faster but if I cant then I would prefer to run it in serial mode.nI'm attaching my working udf for serial mode here. I understood what #if RP_HOST and similar commands to but for I'm not able to understand what should I use for conditional if statement in the udf.nLet me know if you have any suggestions. Thank you!nnApril 4, 2023 at 11:50 amAditi Deekshita Pallay
SubscriberDear mirikardn
Greetings, I am facing a problem similar to the one of simulating a sinusoidal motion of an edge in ANSYS Fluent, with the edge oscillating about the central mean position. Could you kindly provide guidance on what specific User-Defined Function (UDF) and boundary conditions are needed to accomplish this simulation?
If you could also provide additional details about any constraints or requirements for the simulation, it would be much appreciated. Thank you.Viewing 5 reply threads- The topic ‘help me with understanding the structure of the udf for oscillating diaphragm in dynamic mesh’ is closed to new replies.
Ansys Innovation SpaceTrending discussionsTop Contributors-
3737
-
1328
-
1163
-
1090
-
1014
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.
-