24小时热门版块排行榜    

查看: 740  |  回复: 2

妃子笑16888

新虫 (初入文坛)

[求助] UDF

请教一下大家,就是想输入一个x轴上的加速度随时间变化的曲线,用书上的程序计算不了,用我的程序能计算但结果不对,请问一下是为啥
/*******************************************************************/
/* UDF for specifying an x-momentum source term in a spatially     */
/* dependent porous media                                          */
/*******************************************************************/

#include "udf.h"

#define C2 100.0

DEFINE_SOURCE(xmom_source, c, t, dS, eqn)
{
  real x[ND_ND];
  real con, source;

  C_CENTROID(x, c, t);
  con = C2*0.5*C_R(c, t)*x[1];

  source = -con*fabs(C_U(c, t))*C_U(c, t);
  dS[eqn] = -2.*con*fabs(C_U(c, t));

  return source;
}
计算时就会出现这种情况

==============================================================================

Node 0: Process 8516: Received signal SIGSEGV.

==============================================================================

==============================================================================

Node 1: Process 8972: Received signal SIGSEGV.

==============================================================================

==============================================================================

Node 2: Process 8036: Received signal SIGSEGV.

==============================================================================

==============================================================================

Node 4: Process 1380: Received signal SIGSEGV.

==============================================================================

==============================================================================

Node 5: Process 7764: Received signal SIGSEGV.

==============================================================================

==============================================================================

Node 6: Process 9360: Received signal SIGSEGV.

==============================================================================

==============================================================================

Node 3: Process 7944: Received signal SIGSEGV.

==============================================================================
MPI Application rank 0 exited before MPI_Finalize() with status 2
The fl process could not be started.

这是我自己的代码,能计算但感觉没起到什么效果
/******************************************************************
The acceleration in the x-axis direction changes with time
*******************************************************************/
#include "udf.h"
#define g 9.8
DEFINE_SOURCE(accelaration_source, c, t, dS, eqn)
{
  real x[ND_ND];
  real source;
  real a = RP_Get_Real ("CURRENT_TIME" );
  source = -0.125*CURRENT_TIME*g+0.5*g;
  source=x[0];
  dS[eqn] = 0.0;
  return source;
}
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

MoonLee777

新虫 (正式写手)

2楼2018-04-04 20:53:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

yx0918yogurt

新虫 (初入文坛)

引用回帖:
2楼: Originally posted by MoonLee777 at 2018-04-04 20:53:48
试试单核

Node 0: Process 4632: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 1: Process 4996: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 2: Process 1220: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 3: Process 1340: Received signal SIGSEGV.
The f1 process could not be started.

试过单核计算也没有用,请问您还知道其他解决办法吗?
3楼2019-07-30 10:22:14
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 妃子笑16888 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 投票:  有多少人是今天查系统知道结果的? +15 爱看书的可乐 2026-08-26 17/850 2026-08-26 22:48 by xxniao123
[基金申请] 基金不中,共勉 +4 eulota 2026-08-26 4/200 2026-08-26 21:29 by 木风9012
[基金申请] 国自然面上复盘~欢迎讨论 +4 晴天加油 2026-08-26 5/250 2026-08-26 21:27 by 木风9012
[基金申请] 2026年8月25日国自然放榜前突然收到列入评审专家邮件,有关系吗? +25 木水思豆 2026-08-25 28/1400 2026-08-26 14:53 by draco1987
[基金申请] 出来了 +9 trojank 2026-08-26 9/450 2026-08-26 14:25 by 宝贝虫子
[基金申请] 哪位高人中了,把查询到的截图贴出来让我看看,让我长长见识 +4 yuleib84 2026-08-26 5/250 2026-08-26 13:40 by yuleib84
[基金申请] 为什么国自然不能直接公布 +4 bjdxyxy 2026-08-26 4/200 2026-08-26 13:12 by qingmu1201
[基金申请] 国合里面能看到了 +7 一怀馨秋 2026-08-26 7/350 2026-08-26 11:23 by zhaosm1982
[基金申请] 国际合作可查了,中了面上 +18 Ldrop2023 2026-08-26 18/900 2026-08-26 11:15 by cmrandy
[基金申请] 系统进不去 +4 yanglien 2026-08-26 5/250 2026-08-26 11:10 by wenfengw83
[基金申请] 项目信息和经费信息在系统里都可以看到了 +6 wittyboy 2026-08-26 14/700 2026-08-26 10:55 by wittyboy
[基金申请] 国合可查了 +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
[基金申请] 今天务委会开完了,明天出结果吗 +19 angus9576 2026-08-25 23/1150 2026-08-26 10:03 by zp519
[基金申请] 牛来!米来!面来! +8 beefly 2026-08-26 8/400 2026-08-26 08:37 by xuzhipiao
[基金申请] 在坚冰还盖着北海的时候,我看到了怒放的梅花。 (金币+10) +6 ziyangfang 2026-08-25 9/450 2026-08-25 20:26 by huagongfeihu
[基金申请] 某些机构,以效率低为荣,以效率低作为存在感 +9 yuleib84 2026-08-25 10/500 2026-08-25 17:14 by alexon
[基金申请] 没有任何消息-是不是就凉了 +9 图啦图啦 2026-08-24 10/500 2026-08-25 11:59 by 南海小哥
[基金申请] 我面上完蛋了 +13 且听虎啸 2026-08-20 14/700 2026-08-25 09:10 by mrkang
[基金申请] 时间戳今天,20号变了 +5 archvillain 2026-08-20 5/250 2026-08-22 06:12 by hui_daxiao
[基金申请] 看来今天不会放榜了? +8 chengyan1220 2026-08-21 11/550 2026-08-21 17:52 by dcqxinyang
信息提示
请填处理意见