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

UDF Read Data File for Zone Motion

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2017, 11:39
Default UDF Read Data File for Zone Motion
  #1
New Member
 
Guillaume
Join Date: Apr 2017
Posts: 1
Rep Power: 0
N'Furious76 is on a distinguished road
Hello everyone !

I'm using Fluent 15.0 to simulate a 2D 3-blades rotating motion in which there is a principal rotation (rotor) and a secondary rotation (3 blades). I use a sliding mesh between the exterior domain and the rotor domain and also between the rotor domain and each of the 3-blades domain.
For the rotation of the blades domain, I use a Define_Zone_Motion UDF in order to control the rotation by giving a personnal law (more or less sinusoïdal).
But I'd like to know if it's possible to read directly the rotationnal speed of this blade domain from a data file. Does anyone had ever try this ?
I know there is a Read/Write From File UDF, but it doesn't work when I want to use it with the Zone_Motion UDF. This is my code :
#include "udf.h"

DEFINE_ZONE_MOTION(pitch_by_reading_1, omega, axis, origin, velocity, time, dtime)
{

real pitch_vel, phi0, phi, omegar, omegac, radius, pi, lambda;

DEFINE_RW_FILE(reader, fp){
FILE *fp;
fp = fopen("data.txt","r");
pitch_vel = fscanf(fp, "%f", &pitch_vel);
}

pi = 3.141592654;
lambda = 0.8; /* advance ratio */
omegac = 2.5; /* angular velocity of rotor [radians/s] */
phi0 = pi/2.; /* initial angular position of blade origin [radians] */
radius = 0.4; /* radius of rotor [m] */
phi = omegac*(time+dtime); /* angular change from initial position at t+dt */
omegar = pitch_vel; /* pitching velocity of the blade zone [radians/s] */

/* time variation of rotor local reference origin [meters] */
origin[0] = radius*cos(phi0+phi); /* x coordinates */
origin[1] = radius*sin(phi0+phi); /* y coordinates */
origin[2] = 0.0; /* z coordinates */
N3V_D(axis,=,radius*cos(phi0+phi),radius*sin(phi0+ phi),1.0); /* rotation axis definition */

*omega = omegar; /* pitching velocity of the blade zone */
}

Thank you in advance !
N'Furious76 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
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 18:34
[foam-extend.org] problem when installing foam-extend-1.6 Thomas pan OpenFOAM Installation 7 September 9, 2015 22:53
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 11:59
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 11:52


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