|
[Sponsors] |
February 5, 2009, 09:36 |
udf function!!
|
#1 |
Guest
Posts: n/a
|
Hi, i was writing a udf code. but i am need a function that will allow me to apply the heat flux to "CELL RESIDUAL".
i have attached my code below! if u find any mistake please correct it. i'm trying to assign heat flux to a particular zone within my model. the code as follows: #include "udf.h" DEFINE_PROFILE(temperature,cell, thread) { double q = 4100 ; double r = 0.2 ; double x0 = 0.04, x1 = 0.05 ; double b = x1-x0 ; double x[ND_ND] ; double vol = (3.1416*r*r*b)/2 ; double htflx = q/vol ; cell_t cell; begin_c_loop(cell, thread) { /* loops over all faces in the thread passed in the DEFINE macro argument */ C_CENTROID(x,cell,thread) ; if(x0<x[0] && x[0]<x1 ) { /* This is a cell in the combustion layer */ /* find a function to apply the heat flux to this cell residual Watch out, F_PROFILE changes the value of a boundary condition We need here a function that allows to add to the cell residual C_PROFILE(f, thread, index) = v_max * (1-d*d) ; */ } } end_f_loop(f, thread) } |
|
February 5, 2009, 09:37 |
Re: udf function!!
|
#2 |
Guest
Posts: n/a
|
#include "udf.h"
DEFINE_PROFILE(temperature,cell, thread) { double q = 4100 ; double r = 0.2 ; double x0 = 0.04, x1 = 0.05 ; double b = x1-x0 ; double x[ND_ND] ; double vol = (3.1416*r*r*b)/2 ; double htflx = q/vol ; cell_t cell; begin_c_loop(cell, thread) { /* loops over all faces in the thread passed in the DEFINE macro argument */ C_CENTROID(x,cell,thread) ; if(x0<x[0] && x[0]<x1 ) { /* This is a cell in the combustion layer */ /* find a function to apply the heat flux to this cell residual Watch out, F_PROFILE changes the value of a boundary condition We need here a function that allows to add to the cell residual C_PROFILE(f, thread, index) = v_max * (1-d*d) ; */ } } end_f_loop(f, thread) } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cp as a function | Mareike | CFX | 4 | April 8, 2008 05:55 |
If function | PANKAJ | CFX | 3 | January 13, 2008 04:53 |
How to set the function to get f_p(f,t) | arwang | FLUENT | 5 | March 5, 2007 16:41 |
Stream Function - Potential Function coordinates | harish | Main CFD Forum | 8 | June 25, 2005 14:18 |
Max y+ as a function of Re | Fred Uckfield | Main CFD Forum | 6 | October 17, 2001 12:15 |