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

About UDF compiling issues: 'nmake'

Register Blogs Community New Posts Updated Threads Search

Like Tree10Likes
  • 9 Post By Haoyin Shan
  • 1 Post By sabbasi_mr

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 2, 2008, 11:51
Default About UDF compiling issues: 'nmake'
  #1
Haoyin Shan
Guest
 
Posts: n/a
Hi, all,

Lots of users find it is hard at the beginning of UDF use. Most of the time, there is an error: ************************ 'nmake' is not recognized as an internal or external command, operable program or batch file. 'nmake' is not recognized as an internal or external command, operable program or batch file. ************************

This is just the problem of binding between FLUENT and VC++. To know more about this problem, firstly please refer to following post. http://www.cfd-online.com/Wiki/Fluen...at_is_wrong.3F

http://www.cfd-online.com/Forum/flue...cgi?read=47472 gives a long solution about how to solve this problem, but my experience following this did not give me a solution. So I have to find my own way. Followings are my solution.

1. No matter Microsoft Visual Studio professional or express version, they both work fine with FLUENT. As long as it has C++, you could bind it with FLUENT and use it to compile UDF.

2. After installing Microsoft Visual Studio professional or express version, you could check the Environmental variables from 'my computer ---> properties ----> advanced tab', on the bottom part u have environment variables and system variables. Generally on installing, the environmental variables are added for MSVC, check to make sure that this is added. Generally, you need not do anything about this.

3. The most important thing is try to open FLUENT in Visual Studio Command Prompt, which is in 'Start-All programs-Microsoft Visual Studio-Microsoft Visual Studio Tools-Visual Studio Command Prompt'. Then type FLUENT in the command window, FLUENT is starting. Now you can close the Visual Studio Command Prompt, it does not impact the compiling of UDF.

That is it. Very simple, remember to open FLUENT in the Visual Studio Command Prompt, you will be always OK.

  Reply With Quote

Old   October 5, 2009, 23:03
Smile
  #2
New Member
 
Saeed Abbasi
Join Date: Sep 2009
Location: Iran
Posts: 20
Rep Power: 17
sabbasi_mr is on a distinguished road
Thanks for this help. You solved my problem.
ravindersingh likes this.
sabbasi_mr is offline   Reply With Quote

Old   April 12, 2011, 04:05
Default
  #3
Senior Member
 
raymond
Join Date: Nov 2009
Posts: 149
Rep Power: 17
wlt_1985 is on a distinguished road
Quote:
Originally Posted by Haoyin Shan
;149606
Hi, all,

Lots of users find it is hard at the beginning of UDF use. Most of the time, there is an error: ************************ 'nmake' is not recognized as an internal or external command, operable program or batch file. 'nmake' is not recognized as an internal or external command, operable program or batch file. ************************

This is just the problem of binding between FLUENT and VC++. To know more about this problem, firstly please refer to following post. http://www.cfd-online.com/Wiki/Fluen...at_is_wrong.3F

http://www.cfd-online.com/Forum/flue...cgi?read=47472 gives a long solution about how to solve this problem, but my experience following this did not give me a solution. So I have to find my own way. Followings are my solution.

1. No matter Microsoft Visual Studio professional or express version, they both work fine with FLUENT. As long as it has C++, you could bind it with FLUENT and use it to compile UDF.

2. After installing Microsoft Visual Studio professional or express version, you could check the Environmental variables from 'my computer ---> properties ----> advanced tab', on the bottom part u have environment variables and system variables. Generally on installing, the environmental variables are added for MSVC, check to make sure that this is added. Generally, you need not do anything about this.

3. The most important thing is try to open FLUENT in Visual Studio Command Prompt, which is in 'Start-All programs-Microsoft Visual Studio-Microsoft Visual Studio Tools-Visual Studio Command Prompt'. Then type FLUENT in the command window, FLUENT is starting. Now you can close the Visual Studio Command Prompt, it does not impact the compiling of UDF.

That is it. Very simple, remember to open FLUENT in the Visual Studio Command Prompt, you will be always OK.

Dear Haoyin Shan,

What is MSVC and what is its value? How to confirm it is added?

Thanks a lot.

Best regards.
wlt_1985 is offline   Reply With Quote

Old   April 12, 2011, 04:20
Default
  #4
New Member
 
Join Date: Nov 2010
Posts: 7
Rep Power: 16
NLao is on a distinguished road
Hi Haoyin Shan,

I have coded a UDF that iterates over each cell on the face and whether it falls witihin a given circle either sets the velocity as, say 30 m/s, and if it does not sets the velocity as 0 m/s.

However, I want to set the cell as a wall boundary condition if it does not fall within a given circle instead of being 0 m/s.

Is there a way to do this?

I am using the define_profile macro. If more info is needed, I am more than happy to reply

Thanks for any help you wish to offer to me

Lao
NLao is offline   Reply With Quote

Old   January 12, 2012, 18:34
Unhappy
  #5
New Member
 
M.Badr
Join Date: Jan 2012
Posts: 1
Rep Power: 0
Eng.M.Badr is on a distinguished road
Hi,Guys

I m a beginner with fluent,so can anybody help me, I have a problem in build files of C++ in Fluent which is

'nmake' is not recognized as an internal or external command,
operable program or batch file.
'nmake' is not recognized as an internal or external command,
operable program or batch file.

Done.

but as u see he said that build has been done, so i go to load step to continue it give me another error

Opening library "libudf"...
Error: open_udf_library: The system cannot find the file specified.

thank u in advance
Eng.M.Badr is offline   Reply With Quote

Old   January 13, 2012, 07:56
Lightbulb
  #6
Member
 
Join Date: Jun 2011
Posts: 86
Rep Power: 15
mali28 is on a distinguished road
Quote:
Originally Posted by Eng.M.Badr View Post
Hi,Guys

I m a beginner with fluent,so can anybody help me, I have a problem in build files of C++ in Fluent which is

'nmake' is not recognized as an internal or external command,
operable program or batch file.
'nmake' is not recognized as an internal or external command,
operable program or batch file.

Done.

but as u see he said that build has been done, so i go to load step to continue it give me another error

Opening library "libudf"...
Error: open_udf_library: The system cannot find the file specified.

thank u in advance

You have to make sure that both the UDF .c file and the case and data files are in the same directory before you begin compiling the UDF. Also make sure that the folder in which you have the .c and case and data files do not have a space or - in the folder name. Same goes for the case and data file and .c file.
No spaces and no -

Replace space and - with an underscore if there are any.
mali28 is offline   Reply With Quote

Old   January 13, 2012, 08:48
Default
  #7
Member
 
Theodoros Papadopoulos
Join Date: Mar 2011
Posts: 36
Rep Power: 15
papteo is on a distinguished road
Quote:
Originally Posted by Eng.M.Badr View Post
Hi,Guys

I m a beginner with fluent,so can anybody help me, I have a problem in build files of C++ in Fluent which is

'nmake' is not recognized as an internal or external command,
operable program or batch file.
'nmake' is not recognized as an internal or external command,
operable program or batch file.

Done.

but as u see he said that build has been done, so i go to load step to continue it give me another error

Opening library "libudf"...
Error: open_udf_library: The system cannot find the file specified.

thank u in advance
As Haoyin Shan do not forget to open Fluent through the command window of the VS C++!!
papteo is offline   Reply With Quote

Old   January 2, 2013, 11:49
Default problem in starting fluent...
  #8
Senior Member
 
Join Date: Nov 2009
Posts: 125
Rep Power: 17
mactech001 is on a distinguished road
Quote:
Originally Posted by Haoyin Shan
;149606
2. After installing Microsoft Visual Studio professional or express version, you could check the Environmental variables from 'my computer ---> properties ----> advanced tab', on the bottom part u have environment variables and system variables. Generally on installing, the environmental variables are added for MSVC, check to make sure that this is added. Generally, you need not do anything about this.

3. The most important thing is try to open FLUENT in Visual Studio Command Prompt, which is in 'Start-All programs-Microsoft Visual Studio-Microsoft Visual Studio Tools-Visual Studio Command Prompt'. Then type FLUENT in the command window, FLUENT is starting. Now you can close the Visual Studio Command Prompt, it does not impact the compiling of UDF.

That is it. Very simple, remember to open FLUENT in the Visual Studio Command Prompt, you will be always OK.

I can't open FLUENT from the VC command prompt. It claims to be: not an internal or external command. Do you when i open the VC command prompt, i should change directory to the fluent directory and start fluent from the fluent directory please?
__________________
Thank you for your kind attention.

Kind regards,
mactech001
Currently using: ANSYS v13
mactech001 is offline   Reply With Quote

Old   October 18, 2017, 04:10
Default
  #9
New Member
 
chenzhonghua
Join Date: Oct 2017
Posts: 1
Rep Power: 0
Homer_Chen is on a distinguished road
Quote:
Originally Posted by Haoyin Shan
;149606
Hi, all,

Lots of users find it is hard at the beginning of UDF use. Most of the time, there is an error: ************************ 'nmake' is not recognized as an internal or external command, operable program or batch file. 'nmake' is not recognized as an internal or external command, operable program or batch file. ************************

This is just the problem of binding between FLUENT and VC++. To know more about this problem, firstly please refer to following post. http://www.cfd-online.com/Wiki/Fluen...at_is_wrong.3F

http://www.cfd-online.com/Forum/flue...cgi?read=47472 gives a long solution about how to solve this problem, but my experience following this did not give me a solution. So I have to find my own way. Followings are my solution.

1. No matter Microsoft Visual Studio professional or express version, they both work fine with FLUENT. As long as it has C++, you could bind it with FLUENT and use it to compile UDF.

2. After installing Microsoft Visual Studio professional or express version, you could check the Environmental variables from 'my computer ---> properties ----> advanced tab', on the bottom part u have environment variables and system variables. Generally on installing, the environmental variables are added for MSVC, check to make sure that this is added. Generally, you need not do anything about this.

3. The most important thing is try to open FLUENT in Visual Studio Command Prompt, which is in 'Start-All programs-Microsoft Visual Studio-Microsoft Visual Studio Tools-Visual Studio Command Prompt'. Then type FLUENT in the command window, FLUENT is starting. Now you can close the Visual Studio Command Prompt, it does not impact the compiling of UDF.

That is it. Very simple, remember to open FLUENT in the Visual Studio Command Prompt, you will be always OK.
Hi my friend,
I have done the things u told, installing Visual Studio 2010, changing the enviroment available and using visual studio command prompt to start fluent. But when i load the udf, it still came out the message:Opening library "E:\ex151\libudf"... Error: The UDF library you are trying to load (libudf) is not compiled for 3ddp on the current platform (win64).


系统找不到指定的文件。


E:\ex151\libudf\win64\3ddp\libudf.dll


Error: The UDF library you are trying to load (libudf) is not compiled for 3ddp on the current platform (win64).\n\n系统找不到指定的文件。
\n\nE:\ex151\libudf\win64\3ddp\libudf.dll
Error Object: #f


how can i do? Thanks for you answer.
Homer_Chen is offline   Reply With Quote

Old   October 18, 2017, 21:54
Default
  #10
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
You have to compile the library first using source .c file, than load it

Best regards
AlexanderZ is offline   Reply With Quote

Old   October 19, 2017, 09:44
Default
  #11
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by Homer_Chen View Post
Hi my friend,
I have done the things u told, installing Visual Studio 2010, changing the enviroment available and using visual studio command prompt to start fluent. But when i load the udf, it still came out the message:Opening library "E:\ex151\libudf"... Error: The UDF library you are trying to load (libudf) is not compiled for 3ddp on the current platform (win64).


系统找不到指定的文件。


E:\ex151\libudf\win64\3ddp\libudf.dll


Error: The UDF library you are trying to load (libudf) is not compiled for 3ddp on the current platform (win64).\n\n系统找不到指定的文件。
\n\nE:\ex151\libudf\win64\3ddp\libudf.dll
Error Object: #f


how can i do? Thanks for you answer.
The process goes in two steps:
1. Compile the UDF. (Click 'build'.)
2. Load the UDF.

You are showing the result of step 2, and the code in red shows that something went wrong in the compilation. So something went wrong in step 1. To know what went wrong, you have to show the result of step 1.
pakk is offline   Reply With Quote

Old   February 14, 2019, 00:59
Default
  #12
New Member
 
Aabir Das
Join Date: Oct 2017
Posts: 3
Rep Power: 9
Aabir Das is on a distinguished road
Just install ansys 18.2 version or higher, the problem will be solved. In the previous versions you have to start the fluent from the command prompt of visual studio, then UDF has to be compiled.
Aabir Das is offline   Reply With Quote

Old   February 14, 2019, 03:36
Default
  #13
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Installing the newer version can help, but does not always.
If the UDF code is wrong, then no version of Fluent can handle it.
pakk is offline   Reply With Quote

Old   February 14, 2019, 11:34
Default
  #14
New Member
 
Aabir Das
Join Date: Oct 2017
Posts: 3
Rep Power: 9
Aabir Das is on a distinguished road
If the code is wrong than nobody can help, so it's assumed that UDF code is correct.
Aabir Das is offline   Reply With Quote

Old   February 14, 2019, 12:46
Default
  #15
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
That is a very big assumption, given how many questions there are on this forum that have a problem in the code.


Other people reading your statement that don't know that there is a problem in their code might get the idea that the new version will solve their problem, but they can be disappointed.
pakk is offline   Reply With Quote

Old   November 4, 2019, 19:05
Default Environment Variables
  #16
New Member
 
dan
Join Date: Jan 2017
Posts: 24
Rep Power: 9
deenriqu is on a distinguished road
Does anyone know exactly what env vars MS studio sets up? I edited some of mine, and have to figure out which ones I am missing.
deenriqu is offline   Reply With Quote

Reply


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
udf compiling error concerning 'nmake' Violet Fluent UDF and Scheme Programming 6 October 23, 2012 07:27
Statically Compiling OpenFOAM Issues herzfeldd OpenFOAM Installation 21 January 6, 2009 10:38
what does nmake is invalid command [nmake] mean? chunying FLUENT 0 December 21, 2007 05:30
'nmake'-error when compiling an UDF Ted FLUENT 4 February 15, 2007 19:56
NMAKE COMMANDIN COMPILING svh FLUENT 2 September 30, 2004 08:12


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