CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Problem with UDF (BC with refering other BC ) (https://www.cfd-online.com/Forums/fluent-udf/76006-problem-udf-bc-refering-other-bc.html)

cryfreer May 11, 2010 12:39

Problem with UDF (BC with refering other BC )
 
Dear users

When I trying to define BC(Inlet) which is temperature as a function of Outlet temperature. as follow
T of Inlet = T of Outlet + 1.0 C

I don't have any problem in interpreting. But when I try to initializing, I have an error by Fluent : Fatal signal (Access_Violation)

Here is my UDF code

#include "udf.h"
DEFINE_PROFILE(temp, thread, i)
{
Thread *t;
int ID = 13; /* Zone ID of Oulet */
Domain *domain = Get_Domain(1);
face_t f;
t = Lookup_Thread(domain, ID);
begin_f_loop(f,thread)
{
F_PROFILE(f, thread, i) = F_T(f,t) + 1.0;
}
end_f_loop(f,thread)
}


I use a same shape of Inlet and Oulet face (mesh or number of grid).
How can I modify my UDF to escape this situation?
Is it possible to refer other Boundary Conditions such as temperature every steps?

please help me.. I don't know what to do this moment.

cryfreer May 12, 2010 01:09

Initializing
 
If I initialize with constant Temperature not UDF at First. There is no problem. and then I changed BC with UDF as above.
Because I think there is no value to refer at the begining of analysis.
But after analysis, it seems like UDF dose not effect. Outlet temperature decreased with iteration (physically temperature of Outlet should increase).
How can I modify my UDF if I want to change Inlet temperature with every iteration?

gearboy May 12, 2010 01:27

Quote:

Originally Posted by cryfreer (Post 258358)
Dear users

When I trying to define BC(Inlet) which is temperature as a function of Outlet temperature. as follow
T of Inlet = T of Outlet + 1.0 C

I don't have any problem in interpreting. But when I try to initializing, I have an error by Fluent : Fatal signal (Access_Violation)

Here is my UDF code

#include "udf.h"
DEFINE_PROFILE(temp, thread, i)
{
Thread *t;
int ID = 13; /* Zone ID of Oulet */
Domain *domain = Get_Domain(1);
face_t f;
t = Lookup_Thread(domain, ID);
begin_f_loop(f,thread)
{
F_PROFILE(f, thread, i) = F_T(f,t) + 1.0;
}
end_f_loop(f,thread)
}


I use a same shape of Inlet and Oulet face (mesh or number of grid).
How can I modify my UDF to escape this situation?
Is it possible to refer other Boundary Conditions such as temperature every steps?

please help me.. I don't know what to do this moment.

Be assure the the number of the inlet faces (0....n) are same as those of the outlet (0...n) . I have tried on my simple case, tubular flow, there was no problem. So if problem still unresolved, you'd better attach your case file.


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