CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

using DEFINE_GEOM to change 2D geometry- shear constant area

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 4, 2020, 15:11
Default using DEFINE_GEOM to change 2D geometry- shear constant area
  #1
New Member
 
ystein
Join Date: Apr 2020
Posts: 2
Rep Power: 0
ystein is on a distinguished road
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.
purestrain.PNG


I start out with a simple mesh geometry like this:
mesh_square.PNG
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:
dynamicmesh.PNG


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.
meshmotion.PNG

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;


}
Attached Files
File Type: c define_geom_allwall.c (4.8 KB, 0 views)
ystein is offline   Reply With Quote

 


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Non overlap area fractions saisanthoshm88 CFX 11 September 17, 2015 18:42
fluid flow but temperature raises from nowhere? mxcfd STAR-CCM+ 5 September 16, 2014 05:46
vitual _ real deneb FLUENT 3 January 22, 2007 04:31
Restarted run and change in geometry...question Vanessa CFX 3 August 28, 2006 07:55
can I change the geometry file? a.melandinos CFX 2 March 8, 2002 12:57


All times are GMT -4. The time now is 11:28.