CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

myBC does not work in parallel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 20, 2021, 12:21
Default myBC does not work in parallel
  #1
Member
 
UOCFD
Join Date: Oct 2020
Posts: 40
Rep Power: 6
uosilos is on a distinguished road
I have tried to modify the activePressureForceBaffleVelocity BC.
It works fine in a single processor but not in parallel.
Any hint?


Code:
const fvPatch& cyclicPatch = patch().boundaryMesh()[cyclicPatchLabel_];
        const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
        const fvPatch& nbrPatch = refCast<const cyclicFvPatch>
        (
            cyclicPatch
        ).neighbFvPatch();

        const labelList& nbrFaceCells = nbrPatch.patch().faceCells();

        scalar valueDiff = 0;
        scalar valueDiffAvg = 0;
        const scalar& cyclicFacesNumber = cyclicFaceCells.size();
        //scalar cyclicFacesNumber = cyclicFaceCells.size();
        //scalar cyclicFacesNumber = 0;
        
        Info<< "Show = " << cyclicFaceCells.size() << endl;
        Info<< "Faces in each cyclic baffle1 = " << cyclicFacesNumber << endl;

        if (fBased_)
        {
             ...
        }
        else // pressure based
        {
            forAll(cyclicFaceCells, facei)
            {
                valueDiff += p[cyclicFaceCells[facei]];
            }

            forAll(nbrFaceCells, facei)
            {
                valueDiff -= p[nbrFaceCells[facei]];
            }
            
            if (cyclicFacesNumber>0)
            {
                valueDiffAvg = valueDiff/cyclicFacesNumber;
                
                Info<< "Faces in each cyclic baffle2 = " << cyclicFacesNumber << endl;
                Info<< "Baffle face-averaged deltaP = " << valueDiffAvg << endl;
            }

            Info<< "Pressure difference = " << valueDiff << endl;
        }

        //if ((mag(valueDiff) > mag(minThresholdValue_)) || baffleActivated_)
        if ((mag(valueDiffAvg) > mag(minThresholdValue_)) || baffleActivated_)
uosilos is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Communication Deadlock in MPPICFoam Parallel Solver auburnhpc OpenFOAM Running, Solving & CFD 1 May 29, 2021 17:55
The problem when i use parallel computation for mesh deforming. Hiroaki Sumikawa OpenFOAM Running, Solving & CFD 0 November 20, 2018 03:58
[snappyHexMesh] OpenFoam in parallel with sHM and sFE pradyumnsingh OpenFOAM Meshing & Mesh Conversion 4 October 26, 2018 17:25
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 05:18
Cases with small length scale work fine on a single processor but fail in parallel adona058 OpenFOAM Bugs 5 April 17, 2009 05:41


All times are GMT -4. The time now is 10:32.