CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF value too large for defined data type (https://www.cfd-online.com/Forums/fluent-udf/203427-udf-value-too-large-defined-data-type.html)

Intern_SG June 27, 2018 07:07

UDF value too large for defined data type
 
Dear all,

I made an UDF in Linux. When I want to interpreted the UDF ANSYS keeps telling me the following " Value too large for defined data type" and " line 1: syntax error".

Line one is the standard line for the UDF. #include "udf.h"

This ANSYS version is also running on Linux so it has nothing to do with converting windows files to Linux files.

Can anyone help me?

zobekenobe June 27, 2018 08:44

Can you post your code, it would be easier to debug it that way

Intern_SG June 27, 2018 10:38

Dear zobekenobe,

This is the UDF which doesn't work in Linux but does work in Windows.

#include "udf.h"
/* Defining the profile for the inlet pressure */
DEFINE_PROFILE(aortic_pressure,th,i)
{
face_t f;
real a0 = 6018;
real a1 = -657.9;
real b1 = 1722;
real a2 = -706.3;
real b2 = 281.7;
real a3 = -255.8;
real b3 = -162.7;
real a4 = -31.35;
real b4 = 36.84;
real a5 = -166.1;
real b5 = 65.06;
real a6 = -116.3;
real b6 = -69.13;
real a7 = -30.85;
real b7 = -1.664;
real a8 = -95.44;
real b8 = -16.19;
real w = 4*M_PI;
real pressure_inlet = 0.0;
real t = CURRENT_TIME;
begin_f_loop(f,th)
{
pressure_inlet = a0 + a1*cos(t*w) + b1*sin(t*w) +
a2*cos(2*t*w) + b2*sin(2*t*w) + a3*cos(3*t*w) + b3*sin(3*t*w) +
a4*cos(4*t*w) + b4*sin(4*t*w) + a5*cos(5*t*w) + b5*sin(5*t*w) +
a6*cos(6*t*w) + b6*sin(6*t*w) + a7*cos(7*t*w) + b7*sin(7*t*w) +
a8*cos(8*t*w) + b8*sin(8*t*w);
F_PROFILE(f,th,i) = pressure_inlet;
}
end_f_loop(f,th)
}

zobekenobe June 27, 2018 10:44

It compiles and builds fine with Windows!!! No problems
I cant run it on the linux system right now.


Did a search for the same problem apparently it happens with other softwares with one suggestion being the OS or the installed software is probably 32bit.
Many suggested using dos2linux (probably create a udf in windows and then convert and run it)
Have you tried compiling it instead of interpreting it??

Intern_SG June 27, 2018 11:14

Yes I tried to compile it however the ANSYS I use changes from serial to parallel during launching. It gives the following warning without assigning an UDF.

************************************************** **************************
************************************************** **************************
** WARNING: Automatically switched to run in parallel -t1 mode. **
** Detected non-parallelized UDF usage, enabling parallel usage. **
** If you encounter any issues, please re-run with -t0 flag. **
************************************************** **************************
************************************************** **************************

Intern_SG June 27, 2018 11:23

I got a student version in windows so I can't use that one for my mesh. In Linux however I got the full version, so I have to use the Linux version.


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