|
[Sponsors] |
UDF for writing porosity as a function of distance from the wall |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 1, 2012, 12:10 |
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 |
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? |
|
Tags |
define_profile, porosity, udf |
|
|
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 |