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

smth wrong with my udf for pin.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2010, 16:26
Default smth wrong with my udf for pin.
  #1
New Member
 
Faraj
Join Date: Feb 2010
Posts: 22
Rep Power: 16
Filankes is on a distinguished road

This code works, which shows motion of my pin.



#include "udf.h"
#include<stdio.h>
#include<math.h>





DEFINE_CG_MOTION(plate, dt, vel, omega, time, dtime)

{



vel[0] = 0.0;
vel[1] = -0.0149*728.31853*sin(628.31853*time);
vel[2] = 0.0;

omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = 0.0;

}







Nevertheless this code with if, do not work, I don't understand why, please help me guys
================================================== ==

#include "udf.h"
#include<stdio.h>
#include<math.h>





DEFINE_CG_MOTION(plate, dt, vel, omega, time, dtime)

{

if (time==0.0)
{
vel[0] = 0.0;
vel[1] = -0.0149*728.31853*sin(628.31853*time);
vel[2] = 0.0;

omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = 0.0;
}
else if(time==0.002)
{
vel[0] = 0.0;
vel[1] = -0.0149*628.31853*sin(628.31853*time);
vel[2] = 0.0;

omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = 0.0;
}
else if(time==0.003)
{
vel[0] = 0.0;
vel[1] = -0.0149*528.31853*sin(628.31853*time);
vel[2] = 0.0;

omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = 0.0;
}
else if(time==0.005)
{
vel[0] = 0.0;
vel[1] = -0.0149*728.31853*sin(628.31853*time);
vel[2] = 0.0;

omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = 0.0;
}
else if(time==0.007)
{
vel[0] = 0.0;
vel[1] = -0.0149*628.31853*sin(628.31853*time);
vel[2] = 0.0;

omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = 0.0;
}
else if(time==0.008)
{
vel[0] = 0.0;
vel[1] = -0.0149*728.31853*sin(628.31853*time);
vel[2] = 0.0;

omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = 0.0;
}
else if(time==0.01)
{
vel[0] = 0.0;
vel[1] = -0.0149*728.31853*sin(628.31853*time);
vel[2] = 0.0;

omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = 0.0;
}


}
Filankes is offline   Reply With Quote

Old   April 19, 2010, 16:40
Default
  #2
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 19
DoHander is on a distinguished road
What do you mean by it does not work ? You can't compile the code or the results is wrong ?

Do
DoHander is offline   Reply With Quote

Old   April 19, 2010, 19:51
Default
  #3
New Member
 
Faraj
Join Date: Feb 2010
Posts: 22
Rep Power: 16
Filankes is on a distinguished road
Quote:
Originally Posted by DoHander View Post
What do you mean by it does not work ? You can't compile the code or the results is wrong ?

Do

I can load both

but the first one works, and the pin moves, but the second one do not work ==>> pin do not move. Please help me guys.
Filankes 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
udf error srihari FLUENT 1 October 31, 2016 14:18
what is wrong with my UDF for slip boudary cxzhao FLUENT 6 September 27, 2011 00:46
anything wrong in this udf brusly FLUENT 0 November 26, 2007 06:02
What's wrong with my UDF? It worked in the past. CF FLUENT 3 September 26, 2007 20:09
What's wrong with my UDF? olivia FLUENT 1 June 23, 2001 17:06


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