飞机降落箱内流体的运动

问题描述 投票:0回答:2

我一直在研究飞机降落舱内流体的运动。对于我最初的情况,流体来回运动。对于这种情况,我使用了以下代码,但产生了错误。

zone_motion.c ..\..\src\zone_motion.c(7) : error C2100: illegal indirection
..\..\src\zone_motion.c(11) : error C2100: illegal indirection 
..\..\src\zone_motion.c(14) : error C2109: subscript requires array or pointer type 
..\..\src\zone_motion.c(14) : error C2100: illegal indirection 
..\..\src\zone_motion.c(14) : error C2109: subscript requires array or pointer type 
..\..\src\zone_motion.c(14) : error C2109: subscript requires array or pointer type

如何修改此代码?

#include "udf.h"
DEFIINE_ZONE_MOTION(fmotion, omega, axis, origin, velocity, time, dtime)
{
if(time<10)
{
    *omega=10;
}
else
{
    *omega=0;
}
N3V_D(velocity,=,0.01*sin(*omega*time), 0.0, 0.0);
}
c user-defined-functions fluent
2个回答
0
投票

我可能不会帮您,但也许其他人会觉得有用。我有一个与您的问题类似的工作代码。该代码从根本上旋转了域,并在达到最大omega后保持不变。享受:

#include "udf.h"

DEFINE_ZONE_MOTION(fmotion2,omega,axis,origin,velocity,time,dtime)
{
float omega_max, t_end, ramp, rpm;

omega_max=314.0;
t_end=10.0;
ramp=omega_max / t_end;
velocity[0]=0.0;
velocity[1]=0.0;
velocity[2]=0.0;

origin[0]=-0.1;
origin[1]=-0.1;
origin[2]=0.0;

axis[0]=0.0;
axis[1]=0.0;
axis[2]=1.0;

    if (CURRENT_TIME < t_end) 
    {
    *omega = ramp * CURRENT_TIME;
    //print("Current omega value %fn",*omega);
    }
    else
    {
    *omega = omega_max;
    }
  return;
}

0
投票

[DEFIINE_ZONE_MOTIONDEFINE_ZONE_MOTION的拼写错误。

© www.soinside.com 2019 - 2024. All rights reserved.