用VC_研發(fā)基于FLUENT的高壓氣淬過(guò)程數(shù)值模擬軟件_英文__圖文_第1頁(yè)
用VC_研發(fā)基于FLUENT的高壓氣淬過(guò)程數(shù)值模擬軟件_英文__圖文_第2頁(yè)
用VC_研發(fā)基于FLUENT的高壓氣淬過(guò)程數(shù)值模擬軟件_英文__圖文_第3頁(yè)
用VC_研發(fā)基于FLUENT的高壓氣淬過(guò)程數(shù)值模擬軟件_英文__圖文_第4頁(yè)
用VC_研發(fā)基于FLUENT的高壓氣淬過(guò)程數(shù)值模擬軟件_英文__圖文_第5頁(yè)
已閱讀5頁(yè),還剩10頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、第 10卷 第 15期 2010年 5月 167121815(2010 1523772206科 學(xué) 技 術(shù) 與 工 程Science Technol ogy and Engineering Vol 110 No 115 M ay 2010 2010 Sci 1Tech 1Engng 1用 VC+研發(fā)基于 F LUENT 的高壓氣淬過(guò)程數(shù)值模擬軟件胡祥敏 黃 鵬1, 2(廣東科學(xué)技術(shù)職業(yè)學(xué)院 , 珠海 519090; 華南理工大學(xué)機(jī)械工程學(xué)院 1, 廣州 510641; 肇慶學(xué)院機(jī)械工程學(xué)院 2, 肇慶 526061摘 要 分析了 F LUE NT 的用戶(hù)自定義函數(shù) (UDF 的編譯過(guò)程 , 提

2、出了一種在集成開(kāi)發(fā)環(huán)境中編寫(xiě)和編譯 UDF 的方法 。討 論了用面向?qū)ο蠓椒?(OO 編寫(xiě) UDF 的優(yōu)勢(shì)和可能性 , 提出了通過(guò)修改 VC 開(kāi)發(fā)環(huán)境選項(xiàng)和在程序中增加宏來(lái)實(shí)現(xiàn) OO 開(kāi)發(fā) 。 用 OO 法編程 , 用戶(hù)可以使用 M FC 及其它的庫(kù)比如 Object A RX 來(lái)加快開(kāi)發(fā)過(guò)程 , 并降低開(kāi)發(fā)難度 ?;谝陨戏椒ㄩ_(kāi)發(fā)了高壓 氣淬過(guò)程的數(shù)值模擬軟件 , F LUE NT 用于計(jì)算氣體流場(chǎng)和溫度場(chǎng) , 以及金屬溫度場(chǎng) , 有限元軟件 被 F LUE NT 調(diào)用 , 用于 計(jì)算金屬內(nèi)部的應(yīng)力和應(yīng)變 。關(guān)鍵詞 數(shù)值模擬 F LUE NT 二次開(kāi)發(fā) 高壓氣淬 中圖法分類(lèi)號(hào) TP391.

3、75; 文獻(xiàn)標(biāo)志碼 A2010年 3月 8日收到 F LUENT is one 2ume Method (F VM nu si m ulati on s oft 2ware, which has been widely used t o si m ulate the p r ocesses of constant and inconstant fl ow, comp ressible and unco mp ressible fl ow, evaporati on, and combus 2ti on . The s oft w are was written with C language,

4、 and a Secondary Devel opment I nterface (S D I of C language was p resented, which is used t o define material p r oper 2ties and boundary conditi ons, read and edit cell coordi 2nates and variables related t o fields .App licati onscopes are extended and the accuracy of calculati on is i m p r ove

5、d because of the UDF . Because F LUENT Cor 2porati on has not p resented an integrated s oft w are devel 2op ing t oolkits f or writing and editing UDFs, users can only write and edit UDFs in s oft w are such as a notepad and then comp ile the p r ogra m s at cons ole or DOS envi 2r onment, which ma

6、ke it very difficult t o edit p r ogra m s and t o find err ors . And t oday, C language has already ev olved t o C+language . One benefit of writing C+p r ogra m s is that object oriented method can be usedrefs . 1, 2, which can si m p lify the p r ocesses of p r o 2gra mm ing . Another benefit is

7、that s ome libraries like MFC and Object A RX can be used in p r ogra m s s o that the devel op ing p r ocesses can be much easier . It is ex 2pected t o write and comp ile C+OO F LUENT UDF in M icr os oft VC+I D E and devel op a high p ressure gas quenching syste m in this study .1 Ana lysis of Co

8、m p ili n g Processes of FL U 2ENT UD Fs F LUE NT p r ovides the comp iling envir on ment of UDFs, and its comp iling p r ocesses are as f oll ows:writ 2ing C style UDFs in word -editing s oft w are like note 2pad, and then calling a comp iling command in F LU 2ENT . The command p r oduces a file na

9、 med “ user _na me . c ” and the file is na med “ makefile ” . Every ele 2ment of an array of udf_datain “ user_name . c ” points t o a user functi on . The file na med “ makefile ” is a de 2scri p ti on file . Searching paths of header and libraryfiles,static libraries used in comp iling,and the p

10、r ocesses of comp iling are all described in this file . U 2sing the “ makefile ” as a para meter, F LUENT calls the C comp iler, and then a Dyna m ical L inking L ibrary (DLL is p r oduced 3. W hen the DLL is l oaded, F LUE NT gets the udf_dataarray and then gets all user 2 defined functi ons for u

11、sing .Foll owing the above p r ocesses, p r ogra mmers can write and co mp ile F LUENT UDFs in a s oft w are I nte 2 grated Devel opment Envir onment (I D E . I n I D E, comp iling op ti ons should be changed manually accord 2 ing t o the above descri p ti ons, which is not easy f or most of users .

12、2 Co mpili n g F L UENT U DFs i n VC+I DEW riting and co mp iling p r ogra m I D E many advantages . U like Object A RX t o write O p r ogra m s ben 2 efits writing large p r ogra m s and si m p lifying the p r ogra m 2 m ing p r ocesses . Thr ough this way, the user can input data t o the running p

13、 r ogra m s thr ough dial og windows . When pr ogra mm ing in VC+I D E, s o me pr oble m s should be considered . First, many C style functi ons pr ovided by F LUE NT Cor porati on should be used in the ne w syste m. They must be recognized by the VC+co mpiler . Second, UDFs and the udf_dataarray sh

14、ould be ex ported accord 2 ing t o C style . T o s olve these p r oble m s, a macr o na med “ extern “ C ” should be added t o the beginning of C + files .The step s of writing UDFs in VC +I D E can be described as f oll ows . First, running VC +I D E s oft 2 ware and selecting appwizard (dll , and

15、then getting a dll p r oject . Second, editing the I D E comp iler op ti ons, and including p r oject “ including paths ” and “ static li 2 braries paths ” . Third, adding correct F LUE NT static libraries t o the p r oject op ti ons dial og . Fourth, adding functi ons . cpp file t o the p r oject .

16、 UDFs will be written in the file . Fifth, writing correct user_name . cpp file and adding it t o the p r oject .The f or mat of C+files is as foll ows:#include“ stdafx . h ”extern “ C ” #include“ udf . h ”/userdefine functi onsThe above p r ocess can be done manually, and can als o be done by s oft

17、 w are 4s o that p r ogra mmers can concentrate on making UDFs .3 D evelop i n g S i m Software for H i gh Syste m by V C +Compared with quenching p r ocesses by water or oil, high p ressure gas quenching by nitr ogen or heliu m has advantages of unif or m heat transference, reducti on of part defor

18、 mati on, and no oxidati on . H igh p ressure gas quenching p r ocesses are widely used in mould in 2 dustry . Numerical si m ulati on of fl ow field and te mpera 2 ture field in quenched metal by F LUENT, and si m ula 2 ti on of stress field and strain field in metal by Finite Ele mentMethod (FE M

19、are vital t o testify the feasibil 2 ity of quenching p r ocesses, t o op ti m ize the p r ocesses, and t o op ti m ize the design of quenching st oves .For si m ulating fl ow field and te mperature field of high p ressure gas quenching, inlet gas vel ocity and temperature, and outlet p ressure can

20、be regarded as boundary conditi ons . I nlet gas vel ocity was p r ovided by the st ove manufacturer, and inlet gas te mperature was measured by the real 2ti m e method . The pur poses of UDFs in this syste m are t o realize the foll owing p r oces 2 ses:First, changing inlet te mperature and outlet

21、 back 2 fl ow te mperature . Second, modifying material p r oper 2 ties . Third, calculating the metal s olid phase change and the heat p r oduced by the change . Fourth, calcu 2 lating the radiati on energy . Fifth, creating dial ogs,which are used t o input data t o Fluent by the real 2ti m e meth

22、od . Sixth, at the end of every ti m e step, extrac 2 ting cells te mperature, and then calculating and out 2 putting nodes te mperature according t o the require 2 ments of FE M s oft w are, s o that the stress and strain of the metal can be calculated by FE M s oft w are .Because F LUE NT and FE M

23、 s oft w are use different grid syste m s, and F LUE NT out puts cells te mperature but FE M needs nodes te mperature, it is necessary t o inter polate FE M node te mperature by F LUENT cells te mperature, and it is als o necessary t o judge which F LUE NT cell every FE M node is in, and t o calcula

24、te the vect or fr om the cell center t o the node . I f the sum of volume of all the entities f or med by the FE M and F LUE NT cell surfaces t the ume of the cell, then . O ther 2 wise, the node is the cells in F LU 2 ENT have not been refined, the area and nor mal vec 2 t ors of all surface can be

25、 got by F LUENT macr os, but after grids have been refined, they cannot be got cor 2 rectly, excep t for nodes coordinates . So it is the p r o 2 gra mmer s duty t o judge how many points are on a p lane and the area of the p lane .For a tetrahedr on, three nodes are on a p lane . T o judge if a poi

26、nt is in the tetrahedr on, it is necessary t o get the sum of f our tetrahedr on volu me f or med by the point and three points of the tetrahedr ons, and the v ol 2 ume of the tetrahedr on . I f they are equal, the point is in the tetrahedr on . O ther wise, the point is outside the tetrahedr on .Fo

27、r a pyra m id, a vertex and a bott om should first be recognized . The characteristic of a bott om is that four points are on a p lane . Random ly select three points of four considered points, and build t w o p lanes, then calculate the nor mal vect ors of the t w o p lanes . I f the t w o vect ors

28、 are on the sa me directi on, then the f our points are on a p lane . This p r ocess can be p r ogra mmed by the user, and the user can als o use Object A RX p r o 2 vided by Aut odesk Cor porati on, s o that the p r ocess can be si m p lified .For a hexahedr on, a four point bott om and a f our poi

29、nt t op surface should first be recognized . The char 2 acteristic of a bott om is that f our points are on a p lane . The other four points are on the sa me side of the p lane . W hen the bott om and the t op surface have been recog 2 nized, the user can calculate the nor mal vect ors of the t w o

30、p lanes . I f the directi ons of the t w o p lanes are op 2 posite, the user can adjust sequences of the points on one p s o are on the sa me direc 2 . the f the t op surface s o that surface and those on the bott om ponding . W hen the hexahedr on has been rec 2 ognized, it is easy t o judge if a p

31、oint is in the Entity according t o the method menti oned bef ore .A si m p le method t o calculate the relati onshi p of F LUE NT cells and FE M nodes is t o judge if a FE M point is in a certain cell one by one . I n fact, this is a ti m e 2consu m ing method and the ti m e 2comp lexity is O (n ,

32、of which the n is the di m ensi on of the cells . One i m p r oved method is t o compare the distances fr om the point t o the cell centers one by one . Then, choo 2 sing the first m ini m al distance cells and judge whether the points are in those cells . The comp lexity of this method is O (n , t

33、oo . Because it just costs a little ti m e t o judge whether a point is in the cells, the i m 2 p r oved method is a ti m e 2saving method . Another i m 2 p r oved method uses a m ini 2stack data structure . The comp licity of the method is just half of the t w o methods menti oned before .The runni

34、ng of the s oft w are can be described as foll o ws:when the s oft w are starts, it calls initialized functi ons . The first ai m of the functi ons is t o extract F LUE NT cells and corres ponding nodes coordinates . The second ai m is t o l oad FEPG FE M node messagefiles and extract nodes . The th

35、ird ai m is t o judge which cell each node is in one by one and get the vect or fr om the cell centre t o the FEPG node . W hen a ti m e step is over, the te mperature of the nodes can be inter polated by cells te mperature and te mperature grads and the vect ors, and then a F ORT RAN binary file ou

36、t puts . Then Calling FEPG FE M Fortran or C p r ogra m s and calculating the stress and strain filed in the metal . Fi 2nally, calculate the p r oble m s of the next ti m e step, un 2til the ti m e is over .The hierarchy structure of user defined classes can be exp ressed as f oll ows fig . 1Fig .

37、1 H ierarchy structure of user defined classesSome i m portant classes:Class HEntityPublic:static AcGePoint3d original _point; /AcGePoint3d is definedby Object A RX AcGePoint3dA rray points; /pointsof the entity bool operat or <(HEntity&en ; /comparingthe distance fr omentity en t o the origi

38、nal_pointand the distance fr om this entity t o the original_point. virtual bool isPointI n It (AcGePoint3d&po =0; /virtualfunc 2ti on, t o judge if po is int o the entity . double distanceTo (AcGePoint3d &p ; /calculatingthe distancefor m p t o the center of the entity virtual AcGePoint3d c

39、enter ( ; /calculatingthe center of thecell . int cell_id;/I D of a F LUENT cell Class HPlaneEntity:public HEntityPublic: virtual double get A rea ( ; /calculatingthe area of a p lane entity virtual bool isPointI n It (AcGePoint3d&po =0; / virtual nor malize ( ; /arrangingthe points of the entit

40、ypoints sequential Triangle and quadrangle are inherited fr om HEntity, and the decla 2rati ons of the t w o classes are the sa me as HEntity . Class HBodyEntity:public HEntityPublic: virtual bool isPointI n It (AcGePoint3d& ; virtual void nor malize ( ; virtual double volume ( ; /calculatingthe

41、 volume of the 3D enti 2ty . Tetrahedr on, pyra m id and hexahedr on are all in 2herited fr om HBodyEntity, the declarati ons of the three are .A high p ressure gas quenching st ove (model VG Q150 was studied as an exa mp le . The inner di m en 2si on of the st ove is 1200×1320mm 2. The dia met

42、erof the 96sy mmetrical distributed inlet is 22mm. The vel ocity of the inlet gas p r ovided by the st ove manufac 2ture is 35m /s . The inlet gas te mperature was measured by a real 2ti m e method . The p ressure in the st ove was four bars . The dra wing of the st ove is sho wn in fig . 2.The fl o

43、w field distributi on in the st ove was shown in fig . 3. The te mperature field was shown in fig . 4. The calcu 2lated and experi m ental te mperature hist ory was shown in fig . 5. The te mperature of FEPG nodes is written in a file . After opening it in FEPG, the te mperature filed is sho wn in fig . 6. This exa mp le de mons

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論