UDF for radial expansion
Hello all,
I have a simple 2D circle meshed with tetra elements. I want this circle to expand radially. For that purpose i have written the code below, using DEFINE_GRID_MOTION. This code gets face unit normal vectors on boundary, and tries each node to move through this unit vector of the face which it belongs to. However Fluent gives the error " Left handed faces detected! ". I dont know how to handle this problem. Any help would be kindly appreciated. /* Expansion-Contraction through face normal unit vector */ #include "udf.h" DEFINE_GRID_MOTION(radial-expansion, domain, dt, time, dtime) { Thread *tf = DT_THREAD(dt); face_t f; Node *v; real displ; real A[ND_ND]; /* face area normal vector */ real AMag; /* face area magnitude */ real NV_VEC(e); /* face unit normal vector */ int n; SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf)); displ=5*dtime; begin_f_loop(f, tf) { AMag=NV_MAG(A); NV_VS(e,=,A,/,AMag); /* face unit normal vector */ f_node_loop(f,tf,n) { v=F_NODE(f,tf,n); if (NODE_POS_NEED_UPDATE(v)) { NODE_POS_UPDATED(v); NV_V_VS(NODE_COORD(v),=, NODE_COORD(v), +, e, *, displ); } } |
Finally i have managed it, even with a 3D cylinder. I used position vector of each node, instead of face normal vector. I eliminate the z component of the position vector, in order to get uniform expansion (equal displacement for all nodes) for a 3-D cylinder (The central axis of the cylinder is z axis).
However, i still wonder how i could get a uniform expansion; if i would have, for example, an ellipsoid or a sphere. |
Hi, if it's help here is my code for normal expansion (respective fluctuation) of the surface in the Ansys Fluent. I used it for creation of the pressure waves and sound propagation excited by oscilating part.
Tested on the sphere, more complicated test will follow in next few days. Code:
/********************************************************************** |
Hi kure87,
Thank you for your reply. Actually we have sought for almost-proper expansion of left ventricle of human heart. It is difficult to preserve the approximate shape of the LV after applying expansion operation. |
All times are GMT -4. The time now is 23:55. |