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

///moving boundaries with cylinder coordinate

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2018, 06:11
Question ///moving boundaries with cylinder coordinate
  #1
noa
Member
 
anonymous
Join Date: Feb 2011
Posts: 50
Rep Power: 15
noa is on a distinguished road
I have a 3d model that the upper and lower walls r moving in sinusoidal movement. The movement is described in x,y coordinate. I want to change it so the movement will be described in r coordinate.....How can I do it??

I tried but it didn't work:


#include "udf.h"

#define PI 3.1415
#define SA 2e-4 /* Sine Amplitude */
#define T 0.1 /* Sine TIme Period */
#define WPD -1 /* Wave propagation direction: -1 = right */
#define NP 0.01 /* Number of Periods through Length */

#define DEBUG 0


DEFINE_GRID_MOTION(sine_wall_u, domain, dt, time, dtime)
{
Thread *tf = DT_THREAD (dt);
face_t f;
Node *node_p;
real r;
real x[ND_ND];
real z;
z = x[2];
real y;
real t = CURRENT_TIME;
int n;

SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));

begin_f_loop (f, tf)
{
f_node_loop (f, tf, n)
{
node_p = F_NODE (f, tf, n);

if (DEBUG) Message("(1) %le %le %le", NODE_X(node_p), NODE_Y(node_p), NODE_Z(node_p));

if (NODE_POS_NEED_UPDATE (node_p))
{
NODE_POS_UPDATED (node_p);

if (DEBUG) Message("(2) %le %le %le", NODE_X(node_p), NODE_Y(node_p), NODE_Z(node_p));

x = NODE_X(node_p);
z=NODE_Z(nope_p);
if (DEBUG) Message("(3) %le %le %le", NODE_X(node_p), NODE_Y(node_p), NODE_Z(node_p));
r = sqrt((x[0]*x[0])+(x[2]*x[2]));
y = SA*cos(2*PI/NP*r-2*PI/T*t+PI/2)+1e-3;

if (DEBUG) Message("(4) %le %le %le", NODE_X(node_p), NODE_Y(node_p), NODE_Z(node_p));

NODE_Y(node_p) = y;
}

}
}
end_f_loop (f, tf)
}
noa 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
Problems with heat transfer in a cylinder in Cartesian coordinate using laplacianFoam ghorob OpenFOAM Running, Solving & CFD 2 February 11, 2016 12:44
flow around a circular cylinder with velocity inlet and outflow outlet shuoxue OpenFOAM 1 March 3, 2014 10:42
Flow past rotating cylinder: Problem with ForeCoeffs raf1111 OpenFOAM 1 December 16, 2013 09:45
CyclicAMI with half cylinder/ Projection of boundaries OlliWer OpenFOAM Pre-Processing 0 December 10, 2013 09:34
flow around a circular cylinder with velocity inlet and outflow outlet shuoxue OpenFOAM Running, Solving & CFD 0 November 2, 2013 04:32


All times are GMT -4. The time now is 16:14.