24小时热门版块排行榜    

查看: 750  |  回复: 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的回帖

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的回帖
查看全部 3 个回答

MoonLee777

新虫 (正式写手)

2楼2018-04-04 20:53:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 国自然面上复盘~欢迎讨论 +5 晴天加油 2026-08-26 6/300 2026-08-27 04:49 by littlezl
[教师之家] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +3 LIbGuocjEEYw 2026-08-26 4/200 2026-08-27 04:33 by Ie9AyIAvGbvs
[基金申请] 投票:  有多少人是今天查系统知道结果的? +15 爱看书的可乐 2026-08-26 17/850 2026-08-27 03:31 by xxniao123
[硕博家园] 售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急 +3 LIbGuocjEEYw 2026-08-26 4/200 2026-08-27 02:01 by Ie9AyIAvGbvs
[基金申请] 看板上这么多中的,有点像50人群里49个人都是骗子的那种感觉…… +3 a089 2026-08-26 3/150 2026-08-26 23:21 by young90
[基金申请] 2026年的国家社科基金项目通讯评审的新规则与新动向、新挑战 +7 process2012 2026-08-23 10/500 2026-08-26 19:23 by hmhminy
[基金申请] 系统查不到 +10 董八千 2026-08-26 10/500 2026-08-26 16:30 by Equinoxhua
[基金申请] 范进中举一文的中心思想 +9 炎黄贵胄 2026-08-22 10/500 2026-08-26 15:40 by semaglutide
[基金申请] 能否退出参与的面上项目解除限项 +23 koalala 2026-08-24 26/1300 2026-08-26 14:29 by 宝贝虫子
[基金申请] 科研孤儿太难了 +21 我4大白菜 2026-08-20 22/1100 2026-08-26 11:29 by nlgza
[基金申请] 国合里面能看到了 +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
[基金申请] 项目信息和经费信息在系统里都可以看到了 +6 wittyboy 2026-08-26 14/700 2026-08-26 10:55 by wittyboy
[基金申请] 牛来!米来!面来! +8 beefly 2026-08-26 8/400 2026-08-26 08:37 by xuzhipiao
[基金申请] 某些机构,以效率低为荣,以效率低作为存在感 +9 yuleib84 2026-08-25 10/500 2026-08-25 17:14 by alexon
[基金申请] 今日不放榜?网传国自然预计 8 月 27 日可查结果 +17 医学老男孩 2026-08-20 22/1100 2026-08-25 15:36 by 医学老男孩
[基金申请] 建议基金发布提前给出明确的时间点 +13 kulium 2026-08-21 16/800 2026-08-24 16:27 by superceng
[基金申请] 让我中一个面上吧! +13 大萍1987 2026-08-20 16/800 2026-08-24 10:23 by 太傻了
[教师之家] 跳槽后在研项目怎么办? +5 简单化xn 2026-08-22 10/500 2026-08-23 12:38 by 简单化xn
[基金申请] 时间戳又变了 +13 wuchongjun 2026-08-20 19/950 2026-08-21 17:21 by 紫杉醇
信息提示
请填处理意见