|
[Sponsors] |
June 17, 2019, 09:56 |
sinusoidal rotation UDF
|
#1 |
New Member
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8 |
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 |
|
June 18, 2019, 02:19 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
omega is a scalar,
you have to define origin and axis Ansys Fluent Customization manual -> DEFINE_ZONE_MOTION best regards |
|
June 18, 2019, 07:01 |
|
#3 |
New Member
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8 |
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 |
|
June 19, 2019, 01:08 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
very good code,
try it best regards |
|
June 19, 2019, 01:13 |
|
#5 |
New Member
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8 |
very thanks@@!
It works!! Best wishes, Denis |
|
May 19, 2020, 14:10 |
problem in my DEFINE_ZONE_MOTION UDF
|
#6 |
New Member
mohammad
Join Date: Dec 2019
Posts: 15
Rep Power: 7 |
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 |
|
May 19, 2020, 16:25 |
Angular Frequency
|
#7 |
Senior Member
|
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. |
|
May 20, 2020, 19:03 |
problem in my DEFINE_ZONE_MOTION UDF
|
#8 |
New Member
mohammad
Join Date: Dec 2019
Posts: 15
Rep Power: 7 |
||
May 21, 2020, 08:49 |
Angular Frequency
|
#9 |
Senior Member
|
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 . 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. |
|
May 22, 2020, 18:39 |
|
#10 |
New Member
mohammad
Join Date: Dec 2019
Posts: 15
Rep Power: 7 |
Quote:
|
|
|
|
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 |