- **Fluent UDF and Scheme Programming**
(*http://www.cfd-online.com/Forums/fluent-udf/*)

- - **CTRANS and DTRANS in 6DOF in fluent**
(*http://www.cfd-online.com/Forums/fluent-udf/72211-ctrans-dtrans-6dof-fluent.html*)

CTRANS and DTRANS in 6DOF in fluentHey friends,
Does any one know about how to use the custom rotation matrix and derivative rotation matrix in 6DOF module of fluent.Basically I want to do the cfd analysis of wind turbine blade.the blade does not have 6DOF it has only one degree of freedom so I want to constrain the motion of blade in one axis rotation only.To constrain the motion of a free falling body we need to use transformation matrices. I have tried it by using certain transformation matrices but the motion is not constrained as by the requirment. Please if anyone can help me that what is the basic theme behind CTRANS and DTRANS. I will be really thankful... |

You may use sliding meshHi,
Why do you want to define the rotation matrix and not use the sliding mesh? Dragos |

Hai,
U can solve wind turbine releated problems using Sliding Mesh Approach. in case if u need any other details please ref the following journal " Wind tunnel and numerical study of a small vertical axis wind turbine"Robert Howell*, Ning Qin, Jonathan Edwards, Naveed Durrani. |

Thankyou Dragos and Shiva,
Actually I hav done cfd by turbo machinary and moving wall. Here's the reason why i am trying to use rotation matrices instead of sliding meshes. Basically by using sliding mesh or moving frame of reference or moving wall(in rotation) or turbomachinary module, we need to give the rpm value to the blade. But the RPM value of blade should be the output of the software by the action of air as happens in reality.This case resembles to degree of freedom of a body. This is only possible in 6DOF in fluent. For wind turbine there is only one DOF(1 axis rotation) so that i am trying to constrain the motion by using matrices. Now i am also using another approach by using a udf macro i.e DEFINE_CG_MOTION. If we want to specify the direction of velocity in the code, we write v[0]=(some formula) /*for x axis of velocity v[1]=(some formula) /*for y axis of velocity v[2]=(some formula) /*for z axis of velocity Similarly omega[1]= ....... /*y axis rotation ....stc If u can help me in either the 6DOF approach, or this new one which i described at the end. How can we specify the direction of force in c++ code as like of linear and angular velocity I will be very thankful to you |

P=M*omegaHm, what you get from the solver is a positive pressure torque and a negative torque due to drag. If you don't specify the rpm, the turbine will accelerate until the the pressure torque will balance the friction torque, with the result that no output power will be produced.
I imagine that you want to produce some power with it, so basically you can run your turbine with 0 rpm to estimate the torque and then, from the power you want you get a good approximation of the rpm you need. |

sorry i was late to replyHey dragos thanks for reply again
I need to tell you that wind turbine blade is not too simple as u r understanding about it. About your statement " you can run your turbine with 0 rpm to estimate the torque".We cannot estimate the torque value at particular rpm(e.g. 0 rpm),because at every RPM value, the AOA of blade with the air changes.In result of that whole pressure distribution across blade changes.So positive pressure torque and negative torque due to drag will not be same at every RPM.About your statement " you get a good approximation of the rpm you need".If i know power output of the blade then why we need to change the shape of the blade(twist and chord) to optimize for power.Means any kind of blade shape can give us the power as it is my estimation(that i want)from the power you wantplease read below i have written the solution |

Hey DRAGOS i am again here
I have done the cfd analysis of blade by using moving wall condition.what i did is that I give certain rpm value to the blade and after convergence i check the forces or moment value on blade in tangential direction. If the value of force is in such direction that it can accelerate the blade to more rpm I increase the rpm value until at one rpm the tangential torque becomes equal to the frictional torque. This is the net rpm value of the blade.I concluded from the results that power = torque* omega power will be maximum where product of torque and omega will be maximum. And it is at one particular value of rpm and at that rpm there will be a torque value and product of both will be maximum here. This rpm value is not the maximum or minimum but in between value where power is max. I did not understand about one of your statement " until the the pressure torque will balance the friction torque".If you don't specify the rpm, the turbine will accelerateHow a body can move or rotate or accelerate without using dynamic mesh Is it possible in using sliding mesh technique, that by just action of air the turbine will accelerate itself I will be waiting for your kind reply I will be very thankful to you |

Hello Shehzad,
First of all I apologise if any of my previous messages offended you in any way, it was definitely not my intention, maybe just my bad english. Second, what you said in your last message is actually what I had in mind when I wrote the solution: - run your turbine MRF 0 rpm; - estimate the torque; - change the angle of attack (like any modern wind turbine I've seen on the landscape) and increase the rpm to obtain the aimed power; - estimate the torque again; - change again the angle of attack and rpm; - and so on When I said that your turbine will accelerate, I was thinking at your 6 DOF approach. As you also said this is not possible if you use an MRF or sliding mesh approach since you fix the rpm. Dragos |

sory DRAGOSHey Dragos
I am realy sory, my intention was not to make you incorrect or somthing like this. I was just thinking, by me if some one can get help or seek knowledge , i will be happy. Anyway coming to the point You are now clear about my point. I have already done all thiis kind of CFD that you are telling.this CFD approach requires a no. of itereations by changing the rpm to get the results. As i have already explained in the above posts. But you can see it is an iterative process. Now i am free for one month before my final presentation. So what i am wishing for now, is that we should prepare a model() in fluent with the help of UDF , that just by action of air the blade should start moving itself, so that we would be able to get rid of these indirect techniques.Let me explain to you how. If you just visit an example in fluent UDF manual written below in the macro of DEFINED_CG_MOTION ExampleConsider the following example where the linear velocity is computed from a simple force balance on the body in the x-direction such that 4.5-1 change in velocity = force * dtime /massand the UDF is(dont read or understand the UDF i have explained it below)/************************************************** ********** * 1-degree of freedom equation of motion (x-direction) * compiled UDF /* reset velocities */ NV_S(vel, =, 0.0); NV_S(omega, =, 0.0); if (!Data_Valid_P()) return; /* get the thread pointer for which this motion is defined */ t = DT_THREAD(dt); /* compute pressure force on body by looping through all faces */ force = 0.0; begin_f_loop(f,t) { F_AREA(A,f,t); force += F_P(f,t) * NV_MAG(A); } end_f_loop(f,t) /* compute change in velocity, i.e., dv = F * dt / mass velocity update using explicit Euler formula */ dv = dtime * force / 50.0; v_prev += dv; ************************************************** ******* What he is doing here is integrating the pressure around hte body and finding the force by Force = pressue * area And then calculating the velocity by explicit Euler formula at every time step.so body is moving by action of forces generating on it.Now if a body can move due to force generation on it then why it cannot rotate. I am sory Dragos i have written too much. thank you for reading |

Explanation to new workHey Dragos
I have done a little bit work on it. Here we also have two surfaces of blade upper and lower surface. We can find the net pressure difference and then force and then velocity. But it is not too simple as the example of piston above Reson is at each spanwise location airfoil we have different force direction and to convert it into its component towards tangential direction , it requires a lot of search and work But the work will be very if we are able to get force or the torque value from the fluent at each time step in tangetial direction. For example we have written some thing to compute pressure force on body by looping through all faces.We can also wrrite some command that will compute the net torque or force on body and in some direction. like v[0]=(some formula) /*for x axis of velocity v[1]=(some formula) /*for y axis of velocity Similarly omega[1]= ....... /*y axis rotation ....stc May you help me in finding out such comand or if you may guide me from where i can get the variables list in which we can search about the words that we need to write in codes.Thank you very much for bearing me too much. I will be waiting for your kind reply |

Hello again,
In case you use 6DOF approach, I don't think the DEFINE_CG_MOTION is appropriate since your rotor CG is not moving. Instead I would suggest DEFINE_SDOF_PROPERTIES with Code:
`properties[SDOF_LOAD_M_X] = torque_value_x` Code:
` torque_value_x = pressure_torque_x-viscous_torque_x-extracted_torque` |

Hey Dragos ,thank you very much for reply
I am extremly grateful to you for giving me the correct direction. still I need to discuss some things with you. The names you have specified torque_value_x , pressure_torque_x etcAre these the macros that you are calling for use or these are the physical names of the things that we need to calculate by using some formeulas approach.I have searched about in fluent UDF manual a lot but i did not find any macros like these. If these are the macros I dont know how to attach them because i have tried to write them in my UDF by different ways but every time there is an error(unrecognized identifier).So these do not seems to be macros.Also there are different ways of attaching the macros with UDF. Second thing is I have a UDF to check the behaviour of body by applying a constant torque value in "properties[SDOF_LOAD_M_X] " the UDF I hav used is correct and compiled DEFINE_SDOF_PROPERTIES(Blade,prop,dt,time,dtime) prop[SDOF_MASS]=10.0; prop[SDOF_IXX]=10.0; prop[SDOF_IYY]=10.0; prop[SDOF_IZZ]=15.0; { static real t; SDOF_LOAD_LOCAL = TRUE; t=50; prop[SDOF_LOAD_M_Y] = t; } printf ("\Blade: updated 6DOF properties"); } The thing that I was thinking came out to be correct. The blades did rotate due to constant torque value, as well as they translate also in the direction of flow.This happened due to the 6DOF property. I want to constrain its translation and it can be done by using CTRANS and DTRANS matrices.But I dont know what kind of matrix I should use to get rotation only. My rotation axis is negative y axis. May you help me in giving constrained to the motion of blades. Also please guide me to some reference litreture or web site where i could get thorough explanation about torque_value_x and 6DOF properties of fluentI will be grately thankful to you I will be waiting for your kind reply |

Hello Shehzad,
The variables I used in my previous message were just descriptive names and not fluent macros. In order to get their values you just have to use the loop described by you few messages above. I did a test, and if you don't use gravity, then your rotor will not translate, but only rotate with the conditions you impose (torque only). I'm not aware of any 6dof howto for fluent. |

Hey Dragos
thank you very dragos about all this discussion. This was my first time i ever have gotten help from some one on internet. The experience was very good and interesting. i have already used zero gravity condition but blades did move due to action of air. But any way Again thanks for your too much help.Inshallah, In a couple of days i will try to find out the solution. In any case I would able to get the results or not I will tell you about the situation. Good bye thanks again for all discussion |

Hey friends,
Does any one know about how to use the 6DOF module of star ccm++ for wind turbine applications.Basically I want to do the cfd analysis of wind turbine analysis using star ccm++. I have tried it by 6 dof body methodologies.but i m not able to get the required rpm.Please if anyone can help me that what is the basic theme behind this methods. I will be really thankful... |

sorry i do not have any knowledge about star ccm++
i have done all the work in fluent to do the cfd analysis of wind turbine |

Hi,
I am using fluent 6.2 for the flow simulation of vertical axis wind turbine. My problem is how to find out the torque from the moment coefficients value. some times the values are too, in high range!! I am really in dilema as to what to do! Please help me. |

Dear Shehzad.
I am using fluent 6.2 for the flow simulation of vertical axis wind turbine in sliding mesh methodology. My problem is how to find out the torque from the moment coefficients value. some times the values are too, in high range!! I am really in dilema as to what to do! Please help me |

hi shiva
sorry friend i have been there on internet after a long time . so i could not read ur msgs. fluent does not has capability of constraining the motion of a free falling body in 6dof. so you need to write a UDF for that. Compute_force_And_moment is the name of a macro which integrates the forces and moments on the body that are generated due to the action of air. you can have the resulting motion by using the euler's formula and get the desired motion, whatever direction u required, as i have described in the above posts about the formula and the direction of motion on body. |

Quote:
Now, I am learning the dynamic mesh and want to use 6DOF to make my fan's rotate. can you tell me what is the different between prop[SDOF_IYY] and prop[SDOF_LOAD_M_Y], by the way, can you calculate the rotational speed when your blades rotate. Thanks Han |

All times are GMT -4. The time now is 04:17. |