FLUENT udf中文资料ch4(3)

2019-04-17 15:28

they are used to define, and the panel where they are activated in FLUENT. Definitions of each DEFINE macro are listed in the udf.h header file. For your convenience, the definitions are also provided in Appendix A.

? ? ? ? ? ? ? ? ? ? ? ? ? ?

DEFINE_DELTAT (Section 4.3.1)

DEFINE_DIFFUSIVITY (Section 4.3.2) DEFINE_HEAT_FLUX (Section 4.3.3) DEFINE_NOX_RATE (Section 4.3.4) DEFINE_PROFILE (Section 4.3.5) DEFINE_PROPERTY(Section 4.3.6)

DEFINE_SCAT_PHASE_FUNC (Section 4.3.7) DEFINE_SOURCE (Section 4.3.8) DEFINE_SR_RATE (Section 4.3.9)

DEFINE_TURB_PREMIX_SOURCE (Section 4.3.10) DEFINE_TURBULENT_VISCOSITY (Section 4.3.11) DEFINE_UDS_FLUX (Section 4.3.12)

DEFINE_UDS_UNSTEADY (Section 4.3.13) DEFINE_VR_RATE (Section 4.3.14)

Table 4.3.1: Quick Reference Guide for Model-Specific DEFINE Macros Variable DEFINE Macro Panel Activated In boundary condition (e.g., Velocity Inlet) boundary condition boundary condition boundary condition boundary condition boundary condition boundary condition boundary condition boundary condition boundary condition boundary condition species mass fraction DEFINE_PROFILE velocity at a boundary DEFINE_PROFILE pressure at a boundary DEFINE_PROFILE boundary temperature DEFINE_PROFILE turbulent energy kinetic DEFINE_PROFILE turbulent dissipation DEFINE_PROFILE rate mass source momentum source energy source turbulent k.e. source DEFINE_SOURCE DEFINE_SOURCE DEFINE_SOURCE DEFINE_SOURCE turb. dissipation rate DEFINE_SOURCE source UDS or species mass DEFINE_DIFFUSIVITdiffusivity Y turbulent viscosity heat flux density viscosity mass diffusivity thermal conductivity Materials DEFINE_TURBULENTViscous Model _VISCOSITY DEFINE_HEAT_FLUX boundary condition DEFINE_PROPERTY DEFINE_PROPERTY DEFINE_PROPERTY DEFINE_PROPERTY Materials Materials Materials Materials Materials Materials Materials Materials absorption coefficient DEFINE_PROPERTY scattering coefficient laminar flow speed rate of strain scattering function DEFINE_PROPERTY DEFINE_PROPERTY DEFINE_PROPERTY phase DEFINE_SCAT_PHASMaterials E_FUNC DEFINE_SR_RATE DEFINE_VR_RATE User-Defined Function Hooks User-Defined Function Hooks surface reaction rate volume reaction rate turbulent source scalar flux function scalar function center of motion grid motion premixed DEFINE_TURB_PREMUser-Defined Function IX_SOURCE DEFINE_UDS_FLUX Hooks User-Defined Scalars unsteady DEFINE_UDS_UNSTEUser-Defined Scalars ADY gravity DEFINE_CG_MOTION Dynamic Zones DEFINE_GRID_MOTION Dynamic Zones Dynamic Zones NOx Model Iterate geometry deformation DEFINE_GEOM NOx formation rate time step (for time DEFINE_NOX_RATE DEFINE_DELTAT dependent solutions)

? ? ? ? ? ? ? ? ? ? ? ? ? ?

4.3.1 DEFINE_DELTAT

4.3.2 DEFINE_DIFFUSIVITY 4.3.3 DEFINE_HEAT_FLUX 4.3.4 DEFINE_NOX_RATE 4.3.5 DEFINE_PROFILE 4.3.6 DEFINE_PROPERTY

4.3.7 DEFINE_SCAT_PHASE_FUNC 4.3.8 DEFINE_SOURCE 4.3.9 DEFINE_SR_RATE

4.3.10 DEFINE_TURB_PREMIX_SOURCE 4.3.11 DEFINE_TURBULENT_VISCOSITY 4.3.12 DEFINE_UDS_FLUX

4.3.13 DEFINE_UDS_UNSTEADY 4.3.14 DEFINE_VR_RATE

4.3.1 DEFINE_DELTAT 功能和使用方法的介绍

你可以使用DEFINE_DELTAT宏来控制时间相关问题解的时间步长。This macro can only be used if the adaptive time-stepping method option has been activated in the Iterate panel in FLUENT.

Macro: DEFINE_DELTAT ( name, domain) Argument types: Domain *domain Function returns: real

There are two arguments to DEFINE_DELTAT: name and domain. name is the name of the UDF, specified by you. 当你的UDF编译和连接时,你为函数所选择的名字会在FLUENT图形用户界面中变得可见,且可被选择。 domain is passed by the FLUENT solver to your UDF. Your UDF will need to return the real value of the physical time step to the solver.

例子:

下面的UDF名字为mydeltat, is a simple function that shows how you can use DEFINE_DELTAT to change the value of the time step in a simulation. First, RP_Get_Real is used to get the value of the current simulation time ( flow_time). Then, for the first 0.5 seconds of the calculation, a time step of 0.1 is set. A time step of 0.2 is set for the remainder of the simulation. The time step variable is then returned to the solver. See Section 6.9 for details on RP_Get_Real.

/***********************************************************************/

/* UDF that changes the time step value for a time-dependent solution */

/***********************************************************************/

#include \

DEFINE_DELTAT(mydeltat, domain) {

real time_step;

real flow_time = RP_Get_Real(\ if (flow_time < 0.5) time_step = 0.1; else

time_step = 0.2; return time_step; }

Activating an Adaptive Time Step UDF in FLUENT

Once you have compiled and linked the source code for an adaptive time step UDF, you can activate it in the Iterate panel in FLUENT. See Section 8.2.8 for more details.

4.3.2 DEFINE_DIFFUSIVITY 功能和使用方法的介绍

你可以使用DEFINE_DIFFUSIVITY macro to specify the diffusivity for the species transport equations or user-defined scalar (UDS) transport equations.

Macro: DEFINE_DIFFUSIVITY ( name, c, t, i) Argument types: cell_t c Thread *t int i Function returns: real

There are four arguments to DEFINE_DIFFUSIVITY: name, c, and t, and i. name is the name of the UDF, specified by you. 当你的UDF编译和连接时,你为函数所选择的名字会在FLUENT图形用户界面中变得可见,且可被选择。 c, t, and i are variables that are passed by the FLUENT solver to your UDF.

c is an index that identifies a cell within the given thread. t is a pointer to the thread on which the diffusivity function is to be applied. i is an index that identifies the species or user-defined scalar. Your UDF will need to return the real value of diffusivity to the solver.

Note that diffusivity UDFs (defined using DEFINE_DIFFUSIVITY) are called by FLUENT from within a loop on cell threads. Consequently, your UDF will not need to loop over cells in a thread since FLUENT is doing it outside of the function call. Your UDF will be required to compute the diffusivity only for a single cell and return the real value to the solver. 例子:

下面的UDF名字为mean_age_diff, computes the diffusivity for the mean age of air using a user-defined scalar. Note that the mean age of air calculations do not require that energy, radiation, or species transport calculations have been performed. You will need to set uds-0 = 0.0 at all inlets and outlets in your model. This function can be executed as an interpreted or compiled UDF.

/**********************************************************************/

/* UDF that computes diffusivity for mean age using a user-defined */

/* scalar. */ /**********************************************************************/

#include \

DEFINE_DIFFUSIVITY(mean_age_diff, c, t, i) {

return C_R(c,t) * 2.88e-05 + C_MU_EFF(c,t) / 0.7; }

Activating a Diffusivity UDF in FLUENT


FLUENT udf中文资料ch4(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:反洗钱2017多选题

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: