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

udf for flow around rotating cylinder

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 31, 2018, 23:40
Default udf for flow around rotating cylinder
  #1
New Member
 
Farhang
Join Date: Jan 2018
Posts: 2
Rep Power: 0
farhangraymand is on a distinguished road
hi everyone,first time poster...
so im mdelling flow around a "stopping" rotating cylinder (motion with deceleration) and i need to obtain the angular velocity and torque exerted on the cylinder.ive written the following udf but fluent crashes everytime.does anyone know what the problem is and how to fix it?

Last edited by farhangraymand; February 1, 2018 at 01:02.
farhangraymand is offline   Reply With Quote

Old   February 1, 2018, 02:52
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
There is no udf.
pakk is offline   Reply With Quote

Old   February 1, 2018, 07:05
Default heres the udf,seems I forgot to post it !
  #3
New Member
 
Farhang
Join Date: Jan 2018
Posts: 2
Rep Power: 0
farhangraymand is on a distinguished road
#include "udf.h"
#include "mem.h"
#define PI 3.141592654
#define MU 0.01
real omega=5;
real deltat=0.2;
DEFINE_PROFILE(rotation,t,omega1)
{
real Tau_x=0;
real Tau_y=0;
real Tau=0;
real location[ND_ND];
real theta=0;
face_t f;
cell_t c;
real dudy1=0;
real dvdx1=0;
real T=0;
begin_f_loop(f,t)
{
theta=acos(location[0]/0.5);
if (location[1]<0)
{
theta=2*PI-theta;
}
F_C0(f,t);
dudy1=C_DUDY(c,t);
dvdx1=C_DVDX(c,t);
Tau_x=MU*dudy1;
Tau_y=MU*dvdx1;
Tau=Tau_x/cos(theta)-Tau_y/sin(theta);
T=T+Tau*PI*0.5;
}
end_f_loop(f,t)
omega1=omega1-T*deltat;
}
farhangraymand is offline   Reply With Quote

Old   February 1, 2018, 19:51
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
I think you forgot F_CENTROID macros.
Your location variable is not defined in your code, You may try this:
Code:
begin_f_loop(f,t)
{
F_CENTROID(location, f, t);
theta=acos(location[0]/0.5);
if (location[1]<0)
{
theta=2*PI-theta;
}
Best regards
AlexanderZ 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
rotating and pitching UDF - need someone to double-check this daysley Fluent UDF and Scheme Programming 13 September 11, 2022 11:04
UDF for pitching and rotating airfoil guidofrate Fluent UDF and Scheme Programming 0 November 20, 2014 08:32
Flow past rotating cylinder: Problem with ForeCoeffs raf1111 OpenFOAM 1 December 16, 2013 09:45
Rotating cylinder with GGI lbeaudet OpenFOAM Running, Solving & CFD 4 July 6, 2009 02:13
Rotating Cylinder Nick Siemens 1 June 21, 2006 06:42


All times are GMT -4. The time now is 23:26.