CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Parallel run crashes when trying to loop into faces of a patch

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 3, 2013, 15:10
Default Parallel run crashes when trying to loop into faces of a patch
  #1
New Member
 
George D.
Join Date: Jan 2012
Posts: 2
Rep Power: 0
dgeorge8286 is on a distinguished road
Hello everybody. I am trying to calculate a flux using an expression that is related to the value of pressure in 2 different patches of my domain.

To find the label of the patches, I am using:

label patchID1 = mesh.boundaryMesh().findPatchID("side1");
const polyPatch& cPatch1 = mesh.boundaryMesh()[patchID1];

label patchID2 = mesh.boundaryMesh().findPatchID("side2");
const polyPatch& cPatch2 = mesh.boundaryMesh()[patchID2];

This works fine. Then:

forAll(cPatch1, facei)
{
J.boundaryField()[patchID1][facei] = p.boundaryField()[patchID1][facei] - p.boundaryField()[patchID2][facei];
}

While in serial this works perfectly, in parallel the solver crashes. the two patches have the same number of faces. Can anybody help me in this?

I inspect that this is related to the communication of the processors but I am not sure how to fix it.

Thank you in advance.
dgeorge8286 is offline   Reply With Quote

Old   October 4, 2013, 14:27
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,702
Rep Power: 27
ngj will become famous soon enoughngj will become famous soon enough
Hi George,

I would suspect that the decomposition is such that you have different number of faces on the two patches on each processor. Try to investigate processor*/constant/boundary, and you will probably see that the number of faces on the two patches is not the same per processor.

Another thing, which you might want to consider carefully, is that right now you assume a matching ordering of the faces. In general cases with might not be the case.

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   October 4, 2013, 15:27
Default
  #3
New Member
 
George D.
Join Date: Jan 2012
Posts: 2
Rep Power: 0
dgeorge8286 is on a distinguished road
Hi Niels,

Thank you very much for your response. Indeed it is the way you described it, however the option preservePatches in decomposeParDict doesn't seem to help.

George
dgeorge8286 is offline   Reply With Quote

Old   February 10, 2014, 19:29
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 383
Rep Power: 11
jherb is on a distinguished road
Probably too late, but nevertheless: Both patches (side1, side2) have to calculated by the same processor. So I guess preservePatches just guarantees that each patch is calculated by one processor but not all together. You might be able to do the calculation for each patch on an (arbitrary) processor and then use Pstream::scatter to exchange the information between the processors.
jherb is offline   Reply With Quote

Old   February 11, 2014, 11:18
Default
  #5
New Member
 
NaiXian Leslie Lu
Join Date: Jun 2009
Location: France
Posts: 26
Rep Power: 9
LESlie is on a distinguished road
Which OpenFOAM version are you using?
__________________
Cheers,
Leslie LU

LESlie is offline   Reply With Quote

Old   February 11, 2014, 11:21
Default
  #6
New Member
 
NaiXian Leslie Lu
Join Date: Jun 2009
Location: France
Posts: 26
Rep Power: 9
LESlie is on a distinguished road
Quote:
Originally Posted by ngj View Post
Hi George,

I would suspect that the decomposition is such that you have different number of faces on the two patches on each processor. Try to investigate processor*/constant/boundary, and you will probably see that the number of faces on the two patches is not the same per processor.

Another thing, which you might want to consider carefully, is that right now you assume a matching ordering of the faces. In general cases with might not be the case.

Kind regards,

Niels

Hi Niels,

How does one get face IDs of a polyPatch? I've just posted a thread How to get face IDs of a boundary

and reading your comments I feel that you might have the answer. Thanks in advance!
__________________
Cheers,
Leslie LU

LESlie is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
y+ and u+ values with low-Re RANS turbulence models: utility + testcase florian_krause OpenFOAM 110 April 21, 2016 11:54
error in parallel run immortality OpenFOAM Running, Solving & CFD 7 January 1, 2013 14:35
Cyclic BC's: Possible face ordering problem? (Channel flow) sega OpenFOAM Native Meshers: blockMesh 3 September 28, 2010 12:46
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12


All times are GMT -4. The time now is 08:50.