|
[Sponsors] |
August 12, 2015, 13:09 |
Grid motion
|
#1 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
Hi,
I need your help to solve my problem, I'm working on flow around a vibrating cantilever, It has been clamped from its bottom and its top is free, it performs a sinusoidal bending and generates the flow around itself, I've found a sample code in fluent UDF Manual but I've some problems with solver setups, I think I should use grid_motion macro, but I have no idea about its circumstances, Should I use "deforming" option in dynamic mesh settings? There are some other vague tabs for me too, So could anyone help me? Last edited by amin.z; August 13, 2015 at 04:14. |
|
August 18, 2015, 08:26 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Is the vibrating cantilever coupled with the flow or is the cantilever's position predetermined? Either way, use the DEFINE_GRID_MOTION UDF to apply motion to the boundaries on a node-by-node basis. Start with using the "smoothing" method (the mesh connectivity remains the same and the internal nodes are moved according to either a spring or diffusion option), apply the above UDF to the cantilever sides (deforming segments) and define the top of the cantilever as stationary (no deformation).
|
|
August 18, 2015, 10:50 |
|
#3 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
Thanks for your reply,
the cantilever movement doesn't depend on the fluid flow, it is controlled by piezoelectric method, so its forced motion generates the flow around it, I'll post the code in next reply, but in your opinion, Should I use "deforming" option in dynamic mesh setup? or "user define" tab? |
|
August 18, 2015, 10:53 |
|
#4 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
I've found this code:
/************************************************** ******** node motion based on simple beam deflection equation compiled UDF ************************************************** ********/ #include "udf.h" DEFINE_GRID_MOTION(beam,domain,dt,time,dtime) { Thread *tf = DT_THREAD(dt); face_t f; Node *v; real NV_VEC(omega), NV_VEC(axis), NV_VEC(dx); real NV_VEC(origin), NV_VEC(rvec); real sign; int n; /* set deforming flag on adjacent cell zone */ SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf)); sign = -5.0 * sin (26.178 * time); Message ("time = %f, omega = %f\n", time, sign); NV_S(omega, =, 0.0); NV_D(axis, =, 0.0, 1.0, 0.0); NV_D(origin, =, 0.0, 0.0, 0.152); begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); /* update node if x position is greater than 0.02 and that the current node has not been previously visited when looping through previous faces */ if (NODE_X(v) > 0.020 && NODE_POS_NEED_UPDATE (v)) { /* indicate that node position has been update so that it’s not updated more than once */ NODE_POS_UPDATED(v); omega[1] = sign * pow (NODE_X(v)/0.230, 0.5); NV_VV(rvec, =, NODE_COORD(v), -, origin); NV_CROSS(dx, omega, rvec); NV_S(dx, *=, dtime); NV_V(NODE_COORD(v), +=, dx); } } } end_f_loop(f,tf); } |
|
August 18, 2015, 21:29 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
I recommend using the smoothing mesh method with the diffusion option. If the surrounding mesh cannot handle the large deformations (results in a poor mesh quality), then enable remeshing.
There are three dynamic mesh zones you need to specify: -left side of cantilever: type: User-Defined and use the DEFINE_GRID_MOTION UDF -right side of cantilever: similar to above but with different coordinates in the UDF (offset by the width of the cantilever) -top of cantilever: type: stationary The UDF you have posted looks like a good start; although you probably need to modify the equations to reflect your cantilever motion and specific case. |
|
August 21, 2015, 08:29 |
|
#6 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
Thank you dear friend for your help,
I tried to do your tips by I faced to famous and terrible error! Compiling error! I did a few changes and tried to set it up as the way you said but fluent said: "The UDF library you are trying to load (libudf) is not compiled for 2d on the current platform (win64)." I tried some methods for solving the issue but no succeed! the udf works with first grid but for new grid it makes error, it drives me crazy Based on your experiences, What should I do? |
|
August 21, 2015, 09:44 |
|
#7 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
||
August 22, 2015, 12:21 |
|
#8 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
I read it and tried your instruction, but the problem still exists,
I checked with previous grid and new UDF and also used the UNLOAD method, and also used a new grid in another case and data, But the problem is not resolved, I use visual studio 2015, Is there any tips? Thanks for your kindness support |
|
August 22, 2015, 18:37 |
|
#9 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Could you post the new and old grids (I assume a "grid" is a DEFINE_GRID_MOTION UDF)? Is your case 2-D or 3-D?
|
|
August 23, 2015, 02:44 |
|
#10 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
uh, actually "GRID" is a new mesh, I changed some parameters and chose the names as you said, but when I try to compile the same UDF for new mesh fluent said the compiling error,
The domain is 2D, |
|
August 23, 2015, 08:05 |
|
#11 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
If it's the same UDF that was working earlier, then the problem is how Fluent is loading the UDF. First, the dynamic mesh modifies the node points and these cannot be restored without reloading the case file. Second, I've found it most reliable to fully import the case file after modifying the UDF.
|
|
August 27, 2015, 12:08 |
|
#12 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
Such a great idea,
It works Thanks a lot dear friend. |
|
August 27, 2015, 13:51 |
|
#13 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
could you please take a look at the code again?
There is a strange issue, I was able to compile the code using the method you recommended, Then I tried to run the model but the domain is completely stationary! however I guess based on the code, the domain should be 2D and also the beam must be on X direction, but I tried other directions and also 3D domain, but there wasn't any success! So what do you think of that? In your idea is it okay? I've also attached the page of the UDF Manual which I'm using its code. Thanks for your kindness support, |
|
August 27, 2015, 20:17 |
|
#14 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The code they have provided works for 2-D (and should generally work for 3-D). Let's take a step back and consider how the dynamic mesh operates. The UDF you've applied on the beam moves the nodes on said beam, and also the surrounding cell zone via:
Code:
SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf)); If you're still having problems, try changing either the direction or the 2-D to 3-D transform (not both at once) to determine the cause. |
|
August 28, 2015, 17:31 |
|
#15 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
I've attached the mesh and have shown the name of the beam sides,
I use "user-define" tab for this wall but none wall moves, I had also rotated the mesh 90 degrees but it's still stationary, Also size of the domain is : {X (m): -0.025m , 0.025} {Y (m): 0 , 0.03} |
|
August 28, 2015, 19:33 |
|
#16 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
I assume you've modified the UDF posted above for your case (we don't know the code that's causing your errors at the moment). Have you had success with using the UDF above (from the examples in the UDF manual)?
Your simulation is 2-D and therefore the issue I raised above won't be applicable (only for 3-D cases). |
|
August 30, 2015, 05:00 |
|
#17 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
Not yet, It's still stationary
Could you please take a look at my files? If you give me your email address I'll present the files to you, Thanks |
|
September 1, 2015, 07:39 |
|
#18 |
New Member
Join Date: Sep 2014
Posts: 6
Rep Power: 12 |
Hi
I have seen your thread and it was great, I have been working on a similar problem too. I have a question, how did you make the mesh? In my case have make a geometry file then in the Ansys Mesh I did the meshing. Would you please let me know how you did the meshing? |
|
September 1, 2015, 07:47 |
|
#19 | |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 15 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mesh Conversion : structured to unstructured | shreyasr | ANSYS | 8 | April 8, 2019 08:03 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Help me with the grid motion of udf | yuanyeyzygo | Fluent UDF and Scheme Programming | 0 | May 13, 2012 14:49 |
MapFields to New Grid For Extreme Grid Deformations due to Body Motion | albcem | OpenFOAM | 0 | May 5, 2009 15:17 |
Convergence moving mesh | lr103476 | OpenFOAM Running, Solving & CFD | 30 | November 19, 2007 15:09 |