using DEFINE_GEOM to change 2D geometry- shear constant area
5 Attachment(s)
Hi All,
I have been trying to deform a square into a rhombic shape such as the attached pure strain image and have been testing out a few UDFs to deform the boundaries. Attachment 77223 I start out with a simple mesh geometry like this: Attachment 77225 and use DEFINE_GEOM to deform all four walls (labeling is wall12 top right wall and then going clockwise). This is my dynamic mesh setup page: Attachment 77229 Current issues with my UDF: (1) Something that I am worried about is CURRENT_TIME, so I tried to output it as a message, but it always shows like 21 times? Should i put it outside the function? such as in my TUI: "Updating mesh to time 3.00000e-02 (step = 00003)... time = 0.020000 time = 0.020000 time = 0.020000 time = 0.020000 time = 0.020000 time = 0.020000 time = 0.020000 time = 0.020000 time = 0.020000 " (2) my mesh is only moving in the y direction, but I know I need to be stretching all four "corners" so it should update x and y. Attachment 77230 Any help is appreciated. I have also tried to use DEFINE_GRID_MOTION to move the walls at an angle, but to no avail. I have attached my full UDF, but a snippet of it is as follows: #include "udf.h" #include "unsteady.h" #define W 64 /* side wall of trough, mm */ #define gamma 0.2 /* desired strain */ #define vel_exp 5e-2 /* expansion velocity mm/s */ #define vel_comp 4.52267e-2 /* compression velocity mm/s */ DEFINE_GEOM(wall_12geom, domain, dt, position) { Message("time = %f\n ", CURRENT_TIME , '\n'); real D,R,L,l; real hD,hL,hl; real dlength_L, dlength_l; real update_length_L, update_length_l; /*constants */ D = sqrt(2)*W; /*diagnol of square, intial*/ R = sqrt((2+gamma)/(2-gamma)); L = R*D; /*expansion axis diagnol, final*/ l = pow(D,2)/L; /* compression axis diagnol, final*/ hD=D/2; /* use these variables to calculte angle*/ real t = CURRENT_TIME; real slope12, intercept12; /* geometry line */ dlength_L = vel_exp*t; /*delta change in expansion axis from ORIGIN, lengthening x axis*/ dlength_l = -1*vel_comp*t; /*delta change in compression axis from ORIGIN, shortening y axis*/ update_length_L = hD + dlength_L; /* every time step length, L from ORIGIN to sharp corner*/ update_length_l = hD + dlength_l; /* every time step length,l from ORIGIN to sharp corner*/ /* set variables */ slope12 = dlength_l/dlength_L; /*neg */ intercept12 = update_length_l; /*pos*/ /* set y = mx + b dependent on time*/ position[0] = position[0] + dlength_L; /* START HERE */ position[1] = slope12*position[0] + intercept12; } |
Shape Deformation
Instead of using DEFINE_GEOM, use DEFINE_GRID_MOTION. This way you can control motion of each individual node instead of a boundary. If you want to use DEFINE_GEOM, then you have to define four different functions, one for each edge.
|
Quote:
Thank you for your reply. I had originally used DEFINE_GRID_MOTION to control the edge boundaries ( one function for each edge), but did not get it to work properly. With DEFINE_GRID_MOTION, I moved each node of the boundaries based on the angle of the two corners that were moving. My code for one of the wall boundaries is below. However, I think you are saying I should use DEFINE_GRID_MOTION on the interior surface body too? I'm a little confused how you would avoid cell skew using that? Could you expound on that? Thanks! I wonder if this has to do with constraining a mesh that resists the movement of the boundary walls to turn " inward." Code:
/*expansion*/ |
All times are GMT -4. The time now is 05:57. |