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

UDF compiling error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2018, 14:34
Default UDF compiling error
  #1
Senior Member
 
Weiqiang Liu
Join Date: Feb 2018
Posts: 278
Rep Power: 9
Weiqiang Liu is on a distinguished road
Hi all,

I am trying to compile a UDF in fluent to define surface reaction rate. However, I meet a very strange error.

First, I found a very simple c. file which defines source term and it can be compiled normally. Then I started to compiled my own UDF and I keeps getting the error like 'the udf library you are trying to load is not compiled for 2d on current platform (x64)'

At first sight, I thought that my code has something wrong. So I tried to modify my code and still same error.

So I copied a UDF file which defines surface reaction rate from ANSYS UDF manual and tried to compile this code. What is surprising is I got the same error with this official UDF code.

I think the visual studio and Fluent works right on my computer. Because the very simple source term UDF can be compiled normally.

This makes me very confused. Can anybody help me?

By the way, I am using visual studio 10.0, ANSYS fluent 17.0 and windows 10. 64.

attached you can find are the source term UDF and surface reaction rate UDF from ANSYS UDF manual.

BEST.
Attached Files
File Type: c source.c (335 Bytes, 2 views)
File Type: c UDF manual.c (1.0 KB, 2 views)
Weiqiang Liu is offline   Reply With Quote

Old   November 21, 2018, 06:08
Default
  #2
New Member
 
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 23
Rep Power: 9
anuarun is on a distinguished road
Call fluent from visual studio command prompt.
Say for example, if you have VS2015 for 64 bit processor, your command prompt will be
VS2015 x64 Native Tools Command Prompt(This may slightly differ based on which version of visual studio you have). Then you make sure that you have set the environment correctly by running
vcvars64.bat(for 64 bit OS) or vcvars32.bat(for 32 bit OS).

Then you give the path of fluent in command prompt as
C:\Program Files\ANSYS INC\v181\ntbin\win64\fluent.exe (this will also vary depending on your ANSYS version and its installed location)

Now, fluent launch window will appear. Then compile the UDF. It should work fine.
anuarun is offline   Reply With Quote

Old   November 21, 2018, 09:36
Default
  #3
Senior Member
 
Weiqiang Liu
Join Date: Feb 2018
Posts: 278
Rep Power: 9
Weiqiang Liu is on a distinguished road
Quote:
Originally Posted by anuarun View Post
Call fluent from visual studio command prompt.

Say for example, if you have VS2015 for 64 bit processor, your command prompt will be

VS2015 x64 Native Tools Command Prompt(This may slightly differ based on which version of visual studio you have). Then you make sure that you have set the environment correctly by running

vcvars64.bat(for 64 bit OS) or vcvars32.bat(for 32 bit OS).



Then you give the path of fluent in command prompt as

C:\Program Files\ANSYS INC\v181\ntbin\win64\fluent.exe (this will also vary depending on your ANSYS version and its installed location)



Now, fluent launch window will appear. Then compile the UDF. It should work fine.


Hello,

I’ve already solve this problem. Now I have convergence problem. Thanks all the same.

Weiqiang.
Weiqiang Liu is offline   Reply With Quote

Reply

Tags
compiling, source term, surface rate, udf


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
error compiling modified applications yvyan OpenFOAM Programming & Development 21 March 1, 2016 04:53
[swak4Foam] installing funkySetFields igo OpenFOAM Community Contributions 1 November 20, 2012 20:16
[swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." sega OpenFOAM Community Contributions 12 February 17, 2010 09:30
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
user subroutine error CFDUSER CFX 2 December 9, 2006 06:31


All times are GMT -4. The time now is 07:37.