runtime error after succ. compilation + vector component division
I have a problem in running after successfully compiling the modified rhoCentralFoam code.
volVectorField rhoU_dummy = rhoU_old; : ://///////// : : volScalarField q_2 = ( rhoU.component(vector::X)  rhoU_dummy.component(vector::X) ) / rhoU_dummy.component(vector::X) ); compiles well. But when it runs immediately shows "floating point exception" error. The denominator going zero may be one of the reason. I tried even tried adding 1e06 to it. It compiles well but throws away the same error during run time. may be my vector component division goes wrong? Can anyone help me please : ) 
You could try using the stabilise function on the denominator. Also, try adding log lines just prior to the equation, so you can see what values are going into it.

The velocity vector is initially set zero. I think by adding some 1e06 to it before division should not show any problem. The floating point exception error shows at the
second iteration itself. 
The stabilize function will add a small amount to the number if it is close to zero.

Dear marupio,
I am sorry that i m not getting clearly of what u mean by stabilise function. Can u pls post something of that sort! 
Sorry, the function is stabilise(scalar value, scalar smallAmount).
I was wrong  it doesn't check if it is close to zero, it always adds the smallAmount. But, it will add it in the right direction (positive or negative). Here's how you'd use it: Code:
volScalarField q_2 = ( rhoU.component(vector::X)  rhoU_dummy.component(vector::X) ) / stabilise(rhoU_dummy.component(vector::X), SMALL) ); 
Thanks marupio,

All times are GMT 4. The time now is 15:00. 