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

How to resolve this UDF error in Fluent?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2020, 07:19
Question How to resolve this UDF error in Fluent?
  #1
New Member
 
Ussama Ali
Join Date: Jun 2020
Posts: 2
Rep Power: 0
ussama.ali is on a distinguished road
Hello everyone,
I am working on analyzing the flow around a cylinder in Fluent. The cylinder wall is to be rotated via UDF in a clockwise and anti-clockwise direction (like an oscillatory motion). I get an error if I try to compile or interpret the UDF. Please help me in resolving the following error:

When I try to interpret:
Error: C:/Users/Ali/AppData/Local/Temp/2.c.6616.0.c: line 17: structure reference not implemented
When I try to compile:
..\..\src\2.c(17) : error C2440: '=' : cannot convert from 'double' to 'Profile'

Following is the UDF code:
#include "udf.h"
#include "threads.h"
#define o 0.5
#define st 0.2
#define pi 3.1416
DEFINE_ADJUST(rotational_profile, d)
{
Thread *thread = Lookup_Thread(d, 8);
real current_time = RP_Get_Real("flow-time");
THREAD_VAR(thread).wall.omega = o*sin(2*pi*st*current_time);
}

I am using windows 8.1 64bit with MS Visual Studio installed. Ansys version is 2019 R3.
ussama.ali is offline   Reply With Quote

Old   June 20, 2020, 11:30
Default Wall Motion
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,948
Blog Entries: 1
Rep Power: 31
vinerm will become famous soon enough
You don't need a UDF for this; use transient profile.

If, for some reason, you want to use UDF, then you need to use DEFINE_TRANSIENT_PROFILE.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 21, 2020, 04:13
Default
  #3
New Member
 
Ussama Ali
Join Date: Jun 2020
Posts: 2
Rep Power: 0
ussama.ali is on a distinguished road
Dear Vinerm,
Thank you for your reply, can you please elaborate on how to use transient profile?
ussama.ali is offline   Reply With Quote

Old   June 21, 2020, 07:50
Default Transient Profile
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,948
Blog Entries: 1
Rep Power: 31
vinerm will become famous soon enough
Search Fluent forum for transient profile, you'll find what you are looking for.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply

Tags
fluent, rotating cylinder, udf

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to solve UDF compilation problems in Fluent. pakk Fluent UDF and Scheme Programming 16 September 10, 2018 02:48
Problem running fluent with udf on batch tobi b. Fluent UDF and Scheme Programming 3 April 14, 2016 13:54
implementing UDF for fluent in workbench for running multiple simulations faizan_habib7 Fluent UDF and Scheme Programming 0 March 18, 2016 22:29
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 13:41
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 10:16


All times are GMT -4. The time now is 01:35.