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

UDF for writing porosity as a function of distance from the wall

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 1, 2012, 12:10
Default UDF for writing porosity as a function of distance from the wall
  #1
New Member
 
Rohini Bala Chandran
Join Date: Apr 2012
Posts: 8
Rep Power: 14
rohinibc is on a distinguished road
Hi,

I am unable to get my UDF for setting porosity variation to work out. Here is what my fn.c code looks like.

/*****************************
UDF to specifiy porosity as a function of distance from the wall of the packed bed reactor
************************************/

#include "udf.h"
#define H 0.1
#define dp 0.008


DEFINE_PROFILE(porosity_function,t,i)
{
cell_t c;
real x[ND_ND]; /*This will hold the position vectors*/
real y;
real a1;
real a2=6; /*to specifiy the porosity variation function*/
real eps_inf=0.37;
real eps;

a1 = (1./eps_inf)-1;

begin_c_loop(c,t)
{
C_CENTROID(x,c,t);
y = (H - x[1])/ dp ;
eps = eps_inf*(1. + a1*exp(-1*a2*y));
F_PROFILE(c,t,i) = eps;
}
end_c_loop(c,t)
}

I tried using both F_PROFILE and C_PROFILE inside the code. The code builds and loads alright during compilation. But when I try to use in in the porous zone as function for porosity, it doesn't work. It gives me an error which is :
Error = invalid argument; not a number[1]

Could anybody help me with this?
rohinibc is offline   Reply With Quote

 

Tags
define_profile, porosity, 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
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 15:33
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 04:37
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 06:59
Wall function in adverse pressure gradients stephane baralon Main CFD Forum 11 September 2, 1999 04:05


All times are GMT -4. The time now is 09:03.