CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

Problems parallel run with cellZones while serial is running

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

LinkBack Thread Tools Display Modes
Old   March 10, 2017, 09:37
Default Problems parallel run with cellZones while serial is running
Senior Member
Join Date: Jan 2014
Posts: 139
Rep Power: 5
hxaxtma is on a distinguished road
Hi guys,
following problem occurs (using openfoam 4.1) in my case. Calculating some data over a cellZone or cellSet runs in serial absolutely fine, in parallel the solver crashes.

In serial magUbarlocal is filled with correct values.
In parallel no values are inserted -> Solver crashes

Here is a small code snippet causing the problem (implementing within the fvOptions framework). where cells_ contain the label list of the cellZone:
Code how cell labels is obtained:
            label zoneID = mesh_.cellZones().findZoneID(cellSetName_);
            if (zoneID == -1)
                    << "Cannot find cellZone " << cellSetName_ << endl
                    << "Valid cellZones are " << mesh_.cellZones().names()
                    << exit(FatalError);
            cells_ = mesh_.cellZones()[zoneID];

Code which causes the problem:

    // Integrate flow variables over cell set
    const volVectorField& U;
    scalarField magUbarlocal_(cells_,size(),0.0);

    const scalarField& cv = mesh_.V();
    forAll(cells_, i)
        label cellI = cells_[i];
        magUbarlocal_[i] = (flowDir_ & U[cellI]);


    // Collect across all processors
    reduce(magUbarlocal_, sumOp<scalarField>());
Error is here:
void Foam::Pstream::gather<Foam::Field<double>, Foam::sumOp<Foam::Field<double> > >(Foam::List<Foam::UPstream::commsStruct> const&, Foam::Field<double>&, Foam::sumOp<Foam::Field<double> > const&, int, int) at ??:?
Running OPenFOAm in Debug Mode gives following hint:
Time = 1

smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.0842275
526312, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 0.971361820323, Final residua
l = 0.0643989023786, No Iterations 2
smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 0.0662730
562513, No Iterations 2
[0] Field<scalar> f1(0), Field<scalar> f2(0) and Field<scalar> f3(240)
for operation f1 = f2 + f3
[0] From function void Foam::checkFields(const Foam::UList<T>&, const Foam:
:UList<Key>&, const Foam::UList<Type3>&, const char*) [with Type1 = double; Typ
e2 = double; Type3 = double]
[0] in file /opt/openfoam4_dbg/src/OpenFOAM/lnInclude/FieldM.H at line 75.
FOAM parallel run aborting
Next, in FieldM.H , line 75 the command if (f1.size() != f2.size() || f1.size() != f3.size()) results in the above error.
So again, the error is caused by non inserting the local values into the array.

Any advice what I am doing wrong here?

Last edited by hxaxtma; March 10, 2017 at 11:09.
hxaxtma is offline   Reply With Quote



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
multiphaseEulerFoam running in serial but crashing in parallel BlnPhoenix OpenFOAM Running, Solving & CFD 1 May 4, 2017 03:40
parallel run is slower than serial run (pimpleFoam) !!! mechy OpenFOAM 18 August 17, 2016 17:19
Problems running OpenFOAM 2.3 in parallel vinz OpenFOAM Running, Solving & CFD 4 April 25, 2014 15:04
Parallel run diverges, serial does not SammyB OpenFOAM Running, Solving & CFD 1 May 10, 2009 03:28
Parallel Run Problems Jason Siemens 1 November 24, 2008 13:32

All times are GMT -4. The time now is 17:22.