CG Motion Absolute coordinates
I'm having a little trouble with the Define_CG_Motion macro. I'm trying to do a simulation of a wing that is both flapping and pitching. The flapping is a rotation about the xaxis and the pitching is a rotation about the zaxis.
The problem is, it seems that the coordinate system for the CG remains relative to the hooked zone at all times. This makes the wing rotate about the (absolute) yaxis as well if I just define an omega_x and omega_z, because as time advances the flapping motion rotates the wing's relative coordinate system. Is there any way to define the CG location in absolute coordinates, or do I just have to rework my functions to account for the rotation? 
flapping and pitching
Hi, everybody...
I am having this same problem.but in my udf i want to rotate one of edges only about on coordinate,I've been working on it for two weeks but i didnt find any similar problem,if u found any solution for this kind of problems let me know please:) thank you in advance my email: almostafa67@gmail.com 
I haven't had any luck either. I tried doing a coordinate transformation to transform rotations about the reference x, y, and z axes to rotations about the moving body x, y, and z axes. It gets the motion closer to what I want but still not right. Adding to the frustration is the fact that Fluent's "Display Zone Motion" doesn't work right, so I have to do "Preview Mesh Motion" every time just to check.

1 Attachment(s)
hi dear montag...
this the case that i want to simulate it, i hope that u could help me with this. 
Another question. In the Fluent User's manual it says you can check a moving body's center of gravity position and orientation in the dynamic mesh box by pressing 'Update.' See here:
http://my.fit.edu/itresources/manual...ug/node455.htm It would be useful if I could my motion UDF could check the orientation at each time step. Does anyone know how to do that within the UDF? 
For posterity, I figured out how to solve my problem. Use the Euler rate transformations in the UDF in order to convert between body and stationary velocities. You'll also need to use the current zone orientation at each time step using the DT_THETA(dt) macro. Just be careful because it seems to return the orientation in degrees, not radians, so you must convert it to use in trig expressions.

rotation about z axis
2 Attachment(s)
hi dear montag dp...
i worked a lot on my case,but unfortunately see no progress,i sent you the image of the case that i simulated it in gambit and the udf file that i use to rotate small circle about center of bigger circle,(kind of peristaltic pump),would you be so kind as to think about it and explain your udf and if you have any have any advice for me to write my udf file... the udf file that i use: # include "udf.h" # include "dynamesh_tools.h" DEFINE_CG_MOTION(pump,dt,vel,omega,time,dtime) { Thread *t; real freq_t; NV_S(vel,=,0.0); NV_S(omega,=,0.0); if(!Data_Valid_P()) return; freq_t = 4.0; t= DT_THREAD((Dynamic_Thread*)dt); vel[0] = 0.0; vel[1] = 0.0; vel [2] = 0.0; omega [0] = 0.0; omega [1] = 0.0; omega [2] = freq_t; } Thank you in advance for any help you can provide.:) looking forward to ur help... 
Almostafa,
First off, it looks like you could simplify your code down to just: # include "udf.h" # include "dynamesh_tools.h" DEFINE_CG_MOTION(pump,dt,vel,omega,time,dtime) { real freq_t; omega [2] = freq_t; } But I don't think it really matters if you do or not. What exactly is going wrong with your mesh? Perhaps you should make your own thread about it. Anyway, if you are using a Dynamic Mesh I believe you should just use triangular cells (or tetrahedral for 3D). That may be your issue. 
rotation about z axis
dear montag dp...
my udf really worked:D but i faced new problem:o small circle has been locked in its end points!(look at the images) how can i tell fluent move small cylinder and let its end be free???? 
2 Attachment(s)
sorry forgot attach images

Ok, now really confused
I thought I had this right, but now I'm just more confused. I'm trying to just get motion about the x and y axes. I thought the Euler rate equations would help do this, but then I realized I'm still getting rotation about z. I didn't think it was a big deal because Fluent reported it to be less than 1 degree.
It looked like a lot more though, so I tried testing it again without the Euler angles in there. The motion looks exactly the same. But now Fluent reports there to be 0 angle about z after previewing mesh motion. I'm positive that when I tried this before without the Euler angles business it reported the zangle to be about what it looked like ~20 degrees). I'm so confused. And almostafa, I really think you'd get more responses if you just made your own thread instead of constantly changing the subject in mine. Your problem is not really even related to mine. I've helped you all I can, in this thread and my other thread and via PM. Please only post in my threads if you can help out with the problems I'm having. EDIT: So, in all it seems my assumption about CG rotational speed being relative to the moving body axes at all times may be wrong. I really don't know. Perhaps the rotation is actually relative to the stationary frame at all times? In that case why is my wing rotating about the zaxis when I specify 0 rotational velocity about z? I'm very confused about this whole thing. 
For reference, here is a copy of my code. The first would define flapping + pitching motion, assuming the rotations are defined relative to the stationary axes:
Code:
#include "udf.h" Code:
#include "udf.h" Dan 
Hi
Have you found a solution to your problem I really need some help. I dont unuderstand the rotational method in Fluent it does not make sense. I am trying to model a flapping wing in 3D and I cant seem to understand whats wrong. I am very confused. I choose to rotate about the x(flapping) and z(pitching) axis and set this up via UDF and even my profile coordinates and there is motion about the y axes all the time. Then to make matters worse, if I rotate about the x(flapping), y(deviation), and z(pitching) axes at the same time the x axes rotation is fine, but the wing seems to rotate about the y axis in a way that it wants to and rotates about the z axis with some form of accuracy, basically I think the rotation axis in fluent maybe set in a certain way, but I dont understand what it is and how I can solve my problem(s). Could someone please help with this, I have tried so many times to solve this but cannot do it. Please help Dave 
Dave,
In the end I was able to get rotations in two axes to work as follows. Nomenclature: Phi: flapping angle (about global Zaxis) theta: pitching angle (about global Xaxis) Definitions: flapping velocity: dPhi = d(Phi)/dt (user selected, I use a sinusoid) pitching velocity: dtheta = d(theta)/dt Transformation to body coordinates: body xrotational velocity omega[0] = dTheta*cos(Phi) body yrotational velocity omega[1] = dTheta*sin(Phi) body zrotational velocity omega[2] = dPhi You should be able to use a similar approach if your axes are set up differently. Also, these are a simplified version assuming the stroke plane deviation is zero. If you include that you'll have a third velocity and the transformation will be more complicated, but I haven't worked that out. Actually, if you do work out the the threerotation transformation, would you be so kind as to post it here? Thanks. Dan 
Hi Dan
I can get the motion around two axes, thats ok, its adding a third axis which fluent has a problem with. I have thought about this many times and its really just geometry, but I think that fluent has not set up the rotations around an axis properly. If the user sets a rotation about each axis this is what should occur, if a body is flat along the xz plane through the z axis and a rotation occurs about the x, y and z axis this should be simply possible as the rotations are around a fixed global axis, but this was not the case as fluent is coupling the motions about z and y axis always. I dont understand how it does that, because that seems to be more complex than the motion I am asking fluent to do. I will let you know if I find a solution, please let me know if you find a solution friend. Dave 
Quote:
I was puzzled over this for a long time, and still am to some extent, because it seems like the required transformation is not the standard type that uses Euler angles. And oddly enough, there is no information anywhere in Fluent's documentation that I've been able to find about the correct transformation. Even talking with someone from a CFD consulting firm didn't help. 
1 Attachment(s)
Actually, here's something that someone sent me. This guy did a flapping simulation of a dragonfly in fluent, which you should be able to find easily on youtube. I asked him how he did his coordinate transformations and he responded with the attached pdf. It is quite detailed and allows for threeaxis rotation.
Thanks to Jakub K. for this. 
Thanks for the attachment, will have a look through.
It is very odd if they have chosen a time dependent axis system, I dont think they have configured the dynamics correctly. A global coordinate system would be the best possible one to use. Anyway, I will let you know if I progress in this rather weird problem, please let me know if you find any more information. 
Dear Montag Dp...
in the pdf that you have given in your comments. it mentions an ebook in tht.... will u be kind enough, to send me that ebook.... i want to understand the tranformations in more detail..... my email is aamer58@gmail.com. looking forward to your help. 
how to do coordinate transformation in udf
Hello all.....
i am a student of cfd and trying to sweep a simple wing from 0 to pi radians (azimuth angle) and assuming a constant angle of attack. When i make a 2D airfoil in gambit, it is in xy plane. now if i want to make a wing out of it, i have to extend it in z direction. so the wing is formed in such away that its span is in z direction and airfoil in xy plane. but in fluent, in order to mimic insect sweeping, i want the same wing to transform its axes in such away that its span is in x direction and airfoil is in yz plane....... How can this coordinate transformation be achieved in UDF ???? @dear montag Dp...... looking at your previous threads, i think your guidance can serve the purpose. ..... thanks 
All times are GMT 4. The time now is 12:06. 