DecomposePar

From OpenFOAMWiki

It decomposes a case to be run in parallel. The syntax of the command is the following


    decomposePar <root> <case> [-cellDist] [-fields] [-filterPatches] [-copyUniform]


It requires a dictionary named decomposeParDict is present in the system subdirectory of the case. The syntax of the dictionary is the following:

 
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.3                                   |
|   \\  /    A nd           | Web:      http://www.openfoam.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
 
FoamFile
{
    version         2.0;
    format          ascii;
 
    root            "";
    case            "";
    instance        "";
    local           "";
 
    class           dictionary;
    object          decomposeParDict;
}
 
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 
numberOfSubdomains 4;
 
method          simple;
 
simpleCoeffs
{
    n               (1 4 1);
    delta           0.001;
}
 
hierarchicalCoeffs
{
    n               (1 1 1);
    delta           0.001;
    order           xyz;
}
 
metisCoeffs
{
    processorWeights 
    (
        1
        1
        1
    );
}
 
manualCoeffs
{
    dataFile        "";
}
 
distributed     no;
 
roots           
(
);
 
 
// ************************************************************************* //
 
  • numberOfSubdomains specifies the number of processor (or cores) you want to use to solve your case.
  • method specifies the method used to decompose the domain. Available methods are:
    • simple: it decomposes the domain in equal parts according in the directions specified in the corresponding subdictionary simpleCoeffs. For example, do decompose a case in 4 parts in the x direction, n has to be set to (4 1 1). To split the domain into 8 parts, 4 in the x direction and 2 in the z direction, n has to be set to (4 1 2).
    • hierarchical: it's the same than simple, but the user can specify the order according to which the decomposition is done.
    • metis: it decomposes the domain using the METIS algorithm, which tries to minimize the communication between processors. It is possible to specify weights for the different processors if the parallelised system is composed by machines with different performances.
    • manual: it lets the user directly specify the allocation of each cell to a particular processor.
  • delta is the cell skew factor. It's default value is 0.001.

It is possible to distribute the case on different disks, by setting the distributed option to yes and by setting the root for the case directories with the following syntax:

 
roots
<nRoots>
(
  "<root0>"
  "<root1>"
...
);

where <nRoots> is the number of root directories specified, <root0> is the root directory for the node 0, <root1> the root directory for the node 1, and so on.