Hello Antoon,
Thank you very much for the prompt reply.
The expression ((exp((y-3)/0.1)*(y>3)*(y<3))+(y>3)) (Here, L0 = 3) is always equal to zero, I was wondering if there is a mistake. (May be ((exp((y-3)/0.1)*(y>2)*(y<3))+(y>3))? )
{
coord Del = { 0 , 1, 0};
foreach_face()
{
av.x[] = Del.x* (((T[]+T[-1])/2)-(((u.x[]+u.x[-1])/2)*((exp((y-3)/0.1)*(y>3)*(y<3))+(y>3))));
}
foreach()
{
T[]-=(T[]-y) * ((exp((y-3)/0.05)*(y>2)*(y<3))+(y>3));
}
}
In fact, I have tried to add the following code as a sponge layer, however, it does't work (attached wave.png).
event spon (i++)
{
foreach()
{
if (x > 4*7.71875)
{
u.x[] = u.x[]* pow(tanh(5*(L0 - x)/L1), 14);
u.y[] = u.y[]* pow(tanh(5*(L0 - x)/L1), 14);
}
else
{
u.x[] = u.x[];
u.y[] = u.y[];
}
}
}
Finally, thank you for your valuable advise again.
Best regards,
Qunbin
在 2018年4月7日星期六 UTC+8下午12:58:58,Antoon van Hooft写道: