UDF for moving wall (oscillating)
I have been doing a project on sloshing in tanks. In my experimental setup i am using a 'Shake Table Apparatus'.
so for making similar moving condition for my geometry in ansys fluent, i need to create an oscillating moving wall using a udf. I don't have much knowledge in making a udf. I request you to kindly help me in making a udf for an oscillating wall. Given below is the udf i had used so far, but its only giving motion along one direction. i got this udf from a video regarding "generating wawes in tank" #include "udf.h" #include "dynamesh_tools.h" DEFINE_CG_MOTION(oscillate,dt,vel,omega,time,dtime ) { Thread *t; face_t f; /* define the variables */ t = DT_THREAD(dt); begin_f_loop(f,t) /* loop over each face in the zone to create an array of data */ { vel[0]=-2; } end_f_loop(f,t) } T:confused: Thanks for reading |
Here it moves in one direction because the UDF gives it a constant velocity of 2 m/s in negative y-direction.
You don't want a constant velocity. What velocity do you want? (Please don't answer with "an oscillating", but make an equation.) BTW: I don't think this is about not knowing how to make a UDF. This is about making a mathematical model for your problem. You should do that before you make code. |
Quote:
Thanks for your answer sir.. So i need to find out a mathematical model for the moving object. Also if i wrote an equation, how can i give the input in the form of udf? |
Quote:
Code:
v_x = 3 * time + 24 - 8 * sin(time/2) Code:
vel[0] = 3 * time + 24 - 8 * sin(time/2); |
All times are GMT -4. The time now is 21:26. |