|
[Sponsors] |
January 31, 2018, 05:02 |
How to use UDF about adjacent cell ?
|
#1 |
New Member
JuBong
Join Date: Jan 2018
Posts: 16
Rep Power: 8 |
Hi everyone,
To give the temperature because it can not give heat flux conditions to the inlet. I want to change the heat flux condition to the temperature equation. For example, When T2 is the temperature of the side cell in the flow direction, try to give T1 = T2 - dx / k * q ''. for example, In a square module with one cell of 0.001 m2, if the temperature T1 at the inlet is a function of T2 (the temperature of the next cell in the direction of flow), how to use UDF code to express T1 (y) = T2 (y) + 100 ? example #include "udf.h" DEFINE_PROFILE(temperature, thread, position) { real x[ND_ND]; real y; face_t f; C_T(c,t); begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, position) = C_T(c,t) + 100; } end_f_loop(f, thread) } Could you give me some advice on how to change the code? Or is there another way of giving heat? |
|
January 31, 2018, 21:12 |
|
#2 | |
New Member
BigZ
Join Date: Jan 2018
Posts: 11
Rep Power: 8 |
Quote:
|
||
February 2, 2018, 04:16 |
Thank you bigfish_1023
|
#3 |
New Member
JuBong
Join Date: Jan 2018
Posts: 16
Rep Power: 8 |
Hello bigfish_1023
Thank you very much for your reply. I tried using the information you gave me. ( c0=F_C0(f,t) ) The temperature of the inlet was 30K higher than the temperature of the adjacent cell. However, the fluent does not work and the program is turned off. Can I see what's wrong with my code? Can you fix it? Thank you very much for your reply. This is my code. ------------------------------------------------ #include "udf.h" DEFINE_PROFILE(temperature, thread, position) { real x[ND_ND]; real y; Thread *t; face_t f; cell_t c,c0; c0=F_C0(f,t); begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, position) = c0+30; } end_f_loop(f, thread) } ----------------------------------------------------- |
|
Tags |
udf, udf code, udf temperature |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] refineWallLayer Error | Yuby | OpenFOAM Meshing & Mesh Conversion | 2 | November 11, 2021 12:04 |
cell wall distance using C_WALL_DIST(c,t) or other udf | zhixin | Fluent UDF and Scheme Programming | 11 | April 18, 2016 11:17 |
Using UDF in fuel cell addon module | qwe2077 | FLUENT | 5 | February 12, 2015 04:25 |
how to find the index of the adjacent cell of one cell? | jing113cn | Fluent UDF and Scheme Programming | 2 | July 8, 2010 04:26 |
Adjacent cell number | Jing | Siemens | 5 | October 21, 2002 07:29 |