davidem88/rhoEnergyFoam

a little bug

Closed this issue · 3 comments

ducSensor[icell] = max(-divU[icell]/Foam::sqrt(divU2[icell] + rotU2[icell] + epsilon),0.) ;

Hi, maybe there is a little bug:
change eplison to eps?

No, why do you say so? It seems correct to me. epsilon is read from input and it's a scalar

That because when I am debugging, I found the bug:

—> FOAM FATAL ERROR: 
LHS and RHS of + have different dimensions
     dimensions : [0 0 -2 0 0 0 0] + [0 0 0 0 0 0 0]

divU2[icell] + rotU2[icell] + epsilon?

epsilon is dimensions [0 0 0 0 0 0 0], and it sends the value to eps, with its dimension [0 0 -2 0 0 0 0].

I am not sure why in cpu, it not show bug, In GPU version debugging, I found it.

As far as I know, in the CPU version of OF physical dimensions are not checked in the loops. That is why it is working anyway.