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

UDF Help!!!

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 29, 2004, 07:00
Default UDF Help!!!
  #1
paul
Guest
 
Posts: n/a
Hi all,

I'm hoping that someone out there with a grasp of UDF's would be able to help me. I'm trying to model species transport in Fluent. The standard boundary conditions are limited to either zero flux through the wall or a specified, constant value. However, I was hoping to model a flux through the wall that was dependant on both the concentration at the wall and a constant of wall permeability i.e.

q = -D*dc/dn @ the wall

= alpha*c @ the wall

where D is the co-efficient of diffusion and c is the concentration at thhe wall.

I have tried to use both DEFINE_ADJUST and DEFINE_PROFILE in a UDF with a temperature profile, as follows,

#include "udf.h"

#define ALPHA 0.005

real temp;

DEFINE_ADJUST(adjust,t)

{

face_t f;

begin_f_loop(f,t)

{

F_UDMI(F_C0(f,t),THREAD_T0(t),0)=F_T(f,t);

}

end_f_loop(f,t)

}

DEFINE_PROFILE(wall_flux,t,i)

{

face_t f;

begin_f_loop(f,t)

{

temp=F_UDMI(F_C0(f,t),THREAD_T0(t),0);

F_PROFILE(f,t,i)=ALPHA*(temp);

}

end_f_loop(f,tf)

}

I'm not totally familiar with UDF's, but the general idea is that I want to store the values of temperature along the cells at the wall, then apply a profile of temperature at the walls.

I have a few questions regarding the implementation of the UDF.

The UDF compiles correctly in Fluent. THe problem is where do I implement the UDF's i.e. User defined hooks, define - boundary conditions- wall- temperature?

I've tried various approaches but wether I run the model with or without the UDF, makes no difference reagarding the temperature distribution in the flow.

Any suggestions would be greatly appreciated

All the best

Paul
  Reply With Quote

Old   March 30, 2004, 03:56
Default Re: UDF Help!!!
  #2
thomas
Guest
 
Posts: n/a
are you sure to define correctly you thread cause your define profile is wrong DEFINE_ADJUST(adjust,t) t should be referenced as a domain pointer (commonly named by the letter d).

thomas
  Reply With Quote

Old   March 30, 2004, 04:28
Default Re: UDF Help!!!
  #3
paul
Guest
 
Posts: n/a
Hi Thomas,

Thanks for the advive on the pointer. I've made the change to the UDF and it compiles. However, there is no change in the temperature profile at the wall.

When I try to plot the UDM values all I get is zero, which leads me to believe that I'm not using the F_UDMI correctly. Do I only need to use the Adjust UDF in the drop-down menu of the "User-defined -> Function Hooks -> Adjust function" or do I use it elsewhere?

Even by chaning the values of ALPHA in the profile has no effect on the overall temperature.

Can you suggest any further ideas?

Thanks again for your time

Paul
  Reply With Quote

Old   March 30, 2004, 04:48
Default Re: UDF Help!!!
  #4
thomas
Guest
 
Posts: n/a
What is the case you are trying to simulate ?
  Reply With Quote

Old   March 30, 2004, 05:08
Default Re: UDF Help!!!
  #5
paul
Guest
 
Posts: n/a
For a simple first analysis I am modelling heat transfer in a pipe of 6mm diameter. The model is 3-D

Water is passing through the pipe at a speed of 1 m/s and the temperature of the water is 350k. I have set the wall temperature to the DEFINE_PROFILE described in the UDF.

The analysis is transient with a time-step size of 0.1s and ten time steps in all.

Should I be approaching the problem in a different way?

Thanks for the help so far

Paul
  Reply With Quote

Old   March 30, 2004, 08:54
Default Re: UDF Help!!!
  #6
thomas
Guest
 
Posts: n/a
try that and tell me.

DEFINE_AJUST(...,d) real ID_WALL= /* put you wal ID here */ Thread *t = Lookup_Thread(d,ID_WALL); . . .

Keep posted. thomas
  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
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 20:30.