CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF for anisotropic diffusivity

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

LinkBack Thread Tools Display Modes
Old   November 24, 2015, 09:00
Default UDF for anisotropic diffusivity
New Member
Join Date: Nov 2015
Posts: 14
Rep Power: 3
Zerzura is on a distinguished road
Sponsored Links
Good day all,

I would like to implement an Anisotropic Diffusivity for my UDS in a cylinder. This is actually mimicking a drug that is distributing in the arterial wall.
There was a nice example in the UDF manual 12.0 how to do this, unfortunately this does not work in my fluent program and I do not know why. There is already a error message for line 4.
Can somebody please help me?
(I do not know exactly what line 4 and 5 do)

I really appreciate your help!
Have a good day.


#include "udf.h"

/* computation of anisotropic diffusivity matrix for cylindrical orthotropic diffusivity */
static const real origin[3] = {0.0, 0.0, 0.0};
static const real axis[3] = {0.0, 0.0, 1.0};

DEFINE_ANISOTROPIC_DIFFUSIVITY(cylc_diff,c,t,i,dma trix)
real x[3][3];
real xcent[ND_ND];
real R;
/*diffusivities in radia, tangential and axial directions */
real dd1, dd2, dd3;
dd1 = 3e-14*C_R(c,t);
dd2 = 7e-11*C_R(c,t);
dd3 = 7e-11*C_R(c,t);

static const real diff[3] = {dd1,dd2,dd3};


#if RP_3D
#if RP_3D
R = NV_DOT(x[0],x[2]);
R= NV_MAG(x[0]);
if (R>0.0)
#if RP_3D
x[1][0] = -x[0][1];
x[1][1] = x[0][0];

dmatrix[0][0] = diff[0]*x[0][0]*x[0][0]+diff[1]*x[1][0]*[1][0]
#if RP_3D
#if RP_3D
dmatrix[1][0] = diff[0]*x[0][1]*x[0][0]
#if RP_3D
dmatrix[0][1] = dmatrix[1][0];

#if RP_3D
dmatrix[2][2] =diff[0]*x[0][2]*x[0][2]
dmatrix[0][2] = diff[0] *x[0][2]*x[0][2]
dmatrix[2][0] =dmatrxi[0][2];

dmatrix[1][2] = diff[0] *x[0][1]*x[0][2]
dmatrix[2][1] =dmatrxi[1][2];
Zerzura is offline   Reply With Quote
Sponsored Links

Old   November 24, 2015, 18:15
Senior Member
Join Date: Aug 2014
Posts: 204
Rep Power: 6
ssss is on a distinguished road
There is a bug in your code, dmatrxi[1][2] should be dmatrix
ssss is offline   Reply With Quote

Old   December 20, 2015, 10:37
New Member
Join Date: Nov 2015
Posts: 14
Rep Power: 3
Zerzura is on a distinguished road
I am sorry for my late reply!
Thank you for your answer, you are indeed correct! However I changed my method and no longer need this UDF.

Kind regards, and thanks again!
Zerzura is offline   Reply With Quote


anisotropic, diffusivity, udf, uds diffusive

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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF Fluent binary diffusivity (stefan Maxwell) natantyt Fluent UDF and Scheme Programming 0 September 19, 2011 11:42
UDF programming fullmonty FLUENT 5 June 30, 2011 02:40
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01

Sponsored Links

All times are GMT -4. The time now is 14:00.