CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   variation of gravity with time (

rajani February 16, 2005 03:45

variation of gravity with time

I am hereby writing about few questions in UDF. First of all, I am modeling a helium jet injected into ambient air. The flow is laminar, non reacting, axisymmetric and unsteady. I have already studied the effects of gravity on the jet flow i.e I run the case with g=9.81 for some time( say 1 sec) and then switch off the gravity i.e g=0.0 after 1 sec. I have been doing this using the operating conditions panel. Now instead of suddenly changing from g=9.81to 0.0, I would like to put in a linear variation for the change in g within a time of 0.2s. So the value of gravity changes with time accordingly. In order to achieve this, I understand that I have to write a UDF. So, I disenabled the gravity term from the operating conditions panel and tried to include it as a source term in the axial momentum equation. The sample code is as follows: %%%%%%%%%%%%%%%% #include "udf.h"

DEFINE_SOURCE(xmom_source, c, t, dS, eqn) { real temp, source;

source = -9.81*C_R(c,t)* ((C_YI(c,t,0)-C_YI(c,t,1)) dS[eqn] = 0.0;

return source; %%%%%%%%%%%%%%%%5

however, my results are not as expected. I also tried to use M_gravity option, but in vain. Kindly let me know how I can approach the problem of specifying gravity as function of time in a flow problem involving two species.

Thanks Rajani

All times are GMT -4. The time now is 11:02.