OpenFoam 建筑物绕流计算设置

计算建筑物绕流模拟时,需要的设定文件和内容。

一,polyMesh 中 boundary文件内容。

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/*   Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt   *\
|  Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com   |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

8
(
    e
    {
        type            patch;
        nFaces          808;
        startFace       3707465;
    }
    n
    {
        type            patch;
        nFaces          4756;
        startFace       3708273;
    }
    s
    {
        type            patch;
        nFaces          808;
        startFace       3713029;
    }
    w
    {
        type            patch;
        nFaces          808;
        startFace       3713837;
    }
    top
    {
        type            symmetry;
        inGroups        1(symmetry);
        nFaces          16;
        startFace       3714645;
    }
    bottom
    {
        type            wall;
        inGroups        1(wall);
        nFaces          43390;
        startFace       3714661;
    }

    inner_bottom
    {
        type            wall;
        physicalType    patch;
        inGroups        1(wall);
        nFaces          909;
        startFace       3766612;
    }

    bldg
    {
        type            wall;
        physicalType    patch;
        inGroups        1(wall);
        nFaces          8561;
        startFace       3758051;
    }
)

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

二,constant / transportProperties 和 turbulenceProperties 文件内容。

transportProperties

/*--------------------------------*- 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       dictionary;
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

transportModel  Newtonian;

nu              [0 2 -1 0 0 0 0] 1.5e-05;

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

 turbulenceProperties

/*--------------------------------*- 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       dictionary;
    object      RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

simulationType RAS;

RAS
{
    RASModel        kEpsilon;

    turbulence      on;

    printCoeffs     on;
}

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

三,初始变量 0/U,p, k, epsilon, nut 文件内容。

0/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);
	    initABL        true;
    }

    s
    {
        type            zeroGradient;
    }

    w
    {
        type            zeroGradient;
    } 
   
    top
    {
        type            symmetry;
    }

    bottom
    {
        type            noSlip;
    }

    inner_bottom
    {
        type            noSlip;
    }

    bldg
    {
        type            noSlip;
    }
}

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

 0/p

/*--------------------------------*- 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      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    e
    {
        type            zeroGradient;

    }
    n
    {
        type            zeroGradient;

    }

    s
    {
        type            fixedValue;
        value           uniform 0;
    }

    w
    {
        type            zeroGradient;

    }
       
    top
    {
        type            symmetry;

    }
    
    bottom
    {
        type            zeroGradient;

    }    
    
    inner_bottom
    {
        type            zeroGradient;
    }
    bldg
    {
        type            zeroGradient;
    }
}

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

0/k 

/*--------------------------------*- 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      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

kInlet          1.5;   // approx k = 0.5*(I*U)^2 ; I = 0.1

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

internalField   uniform $kInlet;

boundaryField
{
    e
    {
        type            zeroGradient;
    }

    n
    {
	    type            atmBoundaryLayerInletK;
        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            kqRWallFunction;
        value           uniform $kInlet;
    }   

    inner_bottom
    {
        type            kqRWallFunction;
        value           uniform $kInlet;
    }

    bldg
    {
        type            kqRWallFunction;
        value           uniform $kInlet;
    }
}

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

0/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/nut 

/*--------------------------------*- 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      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    e
    {
        type            calculated;
        value           uniform 0;

    }

    n
    {
        type            calculated;
        value           uniform 0;
    }

    s
    {
        type            calculated;
        value           uniform 0;
    }

    w
    {
        type            calculated;
        value           uniform 0;
    }

    top
    {
        type            symmetry;
    }

   bottom
    {
        type            nutkWallFunction;
        value           uniform 0;
	   //z0             uniform 0.01
    }
    
    inner_bottom
    {
        type            nutkWallFunction;
        value           uniform 0;
	    //z0            uniform 0.01
    }

    bldg
    {
        type            nutkWallFunction;
        value           uniform 0;
	    //z0            uniform 0.005
    }
}

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

四,system 下文件设置

system/controlDict

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1706+                                |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/* Butterfly 0.0.4                https://github.com/ladybug-tools/butterfly *\
\*---------------------------------------------------------------------------*/
FoamFile
{
	version		4.0;
	format		ascii;
	class		dictionary;
	location	"system";
	object		controlDict;
}

//#include		"probes";

application		simpleFoam;

startFrom		latestTime;

startTime		0;

stopAt		endTime;

endTime		3000;

deltaT		1;

writeControl		timeStep;

writeInterval		200;

purgeWrite		0;

writeFormat		ascii;

writePrecision		8;

writeCompression		off;

timeFormat		general;

timePrecision		6;

runTimeModifiable		true;

functions{

 #includeFunc  probes
 #includeFunc  probes_lines_0.1m
 #includeFunc  probes_lines_0.01m
 #includeFunc  probes_lines_0m
 #includeFunc  residuals

}

system/fvSchemes

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1706+                                |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/* Butterfly 0.0.4                https://github.com/ladybug-tools/butterfly *\
\*---------------------------------------------------------------------------*/
FoamFile
{
	version		4.0;
	format		ascii;
	class		dictionary;
	location	"system";
	object		fvSchemes;
}

ddtSchemes
{

    default		steadyState;

}

gradSchemes
{

    default		cellLimited leastSquares 1;

}

divSchemes
{

    default		none;

    div(phi,epsilon)		bounded Gauss linearUpwind grad(epsilon);

    div(phi,U)		bounded Gauss linearUpwindV grad(U);

    div((nuEff*dev2(T(grad(U)))))		Gauss linear;

    div(phi,k)		bounded Gauss linearUpwind grad(k);

}

laplacianSchemes
{

    default		Gauss linear limited corrected 0.333;

}

interpolationSchemes
{

    default		linear;

}

snGradSchemes
{

    default		limited corrected 0.333;

}

fluxRequired
{

    default		no;

}

system/fvSolution

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1706+                                |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/* Butterfly 0.0.4                https://github.com/ladybug-tools/butterfly *\
\*---------------------------------------------------------------------------*/
FoamFile
{
	version		4.0;
	format		ascii;
	class		dictionary;
	location	"system";
	object		fvSolution;
}

solvers
{

    p
    {

        agglomerator		faceAreaPair;

        relTol		0.1;

        tolerance		1e-7;

        nCellsInCoarsestLevel		10;

        smoother		GaussSeidel;

        solver		GAMG;

        cacheAgglomeration		on;

        nPostSweeps		2;

        nPreSweepsre		0;

        mergeLevels		1;

    }

    U
    {

        relTol		0.1;

        tolerance		1e-8;

        nSweeps		1;

        smoother		GaussSeidel;

        solver		smoothSolver;

    }

    k
    {

        relTol		0.1;

        tolerance		1e-8;

        nSweeps		1;

        smoother		GaussSeidel;

        solver		smoothSolver;

    }

    epsilon
    {

        relTol		0.1;

        tolerance		1e-8;

        nSweeps		1;

        smoother		GaussSeidel;

        solver		smoothSolver;

    }

}

SIMPLE
{

    nNonOrthogonalCorrectors		2;

    residualControl
    {

        nut		1e-8;

        k		1e-8;

        U		1e-8;

        p		1e-8;

        epsilon	1e-8;

    }

}

relaxationFactors
{

    k		0.7;

    U		0.7;

    epsilon		0.7;

    p		0.3;

}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值