Ansys workbench如何與isight聯(lián)合優(yōu)化分析?

2016-08-22  by:CAE仿真在線  來(lái)源:互聯(lián)網(wǎng)

ANSYS Workbench 組件

Ansys組件容許Isight與ANSYS Workbench軟件交互。

關(guān)于ANSYS Workbench組件

ANSYSWorkbench組件運(yùn)行Isight與ANSYS Workbench軟件進(jìn)行數(shù)據(jù)交換,并且可以驅(qū)動(dòng)ANSYS Workbench仿真模擬。ANSYS Workbench組件是一個(gè)應(yīng)用程序組件,創(chuàng)建了Isight與ANSYS Workbench軟件的鏈接。該組件可以讀取一個(gè)ANSYS Workbench項(xiàng)目文件并生成一個(gè)輸入和輸出參數(shù)列表,在ANSYS Workbench組件編輯器可以修改輸入?yún)?shù)的值。該組件允許執(zhí)行各種類型的分析(如流體流動(dòng)、靜態(tài)的結(jié)構(gòu)分析等等),以及與其他解算器結(jié)構(gòu)在一起(如Fluent等)。該組件還允許提供定制Python腳本檢索和更新參數(shù)??梢允褂肐sight流程組件(如DOE和Optimization)探索設(shè)計(jì)空間,并優(yōu)化模型。

下圖顯示了ANSYS Workbench組件編輯頁(yè)面:

圖1. ANSYS Workbench組件編輯頁(yè)面

開始ANSYS Workbench組件編輯器,雙擊ANSYS Workbench組件圖標(biāo),當(dāng)完成ANSYS Workbench組件編輯器配置后,點(diǎn)擊OK關(guān)閉編輯器。

ANSYS Workbench支持的版本

該組件支持ANSYS Workbench軟件的12.1和13.0版本。

前提條件

必須滿足前提條件才能運(yùn)行ANSYS Workbench組件。在使用ANSYS Workbench組件之前,必須執(zhí)行以下操作:1.必須在計(jì)算機(jī)上安裝了ANSYSWorkbench12.1和13.0版本軟件;2.必須有一個(gè)ANSYSWorkbench可執(zhí)行文件的環(huán)境變量,Name為:ANSYS_WB_EXE_PATH;值為:ANSYS Workbench執(zhí)行路徑。例如:D:\ANSYSInc\v121\Framework\bin\Win32\RunWB2.exe。3.當(dāng)首次使用該組件,運(yùn)行install.bat文件,該文件在<Isightinstallation directory>\intel_a\reffiles\SMAFIPcomponent\AnsysWorkbench目錄中。

配置ANSYS Workbench組件

接下來(lái)詳述如何配置ANSYS Workbench組件執(zhí)行ANSYS Workbench模擬。在這里可以選擇將被用于Isight模型的輸入和輸出參數(shù),設(shè)置設(shè)計(jì)選項(xiàng)和執(zhí)行選項(xiàng),并查看相關(guān)組件的信息。

選擇ANSYS Workbench Project和Parameters

可以選擇一個(gè)ANSYS Workbench項(xiàng)目文件,組件對(duì)該文件進(jìn)行掃描,并顯示可用的參數(shù)。然后,可以選擇想要在Isight模型中使用的參數(shù)。

1.雙擊ANSYS Workbench組件圖標(biāo),將彈出ANSYS Workbench Component Editor頁(yè)面。

2.從ANSYS Workbench Component Editor頁(yè)面,單擊選擇Parameters標(biāo)簽。

3.單擊Browse。

4.導(dǎo)航到你想要使用的ANSYS Workbench項(xiàng)目文件(.wbpj格式),并單擊打開。如果你想要使用自定義Python腳本,在選擇項(xiàng)目文件之前,從Advanced選項(xiàng)卡選擇Use Custom Script。

一個(gè)ANSYS Workbench項(xiàng)目的存檔文件(.zwp格式)及其支持的文件將被創(chuàng)建在之前選擇的項(xiàng)目文件(.wbpj格式)所在目錄中。如果雙擊.zwp格式文件,將創(chuàng)建一個(gè)臨時(shí)目錄zwpContents,在其中提取.zwp文件內(nèi)容。選中的ANSYS Workbench項(xiàng)目將被啟動(dòng)。

注:如果使用的是幾何進(jìn)口,該幾何進(jìn)口文件的副本將被添加到子目錄ImportedFilesByAnsys,子目錄將被創(chuàng)建在與項(xiàng)目文件(.wbpj)相同的目錄中。

ANSYS Workbench項(xiàng)目中的參數(shù)將被顯示在Available Parameters區(qū)域。為了保證Isight模型能夠使用這些參數(shù),需要將它們添加到Isight Parameters區(qū)域。

5.如果參數(shù)很多,在Isight中可以通過(guò)下列方式對(duì)參數(shù)進(jìn)行分類和篩選。

a)通過(guò)點(diǎn)擊相應(yīng)的列標(biāo)題類的參數(shù)。

第一次單擊列數(shù)據(jù)按升序排列,第二次單擊列數(shù)據(jù)按降序排序,第三次單擊列數(shù)據(jù)恢復(fù)初始排列順序,列標(biāo)題右邊的小箭頭圖標(biāo)顯示當(dāng)前排序選項(xiàng)。

b)通過(guò)Mode或者Type模式。

c)在篩選框中輸入?yún)?shù)名稱,可查看參數(shù)的某些信息。

6.通過(guò)下列方式選擇你想要在Isight模型中使用的參數(shù)。

選項(xiàng)

描述

單擊check box

選擇一個(gè)單獨(dú)的參數(shù)

單擊

選擇所有參數(shù)

單擊

清除所有被選參數(shù)

7.向Isight Parameter區(qū)域添加選中的參數(shù)

a)單擊"+",向Isight Parameter區(qū)域中添加選中的參數(shù);

b)單擊"-",從Isight Parameter區(qū)域中移除選中的參數(shù)

8.單擊OK保存設(shè)置,并返回Design Gateway界面。

配置Design和Execution選項(xiàng)

可以使用Advanced標(biāo)簽來(lái)設(shè)置設(shè)計(jì)和執(zhí)行選項(xiàng)

1.雙擊ANSYS Workbench組件圖標(biāo),將彈出ANSYS Workbench Component Editor頁(yè)面。

2.從ANSYS Workbench Component Editor頁(yè)面,單擊選擇Advanced標(biāo)簽。

3.設(shè)置Design Options項(xiàng):

選項(xiàng)

描述

Create in model file paremeters

在Isight模型(.zmf)中保存輸入文件

Use Custom Script

通過(guò)組件使用自定義Python腳本定制組件的輸入和輸出,這些Python腳本文件應(yīng)該放置在工作目錄下,與.wbpj文件同一個(gè)目錄中。在選擇輸入項(xiàng)目文件之前必須要選擇該選項(xiàng)。

4.設(shè)置Execution Options:

選項(xiàng)

描述

Show ANSYS Workbench during execution

啟動(dòng)ANSYS Workbench作為前臺(tái)進(jìn)程,可以查看在ANSYS Workbench模型執(zhí)行期間發(fā)生的變換

Time Out

輸入一個(gè)值(以秒為單位)來(lái)指定等待執(zhí)行的時(shí)間,超出該時(shí)間則確定執(zhí)行失敗,默認(rèn)為300秒

5.單擊OK保存設(shè)置,并返回Design Gataway。

關(guān)于使用腳本

組件允許你提供定制的Python腳本檢索和更新組件參數(shù)。如果你選擇Use Custom Script標(biāo)簽,則ANSYS Workbench組件執(zhí)行兩個(gè)特定用戶提供Python模塊。這些模塊的名稱必須是userscript_dt.py(設(shè)計(jì)界面腳本)和userscript_rt.py(運(yùn)行腳本)??梢允褂眠@些腳本執(zhí)行ANSYS Workbench組件不支持,但是必須的參數(shù)類型的操作。

可以定義一個(gè)或兩個(gè)這種模塊,也可以兩個(gè)都不定義。組件執(zhí)行完designtime模塊(userscript_dt.py)之后打開ANSYS Workbench項(xiàng)目文件,在runtime模塊(userscript_rt.py)特定功能運(yùn)行之前和之后,執(zhí)行更新ANSYS Workbench項(xiàng)目。

Designtime腳本(userscript_dt.py)示例

import os

def runUserScript(projPath):

"""

Before this function is called, the ANSYS Workbench project is already

open and the user should not reopen or close it.

This function gets called after fetching the PIDO parameters.

This function will accept a single parameter containing the path of the

user's work directory where the .wbpj file is located.

This function is required to create two text files, user_input_params.txt

&

user_output_params.txt, in the user's work directory. As the name suggests,

these two files must contain custom input & output parameter name-value

pairs

separated by "::". Each pair should be written on a separate line.

In the following code we are creating two dummy parameters - inputParam1 &

outputParam1.

Note: The decimal point character should be ".", irrespective of the locale.

"""

with open(projPath + os.path.sep + "user_input_params.txt", "w") as

inputFile:

inputFile.write("inputParam1::1.2")

with open(projPath + os.path.sep + "user_output_params.txt", "w") as

outputFile:

outputFile.write("outputParam1::2.3")

Runtime腳本(userscript_rt.py)示例:

import os

def runSetUserValues(projPath, custInputParamsDict):

"""

Before this function is called, the ANSYS Workbench project is already

open and the user should not reopen or close it.

This function accepts two parameters.

1. projPath -> It contains the runtime directory path where the .wbpj

file gets copied.

2. custInputParamsDict -> It is a Python dictionary object, and it

contains the updated custom input param name-value pairs.

273

In this function, the user needs to update the values for the custom

input parameters of the ANSYS Workbench project, located at the provided

projPath to get the updated values of the custom output parameters.

Below is an example of how to get the custom input parameters created

by the user.

"""

if (custInputParamsDict.__len__() > 0):

for k, v in custInputParamsDict.iteritems():

# You should write code here to update value of parameter

# 'k' in ANSYS Workbench model with a new value 'v'

def runUserScript(projPath):

"""

This function gets called after solving the ANSYS Workbench project.

It accepts a single parameter containing the user's runtime directory

path where the .wbpj file gets copied.

From this function, the user should fetch the custom output parameters

from the ANSYS Workbench project, and they should be written in a text

file (user_output_params.txt) with name and value separated by "::".

Each parameter is written on a separate line, as shown in the following

code.

Note: The decimal point character should be ".", irrespective of the

locale.

"""

with open(projPath + os.path.sep + "user_output_params.txt", "w") as

outputFile:

outputFile.write("outputParam1::2.4")

查看關(guān)于ANSYS Workbench組件的信息

1.雙擊ANSYS Workbench組件圖標(biāo),將彈出ANSYS Workbench Component Editor頁(yè)面。

2.從ANSYS Workbench Component Editor頁(yè)面,單擊選擇About標(biāo)簽。About標(biāo)簽提供關(guān)于組件的信息,如版本和描述等。

3.單擊More查看診斷信息。


開放分享:優(yōu)質(zhì)有限元技術(shù)文章,助你自學(xué)成才

相關(guān)標(biāo)簽搜索:Ansys workbench如何與isight聯(lián)合優(yōu)化分析? Ansys與isight聯(lián)合優(yōu)化分析 ansys isight Ansys有限元培訓(xùn) Ansys workbench培訓(xùn) ansys視頻教程 ansys workbench教程 ansys APDL經(jīng)典教程 ansys資料下載 ansys技術(shù)咨詢 ansys基礎(chǔ)知識(shí) ansys代做 Fluent、CFX流體分析 

編輯
在線報(bào)名:
  • 客服在線請(qǐng)直接聯(lián)系我們的客服,您也可以通過(guò)下面的方式進(jìn)行在線報(bào)名,我們會(huì)及時(shí)給您回復(fù)電話,謝謝!
驗(yàn)證碼

全國(guó)服務(wù)熱線

1358-032-9919

廣州公司:
廣州市環(huán)市中路306號(hào)金鷹大廈3800
電話:13580329919
          135-8032-9919
培訓(xùn)QQ咨詢:點(diǎn)擊咨詢 點(diǎn)擊咨詢
項(xiàng)目QQ咨詢:點(diǎn)擊咨詢
email:kf@1cae.com