fluent udf uds线下培训udf02-udf-sinu_第1页
fluent udf uds线下培训udf02-udf-sinu_第2页
fluent udf uds线下培训udf02-udf-sinu_第3页
fluent udf uds线下培训udf02-udf-sinu_第4页
fluent udf uds线下培训udf02-udf-sinu_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Sinusoidal Wall Temperature Variation1. IntroductionThis tutorial examines fluid flow through a two dimensional channel, where one wall of the channel has user-defined temperature profile applied to it. The purpose of this tutorial is to demonstrate the ability of ANSYS Fluent to use user-defined fu

2、nctions (UDFs) to specify a position-dependent variable on the wall boundary condition.This tutorial demonstrates how to do the following:Interpret the UDF.Use UDF for specifying the profiles on boundaries.Postprocess the resulting data.2.PrerequisitesThis tutorial is written with the assumption tha

3、t you have completed Tutorial 1 from ANSYS Fluent Tu- torial Guide, and that you are familiar with the ANSYS Fluent navigation pane and menu structure. Some steps in the setup and solution procedure will not be shown explicitly.For more details about user-defined functions (UDF) refer to the ANSYS F

4、luent UDF Manual.3. Problem DescriptionThe problem considered in this tutorial is shown schematically in Figure 1: Problem Schematic (p. 2).Air at 300 K enters a 2D channel which has an insulated upper wall and a heated lower wall. The tem-perature on the lower wall varies sinusoidally with x-positi

5、on according to:The calculation will be performed assuming steady state, incompressible, and laminar flow in thechannel.Release 15.0 - SASIP,Inc. All rights reserved.- Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.1Sinusoidal Wall Temperature Va

6、riationFigure 1:Problem Schematic4. Preparation1.Copy the files (channel.msh.gz and wallprof.c) to the working folder.2. Use Fluent Launcher to start the 2D version of ANSYS Fluent.3. Enable Double-Precision in the Options list.4. Click the UDF Compiler tab and ensure that the Setup Compilation Envi

7、ronment for UDF is enabled.NoteThe path to the .bat fie which is required to compile the UDF will be displayed as soonas you enable Setup Compilation Environment for UDF.If the UDF Compiler tab does not appear in the Fluent Launcher dialog box by default, click the Show More Options button to view t

8、he additional settings.5. Setup and Solution5.1. MeshRead the mesh file (channel.msh.gz).File Read Mesh.NoteAs the mesh file is read, ANSYS Fluent will report the progress in the console.Release 15.0 - SASIP,Inc. All rights reserved.- Contains proprietary and confidential information of ANSYS, Inc.

9、and its subsidiaries and affiliates.2Setup and SolutionFigure 2:Mesh Display5.2. GeneralSettings1.Retain the default solver settings.General2.Check the mesh.General CheckNoteANSYS Fluent will perform various checks on the mesh and will report the progress inthe console. Ensure that the reported mini

10、mum volume is a positive number.5.3. ModelsEnable energy equation.Models Energy Edit.NoteYou will use the default fluid properties of air for this problem. Hence, you need not makeany changes to the material properties.Release 15.0 - SASIP,Inc. All rights reserved.- Contains proprietary and confiden

11、tial information of ANSYS, Inc. and its subsidiaries and affiliates.3Sinusoidal Wall Temperature Variation5.4. User-Defined FunctionsNoteThe UDF can be compiled as well as interpreted. In this tutorial, you will use the interpretedoption.Interpret the UDF.Define User-Defined Functions Interpreted.1.

12、Click on the Browse. button.2. Select the source file (wallprof.c) in the Select File dialog box.3. Specify the C preprocessor to be used in the CPP Command Name field.NoteIf you want to use the C preprocessor that ANSYS Fluent. has supplied, you can enablethe Use Contributed CPP option.4.Retain the

13、 default value of 10000 for Stack Size.NoteThe Stack Size should be 10000 unless the number of local variables in your function causes the stack to overflow. Its value should be set to a number that is greater than the number of local variables used.5.Click Interpret and close the Interpreted UDFs d

14、ialog box.5.5. Boundary Conditions1.Set the boundary conditions for wall-1.Release 15.0 - SASIP,Inc. All rights reserved.- Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.4Setup and SolutionBoundary Conditions wall-1 Edit.Click the Thermal tab and

15、 select Temperature from the Thermal Conditions list.Select udf temperature_profile from the Temperature drop-down list.a.b.c.Retain the default values for the other parameters.Click OK to close the Wall dialog box.d.2.Set the boundary conditions for velocity-inlet-1.Boundary Conditions velocity-inl

16、et-1 Edit.Release 15.0 - SASIP,Inc. All rights reserved.- Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.5Sinusoidal Wall Temperature Variationa. Select Components from the Velocity Specification Method drop-down list.b. Enter 1 m/sfor X-Velocity

17、.c. Click OK to close the Velocity Inlet dialog box.5.6. SolutionChange the Absolute Criteria for continuity to 0.0001.1.Monitors Residuals Edit.2.Initialize the solution.Release 15.0 - SASIP,Inc. All rights reserved.- Contains proprietary and confidential information of ANSYS, Inc. and its subsidia

18、ries and affiliates.6Setup and SolutionSolution Initialization InitializeNoteHybrid Initialization is the default Initialization Method in ANSYS Fluent. Refer to the section 28.11 Hybrid Initialization, in the ANSYS Fluent Users Guide.Save the initial case file (channel.cas.gz).File Write Case.3.4.S

19、tart the calculation for 100 iterations.Run Calculation CalculateNoteThe solution converges in approximately 47 iterations.Figure 3:Scaled ResidualsSave the data file (channel.dat.gz).File Write Data.5.5.7. PostprocessingDisplay the filled contours of static temperature.Graphics and Animations Conto

20、urs Set Up.Release 15.0 - SASIP,Inc. All rights reserved.- Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.7Sinusoidal Wall Temperature Variation1.Enable Filled in the Options list.2.Select Temperature. and Static Temperature from Contours of drop

21、-down list.3.Click Display (Figure 4: Contours of Static Temperature (p. 8) and close the Contours dialog box.Figure 4:Contoursof Static Temperature5.8. AppendixThe contents of the UDF source code are as follows:/*/*/* User-Defined Functions for sinusoidal temperature profile/*/*/*/*/include udf.h #

22、define PI 3.141592654DEFINE_PROFILE(temperature_profile, thread, position)real r3; /* this will hold the position vector */ real x;face_t f;if (!Data_Valid_P() return;begin_f_loop(f, thread)F_CENTROID(r,f,thread); x = r0;F_PROFILE(f, thread, position) = 300.+100.*sin(PI*x/0.005);end_f_loop(f, thread

23、)Release 15.0 - SASIP,Inc. All rights reserved.- Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.8Setup and Solution5.9.ResultsThe contour plot in Figure 4: Contours of Static Temperature (p. 8) shows that the temperature on the wall and in the fluid reaches a peak at the center of the channel due to the peak in the prescribed wall temperature.5.10. SummaryThis tutorial demonstrated the use of UDF for specifying p

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论