CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How to make a new variable for Initialize? (https://www.cfd-online.com/Forums/fluent/138226-how-make-new-variable-initialize.html)

Jups July 1, 2014 01:32

How to make a new variable for Initialize?
 
hello..
I have a problem.. I used source terms and I make UDF for my source terms..
but i need to define one variable, q = 0 as initialize.. so that the q variable could looping from time to time...
this is my UDF mass sourceterms example :

DEFINE_SOURCE(mass_source, cell, thread)
{
real time, turq, q, source;
time = CURRENT_TIME;

turq = k*(qe-q);
q = q+turq*time;

source = -((1-e)/e)*turq*Rc;
return source;

}

i got problem for my q variable...
can anyone help me to make a new variable q for initialize?


All times are GMT -4. The time now is 19:23.