Ansys Learning Forum › Forums › Discuss Simulation › Fluids › Assign a transient velocity profile to a moving wall? › Reply To: Assign a transient velocity profile to a moving wall?
The Below UDF will perform the job. A few points about the UDF and its use: 1) The UDF uses a macro which directly assigns the velocity to the thread corresponding to the moving wall, instead of going to the GUI to use the value assigned by user. So this UDF will not update the changes in the boundary condition corresponding to moving wall. To see the updated values on the moving wall, one has to display contours of velocity on that wall with node values enable and global values disabled. The Min and Max values reported in the Contours panel will be the updated values of the velocity assigned to the moving wall. 2) The direction of the wall velocity has to be set by the user in the wall boundary condition panel. #include "udf.h" #include "threads.h" #define wallid 5 DEFINEADJUST(myadjust,domain) { Thread thread = Lookup_Thread(domain, wall_id); real current_time = RP_Get_Real("flow-time"); THREAD_VAR(thread).wall.translate_mag = 10 - (5currenttime); } /* Here, wallid is the integer value (zone id), corresponding to the moving wall thread. It can be obtained from Define -> Boundary Condition Panel. In the current UDF, wall velocity is related linearly with the time to assign a value to the moving wall. */