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/)
-   -   Using correlations for heat transfer coefficient by UDF (https://www.cfd-online.com/Forums/fluent-udf/224561-using-correlations-heat-transfer-coefficient-udf.html)

coewgb February 25, 2020 00:54

Using correlations for heat transfer coefficient by UDF
 
Hi,
I am trying to define the heat transfer coefficient (for the non-equilibrium heat transfer inside the porous medium) according to correlations using UDF.
The correlations for heat transfer coefficient (or non-dimensional number) are usually based on other non-dimensional numbers and consequently the effective transport properties, e.g., effective viscosity and thermal conductivity. However, how can I get these values when defining the heat transfer coefficient using DEFINE_PROFILE macro? I looked up the UDF manual, but the above effective transport properties can be only used with cell thread rather than face thread.

vinerm February 25, 2020 02:31

Inheritance
 
Faces inherit the properties from their parent cells, hence, you can actually use F_R, F_KL, etc. just like C_R, C_KL. Not everything is encoded though. In that case, you can simply access the index and the thread using

cell_t c;
c = F_C0(f,t);

where t is the face thread already available from DEFINE_PROFILE if the UDF is hooked to a boundary zone. You would require cell thread and that can be accessed as well using

Thread *tc;
tc = THREAD_T0(t);

And then

C_K_L(c,tc) will return laminar thermal conductivity.

coewgb February 25, 2020 03:13

Dear vinerm,
Thank you for your answer. Actually, I have noticed the macros F_C0 and F_C1 and implemented the program in a similar way as you suggested. In this case, I have two questions regarding to the use of such macros.
1) What is the difference between F_C0 and F_C1? For a face at the boundary, the parent cells are either for fluid or solid. So which one is for fluid?
2) The use of such macros seems not suitable for parallel computation where I got the errors like "Received signal: NODE_0..."

vinerm February 25, 2020 03:22

Parallelization
 
For running a code in parallel, you need to parallelize it. Go through the link

https://www.afs.enea.it/project/nept...df/node212.htm

Since a cell is attached to another cell on most of its faces, except the face that is external boundary like a wall or inlet, almost every face is shared by two cells. But, there is only one parent cell. F_C0 returns the parent cell while F_C1 returns the adjacent cell. F_C1 returns NULL if the face is part of external boundary. You can use macro FLUID_THREAD_P to check if a thread is fluid or solid.

coewgb February 25, 2020 03:45

Thanks a lot. I will work on the parallelization of my UDF.


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