接上个问题

-回复 -浏览
楼主 2018-11-07 14:56:11
举报 只看此人 收藏本贴 楼主

二.Ansys17.0安装时的安装路径尽量不要自己做,因为C盘存储空间有限,也不能放在C盘,所以安装时,只把安装路径的盘号改一下,将C改为DE

三.当使用udf时,编译自定义函数可能会出现以下错误

The UDF library you aretrying to load (libudf) is not compiled for 2d on the current platform (win64)

这是因为fluentc++的通讯出了问题,两个人(软件)说不上话,有些人说要改环境变量,其实没必要,就算改了也不一定能解决问题,毕竟我按照他们的方法没有解决。

找到上图所示的文件D:\ProgramFiles\ANSYS Inc\v170\fluent\ntbin\win64\udf.bat

这是此文件里面的程序,其中红色字体是我加到我的文件里面的。我们看这个文件里的通讯全部是与Microsoft Visual Studio通讯,所以为了修改简单,我们安装Microsoft Visual Studio不安装VC++

@echo off

rem ---

rem MS Visual C++

rem ---

set MSVC=

set MSVC_VERSION=0

 

echo trying to find MS C compiler, version140....

 

setMSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0

if exist"%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env140

 

echo trying to find MS C compiler, version120....

 

setMSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 12.0

if exist"%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env120

 

echo trying to find MS C compiler, version110....

 

setMSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 11.0

if exist"%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env110

 

 

echo trying to find MS C compiler, version100....

 

set MSVC_DEFAULT=%ProgramFiles(x86)%\MicrosoftVisual Studio 10.0

if exist"%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env100

 

echo trying to find MS Ccompiler, version 10.0....

setMSVC_DEFAULT=D:\Program Files (x86)\Microsoft Visual Studio 10.0

if exist"%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%"== "" goto msvc_env100

 

 

setMSVC_DEFAULT=D:\Program Files (x86)\Microsoft Visual Studio 10.0

if exist"%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%"== "" goto msvc_env100

 

:msvc_env100

set MSVC_VERSION=100

call"%MSVC%\VC\vcvarsall.bat" amd64

goto ms_c_end

 

echo trying to find MS C compiler, version90....

 

setMSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0

if exist"%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env90

 

set MSVC_DEFAULT=%ProgramFiles%\MicrosoftVisual Studio 9.0

if exist"%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env90

 

 

echo trying to find MS C compiler, version80....

 

set MSVC_DEFAULT=%ProgramFiles%\microsoftvisual studio 8

if exist"%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env80

 

setMSVC_DEFAULT=%ProgramFiles(x86)%\microsoft visual studio 8

if exist"%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env80

 

 

echo trying to find MS C compiler, version71....

 

set MSVC_DEFAULT=%ProgramFiles%\microsoftvisual studio .net 2003

if exist"%MSVC_DEFAULT%\vc7\bin\cl.exe" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env71

 

 

echo trying to find MS C compiler, version70....

 

set MSVC_DEFAULT=%ProgramFiles%\microsoftvisual studio .net

if exist "%MSVC_DEFAULT%\vc7\bin\cl.exe"set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env70

 

 

echo trying to find MS C compiler, version60....

 

set MSVC_DEFAULT=%ProgramFiles%\microsoftvisual studio

if exist"%MSVC_DEFAULT%\vc98\bin\cl.exe" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_env60

 

 

echo trying to find MS C compiler, SDKs....

 

setMSVC_DEFAULT=%PROGRAMFILES%\Microsoft.NET\SDK\v2.0 64bit

if exist"%MSVC_DEFAULT%\Bin\sdkvars.bat" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_sdk2.0

 

set MSVC_DEFAULT=%PROGRAMFILES%\MicrosoftSDKs\Windows\v6.1

if exist"%MSVC_DEFAULT%\Bin\SetEnv.Cmd" set MSVC=%MSVC_DEFAULT%

if not "%MSVC%" == ""goto msvc_sdk61

 

 

echo "No MSVC compiler detected!"

goto fail_end

 

:ms_c_v_warning

echo Warning: Unable to find MS C Compilerversion %MS_C_V%

goto ms_c_end

 

:msvc_env80

set MSVC_VERSION=80

call "%MSVC%\VC\vcvarsall.bat"amd64

goto ms_c_end

 

:msvc_env90

set MSVC_VERSION=90

call "%MSVC%\VC\vcvarsall.bat"amd64

goto ms_c_end

 

:msvc_env100

set MSVC_VERSION=100

call "%MSVC%\VC\vcvarsall.bat"amd64

goto ms_c_end

 

:msvc_env110

set MSVC_VERSION=110

call "%MSVC%\VC\vcvarsall.bat"x86_amd64

goto ms_c_end

 

:msvc_env120

set MSVC_VERSION=120

call "%MSVC%\VC\vcvarsall.bat"x86_amd64

goto ms_c_end

 

:msvc_env140

set MSVC_VERSION=140

call "%MSVC%\VC\vcvarsall.bat"x86_amd64

goto ms_c_end

 

:msvc_env71

set MSVC_VERSION=71

call"%VS71COMNTOOLS%\vsvars32.bat"

goto ms_c_end

 

:msvc_env60

set MSVC_VERSION=60

setpath=%MSVC%\vc98\bin;%MSVC%\common\msdev98\bin;%path%

setinclude=%MSVC%\vc98\include;%MSVC%\vc98\mfc\include;%include%

setlib=%MSVC%\vc98\lib;%MSVC%\vc98\mfc\lib;%lib%

goto ms_c_end

 

:msvc_sdk2.0

set MSVC_VERSION=SDK 2.0

call"%MSVC_DEFAULT%\Bin\sdkvars.bat"

goto ms_c_end

 

:msvc_sdk61

set MSVC_VERSION=SDK 6.1

call C:\Windows\System32\cmd.exe /E:ON/V:ON /T:0E /K "%MSVC_DEFAULT%\Bin\SetEnv.Cmd" /x64

goto ms_c_end

 

:ms_c_end

if "%MSVC%" == "" gotofail_end

 

echo Detected MSVC%MSVC_VERSION% under"%MSVC%"

echo path=%path%

echo include=%include%

echo lib=%lib%

 

:fail_end

四.安装ansys17.0,18.0的时候按照相同的方式操作,我在win7win10上分别操作安装,win10的系统明显不好用,首先fluent出现问题一所示的错误FLEXnet Licensing error:-1,359. System Error: 2 "No such file or directory",再有就是icem打不开,可能是盗版系统的原因,注意只是说可能。



我要推荐
转发到