|
[Sponsors] |
May 8, 2018, 12:16 |
How to define an axis in UDF?
|
#1 |
New Member
Join Date: Nov 2016
Posts: 10
Rep Power: 10 |
Hi, everyone. I am now working on a problem about a pitching 2D airfoil. I have written my UDF and it makes the airfoil oscillate. However, the airfoil is now oscillating around Z axis and I want to set the axis to be 1/4 of the chord length. What should I do to the UDF?
#include "udf.h" #define Freq 2.0 #define w 2.0*M_PI*Freq #define pitch 7.5*M_PI/180 DEFINE_CG_MOTION(shm, dt, cg_vel, omega, time, dtime) { real omega; omega = pitch*w*cos(w*time); cg_vel[0] = 0.0; cg_vel[1] = 0.0; cg_vel[2] = 0.0; cg_omega[0] = 0.0; cg_omega[1] = 0.0; cg_omega[2] = omega; } |
|
May 8, 2018, 22:27 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
cg_omega[0] = 0.0; cg_omega[1] = 0.0; cg_omega[2] = omega; if you want some "mix" axis you should find normalized vector your axis you want and put it here, for instance for vector {1,1,1}: Code:
cg_omega[0] = 1*omega; cg_omega[1] = 1*omega; cg_omega[2] = 1*omega; |
|
May 9, 2018, 05:44 |
|
#3 |
New Member
Join Date: Nov 2016
Posts: 10
Rep Power: 10 |
But, the rotating axis is still across the origin. I want to set the axis to be ,say line x=1, and rotate at omega_z=1.
|
|
May 14, 2018, 11:15 |
|
#4 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
Hi Larrabee,
If you combine rotation about the origin with a translational velocity that keeps the axis-point stationary, then you get rotation about the axis-point. You could also consider shifting the entire geometry until your axis *is* the origin. Good luck! Ed |
|
July 23, 2018, 01:11 |
|
#5 | |
Member
Hanye Azimi
Join Date: Oct 2016
Posts: 42
Rep Power: 10 |
Quote:
you could define the pitching axis in Fluent in this way : Cell Zone Conditions , rotation-axis origin , x=0.25(if Leading Edge is at 0,0) you may define this point (0.25*chord length) as the centre of gravity location,too. |
||
July 23, 2018, 01:21 |
|
#6 |
Member
Hanye Azimi
Join Date: Oct 2016
Posts: 42
Rep Power: 10 |
I'm working on a similar case. It's been validated while angle of attack equals zero but the results doesn't match when there is A.O.A and I don't know how to input Alpha(angle of attack) in the UDF
my UDF is: #include "udf.h" #define pi 3.141592653589793 // DEFINE_CG_MOTION(airfoil_pitch, dt, vel, omega, time, dtime) { real pitchampl,omg,frequency; /* reset velocities */ NV_S (vel, =, 0.0); NV_S (omega, =, 0.0); /* motion */ frequency=0.06; omg=2*pi*frequenc; pitchampl = 15 * pi / 180; /* angular pitch amplitude */ omega[2] = pitchampl *omg* cos(omg * time); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hydrogen storage by metal hydride | longbk | FLUENT | 12 | August 1, 2023 21:13 |
Help! DMFC UDF problems | Biao | FLUENT | 1 | November 2, 2020 08:39 |
An odd ERROR | mdakbari | Fluent UDF and Scheme Programming | 7 | April 4, 2016 05:30 |
Missing math.h header | Travis | FLUENT | 4 | January 15, 2009 12:48 |
Help: using udf to define direction | Bo | FLUENT | 1 | July 16, 2008 07:47 |