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

CG Motion UDF Problem

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Jessica.S

Reply
 
LinkBack Thread Tools Display Modes
Old   May 18, 2012, 11:30
Default CG Motion UDF Problem
  #1
New Member
 
Leonardo Armas
Join Date: Apr 2012
Posts: 2
Rep Power: 0
leoarmas is on a distinguished road
Hello World!

I have been working in the past few days trying to understand UDFs but i think i've reached a dead end...

This is what i'm trying to do:

I'm just trying to simulate the flow around a body wich is moving up and down with a sinusoidal law of motion. To do this i have written my UDF just as is shown below:

#include "udf.h"

DEFINE_CG_MOTION(object_mov, dt, vel, omega, time, dtime)
{
real a, w, pi;

pi = 3.1415;

/* define motion variables */
a = 0.05; /* 0.05m movement amplitude */
w = 2 * pi * 2; /* 2Hz frequency */

/* define object movement law */
vel[0] = 0;
vel[1] = -a * w * sin(w*time);
vel[2] = 0;
}

I have no problem interpreting this UDF into Fluent. However, when defining the dynamic zone the following warning appears:

"Warning: incorrect cg motion UDF wing on zone 4 (assuming no motion)"

Do you have any clue why could this be? is my UDF correctly written?
Looking forward to your answer.
Thanks!
leoarmas is offline   Reply With Quote

Old   June 1, 2012, 11:42
Default
  #2
New Member
 
Leonardo Armas
Join Date: Apr 2012
Posts: 2
Rep Power: 0
leoarmas is on a distinguished road
Just to say that I have solved the problem: CG motion macro only works when compiled!!
leoarmas is offline   Reply With Quote

Old   June 2, 2012, 01:21
Default
  #3
New Member
 
Jessica Simberg
Join Date: Mar 2012
Posts: 17
Rep Power: 5
Jessica.S is on a distinguished road
Hi,
your missing a math header, try using these:

#include "udf.h"
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
#include "dynamesh_tools.h"
#include "storage.h"

In addition, define an intermediate (i.e. "real v = 0") variable for the motion:

v = -a * w * sin(w*time);
vel[1] = v;

hopefully it will solve your problem...
leoarmas likes this.
Jessica.S is offline   Reply With Quote

Old   August 1, 2012, 06:58
Smile
  #4
New Member
 
Hossein
Join Date: Jul 2012
Posts: 1
Rep Power: 0
hossein66 is on a distinguished road
Quote:
Originally Posted by leoarmas View Post
Just to say that I have solved the problem: CG motion macro only works when compiled!!
How do you fix it? I have this problem but I can't fix it! Can you help me?
hossein66 is offline   Reply With Quote

Old   April 10, 2015, 02:59
Unhappy udf for flapping motion in hover
  #5
New Member
 
roham lavimi
Join Date: Apr 2015
Posts: 1
Rep Power: 0
roham4peace is on a distinguished road
I cant write udf code for flapping motion in hover, help me, im so confused
roham4peace is offline   Reply With Quote

Old   April 10, 2015, 03:22
Default
  #6
New Member
 
Jessica Simberg
Join Date: Mar 2012
Posts: 17
Rep Power: 5
Jessica.S is on a distinguished road
do it with solidworks flow simulation.

J
Jessica.S is offline   Reply With Quote

Reply

Tags
udf cg motion

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF PROBLEM anant FLUENT 2 January 17, 2007 01:15
UDF error CG Motion Alex FLUENT 0 March 22, 2006 18:40


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