CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Solver runs parallel on 3 cores but not on 4 or more cores (

hrushi.397 October 18, 2013 05:55

Solver runs parallel on 3 cores but not on 4 or more cores
Hi all,

I am trying to solve a differential equation and I have my own solver with my own boundary conditions. Solver works fine when run serially.

Now I want to run it in parallel. There problem is, I can divide my domain on only 3 processors. When I try to run it on 4 processors or more, I run into floating point exception. But when I remove my custom boundary condition and run with a boundary condition say zeroGradient, solver works fine on any number of processors. Clearly, problem is with boundary conditions.

Question is: why using custom boundary condition is causing program to fail beyond 3 processors?

P.S. I do not have any interpolation term or any term which will cause a floating point exception in boundary condition. Yet, I encounter floating point exception.



hrushi.397 October 21, 2013 06:15

Anyone? Any help?

Henning86 October 21, 2013 07:15

it is possible that with 3 processor the boundary patch isn't divided and is completely in one "processor mesh".

With 4 processor your patch is splitted and you get the error.

i've done some programming in parallel it is possible to share some code?

hrushi.397 October 21, 2013 08:03

Hi Henning,

Thank you for the reply. I tried dividing my domain in four subdomains such that the boundary in question lies only in single computational domain. However, I am still getting the same error.

No success yet. : (

I cannot share entire code but I have shared main statement of my boundary condition which I debugged to be the main culprit. Can you/ anyone figure out what is going wrong? As far as I know, there is no variable here that will cause the boundary condition to give floating point exception.

this->gradient()= -(Foam::cos(thetar_))*(scalar(1.414213562)/(scalar(2)*epsilon_))*(this->patchInternalField()*this->patchInternalField()-scalar(1));

Thanks and regards,


All times are GMT -4. The time now is 07:01.