# UDF for anisotropic diffusivity

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 November 24, 2015, 09:00 UDF for anisotropic diffusivity #1 New Member   Zerzura Join Date: Nov 2015 Posts: 14 Rep Power: 3 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. UDF: #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}; C_CENTROID(xcent,c,t); NV_VV(x[0],=,xcent,-,origin); #if RP_3D NV_V(x[2],=,axis); #endif #if RP_3D R = NV_DOT(x[0],x[2]); NV_VS(x[0],-=,x[2],*,R); #endif R= NV_MAG(x[0]); if (R>0.0) NV_S(x[0],/=,R); #if RP_3D N3V_CROSS(x[1],x[2],x[0]); #else x[1][0] = -x[0][1]; x[1][1] = x[0][0]; #endif dmatrix[0][0] = diff[0]*x[0][0]*x[0][0]+diff[1]*x[1][0]*[1][0] #if RP_3D +diff[2]*x[2][0]*x[2][0] #endif ; dmatrix[1][1]=diff[0]*x[0][1]*x[0][1] +diff[1]*x[1][1]*x[1][1] #if RP_3D +diff[2]*x[2][1]*x[2][1] #endif ; dmatrix[1][0] = diff[0]*x[0][1]*x[0][0] +diff[1]*x[1][1]*x[1][0] #if RP_3D +diff[2]*x[2][1]*[2][0] #endif ; dmatrix[0][1] = dmatrix[1][0]; #if RP_3D dmatrix[2][2] =diff[0]*x[0][2]*x[0][2] +diff[1]*x[1][2]*x[1][2] +diff[2]*x[2][2]*x[2][2] ; dmatrix[0][2] = diff[0] *x[0][2]*x[0][2] +diff[1]*x[1][0]*x[1][2] +diff[2]*x[2][0]*x[2][2] ; dmatrix[2][0] =dmatrxi[0][2]; dmatrix[1][2] = diff[0] *x[0][1]*x[0][2] +diff[1]*x[1][1]*x[1][2] +diff[2]*x[2][1]*x[2][2] ; dmatrix[2][1] =dmatrxi[1][2]; #endif }

 November 24, 2015, 18:15 #2 Senior Member   anonymous Join Date: Aug 2014 Posts: 204 Rep Power: 6 There is a bug in your code, dmatrxi[1][2] should be dmatrix

 December 20, 2015, 10:37 #3 New Member   Zerzura Join Date: Nov 2015 Posts: 14 Rep Power: 3 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!

 Tags anisotropic, diffusivity, udf, uds diffusive

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Qureshi FLUENT 7 March 23, 2017 08:37 kim FLUENT 3 October 26, 2011 21:38 natantyt Fluent UDF and Scheme Programming 0 September 19, 2011 11:42 fullmonty FLUENT 5 June 30, 2011 02:40 Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01