T721_01 OpenFoam pitzDaily

T721_011 pitzDailyExptInlet

この記事は約24分で読めます。

OpenFoamのサンプル確認(パラメータやキーワードの覚書)です。

バージョン : Windows版(OpenFOAM-v2106-windows-mingw.exe)

チュートリアルフォルダ:チュートリアル場所(windows)

引用元

<チュートリアルフォルダ>\incompressible\simpleFoam\pitzDailyExptInlet

結果図

流体速度のモデルになります。

ベクトル表示

作業

基本的な流れはT703 OpenFoam tipsと同じです。(または作業

//チュートリアルからサンプルをコピーしておきます。//

//リソースフォルダからflange.ansファイルをコピーします。//

//コマンド:メッシュ作成
blockMesh

//計算実行//
simpleFoam

//ParaView用VTK変換//
foamToVTK

モデル

設定値の抜粋まとめ

太字:差分

全体構造

//初期フォルダ・ファイル構成
pitzDailyExptInlet                  
├ 0                       
│ ├ epsilon              
│ ├ k                    
│ ├ nut                  
│ ├ nuTilda              
│ ├ omega                
│ ├ p                    
│ └ U                    
├ constant               
│ ├ boundaryData        
│ │ └ inlet            
│ │    ├ 0             
│ │    │ ├ epsilon    
│ │    │ ├ k          
│ │    │ └ U          
│ │    └ points                 
│ ├ transportProperties  :物性値
│ └ turbulenceProperties  :乱流設定
└ system                  
   ├ blockMeshDict        :ブロックメッシュ定義
   ├ controlDict          :解析ジョブ設定
   ├ decomposeParDict     :並列計算設定
   ├ fvSchemes            :ソルバー設定
   └ fvSolution           :ソルバー設定      

0

設定確認 epsilon

//ファイル:epsilon//

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

internalField   uniform 14.855;

boundaryField
{
    inlet
    {
        type            timeVaryingMappedFixedValue;
        setAverage      0;
        offset          0;
    }

    outlet
    {
        type            zeroGradient;
    }

    upperWall
    {
        type            epsilonWallFunction;
        value           uniform 14.855;
    }

    lowerWall
    {
        type            epsilonWallFunction;
        value           uniform 14.855;
    }

    frontAndBack
    {
        type            empty;
    }
}

設定確認 k

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

internalField   uniform 0.375;

boundaryField
{
    inlet
    {
        type            timeVaryingMappedFixedValue;
        setAverage      0;
        offset          0;
    }

    outlet
    {
        type            zeroGradient;
    }

    upperWall
    {
        type            kqRWallFunction;
        value           uniform 0.375;
    }

    lowerWall
    {
        type            kqRWallFunction;
        value           uniform 0.375;
    }

    frontAndBack
    {
        type            empty;
    }
}

設定確認 nut

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

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            calculated;
        value           uniform 0;
    }

    outlet
    {
        type            calculated;
        value           uniform 0;
    }

    upperWall
    {
        type            nutkWallFunction;
        value           uniform 0;
    }

    lowerWall
    {
        type            nutkWallFunction;
        value           uniform 0;
    }

    frontAndBack
    {
        type            empty;
    }
}

設定確認 nuTilda

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

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    outlet
    {
        type            zeroGradient;
    }

    upperWall
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            zeroGradient;
    }

    frontAndBack
    {
        type            empty;
    }
}

設定確認 omega

なし

設定確認 p

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

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    upperWall
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            zeroGradient;
    }

    frontAndBack
    {
        type            empty;
    }
}

設定確認 U

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

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            timeVaryingMappedFixedValue;
        offset          (0 0 0);
        setAverage      off;
    }

    outlet
    {
        type            zeroGradient;
    }

    upperWall
    {
        type            noSlip;
    }

    lowerWall
    {
        type            noSlip;
    }

    frontAndBack
    {
        type            empty;
    }
}

constant

設定確認 transportProperties

transportModel  Newtonian;

nu              1e-05;

設定確認 turbulenceProperties

simulationType      RAS;

RAS
{
    RASModel        kEpsilon;

    turbulence      on;

    printCoeffs     on;
}

設定確認 boundaryData > inlet > points

// Points
70
(

// min z
(-0.0206 0.000125 0)
(-0.0206 0.000375 0)
(-0.0206 0.000625 0)
(-0.0206 0.000875 0)
(-0.0206 0.001125 0)
(-0.0206 0.001375 0)
(-0.0206 0.001625 0)
(-0.0206 0.001875 0)
(-0.0206 0.00220314 0)
(-0.0206 0.00263672 0)
(-0.0206 0.00312852 0)
(-0.0206 0.00368638 0)
(-0.0206 0.00431918 0)
(-0.0206 0.00503697 0)
(-0.0206 0.00585116 0)
(-0.0206 0.0067747 0)
(-0.0206 0.00782229 0)
(-0.0206 0.00901059 0)
(-0.0206 0.0103585 0)
(-0.0206 0.0118874 0)
(-0.0206 0.0134739 0)
(-0.0206 0.0149487 0)
(-0.0206 0.0162845 0)
(-0.0206 0.0174943 0)
(-0.0206 0.0185901 0)
(-0.0206 0.0195826 0)
(-0.0206 0.0204815 0)
(-0.0206 0.0212956 0)
(-0.0206 0.022033 0)
(-0.0206 0.0227009 0)
(-0.0206 0.0233059 0)
(-0.0206 0.0238537 0)
(-0.0206 0.0243499 0)
(-0.0206 0.0247994 0)
(-0.0206 0.0252065 0)

// max z
(-0.0206 0.000125 0.173)
(-0.0206 0.000375 0.173)
(-0.0206 0.000625 0.173)
(-0.0206 0.000875 0.173)
(-0.0206 0.001125 0.173)
(-0.0206 0.001375 0.173)
(-0.0206 0.001625 0.173)
(-0.0206 0.001875 0.173)
(-0.0206 0.00220314 0.173)
(-0.0206 0.00263672 0.173)
(-0.0206 0.00312852 0.173)
(-0.0206 0.00368638 0.173)
(-0.0206 0.00431918 0.173)
(-0.0206 0.00503697 0.173)
(-0.0206 0.00585116 0.173)
(-0.0206 0.0067747 0.173)
(-0.0206 0.00782229 0.173)
(-0.0206 0.00901059 0.173)
(-0.0206 0.0103585 0.173)
(-0.0206 0.0118874 0.173)
(-0.0206 0.0134739 0.173)
(-0.0206 0.0149487 0.173)
(-0.0206 0.0162845 0.173)
(-0.0206 0.0174943 0.173)
(-0.0206 0.0185901 0.173)
(-0.0206 0.0195826 0.173)
(-0.0206 0.0204815 0.173)
(-0.0206 0.0212956 0.173)
(-0.0206 0.022033 0.173)
(-0.0206 0.0227009 0.173)
(-0.0206 0.0233059 0.173)
(-0.0206 0.0238537 0.173)
(-0.0206 0.0243499 0.173)
(-0.0206 0.0247994 0.173)
(-0.0206 0.0252065 0.173)

)

設定確認 boundaryData > inlet > 0 > epsilon

// Data on points
70
(

//minz
9813.84
9813.84
7231.83
1260.68
1260.68
253.433
253.433
76.6694
76.6694
30.8982
16.0868
16.0868
10.4406
7.39238
4.6135
3.0542
2.39951
2.24094
2.3504
2.93787
3.6326
3.15933
2.71282
2.72062
3.09416
4.18748
7.30754
14.5872
29.1787
73.9208
490.641
3622.84
5549.75
6430.47
6327.27

// maxz
9813.84
9813.84
7231.83
1260.68
1260.68
253.433
253.433
76.6694
76.6694
30.8982
16.0868
16.0868
10.4406
7.39238
4.6135
3.0542
2.39951
2.24094
2.3504
2.93787
3.6326
3.15933
2.71282
2.72062
3.09416
4.18748
7.30754
14.5872
29.1787
73.9208
490.641
3622.84
5549.75
6430.47
6327.27
)

設定確認 boundaryData > inlet > 0 > k

70
(

//minz
2.95219
2.95219
2.03053
0.578138
0.578138
0.395494
0.395494
0.240375
0.240375
0.178115
0.147052
0.147052
0.134358
0.118537
0.0868366
0.0821937
0.0830451
0.0986349
0.0910976
0.0970347
0.0989484
0.100615
0.101638
0.101436
0.093114
0.0807476
0.091841
0.128637
0.195302
0.188586
0.278105
1.68477
2.52454
3.28528
2.20308

// maxz
2.95219
2.95219
2.03053
0.578138
0.578138
0.395494
0.395494
0.240375
0.240375
0.178115
0.147052
0.147052
0.134358
0.118537
0.0868366
0.0821937
0.0830451
0.0986349
0.0910976
0.0970347
0.0989484
0.100615
0.101638
0.101436
0.093114
0.0807476
0.091841
0.128637
0.195302
0.188586
0.278105
1.68477
2.52454
3.28528
2.20308
)

設定確認 boundaryData > inlet > 0 > u

// Data on points
70
(

//minz
(5.74803 0 0)
(5.74803 0 0)
(11.3009 0 0)
(13.4518 0 0)
(13.4518 0 0)
(14.0472 0 0)
(14.0472 0 0)
(14.2901 0 0)
(14.2901 0 0)
(14.3668 0 0)
(14.3108 0 0)
(14.3108 0 0)
(14.158 0 0)
(13.9312 0 0)
(13.7642 0 0)
(13.6843 0 0)
(13.731 0 0)
(13.6463 0 0)
(13.6104 0 0)
(13.4808 0 0)
(13.2398 0 0)
(12.9544 0 0)
(12.8659 0 0)
(12.8727 0 0)
(12.9369 0 0)
(13.0134 0 0)
(13.105 0 0)
(13.2712 0 0)
(13.5215 0 0)
(13.7194 0 0)
(13.6965 0 0)
(10.5343 0 0)
(7.15377 0 0)
(4.09142 0 0)
(1.31793 0 0)

// maxz
(5.74803 0 0)
(5.74803 0 0)
(11.3009 0 0)
(13.4518 0 0)
(13.4518 0 0)
(14.0472 0 0)
(14.0472 0 0)
(14.2901 0 0)
(14.2901 0 0)
(14.3668 0 0)
(14.3108 0 0)
(14.3108 0 0)
(14.158 0 0)
(13.9312 0 0)
(13.7642 0 0)
(13.6843 0 0)
(13.731 0 0)
(13.6463 0 0)
(13.6104 0 0)
(13.4808 0 0)
(13.2398 0 0)
(12.9544 0 0)
(12.8659 0 0)
(12.8727 0 0)
(12.9369 0 0)
(13.0134 0 0)
(13.105 0 0)
(13.2712 0 0)
(13.5215 0 0)
(13.7194 0 0)
(13.6965 0 0)
(10.5343 0 0)
(7.15377 0 0)
(4.09142 0 0)
(1.31793 0 0)
)

system

設定確認 blockMeshDict

scale   0.001;

vertices
(
    (-20.6 0 -0.5)
    (-20.6 25.4 -0.5)
    (0 -25.4 -0.5)
    (0 0 -0.5)
    (0 25.4 -0.5)
    (206 -25.4 -0.5)
    (206 0 -0.5)
    (206 25.4 -0.5)
    (290 -16.6 -0.5)
    (290 0 -0.5)
    (290 16.6 -0.5)

    (-20.6 0 0.5)
    (-20.6 25.4 0.5)
    (0 -25.4 0.5)
    (0 0 0.5)
    (0 25.4 0.5)
    (206 -25.4 0.5)
    (206 0 0.5)
    (206 25.4 0.5)
    (290 -16.6 0.5)
    (290 0 0.5)
    (290 16.6 0.5)
);

negY
(
    (2 4 1)
    (1 3 0.3)
);

posY
(
    (1 4 2)
    (2 3 4)
    (2 4 0.25)
);

posYR
(
    (2 1 1)
    (1 1 0.25)
);


blocks
(
    hex (0 3 4 1 11 14 15 12)
    (18 30 1)
    simpleGrading (0.5 $posY 1)

    hex (2 5 6 3 13 16 17 14)
    (180 27 1)
    edgeGrading (4 4 4 4 $negY 1 1 $negY 1 1 1 1)

    hex (3 6 7 4 14 17 18 15)
    (180 30 1)
    edgeGrading (4 4 4 4 $posY $posYR $posYR $posY 1 1 1 1)

    hex (5 8 9 6 16 19 20 17)
    (25 27 1)
    simpleGrading (2.5 1 1)

    hex (6 9 10 7 17 20 21 18)
    (25 30 1)
    simpleGrading (2.5 $posYR 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 1 12 11)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (8 9 20 19)
            (9 10 21 20)
        );
    }
    upperWall
    {
        type wall;
        faces
        (
            (1 4 15 12)
            (4 7 18 15)
            (7 10 21 18)
        );
    }
    lowerWall
    {
        type wall;
        faces
        (
            (0 3 14 11)
            (3 2 13 14)
            (2 5 16 13)
            (5 8 19 16)
        );
    }
    frontAndBack
    {
        type empty;
        faces
        (
            (0 3 4 1)
            (2 5 6 3)
            (3 6 7 4)
            (5 8 9 6)
            (6 9 10 7)
            (11 14 15 12)
            (13 16 17 14)
            (14 17 18 15)
            (16 19 20 17)
            (17 20 21 18)
        );
    }
);

設定確認 controlDict

結果出力間隔を50→10にしています。 writeInterval 10;

application     simpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         1000;

deltaT          1;

writeControl    timeStep;

writeInterval   10;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{
    streamLines
    {
        type            streamLine;

        // Where to load it from (if not already in solver)
        libs            (fieldFunctionObjects);

        // Output every
        writeControl    writeTime;
        // writeInterval 10;

        setFormat       vtk; //gnuplot;//xmgr;//raw;//jplot;//csv;//ensight;

        // Tracked forwards (+U) or backwards (-U)
        trackForward    true;

        // Names of fields to sample. Should contain above velocity field!
        fields          (p k U);

        // Steps particles can travel before being removed
        lifeTime        10000;

        // Number of steps per cell (estimate). Set to 1 to disable subcycling.
        nSubCycle       5;

        // Cloud name to use
        cloud           particleTracks;

        // Seeding method.
        seedSampleSet
        {
            type        uniform;

            axis        x;  //distance;
            start       (-0.0205 0.001  0.00001);
            end         (-0.0205 0.0251 0.00001);
            nPoints     10;
        }
    }
}

設定確認 decomposeParDict

numberOfSubdomains 4;

method          hierarchical;

coeffs
{
    n           (2 2 1);
}

設定確認 fvSchemes

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;

    div(phi,U)      bounded Gauss upwind;


    turbulence      bounded Gauss upwind;
    div(phi,k)      $turbulence;
    div(phi,epsilon) $turbulence;
    div(phi,nuTilda) $turbulence;
    div(phi,R)      $turbulence;
    div(R)          Gauss linear;

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

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

wallDist
{
    method          meshWave;
}

設定確認 fvSolution

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-06;
        relTol          0.1;
        smoother        GaussSeidel;
    }

    "(U|k|epsilon|R|nuTilda)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    consistent      yes;

    residualControl
    {
        p               1e-2;
        U               1e-3;
        "(k|epsilon|omega)" 1e-3;
    }
}

relaxationFactors
{
    fields
    {
        p               0.3;
    }
    equations
    {
        U               0.7;
        k               0.7;
        epsilon         0.7;
        R               0.7;
        nuTilda         0.7;
    }
}

設定確認 streamlines

nLines  10;
start   (-0.0205 0.001  0.00001);
end     (-0.0205 0.0251 0.00001);
fields  (p k U);
U       U;

// Must be last entry
#includeEtc "caseDicts/postProcessing/visualization/streamlines.cfg"

コメント

Translate »
タイトルとURLをコピーしました