作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在研究飞机副油箱内的流体运动。对于我最初的情况,液体正在来回移动。对于这种情况,我使用了以下代码,但产生了错误。
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/
我是一名优秀的程序员,十分优秀!