请教一下大家,就是想输入一个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;
==============================================================================
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;
}