gravity direction
Hello,
does anybody know if it's possible to change the direction of the gravity acceleration with a time dependent UDF? Thanks!! |
Hi,
I've done it before with a proper journal file. I don't think that it can be done with UDF! |
Thanky you for the reply,
I was thinking to use a journal file as well, but I tried write this UDF. Unfortunately it's wrong because "gravity" isn't the variable right name. Do you know which could be the proper one? #include "udf.h" #define PI 3.14159 DEFINE_ADJUST(gravity_change,d) { cell_t c; Thread *t; real gr[ND_ND]; real time=RP_Get_Real("flow-time"); if (time<0.25) gr[0]=9.81*sin(PItime*4/0.25); gr[1]=9.81*cos(PI/180*time*4/0.25); gravity[0]=RP_Set_Real(gr[0]); gravity[1]=RP_Set_Real(gr[1]); } |
if you want to write a UDF, I have a suggestion. you can implicitly involve a gravitational effect by importing a source term in momentum equations, here it doesn't need to activate gravity effect in fluent instead write 2 UDFs for x and y momentum equations via DEFINE_SOURCE macro.
|
Great idea!
Could you be so kind to give me an example? |
Quote:
your x and y momentum sources change with time. e.g. for rotating gravity it would be: s_x=rho*g*cos(wt) s_y=rho*g*sin(wt) to implement a DEFINE_SOURCE UDF you can refer to UDF manual. I think it's clear. |
I really don't know how to thank you!
But I have another question, I hope it will be the last! Since my problem is multiphase, is it possible to read Rho or is it suppose to be a constant? |
I think, if you use C_R(c,t) as rho, FLUENT automatically account for that.
|
It works!
Thank you for all these aids Amir! |
All times are GMT -4. The time now is 12:10. |