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

Any way to shorten this moving wall?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pilakin

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 19, 2014, 09:10
Default Any way to shorten this moving wall?
  #1
New Member
 
Join Date: Sep 2014
Posts: 12
Rep Power: 11
pilakin is on a distinguished road
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?
Attached Images
File Type: jpg init13.1.jpg (86.1 KB, 18 views)
File Type: jpg init13.2.jpg (61.2 KB, 21 views)
pilakin is offline   Reply With Quote

Old   September 22, 2014, 05:05
Default
  #2
Member
 
Join Date: Jul 2013
Posts: 80
Rep Power: 12
upeksa is on a distinguished road
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
upeksa is offline   Reply With Quote

Old   September 22, 2014, 07:16
Default
  #3
New Member
 
Join Date: Sep 2014
Posts: 12
Rep Power: 11
pilakin is on a distinguished road
Quote:
Originally Posted by upeksa View Post
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
the length of the wall would depend on the height of the circlish left area. but my main problem is, I don't know how to displace the nodes in the wall. I was using an UDF with define_cg_motion to move the wall and defined the wall as a rigid body.
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.
pilakin is offline   Reply With Quote

Old   September 23, 2014, 04:33
Default
  #4
New Member
 
Join Date: Sep 2014
Posts: 12
Rep Power: 11
pilakin is on a distinguished road
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);
	}
}
ghost82 likes this.
pilakin is offline   Reply With Quote

Reply


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
Radiation interface hinca CFX 15 January 26, 2014 17:11
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32
[ICEM] Export ICEM mesh to Gambit / Fluent romekr ANSYS Meshing & Geometry 1 November 26, 2011 12:11
How to make boundary layer mesh moving with wall wayne FLUENT 3 June 11, 2008 23:23
moving wall and fluid soody FLUENT 3 September 20, 2004 01:37


All times are GMT -4. The time now is 21:13.