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

Compile UDF outside of Fluent with Visual Studio

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2022, 02:14
Default Compile UDF outside of Fluent with Visual Studio
  #1
New Member
 
Andreas
Join Date: Jul 2022
Location: Southern Germany
Posts: 5
Rep Power: 3
Maddy1984 is on a distinguished road
Hello everyone,

So I used the search function but nothing helped for me. Our company guidline blocks the internal fluent compiler so I need to compile my code outside of Fluent.

I used the ANSYS help and followed the steps inside this document: https://ansyshelp.ansys.com/account/...mpile_tui.html

I know my c-code is fine, because someone who can use it in Fluent tested it.

So I modified the user_nt.udf and added the following (example for 3d_host):

Code:
FLUENT_INC= C:\Program Files\ANSYS Inc\v221\fluent\
FLUENT_ARCH= win64

CSOURCES = $(SRC)code.c
HSOURCES = $(SRC)header.h
VERSION = 3d_host
PARALLEL_NODE = none
My header-File only states the following:
Code:
#include "C:\Program Files\ANSYS Inc\v221\fluent\fluent22.1.0\src\udf\udf.h"
But everytime I compline the code in "x64 Native Tools Command Prompt for VS 2019" I get the following:

Quote:
Microsoft (R) Program Maintenance Utility, Version 14.29.30146.0
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

# Generating ud_io1.h
resolve.exe -udf ..\..\src\code.c -head_file ud_io1.h
cl /c /DUDF_EXPORTING /DUDF_NT /DWIN64 /EHa /wd4224 -I. -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\win64\3d_host -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\main -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\addon-wrapper -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\io -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\species -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\pbns -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\numerics -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\sphysics -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\storage -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\mphase -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\bc -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\models -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\material -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\amg -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\util -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\mesh -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\udf -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\ht -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\dx -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\turbulence -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\acoustics -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\parallel -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\etc -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\ue -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\dpm -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\src\dbns -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\cortex\src -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\client\src -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\tgrid\src -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\multiport\src -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\fluent22.1.0\multiport\mpi_wrapper\src -I"C:\Program Files\ANSYS Inc\v221\fluent FLUENT_ARCH= win64"\include ..\..\src\code.c ..\..\src\header.h
Microsoft (R) C/C++-Optimierungscompiler Version 19.29.30146 für x64
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

cl : Befehlszeile warning D9024 : Unbekannter Typ der Quelldatei "..\..\src\header.h", Objektdatei wird angenommen.
cl : Befehlszeile warning D9027 : Quelldatei "..\..\src\header.h" wird ignoriert.
code.c
C:\Program Files\ANSYS Inc\v221\fluent\fluent22.1.0\src\udf\udf.h(22): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "global.h": No such file or directory
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bi n\HostX64\x64\cl.EXE"": Rückgabe-Code "0x2"
Stop.
So obvious he can't find the global.h file, which should be in \scr\main.

But above the folder is loaded.

So where can my mistake be?

Kind Regards,

Andreas
Maddy1984 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
What compilers can we use in Ansys Fluent to compile our UDF? Roh Fluent UDF and Scheme Programming 19 November 11, 2021 21:09
Compiling udf in visual studio: unresolved external symbol ghost82 Fluent UDF and Scheme Programming 4 July 23, 2021 13:59
Problem in compiling UDF with ANSYS Fluent 17.1 and Visual Studio 14.0 Spiker54321 Fluent UDF and Scheme Programming 2 October 27, 2016 09:09
Fluent 6.3.26 on Linux does not compile an UDF Entwistle Fluent UDF and Scheme Programming 1 March 4, 2014 14:49
The fluent stopped and errors with "Emergency: received SIGHUP signal" yuyuxuan FLUENT 0 December 3, 2013 22:56


All times are GMT -4. The time now is 15:40.