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

Error in 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 21, 2015, 05:18
Default Error in 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
I have the following UDF for sinusoidal wave propagation at channel wall. this UDF is intended to deform the channel wall thus causing the fluid motion 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]; //based on XStep you can pre compute how much should be the vector dimension (number of elements in xVec, say 1000 (replace it here
float xVec[1000];
xVec[0] = 0;

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

float hVec[1000]; //same as the case of xVec, compute the number and put the number here

int 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;
}
}

After building the library the following errors in console appear.

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.
Please I need some useful suggestion to get rid of these errors. I am a beginner in ANSYS Fluent and my brother wrote this UDF for me whose is a computer engineer. I think the errors are due to syntex difference??
engrmansoor2534 is offline   Reply With Quote

Reply

Tags
ansys 13 work bench, fluent - udf


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 12:30
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 4 December 2, 2019 01:04
Radiation interface hinca CFX 15 January 26, 2014 18:11
udf variable for wall temperature Kiran FLUENT 0 July 31, 2008 09:31
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


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