/*DEFINE_VR_RATE(name, c, t, r, mw, yi, rr, rr_t)
Argument Type Description
symbol name UDF name.
cell_t c Cell index.
Thread *t Pointer to cell thread on which the volumetric reaction rate is to be applied.
Reaction *r Pointer to data structure that represents the current reaction.
real *mw Pointer to array of species molecular weights.
real *yi Pointer to array of the species mass fractions.
real *rr Pointer to laminar reaction rate.
real *rr_t Pointer to turbulent reaction rate.*/
#include "udf.h"
#define k1 /*可以是常数*/
#define k2 5.0 /*K1、K2可以不定义,直接在公式中体现*/
DEFINE-VR-RATE(vol_rate,c,t,r,mole_weight,species_mf,rate,rr_t)
{
real a1 = species_mf[0];
real b1 = mole_weight[0];
if(FLUID_TEMP_P(t) && TEMP_1000K(t))/*判断语句*/
*rate = k1*a1+k2*a2;()/*正常反应需要的公式*/
else
*rate = 0.;
*rr_t = *rate;
}
/*********************************************************************
UDF for specifying a volume reaction rate
The basics of ANSYS Fluent’s calculation of reaction rates: only an
Arrhenius ("finite rate") reaction rate is calculated
from the inputs given by the user in the graphical user interface
**********************************************************************/
#include "udf.h"
DEFINE_VR_RATE(vol_reac_rate, c, t, r, wk, yk, rate, rr_t)
{
int i;
/* Calculate Arrhenius reaction rate */
prod = 1.;
for (i = 0; i < r->n_reactants; i++)
{
ci = C_R(c, t) * yk[r->reactant[i]] / wk[r->reactant[i]];
prod *= pow(ci, r->exp_reactant[i]);
}
*rate = r->A * exp(-r->E / (UNIVERSAL_GAS_CONSTANT * C_T(c, t))) *
pow(C_T(c, t), r->b) * prod;
*rr_t = *rate;
/* No "return..;" value. */
}
/*********************************************************************
Multiple reaction UDF that specifies different reaction rates
for different volumetric chemical reactions
**********************************************************************/
#include "udf.h"
DEFINE_VR_RATE(myrate, c, t, r, mw, yi, rr, rr_t)
{
/*If more than one reaction is defined, it is necessary to distinguish
between these using the names of the reactions. */
if (!strcmp(r->name, "reaction-1"))
{
/* Reaction 1 */
}
else if (!strcmp(r->name, "reaction-2"))
{
/* Reaction 2 */
}
else
{
/* Message("Unknown Reaction\n"); */
}
/* Message("Actual Reaction: %s\n",r->name); */
}
rateccc_化学反应UDF_fluentudf反应_fluent_fluentudf_化学反应udf
版权申诉
5星 · 超过95%的资源 127 浏览量
2021-09-11
06:51:45
上传
评论 4
收藏 1KB RAR 举报
心梓
- 粉丝: 808
- 资源: 8057
最新资源
- 常用工具集参考用于图像等数据处理
- 音乐展示网页、基于Stenography的图像数字水印添加与提取,以及基于颜色矩和Tamura算法的图像相似度评估算法py源码
- 基于EmguCV(OpenCV .net封装),图像数字水印加解密算法的实现,其中包含最低有效位算法,离散傅里叶变换算法+文档书
- 基于matlab+DWT的图像水印项目,数字水印+源代码+文档说明+图片+报告pdf
- (优秀毕业设计)基于python实现的数字图像可视化水印系统的设计与实现,多种数字算法实现+源代码+文档说明+理论演示pdf
- 基于DWT-DCT-SVD和deflate压缩的数字水印方法python源码+Gui界面+演示视频(高分毕业设计)
- 基于matlab实现DWT、DCT、SVD算法数字图像水印可视化系统+GUI界面+文档说明+详细注释(高分毕业设计)
- NCIAE-Data-Structure大一大二笔记
- 学习wireshark笔记
- digital-image-数据可视化笔记
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
- 3
前往页