|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我根据帮助文档,建立了age of air的udf,结果计算都是0.求高人指点。我的qq:19805513,有报酬
/*========================*/
#include "udf.h"
/*
* UDF to compute fluid residence time
*
* This UDF requires at least 1 UDS to be defined
* At inlet, define UDS (value) = 0
* UDS will have units of time and represent approximate residence time
* of fluid in domain
*
* Diffusivity of scalar should be small to reduce diffusion i.e. 1E-5
* However, for turbulent flow with recirculating regions, it is more appropriate
* to hook the function rtd_diff to the UDS diffusivity in the
* materials panel
*/
/*OK here you go.
Convert this text to a *.c file then compile as usual and follow notes to hook in. Then solve for scalar only and post process.
/* Diffusivity for mean age of air
is solved using a user-defined scalar. This
calculation can be performed after the normal
problem has already been solved ... just turn off
all of the previous equations being solved for
and activate solution of the user-defined scalar-0
equation. Make sure to select
- mean_age_diff as the uds diffusivity in the materials panel
- mass flow rate as the uds flux function
- mean_age_source as the uds volumetric source term in
all fluid regions
Use a journal like this to do that in F63 :
def bc fluid fluid-1 n y 0 0 0 0 0 0 0 1 n y "mean_age_source" n y 0 0 0 0 0 0 n n n
def bc fluid fluid-2 n y 0 0 0 0 0 0 0 1 n y "mean_age_source" n y 0 0 0 0 0 0 n n n
def bc fluid fluid-3 n y 0 0 0 0 0 0 0 1 n y "mean_age_source" n y 0 0 0 0 0 0 n n n
etc
- set uds-0 scalar values = 0.0 at all inlets and outlets
mean age of air calculations do not require
any energy, radiation, or species transport
calculations to have been performed
*/
DEFINE_SOURCE(rt_source,c,t,dS,eqn)
{
real source = C_R(c,t);
dS[eqn] = 0.0;
return source;
}
/*
* in the function below, the turbulent schmidt number has been
* set to 1.0 in accordance with the references mentioned above
* and the fluid molecular diffusivity has been set to 1.0e-5 m2/s
*
* these values can be changed on an as-needed basis, for instance in
* Airpak mean age of air calculations, a value of 2.88e-5 is used
* for the molecular diffusivity and a value of 0.7 is used for the
* turbulent Schmidt number
* return C_R(c,t)*1.0e-05+C_MU_EFF(c,t)/1.0;
*/
DEFINE_DIFFUSIVITY(rtd_diff, c, t, i)
{
return C_R(c,t)*1.0e-05+C_MU_EFF(c,t)/1.0;
} |
|