gpt4 book ai didi

c - 飞机副油箱内的流体运动

转载 作者:行者123 更新时间:2023-11-30 17:04:55 26 4
gpt4 key购买 nike

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

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);
}

最佳答案

我可能帮不了你,但也许其他人会发现这很有用。我有一个与您的问题类似的工作代码。该代码线性地旋转域,并在达到最大欧米伽后保持不变。享受:

#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;
}

关于c - 飞机副油箱内的流体运动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35512746/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com