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/)
-   -   Obtaining a spices value in a boundary outlet (https://www.cfd-online.com/Forums/fluent-udf/235068-obtaining-spices-value-boundary-outlet.html)

visitor March 30, 2021 16:22

Obtaining a spices value in a boundary outlet
 
If the macro from fluent reads the pollutant species mass fraction is
C_POLLUT(c,t,i) and i in this case say it is 4 (soot), how do I get this to read a boundary wall?

Example below is the macro, but how do I get this to read a boundary wall outlet with an ID5? The ID5 is shown in Fluent boundary IDs.

C_POLLUT(c,t,4);

Yasser March 31, 2021 22:09

Quote:

Originally Posted by visitor (Post 800257)
If the macro from fluent reads the pollutant species mass fraction is
C_POLLUT(c,t,i) and i in this case say it is 4 (soot), how do I get this to read a boundary wall?

Example below is the macro, but how do I get this to read a boundary wall outlet with an ID5? The ID5 is shown in Fluent boundary IDs.

C_POLLUT(c,t,4);

First, I am not sure if a similar macro exist for face thread or not ... Many cell macros have similar macros for the face, just by replacing C with F .. and they are not documented in the UDF manual. So, I will assume that F_POLLUT(f,t,i) is the same macro for face.

The wall is a face thread .. so, try this

Quote:

Domain d = Get_Domain(1);
Thread *t = Lookup_Thread(d, ID);
face_t f;
begin_f_loop(f, thread)
{
F_POLLUT(f,t,i);
}
end_f_loop(f,thread)

visitor April 1, 2021 03:35

Thanks Yasser

I will try your suggestion as soon as possible.

This is good, all i have to do is enter boundary wall ID.

I can also use this in an "if" condition statement e.g.
{
If((F_POLLUT(f,t,i))>0.001)
.....
/*i for soot is 4*/
/* F_POLLUT(f,t,i) reads a mass fraction*/
}

Domain d = Get_Domain(1);
Thread *t = Lookup_Thread(d, ID);
face_t f;
begin_f_loop(f, thread)
{
F_POLLUT(f,t,i);
}
end_f_loop(f,thread)

Yasser April 1, 2021 10:52

also change the word "thread" to "t"

visitor April 1, 2021 13:03

Yes, thanks. It has to be the same.

I will be adding a define_profile to open/close an air inlet. Once i get back to computing.

Domain d = Get_Domain(1);
Thread *t = Lookup_Thread(d, ID);
face_t f;
begin_f_loop(f, t)
{
If((F_POLLUT(f,t,4))>0.001)
DEFINE_PROFILE(inlet,th,i)
{
face_t f;
begin_f_loop(f,th)
{
For(f=1;f<=5;(f+=0 5)) /*increment air in steps of 0.5 and up to 5. Untill pollution drops*/
F_PROFILE(f,th,i)=f;
}
end_f_loop(f,th);
}
end_f_loop(f,t)
}

Yasser April 1, 2021 13:10

I don't think this is going to work ... Lookup_Thread and other macros should be inside a function.

Also you can not add define macro inside a function ... any macro that starts with DEFINE should be a macro by itself ... You can recall the function from any other function by its name .. for example,

inlet();

visitor April 1, 2021 13:51

Changed it to a loop within a loop. I have added more info for clarifications.

DEFINE_PROFILE(inlet,th,i); /*defining for the air inlet*/
Domain d = Get_Domain(1);
Thread *t = Lookup_Thread(d, 4); /*the 4 is for soot*/
face_t f;
begin_f_loop(f, t) /*this is for the outlet with soot monitored*/
{
If((F_POLLUT(f,t,4))>0.001)

begin_f_loop(f,th) /*this is the air inlet*/
{
For(f=1;f<=5;(f+=0 5))
/*increment air in steps of 0.5 and up to 5. Until pollution drops*/
F_PROFILE(f,th,i)=f;
}
end_f_loop(f,th);

}
end_f_loop(f,t)
}


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