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

UDF for Sinusoidal wave propagation at channel wall

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 13, 2015, 14:52
Default UDF for Sinusoidal wave propagation at channel wall
  #1
Member
 
Mansoor Ahmed
Join Date: Apr 2014
Location: https://t.me/pump_upp
Posts: 47
Rep Power: 12
engrmansoor2534 is on a distinguished road
Send a message via ICQ to engrmansoor2534 Send a message via AIM to engrmansoor2534 Send a message via Yahoo to engrmansoor2534
Hi everyone
I have written a UDF for sinusoidal wave propagation at a channel wall. the wall should deform according to the equation in order to initialize the flow inside the channel.
#include "udf.h"
#include<stdlib.h>
#include<math.h>

#define AH 0.1 // Average Height of Channel
#define XL 1.0 // Length
#define WA 0.01 // Wave Amplitude
#define PI 3.1415925
#define C 0.05 //Wave Speed
#define Lambda 3.0 // wavelength

#define XStep 0.001
#define XSize XL/XStep

#define HStep 0.0001
#define HSize AH/HStep

DEFINE_GRID_MOTION(peristaltic, domain, dt, time, dtime)
{
Thread *tf= DT_THREAD(dt);
face_t f;

float curr_time = CURRENT_TIME;

float xVec[XSize];
xVec[0] = 0;
for (int counter = 1; counter < XSize; counter++)
xVec[counter] = xVec[counter - 1] + XStep;

float hVec[HSize];

i=1;
begin_f_loop(f,tf)
{
curr_time = CURRENT_TIME;
float sint = sin (2 * PI/Lambda * xVec[i] - C * curr_time);
hVec[i] = AH * WA * sint;
i = i + 1;
}
}
kindly I need comments. Is this right according to my case problem details are attached.

I am not yet able to run this code as I am having troubles in loading this UDF as compiled. I have installed Microsoft visual studio express 2010 and SDK 7.0. I am using ANSYS fluent 14.5. yet it gives an error as shown in the attachment.
Regards
Attached Images
File Type: jpg udf error.jpg (66.5 KB, 51 views)
Attached Files
File Type: docx Data for peristalsis UDF.docx (50.8 KB, 24 views)
engrmansoor2534 is offline   Reply With Quote

Old   August 17, 2015, 01:15
Default
  #2
New Member
 
Vinh Ha Tien
Join Date: Feb 2014
Posts: 5
Rep Power: 12
Havinh is on a distinguished road
I have got this problem too
And I have solved ít by using VS Ultimate version.
So try it now
Havinh is offline   Reply With Quote

Old   August 17, 2015, 01:52
Default
  #3
Member
 
Mansoor Ahmed
Join Date: Apr 2014
Location: https://t.me/pump_upp
Posts: 47
Rep Power: 12
engrmansoor2534 is on a distinguished road
Send a message via ICQ to engrmansoor2534 Send a message via AIM to engrmansoor2534 Send a message via Yahoo to engrmansoor2534
Quote:
Originally Posted by Havinh View Post
I have got this problem too
And I have solved ít by using VS Ultimate version.
So try it now
Thank you. I am going to install VS ultimate. Do I have to change the path in system variables after the installation?
engrmansoor2534 is offline   Reply With Quote

Old   August 17, 2015, 02:18
Default
  #4
New Member
 
Vinh Ha Tien
Join Date: Feb 2014
Posts: 5
Rep Power: 12
Havinh is on a distinguished road
in my experiment, it's not necessary. I just install ultimate version and everything run perfectly
Havinh is offline   Reply With Quote

Old   August 17, 2015, 04:56
Default
  #5
Member
 
Mansoor Ahmed
Join Date: Apr 2014
Location: https://t.me/pump_upp
Posts: 47
Rep Power: 12
engrmansoor2534 is on a distinguished road
Send a message via ICQ to engrmansoor2534 Send a message via AIM to engrmansoor2534 Send a message via Yahoo to engrmansoor2534
I have installed microsoft VS 2010 ultimate but still getting this error"xcopy is not recognized as an internal or external command, operable program or batch file" when i try to build the library. it builds the library "libudf" along with showing the above error. after that when i click load it gives the same old error message" the library u r trying to load (libudf) is not compiledfor 2d on the current platform (win64), the system cannot find the file specified .... D:\... libudf.dll"
I really don't know what else I can do to get this code compiled!
engrmansoor2534 is offline   Reply With Quote

Old   August 21, 2015, 04:01
Default UDF compile error solved
  #6
Member
 
Mansoor Ahmed
Join Date: Apr 2014
Location: https://t.me/pump_upp
Posts: 47
Rep Power: 12
engrmansoor2534 is on a distinguished road
Send a message via ICQ to engrmansoor2534 Send a message via AIM to engrmansoor2534 Send a message via Yahoo to engrmansoor2534
At last my Fluent is able to compile UDF's. I shifted to 32 bit versions and it did the job for me. Just installed MS visual studio 2010 professional and ran fluent from MS visual studio cross tool command prompt.
After running my UDF it gives the following errors.

Build Time: Oct 12 2010 17:12:32 Build Id: 10703
Loading "c:\PROGRA~1\ANSYSI~1\v130\fluent\fluent13.0.0\lib \fl_s1119.dmp"
Done.



> Deleted old libudf\ntx86\2d\libudf.dll
1 file(s) copied.
(system "copy "c:\PROGRA~1\ANSYSI~1\v130\fluent"\fluent13.0.0\sr c\makefile_nt.udf "libudf\ntx86\2d\makefile" ")
1 file(s) copied.
(chdir "libudf")()
(chdir "ntx86\2d")()
# Generating ud_io1.h
PeistalticUDFNEW.C
..\..\src\PeistalticUDFNEW.C(29) : error C2143: syntax error : missing ';' before 'type'
..\..\src\PeistalticUDFNEW.C(30) : error C2065: 'counter' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(30) : error C2065: 'counter' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(30) : error C2065: 'counter' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(31) : error C2065: 'counter' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(31) : error C2065: 'counter' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(33) : error C2143: syntax error : missing ';' before 'type'
..\..\src\PeistalticUDFNEW.C(35) : error C2143: syntax error : missing ';' before 'type'
..\..\src\PeistalticUDFNEW.C(39) : error C2143: syntax error : missing ';' before 'type'
..\..\src\PeistalticUDFNEW.C(40) : error C2065: 'hVec' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(40) : error C2065: 'i' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(40) : error C2109: subscript requires array or pointer type
..\..\src\PeistalticUDFNEW.C(40) : error C2065: 'sint' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(41) : error C2065: 'i' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(41) : error C2065: 'i' : undeclared identifier
..\..\src\PeistalticUDFNEW.C(43) : fatal error C1075: end of file found before the left brace '{' at '..\..\src\PeistalticUDFNEW.C(36)' was matched

Done.
Can any body guide me in this regard
engrmansoor2534 is offline   Reply With Quote

Reply

Tags
udf grid 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
Divergence in AMG solver! marina FLUENT 20 August 1, 2020 11:30
udf for wave in tank with moving wall Kushal Puri Fluent UDF and Scheme Programming 5 January 4, 2016 07:09
Radiation interface hinca CFX 15 January 26, 2014 17:11
udf variable for wall temperature Kiran FLUENT 0 July 31, 2008 08:31
UDF for oscillating wall Rajneesh FLUENT 0 February 21, 2006 21:44


All times are GMT -4. The time now is 09:18.