OpenFoam 并行计算设置

OpenFoam 并行计算设置需要的步骤。

一, 准备 decomposeParDict 文件

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

numberOfSubdomains 4;

method          simple;

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

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

manualCoeffs
{
    dataFile        "";
}

distributed     no;

roots           ( );


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

 二,运行命令行指令

decomposePar 

mpirun -np 4 simpleFoam -parallel > log 

reconstructPar

三,注意事项

初始值设定时,如果使用了入口大气边界条件,应该设定 value 值。

比如 U 值设定为:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    e
    {
        type            zeroGradient;

    }
    n
    {
	    type            atmBoundaryLayerInletVelocity;
        flowDir         (0 -1 0);
        zDir            (0 0 1);
        Uref            9.52;
        Zref            6.0;
        z0              uniform 0.01;
        zGround         uniform 0.0;

	    value         uniform (0 0 0); //setup value
	    initABL        true;           //setup initial bool to true


    }

    s
    {
        type            zeroGradient;

    }

    w
    {
        type            zeroGradient;

    }    
    top
    {
        type            symmetry;

    }
    bottom
    {
        type            noSlip;

    }
    inner_bottom
    {
        type            noSlip;
    }
    bldg
    {
        type            noSlip;
    }
}

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

比如 k 和 epsilon 值设定为:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

epsilonInlet  0.03; // Cmu^0.75 * k^1.5 / L ; L =10

dimensions      [0 2 -3 0 0 0 0];

internalField   uniform $epsilonInlet;

boundaryField
{
    e
    {
        type            zeroGradient;

    }
    n
    {
	    type            atmBoundaryLayerInletEpsilon;
        flowDir         (0 -1 0);
        zDir            (0 0 1);
        Uref            9.52;
        Zref            6.0;
        z0              uniform 0.01;
        zGround         uniform 0.0;

	    value         uniform 0;
	    initABL        true;

    }

    s
    {
        type            zeroGradient;

    }

    w
    {
        type            zeroGradient;

    }
    
    top
    {
        type            symmetry;

    }
    
    bottom
    {
        type            epsilonWallFunction;
        value           uniform $epsilonInlet;
	//z0               uniform 0.01;

    }

    inner_bottom
    {
        type            epsilonWallFunction;
        value           uniform $epsilonInlet;
	    //z0               uniform 0.01;
    }

    bldg
    {
        type            epsilonWallFunction;
        value           uniform $epsilonInlet;
	//z0               uniform 0.005;
    }

    
}

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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值