|
[Sponsors] |
September 19, 2014, 10:10 |
Any way to shorten this moving wall?
|
#1 |
New Member
Join Date: Sep 2014
Posts: 12
Rep Power: 12 |
I have a moving layering mesh you can see in the picture. The wall on the right is a rigid body and is moving to the left. Now comes an area where the domain becomes thinner. The moving wall stays the same length though. You can see the result of this in the second pitcure. Is there a way to shorten the length of the moving wall with UDFs or can you think of any work around?
|
|
September 22, 2014, 06:05 |
|
#2 |
Member
Join Date: Jul 2013
Posts: 80
Rep Power: 13 |
You must first find the relation between the lateral displacement of your case and the length of the right boundary.
Then you have to update as well the displacement of the nodes in that right boundary. Cheers |
|
September 22, 2014, 08:16 |
|
#3 | |
New Member
Join Date: Sep 2014
Posts: 12
Rep Power: 12 |
Quote:
right now I'm playing around with the define_grid_motion UDF macro as this seems to be the way to go about this problem. |
||
September 23, 2014, 05:33 |
|
#4 |
New Member
Join Date: Sep 2014
Posts: 12
Rep Power: 12 |
I solved the problem. Here's the code I developed. It might help you if you're having a similar issue.
Code:
#include "udf.h" #include "dynamesh_tools.h" #define CELL_HEIGHT 0.0032 #define MAIN_ZONE_LENGTH 0.71 #define SIMULATION_DURATION 500 #define CYLINDER_LENGTH 0.66 #define RADIUS 0.165 #define NOZZLE_LENGTH 0.03 #define TANK_LENGTH 0.792 DEFINE_GRID_MOTION(wall50motion,domain,dt,time,dtime) { Thread *currentThread = DT_THREAD(dt); face_t currentFace; Node *currentNode; real NV_VEC(Xaxis); real NV_VEC(Yaxis); real wallMovingXspeed; int nodeID; real Xc; real YpbCurrent; real YpbAfter; real XpbCurrent; real XpbAfter; real XpbAtShrinkingStartTime; real shrinkingStartTime; real NodeYcurrent; real NodeYafter; int i = 0; Xc = RADIUS + NOZZLE_LENGTH; XpbAtShrinkingStartTime = (TANK_LENGTH - CYLINDER_LENGTH) / 2 + NOZZLE_LENGTH; wallMovingXspeed = -(MAIN_ZONE_LENGTH-CELL_HEIGHT)/SIMULATION_DURATION; shrinkingStartTime = CYLINDER_LENGTH / (-wallMovingXspeed); NV_D(Xaxis, =, 1.0, 0.0, 0.0); NV_D(Yaxis, =, 0.0, 1.0, 0.0); if (CURRENT_TIME >= 0 && CURRENT_TIME < shrinkingStartTime) { begin_f_loop(currentFace,currentThread) { f_node_loop(currentFace,currentThread,nodeID) { currentNode = F_NODE(currentFace,currentThread,nodeID); if ( NODE_POS_NEED_UPDATE (currentNode)) { NODE_POS_UPDATED(currentNode); NV_V_VS(NODE_COORD(currentNode), =, NODE_COORD(currentNode), +, Xaxis,*,wallMovingXspeed*dtime); } } } end_f_loop(currentFace,currentThread); } else if (CURRENT_TIME >= shrinkingStartTime && CURRENT_TIME < SIMULATION_DURATION) { begin_f_loop(currentFace,currentThread) { i++; f_node_loop(currentFace,currentThread,nodeID) { currentNode = F_NODE(currentFace,currentThread,nodeID); if ( NODE_POS_NEED_UPDATE (currentNode)) { NODE_POS_UPDATED(currentNode);; NV_V_VS(NODE_COORD(currentNode), =, NODE_COORD(currentNode), +, Xaxis,*,wallMovingXspeed*dtime); XpbCurrent = XpbAtShrinkingStartTime + wallMovingXspeed * (CURRENT_TIME-shrinkingStartTime); XpbAfter = XpbAtShrinkingStartTime + wallMovingXspeed * (CURRENT_TIME+dtime-shrinkingStartTime); YpbCurrent = RADIUS * sin(acos((Xc-XpbCurrent)/RADIUS)); YpbAfter = RADIUS * sin(acos((Xc-XpbAfter)/RADIUS)); NodeYcurrent = NODE_Y(currentNode); NodeYafter = NodeYcurrent/YpbCurrent*YpbAfter; NV_V_VS(NODE_COORD(currentNode), =, NODE_COORD(currentNode), +, Yaxis,*,NodeYafter-NodeYcurrent); } } } end_f_loop(currentFace,currentThread); } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
[ICEM] Export ICEM mesh to Gambit / Fluent | romekr | ANSYS Meshing & Geometry | 1 | November 26, 2011 13:11 |
How to make boundary layer mesh moving with wall | wayne | FLUENT | 3 | June 12, 2008 00:23 |
moving wall and fluid | soody | FLUENT | 3 | September 20, 2004 02:37 |