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/)
-   -   How to specifically apply heteregoneous reaction UDF only in certain cell zone (https://www.cfd-online.com/Forums/fluent-udf/239238-how-specifically-apply-heteregoneous-reaction-udf-only-certain-cell-zone.html)

fluidizedbed October 27, 2021 09:55

How to specifically apply heteregoneous reaction UDF only in certain cell zone
 
Hello all,


I have prepared and tested a heterogeneous reaction UDF (DEFINE_HET_RXN_RATE) which turned out to be working fine now.

In my mesh, I have 3 separate cell zones (fluid). At the moment the reaction occurs in all these three zones. If I would like to apply the reaction only in one of these three zones (please see the image below) - what should I do for the macro to pinpoint to the right pointer?

Because of the way the heterogeneous reaction applied (phase interaction - independent of the cell zone, unlike the single phase reaction), I cannot also specify that this reaction only apply at the particular cell zone.

I understood that the top level domain is the superdomain. But this seems to refer to the "mixture", not the "cell zone", and in my case the mixture actually exists in all these three cell zones. Do you have any suggestions how to implement this?

Thanks in advance!

AlexanderZ October 28, 2021 22:02

you may try to do following
you may check thread ID using thread from the header of function
Code:

DEFINE_HET_RXN_RATE(name, c, t, hr, mw, yi, rr, rr_t)
{
if THREAD_ID(t) == id of you zone
{}
}


fluidizedbed October 29, 2021 10:16

Quote:

Originally Posted by AlexanderZ (Post 815328)
you may try to do following
you may check thread ID using thread from the header of function
Code:

DEFINE_HET_RXN_RATE(name, c, t, hr, mw, yi, rr, rr_t)
{
if THREAD_ID(t) == id of you zone
{}
}


Thank you!


It works quite well in principle. Just stating this here: for others who are interested with this case, the statements of the thread pointers must be placed before the if statement.


However, somehow in the case that I am working the reaction occurs as well outside the cell zone in the direction of the flow - instead of going directly to 0 when the flow goes to the next cell zone. It is like as if there is a numerical diffusion happening for the reaction.

I am still trying to figure out why actually this can occur.


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