Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
对于两相流求解器想判断alpha为某值然后两个分支,但if语句不对,不知道怎么写程序语句,求指导:happy:
forAll(alpha, celli0) { if(alpha[celli] == 0.5) { } else { } }
@赵一铭
error: ‘celli’ was not declared in this scope if(alpha1[celli] == 0.9)
赵老师,这地方怎么改一下
@飞火流星jyj
forAll(alpha, celli) { if(alpha[celli] == 0.5) { } else { } }
另外,这个判断alpha[celli] == 0.5,只是判断是不是等于0.5。或许你可以写为:if(alpha[celli] > 0.89 && alpha[celli] < 0.91)
alpha[celli] == 0.5
if(alpha[celli] > 0.89 && alpha[celli] < 0.91)
@赵一铭 谢谢赵老师耐心回答,forAll(alpha, celli)这句是怎么解释的
forAll(alpha, celli)
forAll(alpha, celli)表示循环整个网格单元 :cheeky:
@赵一铭 发现效率很慢啊,赵老师,这个语句出自于of在哪定义的?
ForAll 是一个宏,定义如下
#define forAll (list, i ) for (Foam::label i=0; i<(list).size(); ++i)