注册 登录
流体中文网 返回首页

gearboy的个人空间 http://cfluid.com/?15372 [收藏] [复制] [分享] [RSS]

日志

UDF获取气体分压力或摩尔分数

已有 837 次阅读2013-4-17 14:00 |个人分类:UDF使用技巧

You can use the following equation
pi=C_P(c,t)*gas_molar_fraction
where, pi is the partial pressure, C_P(c,t) gets the mixed gas pressure.
gas_molar_fraction is the mole fraction of a species in the mixture, which can be calculated by
- first summing up [mass fraction / molecular weight] of all species and
- then dividing the same quotient for the individual species by the calculated sum.
This is done automatically by the following function call (including variables and preparation)


Material *mix_mat = mixture_material(Get_Domain(1));
Material *spe_mat = NULL;
real all_mass_fracts[MAX_SPE_EQNS];
real all_mole_fracts[MAX_SPE_EQNS];
int i = -1;
mixture_species_loop(mix_mat, spe_mat, i)
{
all_mass_fracts[i] = C_YI(c,t,i);
}
Mole_Fraction(mix_mat, all_mass_fracts, all_mole_fracts)
After this, the mole fractions of all species can be found in the array "all_mole_fracts".

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

返回顶部
//