|
[Sponsors] |
UDF for Sinusoidal wave propagation at channel wall |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 13, 2015, 15:52 |
UDF for Sinusoidal wave propagation at channel wall
|
#1 |
Member
|
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 |
|
August 17, 2015, 02:15 |
|
#2 |
New Member
Vinh Ha Tien
Join Date: Feb 2014
Posts: 5
Rep Power: 12 |
I have got this problem too
And I have solved ít by using VS Ultimate version. So try it now |
|
August 17, 2015, 02:52 |
|
#3 |
Member
|
||
August 17, 2015, 03:18 |
|
#4 |
New Member
Vinh Ha Tien
Join Date: Feb 2014
Posts: 5
Rep Power: 12 |
in my experiment, it's not necessary. I just install ultimate version and everything run perfectly
|
|
August 17, 2015, 05:56 |
|
#5 |
Member
|
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! |
|
August 21, 2015, 05:01 |
UDF compile error solved
|
#6 |
Member
|
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 |
|
Tags |
udf grid motion |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Divergence in AMG solver! | marina | FLUENT | 20 | August 1, 2020 12:30 |
udf for wave in tank with moving wall | Kushal Puri | Fluent UDF and Scheme Programming | 5 | January 4, 2016 08:09 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
udf variable for wall temperature | Kiran | FLUENT | 0 | July 31, 2008 09:31 |
UDF for oscillating wall | Rajneesh | FLUENT | 0 | February 21, 2006 22:44 |