CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How to run airFoil2D exapmle in parallel on 4 cores? (https://www.cfd-online.com/Forums/openfoam/83703-how-run-airfoil2d-exapmle-parallel-4-cores.html)

klausb January 8, 2011 15:58

How to run airFoil2D exapmle in parallel on 4 cores?
 
Hello,

I tried to run the airFoil2D example in parallel (4 core processor) using mpi but it didn't work. What's wrong?

My approach:

1. Created a decomposeParDict (and set y to 0 since it's a 2D case)
2. Ran decomposePar
3. Changed the Allrun batch file

decomposeParDict:

numberOfSubdomains 4;

method simple;

simpleCoeffs
{
n ( 2 2 0 );
delta 0.001;
}

hierarchicalCoeffs
{
n ( 1 1 0 );
delta 0.001;
order xyz;
}

metisCoeffs
{
processorWeights ( 1 1 1 1 );
}

manualCoeffs
{
dataFile "";
}

distributed no;

roots ( );


//************************************************** ***********************//

Allrun:

#!/bin/sh

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

application=`getApplication`

#runApplication $application
mpirun -np 4 $application -parallel > log &

cheng1988sjtu January 8, 2011 21:15

Run Parallel
 
Since it's 2D case, and it's in xz plane, so maybe in the following line you can try:

simpleCoeffs
{
n ( 2 1 2 );
delta 0.001;
}

hierarchicalCoeffs
{
n ( 1 1 1 );
delta 0.001;
order xyz;
}

Hope it works~:)

klausb January 9, 2011 02:45

Solution
 
Thank you! Also, the header text must be there.

Solution:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.x |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

numberOfSubdomains 4;

method simple;

simpleCoeffs
{
n ( 2 1 2 );
delta 0.001;
}

hierarchicalCoeffs
{
n ( 1 1 1 );
delta 0.001;
order xyz;
}

metisCoeffs
{
processorWeights ( 1 1 1 1 );
}

manualCoeffs
{
dataFile "";
}

distributed no;

roots ( );


// ************************************************** *********************** //


All times are GMT -4. The time now is 00:24.