|
[Sponsors] |
November 24, 2015, 09:00 |
UDF for anisotropic diffusivity
|
#1 |
New Member
Zerzura
Join Date: Nov 2015
Posts: 14
Rep Power: 11 |
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: 205
Rep Power: 13 |
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: 11 |
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 |
|
|
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 22:38 |
UDF Fluent binary diffusivity (stefan Maxwell) | natantyt | Fluent UDF and Scheme Programming | 0 | September 19, 2011 12:42 |
UDF programming | fullmonty | FLUENT | 5 | June 30, 2011 03:40 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |