CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Running cellSet in parallel (

winden March 27, 2012 14:16

Running cellSet in parallel

I am trying to run cellSet (OF v.1.7.1) in parallel.

This works fine until I try to use surface-based selection. It seems (unlike e.g. snappyHexMesh) cellSet does not recognize the outsidePoints-entry if it/they are not in the current processor mesh. Is this fixed in setSet in later versions or is there another workaround? I played with the thought of using pointSet before decomposing to create a (very) long list of outside points to give to cellSet but I am sure there is a better way.

file "constant/triSurface/stlname.stl";

outsidePoints ((0 0.001 -1.342));
includeCut true;
includeInside false;
includeOutside false;
nearDistance 0.123079;

curvature -100;

gives error:
[0] outsidePoint (0 0.001 -1.342) is not inside any cell

The point works fine with one processor so that's not the issue.

Any ideas?

Kind regards

winden March 28, 2012 11:56

Ok sorry for spamming my own thread but, to answer parts of my own question: I modified my run-script to work with version 2.0.0 so I could try the new implementation and it works. I still want to be able to run in 1.7 as well though so the question whether there is a workaround still stands.

Another question regarding cellSet/setSet in parallel: How to make it cooperate with refineMesh as you can do in serial?

I.e, how can I either:

Make cellSet/setSet write one single set in constant/polyMesh/sets so refineMesh can read it


Make refineMesh read sets from processor*/constant/polyMesh/sets where cellSet/setSet creates them in parallel.

I do not want to have to recompose/decompose between and I want identical final meshes as you would get in serial.


wyldckat March 28, 2012 15:24

Greetings Björn,

The usual way of manipulating OpenFOAM meshes that have been decomposed is to run the utilities in parallel as well, for example:

foamJob -s -p cellSet

mpirun -np _number_processes_ cellSet -parallel
Same goes for refineMesh.

The only utilities that aren't executed in parallel are usually the ones that do decomposition and reconstruction.

Nonetheless, if you've already ran cellSet in parallel and it failed to handle those surface selections, then it might be a bug, which may or may not be already fixed in the latest versions of OpenFOAM :(

If you have a simple test case for us to test, share it here and anyone can easily run it with the version they got at hand. And if you please, make it an easy way to run it, the same way that OpenFOAM's tutorials do it, namely with Allrun scripts.

Best regards,

winden March 29, 2012 05:19

Hi Bruno, thanks for your reply.

After testing it seems like this is a bug in version 1.7 (don't know about earlier ones) but which is fixed in later versions. I will see if I can make a small testcase to show it.

The problem I have now with setSet and refineMesh is not to get them to run individually in parallel but that setSet creates a number of decomposed sets in /processor*/constant/polyMesh/sets whereas refineMesh in parallel is still looking for a single set in /constant/polyMesh/sets.


wyldckat March 29, 2012 07:56

Hi Björn,

Is that problem occurring with the latest OpenFOAM 2.1.0 or even 2.1.x? If so, I think you should report it as a bug:

Unfortunately, I don't know if there is any way to reconstruct sets :(

Best regards,

winden March 29, 2012 10:08

1 Attachment(s)
Hi again.

Here is a testcase that crashes on running in parallel in 1.7 but works fine in serial in all versions and in parallel on 2.0.

Allrun runs cellSet from a dictionary and Allrun2 runs with setSet as required by later versions.

I also tried with other geometries and number of processors. With some I don't get the point error but zero cells get selected in parallel and a non-zero amount gets selected with the exact same setup in serial.

As for the refineMesh-issue, turns out it was not an issue, just a stupid mistake by me :).

wyldckat April 1, 2012 05:07

Hi Björn,

I've confirmed that your test case also works with OpenFOAM 2.1.x and gives the same problem on 1.7.x as it does with your 1.7.1 version. I also moved the sphere a bit to the right so it would be between processors and it still worked on 2.1.x.

The simplest solution would be to at least use setSet from 2.0.* or 2.1.* and the rest use from 1.7.1.

So the big question(s) is(are): do you have to use OpenFOAM 1.7.1? Or can you upgrade? Or would a limited upgrade be enough (limited in the sense that only setSet from 2.* is used in your 1.7.1)?

Best regards,

winden April 2, 2012 06:37

Hi Bruno.

Thanks for your help in confirming this.

I don't have any problems switching between versions myself. The problem is that I am writing a script that others in my department might want to use and it would be nice if I could make it version independent but perhaps that is not possible. It is already independent when run in serial and I discovered that there is a more serious issue that refineMesh doesn't seem to work very well in parallel either.

Thank you for your help. If anyone comes up with a sneaky trick to make cellSet run in parallel with surface-based selection in v1.7 and below please tell me, otherwise I will have to settle for serial for the moment.


All times are GMT -4. The time now is 06:42.