|
[Sponsors] |
February 3, 2016, 12:48 |
UDF Moving wall preview strange
|
#1 |
New Member
Christian
Join Date: Nov 2015
Posts: 14
Rep Power: 11 |
Hello everyone,
im currently trying to implement a UDF for the movement of an ultrasonic horn. So the horn should oscillate along the z-axis. I got this UDF DEFINE_CG_MOTION(sonotroda,dt,vel,omega,time,dtime ) { Thread *t; face_t f; /* define the variables */ t = DT_THREAD(dt); /* get the thread pointer for which the motion is defined */ /* if (!Data_Valid_P()) /* return; /* check if the values of the variables are accessible before you compute the function */ begin_f_loop(f,t) /* loop over each face in the zone to create an array of data */ { if (time <= 1) vel[1] = -2* 3.14159 * 20000 * 0.000025 * cos (2 * 3.14159 * 20000 * time); /* define the velocity of the moving zone---*/ else vel[1] = 0; } end_f_loop(f,t) } ok when i define which face should move and preview the motion it just looks as if the zylinder elongates a long way and it doesnt look as if it oscillates around its original position. Is that normal or is there something that i did completely wrong? I uploaded a screenshot of it. Kind regards, Christian |
|
February 4, 2016, 06:58 |
|
#2 |
New Member
Christian
Join Date: Nov 2015
Posts: 14
Rep Power: 11 |
Is there any Problem with my UDF? Is it theoretically applicable to the case that i described? -> oscillating since its a sonotrode.
Also with this Simulation Cavitation through ultrasound should be simulated. Any help would be of great help. Kind Regards, Christian |
|
February 5, 2016, 17:32 |
|
#3 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
You've applied a sinusoidal motion in the y-direction for the first second of simulation on a particular face. If you've applied this motion to one end of your cylinder then I'd expect this cylinder to elongate. Apply this motion to both end faces to create an oscillatory motion of the cylinder along the y-axis. Is the entire domain a cylinder or are there other sections?
|
|
February 5, 2016, 17:41 |
|
#4 |
New Member
Christian
Join Date: Nov 2015
Posts: 14
Rep Power: 11 |
Hello and thanks for your answer `e`,
i already found out today what the problem was. When i set the timestep to xe-6 or even lower then the domain that should moved in this wave pattern moved as it was intended to do. It seems that for bigger time steps the motion gets registered in a weird way and thus the cylinder elongates endlessly. so the solution was just to decrese the timestep to sth xe-6. xe-5 was already to big again and it already started to elongate. Also since the moving face is a sonotrode in my case it wouldnt make sense to set both faces to move. but still thank you so much for your answer and have a nice weekend |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving wall vs. SRF vs. Moving mesh | ghost82 | Main CFD Forum | 18 | February 5, 2022 08:48 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
stationary wall vs. moving wall | user0314 | FLUENT | 0 | August 26, 2011 10:42 |
Get position of a moving wall every time step in UDF | schemer | Fluent UDF and Scheme Programming | 2 | August 10, 2011 03:41 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 06:12 |