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

interpret several UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 1, 2010, 09:23
Default interpret several UDF
  #1
New Member
 
Eddie
Join Date: Aug 2010
Posts: 8
Rep Power: 16
eddiegolpesar is on a distinguished road
Hi
I prepared the following UDF for Darcy term in DC casting, for velocity in x direction. It was interpreted successfully. I want use some other UDFs like this for velocity in y direction, k and epsilon. But I see only the last interpreted UDF and I can't see all of them in the graphical panel in source terms part. Please help me....

/*EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEE

UDF that adds Darcy source term for U in the X direction

DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD DDDDDDDDDDDDDDDDD*/

#include "udf.h"

#define FST 0.3
#define TL 903
#define TS 743
#define TF 933
#define kp 0.16
#define shi 1.0e-15
#define visc 0.001
#define K0 2.0e-11

real TEMP, DEPVAR, SDEPVAR, PERM, FL, FS;
/*real DEPVAR;
real SDEPVAR;
real PERM;
real FL;
real FS;*/

DEFINE_SOURCE(darcy_ux, c, t, dS, eqn)
{
real source;

TEMP= C_T(c,t);
DEPVAR= C_U(c,t);
SDEPVAR= 0. ;

/***** cacculation of FL & FS *****/
if (TEMP >= TL)
{
FL=1. ;
}
if ((TEMP > TS) && (TEMP < TL))
{
FL= 1.-1./(1.-kp)*(TL-TEMP)/(TF-TEMP);
}
if (TEMP <= TS)
{
FL= 0. ;
}

/***** cacculation Permeability & Darcy term *****/
if (FS==0.)
{
source = dS[eqn] = 0. ;
}
if ((FS>0.) && (FS<=FST))
{
source = dS[eqn] = 0. ;
}
if ((FS>=FST) && (FS<1.))
{
PERM=K0*pow((1.-FS),3.)/pow(FS,2.);
source = -visc/(PERM+shi)*DEPVAR + visc/(PERM+shi)*SDEPVAR ;
dS[eqn]= visc/(PERM+shi) ;
}
return source;
}
eddiegolpesar is offline   Reply With Quote

Reply

Tags
interpret, several variables, udf


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not to interpret UDF AlexanderSventitskiy FLUENT 4 August 18, 2011 09:10
interpret or compile an UDF (emergency) Lotfi FLUENT 1 August 26, 2007 13:58
Not able to interpret UDF Prasad FLUENT 1 August 15, 2007 09:44
Interpret three UDF for property Atsu FLUENT 4 April 22, 2006 16:04
UDF Interpret - Syntax Error Leonard FLUENT 1 October 22, 2005 11:06


All times are GMT -4. The time now is 05:17.