CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for linear elasticity of arterial wal (https://www.cfd-online.com/Forums/fluent-udf/104005-udf-linear-elasticity-arterial-wal.html)

n.phililipova July 1, 2012 11:27

UDF for linear elasticity of arterial wal
 
I have to program UDF for linear elastic wall and parabolic velocity profile at the inlet.
I found this script:

#include "udf.h"

/*Define Wall Deformation*/
DEFINE_GRID_MOTION( elastic_wall, domain, dynamic_thread, time, dtime)
{
/*Model Constants*/

/*Elasticity Parameters*/
real E = 400000; /*Young's Modulus (Pa)*/
real vp = .499; /*Poisson's Ratio*/
real h = .0055; /*Wall Thinkness (m)*/

/*Reference Values*/
real Pref = 0;


/*Variable Declarations*/

/*Fluent Data Access*/
Thread *tf = DT_THREAD(dynamic_thread);
face_t f;
Node *v;
int n;

/*Model Variables*/
real P; /*Wall Pressure*/
real r; /*Radius at wall*/
real NV_VEC(dr); /*Wall Increment*/
real Dw; /*Wall Distensibility*/


/*Set deforming flag on adjacent cell zone */

SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf)); /*??Need to look up exacty what this is doing??*/


/*Loop Over Faces*/

begin_f_loop( f, tf )
{
/*Compute Pressure on the face*/
P = -F_P( f, tf ); /*??Minus sign to account for face orientation??*/
Message ("Face Pressure = %f\n", P);

/*Loop Over Nodes*/
f_node_loop(f,tf,n)
{
/*Assign Node Value*/
v = F_NODE(f,tf,n);

/*Check if node needs to be updated*/
if (NODE_POS_NEED_UPDATE (v))
{
/* Indicate that node position has been updated*/
NODE_POS_UPDATED(v);

/*Compute Wall Distensibility*/
r = NODE_Y(v); /*??Does NODE_Y(v) access radial positiion in axisymmetric??*/
Dw = r*(1-vp*vp) / (E*h);

/*Increment Wall*/
NV_D( dr, =, 0, r*Dw*( P - Pref ),0 );
NV_V( NODE_COORD(v), +=, dr);

/*Debugging*/
Message ("Radius: %f, Deflection: %f\n", r, dr[1] );

}/*end if statement*/

}/*end node loop*/

}/*end face loop*/
end_f_loop( f, tf )

}/*end DEFINE_GRID_MOTION*/

I think that parabolic velocity equation has to estimate the change in radius.
I will be grateful to anyone, who can gives any assistance!
Wish success to everyone!

e-mail: philipova@imbm.bas.bg

n.phililipova July 1, 2012 11:35

Please I need help as soon as possible


All times are GMT -4. The time now is 04:43.