CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDS problem (https://www.cfd-online.com/Forums/fluent/69266-uds-problem.html)

artin haroutunian October 17, 2009 07:24

UDS problem
 
Hi there, I'm a graduate mechanical engineering student and i need to use UDF to do a project. I have come across some statements whose functions are not clear for me. I'll be so thankful if someone explains their function to me. Here is the beginning part of the source code:
DEFINE_ADJUST(psi_adjust, domain)
{
/* Check the number of user defined-scalars */
if (n_uds < N_REQUIRED_UDS)
Internal_Error("wrong number of user defined scalars allocated");
/* Fill a user defined scalar with the axial momentum source term */
Thread_loop_c (t, domain)
{
if (NULL != THREAD_STORAGE(t,SV_UDS_I(RHO)))
{
begin_c_loop (c,t)
{
.... (and it goes on)
I want to know 1)what does the second "if" statement do and what's "RHO"? 2)Is the statement "n_uds<N_REQUIRED_UDS" something known for fluent? Because they (n_uds and N_REQUIRED_UDS) were not declared anywhere in the source file!!!

I also have another question about how does fluent deal with terms of a user defined scalar equation. I want to know if it is necessary to define all 4 terms (unsteady,diffusion,convection and source) of a UDS equation even if some of them are equal to zero!? I mean for example if the UDS has only diffusion and source terms, is it necessary to set convetive and unsteady sources equal to zero or fluent does this autumatically. Or is it ok to only define a diffusion coefficient equal to "1" to specify the laplace equation!?
I'll be so thankful if someone helps me.
Thanks a lot [IMG]file:///C:/Users/Artin/AppData/Local/Temp/msohtmlclip1/01/clip_image001.gif[/IMG]


All times are GMT -4. The time now is 20:37.