资源预览内容
第1页 / 共7页
第2页 / 共7页
第3页 / 共7页
第4页 / 共7页
第5页 / 共7页
第6页 / 共7页
第7页 / 共7页
亲,该文档总共7页全部预览完了,如果喜欢就下载吧!
资源描述
ANSYS 15. 0 fluent udf环境变量的设置 初学udf,还没进入主题就被udf问题搞死了,摸索了一两天终于让我搞出了点 名堂,本人用的是 ANSYS 15.0和vc 10.0不多说,先把 ANSYS和vc者B装上, 网上有教程安装的,一步步来别跳步。最好把vc6也装一下,因为里面有的东西设置环境变量要用到。先不要打开软件。设置环境变量:1 .C:Program FilesANSYS Incv150fluentntbinwin64 目录下双击 setenv和 remenv2 .设置环境变量:INCLUDEC:Program Files (x86)Microsoft Visual Studio 10.0VCinclude;C:Program Files (x86)Microsoft SDKsWindowsv7.0AInclude;LIBC:Program Files (x86)Microsoft Visual Studio 10.0VClibamd64;C:Program Files (x86)Microsoft SDKsWindowsv7.0ALibx64;C:Program Files (x86)Microsoft Visual Studio 10.0VCatlmfclib;PATHC:Program Files (x86)Microsoft Visual Studio 10.0VCbinamd64;C:Program Files (x86)Microsoft VisualStudio 10.0Common7IDE;找个udf文件,注意udf是支持三维还是二维的,打开 fluent ,设置工作目录。如下: 接着就是编译了,不用打开case的,直接就可以 define .如果出现什么xcopy.我们找到 C:WindowsSystem32里面的xcopy复制到C:Program Files (x86)Microsoft Visual Studio 10.0VCbin;C:Program Files (x86)Microsoft Visual Studio 10.0VCbinamd64;如果出现size t ”重定义;不同的基类型,可能是你的udf文件有问题。如果实在不行,按照下面的环境变量重新设置一下,重启电脑。INCLUDE C:Program Files (x86)Microsoft Visual Studio 10.0VCinclude;C:Program Files (x86)Microsoft SDKsWindowsv7.0AInclude;LIB C:Program Files (x86)Microsoft Visual Studio 10.0VClibamd64;C:Program Files (x86)Microsoft SDKsWindowsv7.0ALibx64; C:Program Files (x86)Microsoft Visual Studio 10.0VCatlmfclib;PATH C:Program Files (x86)Microsoft Visual Studio 10.0VCbin;C:Program Files (x86)Microsoft Visual Studio 10.0VCbinamd64;C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDE;C:Program Files (x86)Microsoft Visual Studio 10.0Common7Tools;c:program filesansys incv150fluentntbinwin64 4 1 Problem with nmake?According to the manual, I wrote a C code, saved it in my working folder, added it, clicked Build. and then I saw this:1 file(s) copied.(chdir example)()(chdir win642d)()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.4.2 Solution to the nmake problemWithout any detail, the problem is caused because nmake.exe cannot be found. The solution is to start Fluent from the x64 version of the Visual Studio 2013 Command Prompt:1. Open the? Start screen ?(press Windows button on your keyboard)2. Type Visual Studio Tools , click the folder.3. In the folder click and start VS2013 x64 Cross Tools Command Prompt4. Navigate to your working folder, i.e. the folder where your case and data files are (.cas & .dat).6. Make sure that on the Environment tab Setup Compilation Environment for UDF is ticked. The default address is fine.Starting Fluent this way should solve the nmake problem and the compilation message should look like this:1 file(s) copied.(chdir exex)()(chdir win642d)()# Generating ud_io1.hvelocity_profile.c# Generating udf_names.c because of makefile velocity_profile.objudf_names.c# Linking libudf.dll because of makefile user_nt.udf udf_names.obj velocity_profile.objCopyright (C) Microsoft Corporation. All rights reserved.Creating library libudf.lib and object libudf.expDone.5.1 Problem with x64 systemIn case you do not have Microsoft Visual Studio 2013 Express then likely you tried starting Fluent from the Visual Studio Command Prompt (2010) or any other previous version of VScommand prompt. It is likely that you encountered a problem when clicking Load, specifically thisone:The UDF library you are trying to load (libudf) is not compiled for 2d on the curent platform (win64).The system cannot find the file specified.X:libudfwin642dlibudf.dllThe reason of this error is that previous versions of Visual Studio are 32bit and do not work with your x64 version of Fluent. You probably googled the problem and found advice to start Fluent from the command promt of the SDK (Software Development Kit) 7.0/7.1 instead, or from the command prompt of the .NET Framework. Unfortunately, as Microsoft states on their website at the? Windows SDK 8.1 download page:The Windows SDK no longer ships with a complete command-line build environment. You must install a compiler and build environment separately. If you require a complete development environment that includes compilers and a build environment, you can download Visual Studio 2013, which includes the appropriate components of the Windows SDK.Older versions of the .NET Framework and SDK do not seem to work properly on Windows 8.1(citation needed , just my experience? 3 ?). I also found out that with a working x64 SDK installed you can start the simple windows command prompt (cmd.exe) with the proper environmental variables using a cmd.exe /k command, which I failed to get to work.5.2 Solution to the problem of x64 systemThe solution to this is to start Fluent from t
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号