24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 4267  |  回复: 4

nba24

新虫 (小有名气)

[求助] 质量源项、动量源项

source = -mass/C_VOLUME(cell_gas,thread_gas)/CURRENT_TIMESTEP;           /* 传质源项,单位 kg/m3-s */            
   mass具体是如何定义的?相减符号如何?
  还有,谁有动量源项,我已经在UDF里面写好质量源项,怎样加动量源项?在UDF里面
回复此楼
天津大学化学工程
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

kylafree

至尊木虫 (知名作家)

【答案】应助回帖

★ ★
感谢参与,应助指数 +1
xiegangmai: 金币+2, 谢谢应助 2012-06-22 00:12:29
查看 UDF HELP 中 DEFINE_SOURCE宏,有详细说明
2楼2012-06-21 22:35:29
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hihaoer

新虫 (小有名气)

【答案】应助回帖

★ ★
xiegangmai: 金币+2, 谢谢应助! 2012-06-27 21:14:08
source = -mass/C_VOLUME(cell_gas,thread_gas)/CURRENT_TIMESTEP

你没有写出全部,根据你写的来看mass除以单元体积和时间步。根据源项的定义单位是kg/m3,所以mass单位是kg。负号我的理解应该表示消失源项,至于动量源fluent udf help里面的例子就是动量源,你可以看看。
3楼2012-06-27 09:50:57
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nba24

新虫 (小有名气)

引用回帖:
3楼: Originally posted by hihaoer at 2012-06-27 09:50:57
source = -mass/C_VOLUME(cell_gas,thread_gas)/CURRENT_TIMESTEP

你没有写出全部,根据你写的来看mass除以单元体积和时间步。根据源项的定义单位是kg/m3,所以mass单位是kg。负号我的理解应该表示消失源项,至于 ...

DEFINE_SOURCE(gas_source, cell_gas, thread_gas, dS, eqn)        /* gas相o2组分的传质源项 */
{
real source;
Domain *domain_liquid = Get_Domain(3);        /* liquid相domain指针 */
Thread *thread_mix = THREAD_SUPER_THREAD(thread_gas);        /* mixture的fluid-air区域指针 */
Thread *thread_liquid = Lookup_Thread(domain_liquid, 2);        /* liquid相的fluid-water区域指针 */
cell_t cell_liquid;
real m0_gas, m0_liquid, m1_gas, m1_liquid;

if(C_UDMI(cell_gas, thread_mix, 0 ) == -1)        /* 非相界面cell */
        {
        source = 0.0;        /* 传质源项为0 */
        }
else        /* 相界面cell */
        {
        cell_liquid = C_UDMI(cell_gas, thread_mix, 0);        /* 获取相界面另一侧的cell编号 */
        /* 下面就可通过thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五个变量获取需要的数据计算传质源项 */
        m0_gas = C_YI(cell_gas, thread_gas, 0)*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas);        /* 气相中o2组分质量,单位 kg */
        m0_liquid = C_YI(cell_liquid, thread_liquid, 0)*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid);        /* 液相中o2组分质量,单位 kg */
        m1_liquid = (m0_gas+m0_liquid)*kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)/(kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)+C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas));/* 分配后液相中o2组分质量,单位 kg */
        m1_gas = m1_liquid*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas)/(C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)*kc);        /* 分配后气相中o2组分质量,单位 kg */
        source = (m1_gas-m0_gas)/C_VOLUME(cell_gas, thread_gas)/(CURRENT_TIMESTEP+0.023);        /* 传质源项,单位 kg/m3-s */
        }

dS[eqn] = 0.0;
return source;
}

DEFINE_SOURCE(liquid_source, cell_liquid, thread_liquid, dS, eqn)        /* liquid相o2组分的传质源项 */
{
real source;
Domain *domain_gas = Get_Domain(2);        /* gas相domain指针 */
Thread *thread_mix = THREAD_SUPER_THREAD(thread_liquid);        /* mixture的fluid-water区域指针 */
Thread *thread_gas = Lookup_Thread(domain_gas, 3);        /* gas相的fluid-air区域指针 */
cell_t cell_gas;
real m0_gas, m0_liquid, m1_gas, m1_liquid;

if(C_UDMI(cell_liquid, thread_mix, 0 ) == -1)        /* 非相界面cell */
        {
        source = 0.0;        /* 传质源项为0 */
        }
else /* 相界面cell */
        {
        cell_gas = C_UDMI(cell_liquid, thread_mix, 0);        /* 获取相界面另一侧的cell编号 */
        /* 下面就可通过thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五个变量获取需要的数据计算传质源项 */
        m0_gas = C_YI(cell_gas, thread_gas, 0)*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas);        /* 气相中o2组分质量,单位 kg */
        m0_liquid = C_YI(cell_liquid, thread_liquid, 0)*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid);        /* 液相中o2组分质量,单位 kg */
        m1_liquid = (m0_gas+m0_liquid)*kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)/(kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)+C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas));/* 分配后液相中o2组分质量,单位 kg */
        m1_gas = m1_liquid*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas)/(C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)*kc);        /* 分配后气相中o2组分质量,单位 kg */
        source = (m1_liquid-m0_liquid)/C_VOLUME(cell_liquid, thread_liquid)/(CURRENT_TIMESTEP+0.023);        /* 传质源项,单位 kg/m3-s */
        }

dS[eqn] = 0.0;
return source;
}

DEFINE_SOURCE(gas_source1, cell_gas, thread_gas, dS, eqn)        /* gas相o2组分的传质源项 */
{
real source;
Domain *domain_liquid = Get_Domain(3);        /* liquid相domain指针 */
Thread *thread_mix = THREAD_SUPER_THREAD(thread_gas);        /* mixture的fluid-air区域指针 */
Thread *thread_liquid = Lookup_Thread(domain_liquid, 2);        /* liquid相的fluid-water区域指针 */
cell_t cell_liquid;
real m0_gas, m0_liquid, m1_gas, m1_liquid;

if(C_UDMI(cell_gas, thread_mix, 1 ) == -1)        /* 非相界面cell */
        {
        source = 0.0;        /* 传质源项为0 */
        }
else /* 相界面cell */
        {
        cell_liquid = C_UDMI(cell_gas, thread_mix, 1);        /* 获取相界面另一侧的cell编号 */
        /* 下面就可通过thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五个变量获取需要的数据计算传质源项 */
        m0_gas = C_YI(cell_gas, thread_gas, 0)*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas);        /* 气相中o2组分质量,单位 kg */
        m0_liquid = C_YI(cell_liquid, thread_liquid, 0)*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid);        /* 液相中o2组分质量,单位 kg */
        m1_liquid = (m0_gas+m0_liquid)*kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)/(kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)+C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas));/* 分配后液相中o2组分质量,单位 kg */
        m1_gas = m1_liquid*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas)/(C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)*kc);        /* 分配后气相中o2组分质量,单位 kg */
        source = (m1_gas-m0_gas)/C_VOLUME(cell_gas, thread_gas)/CURRENT_TIMESTEP;        /* 传质源项,单位 kg/m3-s */
        }

dS[eqn] = 0.0;
return source;
}


这是我写的源项  -----但是我觉得我的周期性浓度变化没有写进来----求助啊
天津大学化学工程
4楼2012-07-08 22:13:12
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nba24

新虫 (小有名气)


xiegangmai: 金币+1, 鼓励讨论交流! 2012-07-08 22:35:08
引用回帖:
3楼: Originally posted by hihaoer at 2012-06-27 09:50:57
source = -mass/C_VOLUME(cell_gas,thread_gas)/CURRENT_TIMESTEP

你没有写出全部,根据你写的来看mass除以单元体积和时间步。根据源项的定义单位是kg/m3,所以mass单位是kg。负号我的理解应该表示消失源项,至于 ...

DEFINE_SOURCE(gas_source, cell_gas, thread_gas, dS, eqn)        /* gas相o2组分的传质源项 */
{
real source;
Domain *domain_liquid = Get_Domain(3);        /* liquid相domain指针 */
Thread *thread_mix = THREAD_SUPER_THREAD(thread_gas);        /* mixture的fluid-air区域指针 */
Thread *thread_liquid = Lookup_Thread(domain_liquid, 2);        /* liquid相的fluid-water区域指针 */
cell_t cell_liquid;
real m0_gas, m0_liquid, m1_gas, m1_liquid;

if(C_UDMI(cell_gas, thread_mix, 0 ) == -1)        /* 非相界面cell */
        {
        source = 0.0;        /* 传质源项为0 */
        }
else        /* 相界面cell */
        {
        cell_liquid = C_UDMI(cell_gas, thread_mix, 0);        /* 获取相界面另一侧的cell编号 */
        /* 下面就可通过thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五个变量获取需要的数据计算传质源项 */
        m0_gas = C_YI(cell_gas, thread_gas, 0)*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas);        /* 气相中o2组分质量,单位 kg */
        m0_liquid = C_YI(cell_liquid, thread_liquid, 0)*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid);        /* 液相中o2组分质量,单位 kg */
        m1_liquid = (m0_gas+m0_liquid)*kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)/(kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)+C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas));/* 分配后液相中o2组分质量,单位 kg */
        m1_gas = m1_liquid*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas)/(C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)*kc);        /* 分配后气相中o2组分质量,单位 kg */
        source = (m1_gas-m0_gas)/C_VOLUME(cell_gas, thread_gas)/(CURRENT_TIMESTEP+0.023);        /* 传质源项,单位 kg/m3-s */
        }

dS[eqn] = 0.0;
return source;
}


我这个因为是周期型传质---两边都传---然后右边的传质实际上是下一个长度周期的呀---所以我不知道怎样弄啊---我的udf  关于质量分数哪儿写的不对啊
天津大学化学工程
5楼2012-07-08 22:28:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 nba24 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 367求调剂 +3 谢28 2026-03-30 3/150 2026-04-05 13:27 by huangmoli
[考研] 工科08专硕机械275求调剂 +3 AaAa7420 2026-04-02 3/150 2026-04-05 13:26 by jp9609
[考研] 工科277分求调剂材料 +8 上了上了上哦 2026-04-05 9/450 2026-04-05 13:05 by wwytracy
[考研] 一志愿江南大学085501机械工程专硕326分,本科佳木斯大学 +5 顾若浮生 2026-04-03 9/450 2026-04-05 09:57 by 1753564080
[考研] 320分人工智能调剂 +7 振—TZ 2026-04-03 7/350 2026-04-05 00:42 by chongya
[考研] 280求调剂 +3 李rien 2026-04-04 3/150 2026-04-04 23:32 by lqwchd
[考研] 材料专硕306英一数二 +8 z1z2z3879 2026-03-31 8/400 2026-04-04 22:08 by hemengdong
[考研] 325求调剂 +4 春风不借意 2026-04-04 4/200 2026-04-04 14:46 by 湘农储能材料
[考研] 0710生物学336分求调剂 +6 kiyy 2026-04-01 8/400 2026-04-04 10:10 by kiyy
[考研] 297求调剂 +11 ljy20040718! 2026-04-03 13/650 2026-04-04 09:23 by 来看流星雨10
[考研] 301求调剂 +14 A_JiXing 2026-04-01 14/700 2026-04-03 18:31 by ls刘帅
[考研] 求调剂 +4 15064154688 2026-04-03 5/250 2026-04-03 15:07 by zrongyan
[考研] 325分化学调剂 +5 15771691647 2026-04-02 5/250 2026-04-03 09:58 by ChemPharm
[考研] 0703化学 +7 goldtt 2026-04-02 9/450 2026-04-03 09:36 by 蓝云思雨
[考研] 081200-11408-276学硕求调剂 +3 崔wj 2026-04-02 3/150 2026-04-02 15:06 by cal0306
[考研] 311求调剂 +14 蓝月亮亮 2026-03-30 14/700 2026-04-02 12:18 by 1753564080
[考研] 298求B区调剂 +4 zzz,,r 2026-04-02 5/250 2026-04-02 12:17 by 土木硕士招生
[考研] 材料调剂 +11 一样YWY 2026-03-31 11/550 2026-04-01 11:35 by wangjy2002
[考研] 326求调剂 +4 崽崽仔 2026-03-31 4/200 2026-04-01 09:58 by 我的船我的海
[考研] 318求调剂 +10 陈晨79 2026-03-30 10/500 2026-03-31 17:37 by 544594351
信息提示
请填处理意见