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

CG Motion UDF Problem

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Jessica.S

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2012, 12: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, 12: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, 02:21
Default
  #3
New Member
 
Jessica Simberg
Join Date: Mar 2012
Posts: 18
Rep Power: 14
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, 07:58
Smile
  #4
New Member
 
Hossein
Join Date: Jul 2012
Posts: 2
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, 03: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, 04:22
Default
  #6
New Member
 
Jessica Simberg
Join Date: Mar 2012
Posts: 18
Rep Power: 14
Jessica.S is on a distinguished road
do it with solidworks flow simulation.

J
Jessica.S is offline   Reply With Quote

Old   October 9, 2015, 02:55
Default
  #7
New Member
 
Manahara Manatunga
Join Date: Mar 2014
Posts: 15
Rep Power: 12
manahara is on a distinguished road
Quote:
Originally Posted by hossein66 View Post
How do you fix it? I have this problem but I can't fix it! Can you help me?
Hi, Define CG Motion can only be compiled not interpreted. Please try compiling the UDF rather
manahara is offline   Reply With Quote

Old   April 4, 2016, 03:13
Default
  #8
New Member
 
mortezasekaloo
Join Date: Apr 2016
Posts: 4
Rep Power: 10
morteza 1374 is on a distinguished road
Quote:
Originally Posted by manahara View Post
Hi, Define CG Motion can only be compiled not interpreted. Please try compiling the UDF rather
hi
I am the student of fluid mechanics and now I am studying on fluid project. The subject of my project is about blade turbine that Oil radially impacts to the turbine blades by a nozzle, causing the turbine to spin. I have a problem in modeling of turbine that I don’t know how to obtain moment of inertia of blade and fluid and how to relate this challenge to the Cg motion until I can model this turbine in fluent software. Please help me
Thank for your attention
morteza 1374 is offline   Reply With Quote

Old   May 14, 2016, 04:04
Default Dynamic mesh flapping wing - Interface problem
  #9
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 210
Rep Power: 16
arunraj is on a distinguished road
Hi everyone,

I am simulating flapping wing of aerofoil. I have created three zones, zone 1, 2 and 3. Zone 1 has aerofoil with structured mesh around the aerofoil. Zone 2 and 3 has unstructured gird. My problem is I have properly followed all the steps. But I am not able to achieve what I want. Because the shadow of the interface is taking as wall and is not moving along with the domain. Kindly someone help in sorting out this issue. I have attached my UDF alos. Please have a look. Thank you so much

https://drive.google.com/file/d/0B7L...ew?usp=sharing
https://drive.google.com/file/d/0B7L...ew?usp=sharing
Attached Files
File Type: c second.c (1.1 KB, 172 views)
arunraj is offline   Reply With Quote

Old   June 15, 2019, 08:49
Default CG_Motion udf problem
  #10
New Member
 
Rubel Ahammed
Join Date: May 2019
Posts: 13
Rep Power: 7
Rubel Ahammed is on a distinguished road
Dear Experts,

I am trying to do a moving mesh for a body which is moving up and down. To do this I have written below UDF:

#include "udf.h"

static real velx = 0.0;

DEFINE_CG_MOTION(box,dt,vel,omega,time,dtime)
{
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);

velx = 0.05 * sin(3.1415927 * time / 10.);
Message ("time = %f, vel[0] =%f\n", time, vel[0]);
}

during compile i have face below error mentioned below:


Error: The UDF library you are trying to load (D:\MR Damper\CG Motion\Moving Mesh_files\dp0\FFF\Fluent\libudf) is not compiled for 2d on the current platform (win64).

The system cannot find the file specified.

D:\MR Damper\CG Motion\Moving Mesh_files\dp0\FFF\Fluent\D:\MR Damper\CG Motion\Moving Mesh_files\dp0\FFF\Fluent\libudf\win64\2d\libudf.d ll


How can I solve this problem? looking forward to your answer.
Thanks
Rubel Ahammed is offline   Reply With Quote

Old   June 16, 2019, 05:31
Default
  #11
New Member
 
Jessica Simberg
Join Date: Mar 2012
Posts: 18
Rep Power: 14
Jessica.S is on a distinguished road
Honestly, if you can do it in star ccm+

Ansys suck where moving geometries and large displacements are needed...
Jessica.S is offline   Reply With Quote

Old   June 17, 2019, 03:32
Default
  #12
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Originally Posted by Rubel Ahammed View Post
Dear Experts,

I am trying to do a moving mesh for a body which is moving up and down. To do this I have written below UDF:

#include "udf.h"

static real velx = 0.0;

DEFINE_CG_MOTION(box,dt,vel,omega,time,dtime)
{
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);

velx = 0.05 * sin(3.1415927 * time / 10.);
Message ("time = %f, vel[0] =%f\n", time, vel[0]);
}

during compile i have face below error mentioned below:


Error: The UDF library you are trying to load (D:\MR Damper\CG Motion\Moving Mesh_files\dp0\FFF\Fluent\libudf) is not compiled for 2d on the current platform (win64).

The system cannot find the file specified.

D:\MR Damper\CG Motion\Moving Mesh_files\dp0\FFF\Fluent\D:\MR Damper\CG Motion\Moving Mesh_files\dp0\FFF\Fluent\libudf\win64\2d\libudf.d ll


How can I solve this problem? looking forward to your answer.
Thanks
push BUILD button to compile, not load

best regards
AlexanderZ is offline   Reply With Quote

Old   November 9, 2019, 03:53
Smile I have an issue running my UDF
  #13
New Member
 
Sharif
Join Date: Nov 2019
Posts: 2
Rep Power: 0
Minato786 is on a distinguished road
train.c

tunnel.c

error1.PNG

Hello everyone, I'm trying to get my train to move but no matter what I try, I'm not able to compile the files. I'm not sure if its the file having issues or my settings are the problem. I hope someone could shed some light on this for me.

Thanks
Minato786 is offline   Reply With Quote

Old   November 11, 2019, 00:11
Default
  #14
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Originally Posted by Minato786 View Post
Attachment 73214

Attachment 73215

Attachment 73216

Hello everyone, I'm trying to get my train to move but no matter what I try, I'm not able to compile the files. I'm not sure if its the file having issues or my settings are the problem. I hope someone could shed some light on this for me.

Thanks
read error log
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   December 20, 2019, 13:59
Default
  #15
New Member
 
Gyan
Join Date: Dec 2019
Posts: 1
Rep Power: 0
Gyansetu is on a distinguished road
The program is wrong, even I have also stuck with the same problem.
Gyansetu is offline   Reply With Quote

Old   March 15, 2022, 03:46
Default
  #16
New Member
 
Furkan Enes
Join Date: May 2021
Posts: 3
Rep Power: 5
Furkanenes76 is on a distinguished road
I also get the same warning with you. However, when I try to compile my UDF, it is said that libudf does not exist. Did you get any error something like this?
Furkanenes76 is offline   Reply With Quote

Old   March 15, 2022, 07:59
Default
  #17
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
unload all UDF folders via udf manager,
make any changes in source file you are going to compile
compile
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   February 14, 2023, 09:59
Default
  #18
New Member
 
Furkan Enes
Join Date: May 2021
Posts: 3
Rep Power: 5
Furkanenes76 is on a distinguished road
May you help me with my second question in this forum? I am new in this forum and try to get help. I think there are not enough people seeing my post. I don't know why.

Thank you so much
Furkanenes76 is offline   Reply With Quote

Reply

Tags
udf cg motion


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
udf compiling problem akr FLUENT 3 August 22, 2007 08: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 14:55.