SDK 解决FLUENT 中udf 编译问题 终极大法


        错误原因与解决方法:fluent udf在compiled时出现错误:'nmake' 不是内部或外部命令

        对比了两台主机上的环境变量 Path、 lib 以及 include 之后发现可以正常运行udf的旧的主机(A)与新的主机(B)之间的差别,发现Path等并没有太多异常,甚至A上几乎没有添加环境变量。于是采用下方案

        

        解决方案: 

        从Microsoft 官网下载 软件开发补丁: NET Framework 2.0 Software Development Kit (SDK) (x64)

        安装补丁

        从开始快捷键中 以管理员身份运行 SDK 命令行,SDK Command Prompt

        命令行中 切换至fluent 启动项位置,运行fluent

        切换fluent工作目录至case 目录,运行。

        udf 可以成功运行

        在SDK 运行代码为:

——————————————————

        随后,删除了libudf之后 以正常方式打开case之后仍然失败。

        不删除libudf,正常方式打开case之后成功。

        因此推断 在编译过程中有点问题,可能还是VS与 fluent 之间配合不好。 在编译完成之后udf即可正常运行

21.png

附上一张图片和参考方案来源

How can I manage to compile my UDF with Windows 7 64bit?

This problem sometimes looks similar to the one concerning the missing 'nmake'.

  • Install Visual Studio. Most of the time the Visual C++ 2008 Express Edition [3] is recommended. On my system it even works with the new Visual Studio 2010 Professional Release Candidate [4].

  • Set the correct environment variables. Browse your way through the Windows system control to 'System'. There you will find a section 'Advanced system settings'. In the following dialog go to the 'Advanced' tabulator and click on 'Environment variables' (lower right corner). Go through the 'System variables' list and search for the 'Path' entry. Add the following to the variable: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files\ANSYS Inc\v120\fluent\ntbin\win64. Adjust this entry to your system concerning the installation directories! The Visual Studio entry should point to the location where 'nmake' is located.

  • Install a Software Development Kit (SKD) for 64bit systems. This may be the difference between 32bit and 64bit systems. I have used the .NET Framework 2.0 Software Development Kit (SDK) (x64) from 2006[5] because it is explicitly for 64bit systems and I was not sure if more recent versions are for 64bit systems as well.

  • Start FLUENT from the SDK command prompt. Do not use the Visual Studio command prompt, use the SDK command prompt! Go to the directo是、ry your case is in and type 'fluent'.


Ansys.FluentudfANSYS流体力学及仿真有限元理论及编程

SDK 解决FLUENT 中udf 编译问题 终极大法的评论2条

  • 池中有电流
    0
    赞噢~
  • OLNYONE
    1
    老师,您上传的案例图片无法显示。要截图复制,或者直接上传图片

SDK 解决FLUENT 中udf 编译问题 终极大法的相关案例教程

1. 简介 上一篇文章提到过,编译型的UDF相较于解释型的UDF更加通用,但是使用编译型UDF之前必须进行Fluent环境配置。Fluent环境配置虽然听起来似乎很简单,但是实际上确实一个很玄学的东西。有的人可能安装Fluent之后,就已经配置好了环境,而有的人可能自己搞了几天,甚至重装软件,重装系统还是搞不好。 Fluent环境变量的配置网上介绍的很多很杂,这里我介绍几种配置环境变量的方法,不能
虽说fluent现在有了和comsol类似的表达式功能,但有些地方还是要用到UDF的(主要是别人的算例用的udf。。。) udf需要编译,编译时udf源文件需要和算例文件在一个文件夹。但在编译时,可能会出现奇怪的错误,分享一下我的踩坑经过。 1、visual c++位置不对,导致fluent编译时找不到编译器。 fluent只能用visual c++编译UDF,所以编译前需要安装visual c+
引言 Abaqus为用户提供了大量的用户子程序,用户可以通过子程序接口开发Abaqus原本不具备的单元、材料、载荷等。此外,利用子程序能帮助我们去理解、推测Abaqus的计算过程,这对国产自主软件对标Abaqus功能开发具有一定的参考意义。 一、安装Abaqus,并配置使用用户子程序 Win10(x64)成功安装VisualStudio2012+Intel Visual Fortran Compo
Fluent UDF 许多学习了一段时间Fluent的朋友们会开始接触到一个叫UDF的东东,这个东东的全称叫User Define Function,翻译成中文可以是“用户自定义功能”或“用户自定义函数”。 许多想入门UDF的朋友在学习UDF前面临的第一个问题应该是UDF环境变量设置的问题,这个问题可能已经成为新手入门UDF的一个门槛了。UDF环境变量设置现在网上百度也能搜到一些教程,这里我不操作
package 她; import java.util.*;//控制镜面输入 import java.util.Random;//随机数 public class t { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.print("please enter a firs
影响力
粉丝
内容
获赞
收藏
    项目客服
    培训客服
    3 1