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 Simple UDF!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 14, 2013, 09:21
Question Error in Simple UDF!
  #1
Member
 
Join Date: Jul 2012
Posts: 48
Rep Power: 14
Abhya is on a distinguished road
Hi everyone!
There's a very simple on demand udf I'm writing ... using DEFINE_ON_DEMAND .. and I dont get the error its on the line where DEFINE_ON_DEMAND is defined .. theCode and error are:
Code:
The udf code is :
#include "udf.h"
     
FILE *fout;
     
void get_req_cells_coords(Domain *domain, int id)
{
    real CC[2];
    cell_t c;
    Thread *t = Lookup_Thread(domain, id);
    fprintf(fout,"thread id %d\n", id);
    begin_c_loop(c,t)
    {
        C_CENTROID(CC,c,t);
        fprintf(fout, "f%d %g %g %g\n", c, CC[0], CC[1], CC[2]);
    }
    end_f_loop(c,t)
    fprintf(fout, "\n");
}
DEFINE_ON_DEMAND(get_req_cells_coords)
{
    Domain *domain;
    domain = Get_Domain(1);
    fout = fopen("req_cells.out", "w");
    get_req_cells_coords(domain, 3);
    get_req_cells_coords(domain, 4);
    fclose(fout);
}

The error is:

# Generating ud_io1.h
get_req_cells_coords.c
..\..\src\get_req_cells_coords.c(19) : error C2143: syntax error : missing ';' before 'type'
can anyone help me ?
Im using Microsoft Visual Studio 2010 with FLUENT v14.5
Abhya is offline   Reply With Quote

Old   March 14, 2013, 09:36
Default
  #2
Member
 
Join Date: Jul 2012
Posts: 48
Rep Power: 14
Abhya is on a distinguished road
Another thing I'd like to mention is that I've been able to compile some other udfs using DEFINE_SOURCE without errors ...
but y this doesn't work ???
Abhya is offline   Reply With Quote

Reply


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
FLUENT UDF Simple error. startup0820 Fluent UDF and Scheme Programming 0 August 14, 2012 04:54
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 12:29
simple rigid body motion UDF Dan FLUENT 0 January 11, 2006 06:48
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


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