CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF intrepreting errors (https://www.cfd-online.com/Forums/fluent/34976-udf-intrepreting-errors.html)

Satish Perivilli November 2, 2004 17:27

UDF intrepreting errors
 
Hello all

I am trying to use a UDF for one of my simulations. I am trying to intrepret the UDF by specifying a source file written in C. I get an error in the console window stating the following:

error: N:\Research with Fluent\UDF_EXs_from_Fluent.com\udf-temp\viscosity.c: line 1: parse error.

Please let me know what the problem is and how can I sort this out.

Thanks

anni November 3, 2004 07:08

Re: UDF intrepreting errors
 
Hello,

you have done something wrong in proggramming, in the first line of your program.

Because it says: line 1: parse error.

Anni

Satish Perivilli November 3, 2004 17:12

Re: UDF intrepreting errors
 
Hi all

thanks to anni for the reply. I had a look at my program but was not able to find out any error myself. So if anybody could find out any error pls. let me know, also let me know whether the locations of udf.h and corresponding files do matter. Here is what i am trying to use for my UDF.

/* This program is to write a macro to define the heat flux boundary conditions on the tool and shoulder */

# include "udf.h"

DEFINE_HEAT_FLUX (shdr_n_tool_heat_flux, f, t, c0, t0, cid, cir) /* Using a macro from "Model Specific DEFINE macros" */

{

real x[ND_ND], x_coord, z_coord; /* This will hold the position vector of the centroid of a cell, its x&z cordnates */

real temp, dim_less_temp; /* Temperature, Dimensionless temperature */

cell_t c; /* Cell identifier */

/* Beginning of the loop over all cells in the thread */

begin_c_loop(c, t)

{

/* To find the cell centroid and approximate it as the node at which the cell temperature acts */

C_CENTROID(x,c,t);

x_coord = x[0];

z_coord = x[2];

/* To find the cell temperature and define a dimensionless temperature */

temp = C_T(c,t);

dim_less_temp = 1-temp/926;

/* heat_flux is the flux to be applied at each node on the shoulder and the tool surface */

/* heat_flux = Tau0,0 [N/m2] * omega [rad/s] *sqrt (x^2+z^2)*{1-T/926[K]} */

heat_flux = 104191920*26.19*sqrt(x_coord*x_coord+z_coord*z_coo rd)*dim_less_temp;

}

end_c_loop(c,t)

/* End of the loop over all cells in the thread */

}

----------------------------------------------------

the error i get when i try to compile is this

"error: N:\Research with Fluent\UDF_EXs_from_Fluent.com\udf-temp\viscosity.c: line 1: parse error. "

thanks and please let me know if I can work this out.


Satish Perivilli November 5, 2004 15:59

Re: UDF intrepreting errors
 
HI

I have had this sorted out and I had to move my mesh files to c:\fluent.inc\ntbin\ntx86 folder . Now I am able to intrepret my UDF finally, but have encountered a newer problem. Can anybody tell me how to sort this out?? thanks.

The error is

Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: ()

Kartz November 6, 2004 13:47

Re: UDF intrepreting errors
 
if you have placed the c file in the ntx folder, you do not have to call the file (at the place where you put in the file name )with its whole address, since this the working directory.Just give the name of the file.

However if you decide, to place your mesh file at some other folder(like in ur 1st msg), then put in the c file in that same folder. And when you call for the file, use the full address. Hope it solves your problem. G.Luck

Bowling November 9, 2004 04:35

Re: UDF intrepreting errors
 
I have ever found the problem like yours. I didn't know why but I installed the program again. It was ok. You have to install FLUENT before C++. If you have more problem, post it. I try to help you.

Bowling


All times are GMT -4. The time now is 20:33.