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

Bad parallelization. Has this ever happened to you??? :O

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 23, 2019, 15:40
Default Bad parallelization. Has this ever happened to you??? :O
  #1
New Member
 
Join Date: Sep 2019
Posts: 14
Rep Power: 2
rucky96 is on a distinguished road
Hi,

I was trying to solve the problem of a magnetically confined conductive fluid in a periodic cylinder. The results for a serial simulation gives resonable results... But when I run the simulation for 2 processors one can distinguish 2 zones in the cylinder (one per processor). If I am using 3 one can distinguish 3 zones. Same for 4.

I suppose that there is a problem in the comunication between the cells at the boundaries of each processors zone. I am using scotch method.

I tried (it did not work):
  1. Change the method to simple.
  2. Add a correctBoundaryConditions() in the equation for B in mhdFoam.

I suppose that the problem is in the solver that I am using (a mhdFoam slightly modified). mhdFoam works well with parallelization. But when one wants to add a external magnetic field one has to modify the equation for B (with \mathbf B\left(\mathbf r,t\right)=\mathbf B_{variable}\left(\mathbf r,t\right)+\mathbf B_{fixed}\left(\mathbf r\right), \mathbf B_{fixed}\left(\mathbf r\right) is the same for all t).
  • Induction equation in mhdFoam looks like:
    Code:
            while (bpiso.correct())
            {
                fvVectorMatrix BEqn // the magnetic induction equation, calculates the magnetic field taking into account the influence of the velocity.
                (
                    fvm::ddt(B)
                  + fvm::div(phi, B)
                  - fvm::laplacian(DB, B)
                  - fvc::div(phiB, U)
                );
    
                BEqn.solve();
                phiB = fvc::flux(B);//phiB is calculated at faces.
                
                while (bpiso.correctNonOrthogonal())
                {
                    fvScalarMatrix pBEqn //A Poisson equation is derived for the fictitious magnetic pressure pB and solved
                    (
                        fvm::laplacian(pB) == fvc::div(phiB)
                    );
    
                    pBEqn.solve();
    
                    if (bpiso.finalNonOrthogonalIter()) //The variable distribution is then employed to correct the phiB values
                    {
                        phiB -= pBEqn.flux();
                    }
                    
                }// The loop exits after the prescribed iterations stated in the fvSolution file.
                #include "magneticFieldErr.H" //print magnetic field divergence deviation from null value
            }
  • My induction equation in modified mhdFoam looks like
    Code:
            #include "readBFixed.H"
            while (bpiso.correct())
            {
                fvVectorMatrix BVbleEqn
                (
                    fvm::ddt(BVble)
                  + fvm::div(phi,BVble)
                  + fvc::div(phi,BFixed)
                  - fvc::div(phiBVble,U)
                  - fvc::div(phiBFixed,U)
                  - fvm::laplacian(lambda,BVble)
                  - fvc::laplacian(lambda,BFixed)
                );
                
                BVbleEqn.solve();
                phiBVble = fvc::flux(BVble);
    
                while (bpiso.correctNonOrthogonal())
                {
                    fvScalarMatrix pBVbleEqn
                    (
                        fvm::laplacian(pBVble) == fvc::div(phiBVble)
                    );
    
                    pBVbleEqn.solve();
    
                    if (bpiso.finalNonOrthogonalIter())
                    {
                        phiBVble -= pBVbleEqn.flux();
                    }
                }
                #include "magneticFieldErr.H"
    
                BVble.correctBoundaryConditions();          
            }
            B=BVble+BFixed;
            phiB = fvc::flux(B);

Maybe the problem is to sum B=BVble+BFixed in this way??

3p.png

2p.png
rucky96 is offline   Reply With Quote

Old   November 28, 2019, 09:58
Default
  #2
New Member
 
Join Date: Sep 2019
Posts: 14
Rep Power: 2
rucky96 is on a distinguished road
I tried the same case with the OF series solver for MHD. I used the same configuration and the same magnetic field profile but without an external magnetic field source at t> 0, that is, it is an MHD decay. The result has been the same as with the modified solver.

I have tried the same thing in a box with periodic conditions on the sides and I have not seen anything unusual.

It seems that the quality of the parallelization in OF depends on how simple the mesh is. If it is a bit complicated it seems that parallelization does not work so well. If this is true is an OF internal issue and I cannot do anything.

Am I right?
rucky96 is offline   Reply With Quote

Old   November 28, 2019, 17:49
Default
  #3
HPE
Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 76
Rep Power: 2
HPE is on a distinguished road
yes you can. submit an issue ticket in gitlab repo.
__________________
Kind regards,
HPE
HPE is offline   Reply With Quote

Old   November 29, 2019, 13:22
Default
  #4
New Member
 
Join Date: Sep 2019
Posts: 14
Rep Power: 2
rucky96 is on a distinguished road
Hi HPE,

Thanks for answering. I do not understand what you mean
rucky96 is offline   Reply With Quote

Old   November 29, 2019, 13:43
Default
  #5
HPE
Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 76
Rep Power: 2
HPE is on a distinguished road
My apologies. I wrote that while I was in bed.

>> If this is true is an OF internal issue and I cannot do anything.

I meant that if you think that there is an internal issue in OF, you can submit a bug ticket in gitlab repository, so that the developers can have a look at the issue, and evaluate it for you.
__________________
Kind regards,
HPE
HPE is offline   Reply With Quote

Reply

Tags
mhdfoam, parallelization, scotch, simple method

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] Add Layers in snappyHexMesh shchepan OpenFOAM Meshing & Mesh Conversion 22 November 23, 2019 14:21
Problems installing OpenFOAM 2.3.0, 1.6-ext and foam-extend 3.0 sam.ho OpenFOAM Installation 35 April 5, 2014 16:31
[ANSYS Meshing] Very thin plate (0.1mm) ICEM CFD bad meshing msormania ANSYS Meshing & Geometry 1 April 30, 2012 08:45
Allwmake path error kiski OpenFOAM Installation 20 March 22, 2012 13:45
Problems of Duns Codes! Martin J Main CFD Forum 8 August 15, 2003 00:19


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