CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Fluent crash / interpret UFD script (https://www.cfd-online.com/Forums/fluent/219528-fluent-crash-interpret-ufd-script.html)

sleontsi July 30, 2019 09:15

Fluent crash / interpret UFD script
 
Hi all!

Allow me to describe my problem. I have a simple geometry (can be attached if requested). I open it with DesignModeler and make a group of all the components. I do this in order to avoid problems with overlap regions in meshing. After the meshing is complete, I open it in fluent, meshing is ok, assign the materials to solid (aluminum). If I assign a temperature, a heat flux and simulate it, it works.

Now I try to insert a basic UDF file, DEFINE_SOURCE and I use the basic file and I take the one from the manual. When I try to compile it I get the following. In the build stage:

Copied C:\Users\sleontsi\ThermalStudies\ThermalRunaway_fi les\dp0\FFF-1\Fluent/C:\Users\sleontsi\ThermalStudies\ThermalRunaway_fi les\dp0\FFF-1\Fluent\udfscript.c to C:\Users\sleontsi\ThermalStudies\ThermalRunaway_fi les\dp0\FFF-1\Fluent\libudf\src
udf_names.c and user_nt.udf files in 3ddp_host are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v191\fluent"\fluent19.1.0\sr c\udf\makefile_nt.udf "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf\win64\3ddp_host\makefile" ")
1 file(s) copied.
(chdir "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf")(chdir "win64\3ddp_host")udf_names.c and user_nt.udf files in 3ddp_node are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v191\fluent"\fluent19.1.0\sr c\udf\makefile_nt.udf "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf\win64\3ddp_node\makefile" ")
1 file(s) copied.
(chdir "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf")(chdir "win64\3ddp_node")
Done.

in the load part I get:

Opening library "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf"...
Library "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf\win64\3ddp_host\libudf.dll" opened
Opening library "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf"...
Library "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf\win64\3ddp_node\libudf.dll" opened
heat_flux
Done.

and the dialog box closes. The problem now is that the function is not visible in the drop-down menu.

If I interpret it though, I can see the function, but when I try to run it, it crashes with ""999999 mpt_accept error accept failed invalid argument".

Any help will be highly appreciated.

Thanks a lot,
Best,
Stefanos

AlexanderZ July 31, 2019 00:02

show your UDF.

your file was not compiled, as it said to you all files are up to date.
open your source file, type space and delete it -> save -> recompile -> check console output

if you still have problems: show your udf, logs with errors

best regards

sleontsi July 31, 2019 01:25

1 Attachment(s)
Hi Alexander! Thanks for the reply..

So, I started again. Removed the libudf folder from the dp0/FFF-1/Fluent folder and I recompiled, making a change and saving again the UDF file. These are the messages in the log:

> Copied C:\Users\sleontsi\ThermalStudies\ThermalRunaway_fi les\dp0\FFF-1\Fluent/C:\Users\sleontsi\ThermalStudies\ThermalRunaway_fi les\dp0\FFF-1\Fluent\udfscript.c to C:\Users\sleontsi\ThermalStudies\ThermalRunaway_fi les\dp0\FFF-1\Fluent\libudf\src

************************************************** **************************
************************************************** **************************
** 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. **
************************************************** **************************
************************************************** **************************udf_names.c and user_nt.udf files in 3ddp_host are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v191\fluent"\fluent19.1.0\sr c\udf\makefile_nt.udf "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf\win64\3ddp_host\makefile" ")
1 file(s) copied.
(chdir "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf")(chdir "win64\3ddp_host")
************************************************** **************************
************************************************** **************************
** 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. **
************************************************** **************************
************************************************** **************************udf_names.c and user_nt.udf files in 3ddp_node are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v191\fluent"\fluent19.1.0\sr c\udf\makefile_nt.udf "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf\win64\3ddp_node\makefile" ")
1 file(s) copied.
(chdir "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf")(chdir "win64\3ddp_node")
Done.

Opening library "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf"...
Library "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf\win64\3ddp_host\libudf.dll" opened
Opening library "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf"...
Library "C:\Users\sleontsi\ThermalStudies\ThermalRunaway_f iles\dp0\FFF-1\Fluent\libudf\win64\3ddp_node\libudf.dll" opened
heat_flux
Done.

My UDF is pretty simple. I've attached it.

Thanks again for your time! :)

sleontsi July 31, 2019 01:30

Just a follow-up, when I recompile, without closing fluent and removing the folder suggested by fluent, I get this error:

LINK : fatal error LNK1104: cannot open file 'libudf.dll'

AlexanderZ August 1, 2019 00:39

in case of
Code:

LINK : fatal error LNK1104: cannot open file 'libudf.dll'
you should unload your UDF, as it was done

check the order once again:
1.removed the libudf folder from your working directory
2.make a change and saving again the UDF file.
3.recompile

if everything is correct you should get
Code:

Creating library libudf.lib and object libudf.exp

Done.

your udf is pretty simple and should work
Code:

#include "udf.h"

DEFINE_SOURCE(heat_flux,c,t,dS,eqn)
{
        real source;
        source = 1e6;
        dS[eqn] = 0;
        return source;
}

best regards


All times are GMT -4. The time now is 10:39.