CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

udf function!!

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 5, 2009, 09:36
Default udf function!!
  #1
shayej
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) }

  Reply With Quote

Old   February 5, 2009, 09:37
Default Re: udf function!!
  #2
shayej
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) }

  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cp as a function Mareike CFX 4 April 8, 2008 04: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 13:18
Max y+ as a function of Re Fred Uckfield Main CFD Forum 6 October 17, 2001 11:15


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