|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Farhang
Join Date: Feb 2018
Posts: 2
Rep Power: 0 ![]() |
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 02:02. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 ![]() |
There is no udf.
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Farhang
Join Date: Feb 2018
Posts: 2
Rep Power: 0 ![]() |
#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; } |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
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; } |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
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 12:04 |
UDF for pitching and rotating airfoil | guidofrate | Fluent UDF and Scheme Programming | 0 | November 20, 2014 09:32 |
Flow past rotating cylinder: Problem with ForeCoeffs | raf1111 | OpenFOAM | 1 | December 16, 2013 10:45 |
Rotating cylinder with GGI | lbeaudet | OpenFOAM Running, Solving & CFD | 4 | July 6, 2009 03:13 |
Rotating Cylinder | Nick | Siemens | 1 | June 21, 2006 07:42 |