CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

sinusoidal rotation UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By AlexanderZ
  • 1 Post By denis Kim

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 17, 2019, 09:56
Default sinusoidal rotation UDF
  #1
New Member
 
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8
denis Kim is on a distinguished road
Hello,
now i am trying to simulate the sinusoidal rotation of the cylindrical tank with below conditions.

-Amplitude: 50deg (0.872 rad)
-frequency: 0.125 hz (=period: 8sec)

The tank will be simulating with Y axis and there is no transitional movements.
The code what i did is,

#include "udf.h"
DEFINE_ZONE_MOTION(rotation,omega,axis,origin,velo city,time,dtime)
{

*omega[0] = 0.0;
*omega[1] = 2*3.141592*0.125*0.872*cos(2*3.141592*0.125*time);
*omega[2] = 0.0;


N3V_D (velocity,=,0.0,0.0,0.0);
N3V_D (omega,=,0.0,1.0,0.0);

return;
}

but i returns error message like below,
..\..\src\rotation_test_17.c(5) : error C2100: illegal indirection
..\..\src\rotation_test_17.c(6) : error C2100: illegal indirection
..\..\src\rotation_test_17.c(7) : error C2100: illegal indirection

Anyone who can help me modify the code or any comments?
(Please help me...)
It would be very help and thank you so much in advance.

Best regards,
Denis
denis Kim is offline   Reply With Quote

Old   June 18, 2019, 02:19
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
omega is a scalar,
you have to define origin and axis

Ansys Fluent Customization manual -> DEFINE_ZONE_MOTION

best regards
vavnoon likes this.
AlexanderZ is offline   Reply With Quote

Old   June 18, 2019, 07:01
Default
  #3
New Member
 
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8
denis Kim is on a distinguished road
Thank you for your valuable comments.

i am recoding in consideration of your comments.

can you give me a comments below UDF?

#include "udf.h"
DEFINE_ZONE_MOTION(rotation,omega,axis,origin,velo city,time,dtime)
{
*omega = 2*3.141592*0.125*0.872*cos(2*3.141592*0.125*time);

N3V_S(origin,=,0.0); /* default values, line could be omitted */
N3V_D(axis,=,0.0,1.0,0.0); /* default values, line could be omitted */

return;
}

Thank you in advance.

Best regards,

Kim
vavnoon likes this.
denis Kim is offline   Reply With Quote

Old   June 19, 2019, 01:08
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
very good code,
try it

best regards
AlexanderZ is offline   Reply With Quote

Old   June 19, 2019, 01:13
Smile
  #5
New Member
 
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8
denis Kim is on a distinguished road
very thanks@@!

It works!!

Best wishes,

Denis
denis Kim is offline   Reply With Quote

Old   May 19, 2020, 14:10
Default problem in my DEFINE_ZONE_MOTION UDF
  #6
New Member
 
mohammad
Join Date: Dec 2019
Posts: 15
Rep Power: 7
movaffagh is on a distinguished road
hi i have a problem with my code in mesh motion rotation.i have a fuel assembly and i should simulate heaving and rolling motions. my code its in below:

#include<udf.h>
#define period 6
#define angular_freq 2*M_PI*period
#define tetamax 10*M_PI/180
DEFINE_ZONE_MOTION(fmotion,omega,axis,origin,veloc ity,time,dtime)
{

*omega =tetamax*sin(angular_freq*time);

N3V_D (velocity,=,0.0,0.0,0.0);
N3V_S(origin,=,0.0);
N3V_D(axis,=,1.0,0.0,0.0);

return;
}

i need my geometry rotate between -10 and 10 degree but with this code my geo rotate between 0 and 10 degre
what's my problem?
thank's
movaffagh is offline   Reply With Quote

Old   May 19, 2020, 16:25
Default Angular Frequency
  #7
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
That's because the angular frequency is wrong. Divide it by 180.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 20, 2020, 19:03
Default problem in my DEFINE_ZONE_MOTION UDF
  #8
New Member
 
mohammad
Join Date: Dec 2019
Posts: 15
Rep Power: 7
movaffagh is on a distinguished road
Quote:
Originally Posted by vinerm View Post
That's because the angular frequency is wrong. Divide it by 180.
dear vinerm:why i should divide? i have pi in my angular frequency and its in radian unit. whats unit i should use?
movaffagh is offline   Reply With Quote

Old   May 21, 2020, 08:49
Default Angular Frequency
  #9
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
You are right. You don't really need that and it actually changes nothing except reducing the rotational speed. But if 6 is really the time period then your equation for angular frequency is wrong. It should be 2\pi/6. And with that, you get one complete cycle within 6 seconds, including -0.1745 as minimum value, which corresponds to -10 in degree.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 22, 2020, 18:39
Default
  #10
New Member
 
mohammad
Join Date: Dec 2019
Posts: 15
Rep Power: 7
movaffagh is on a distinguished road
Quote:
Originally Posted by vinerm View Post
You are right. You don't really need that and it actually changes nothing except reducing the rotational speed. But if 6 is really the time period then your equation for angular frequency is wrong. It should be 2\pi/6. And with that, you get one complete cycle within 6 seconds, including -0.1745 as minimum value, which corresponds to -10 in degree.
thank you for your help.
movaffagh is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF Rotation lepetitmort Fluent UDF and Scheme Programming 38 October 15, 2020 07:29
udf for blade rotation mamad7192 Fluent UDF and Scheme Programming 1 May 28, 2017 18:09
UDF for non sinusoidal or varying amplitude motion with respect to time lalit kumar FLUENT 1 November 13, 2010 17:58
Sinusoidal motion udf urmazda Fluent UDF and Scheme Programming 6 July 30, 2010 12:44
VOF UDF FOR PATCHING SINUSOIDAL FREE SURFACE beginner FLUENT 1 September 10, 2007 03:16


All times are GMT -4. The time now is 16:45.