OpenFOAM

T721_031_r1 buoPim hotRoom

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

OpenFoamのサンプル確認(パラメータやキーワードの覚書)です。
(次ページに要素置き換えを行ったもの)

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

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

引用元

<チュートリアルフォルダ>\heatTransfer\buoyantPimpleFoam\hotRoom

結果図

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

作業

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

//チュートリアルからサンプルをコピーしておきます。//
//0.origから0へ(.org削除)
//コマンド:メッシュ作成
blockMesh

//コマンド実行
setFields

//計算実行//
buoyantPimpleFoam

//ParaView用VTK変換//
foamToVTK

モデル

設定値の抜粋まとめ

全体構造

//初期フォルダ・ファイル構成
hotRoom                                   
├ 0.orig                                 
│ ├ alphat                              
│ ├ epsilon                             
│ ├ k                                   
│ ├ nut                                 
│ ├ p                                   
│ ├ p_rgh                               
│ ├ T                                   
│ └ U                                   
├ constant                               
│ ├ g                                   
│ ├ thermophysicalProperties    :物性値
│ └ turbulenceProperties                
├ system                                 
│ ├ blockMeshDict             :ブロックメッシュ定義          
│ ├ controlDict              :解析ジョブ設定         
│ ├ fvSchemes                 :ソルバー設定        
│ ├ fvSolution                :ソルバー設定       
│ └ setFieldsDict                       
├ Allclean                               
└ Allrun             

0.orig

設定確認 alphat

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

internalField   uniform 0;

boundaryField
{
    floor
    {
        type            compressible::alphatWallFunction;
        value           uniform 0;
    }

    ceiling
    {
        type            compressible::alphatWallFunction;
        value           uniform 0;
    }

    fixedWalls
    {
        type            compressible::alphatWallFunction;
        value           uniform 0;
    }
}

epsilon

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

internalField   uniform 0.01;

boundaryField
{
    floor
    {
        type            epsilonWallFunction;
        value           uniform 0.01;
    }

    ceiling
    {
        type            epsilonWallFunction;
        value           uniform 0.01;
    }

    fixedWalls
    {
        type            epsilonWallFunction;
        value           uniform 0.01;
    }
}

k

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

internalField   uniform 0.1;

boundaryField
{
    floor
    {
        type            kqRWallFunction;
        value           uniform 0.1;
    }

    ceiling
    {
        type            kqRWallFunction;
        value           uniform 0.1;
    }

    fixedWalls
    {
        type            kqRWallFunction;
        value           uniform 0.1;
    }
}

nut

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

internalField   uniform 0;

boundaryField
{
    floor
    {
        type            nutkWallFunction;
        value           uniform 0;
    }

    ceiling
    {
        type            nutkWallFunction;
        value           uniform 0;
    }

    fixedWalls
    {
        type            nutkWallFunction;
        value           uniform 0;
    }
}

設定確認 p

//ファイル:p//

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

internalField   uniform 1e5;

boundaryField
{
    floor
    {
        type            calculated;
        value           $internalField;
    }

    ceiling
    {
        type            calculated;
        value           $internalField;
    }

    fixedWalls
    {
        type            calculated;
        value           $internalField;
    }
}

p_rgh

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

internalField   uniform 1e5;

boundaryField
{
    floor
    {
        type            fixedFluxPressure;
        value           uniform 1e5;
    }

    ceiling
    {
        type            fixedFluxPressure;
        value           uniform 1e5;
    }

    fixedWalls
    {
        type            fixedFluxPressure;
        value           uniform 1e5;
    }
}

T

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 300;

boundaryField
{
    floor
    {
        type            fixedValue;
        value           uniform 300;
    }

    ceiling
    {
        type            lumpedMassWallTemperature;
        kappaMethod     fluidThermo;
        kappa           none;
        mass            1000;
        Cp              4100;
        value           uniform 300;
    }

    fixedWalls
    {
        type            zeroGradient;
    }
}

設定確認 U

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

internalField   uniform (0 0 0);

boundaryField
{
    floor
    {
        type            noSlip;
    }

    ceiling
    {
        type            noSlip;
    }

    fixedWalls
    {
        type            noSlip;
    }
}

constant

g

dimensions      [0 1 -2 0 0 0 0];
value           (0 -9.81 0);

設定確認 thermophysicalProperties

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

pRef            100000;

mixture
{
    specie
    {
        molWeight       28.9;
    }
    thermodynamics
    {
        Cp              1000;
        Hf              0;
    }
    transport
    {
        mu              1.8e-05;
        Pr              0.7;
    }
}

turbulenceProperties

simulationType      RAS;

RAS
{
    RASModel        kEpsilon;

    turbulence      on;

    printCoeffs     on;
}

system

設定確認 blockMeshDict

scale   1;

vertices
(
    (0 0 0)
    (10 0 0)
    (10 5 0)
    (0 5 0)
    (0 0 10)
    (10 0 10)
    (10 5 10)
    (0 5 10)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (20 10 20) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    floor
    {
        type wall;
        faces
        (
            (1 5 4 0)
        );
    }
    ceiling
    {
        type wall;
        faces
        (
            (3 7 6 2)
        );
    }
    fixedWalls
    {
        type wall;
        faces
        (
            (0 4 7 3)
            (2 6 5 1)
            (0 3 2 1)
            (4 5 6 7)
        );
    }
);

mergePatchPairs
(
);

設定確認 controlDict

application     buoyantPimpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         2000;

deltaT          2;

writeControl    timeStep;

writeInterval   100;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

adjustTimeStep  no;

maxCo           0.5;

functions
{
    htc
    {
        type            heatTransferCoeff;
        libs            (fieldFunctionObjects);
        field           T;
        writeControl    outputTime;
        writeInterval   1;
        htcModel        fixedReferenceTemperature;
        patches         (ceiling);
        TRef            373;
    }
}

設定確認 fvSchemes

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,U)      Gauss upwind;

    energy          Gauss upwind;
    div(phi,h)      $energy;
    div(phi,e)      $energy;
    div(phi,K)      Gauss linear;
    div(phi,Ekp)    Gauss linear;

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

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

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

設定確認 fvSolution

solvers
{
    "rho.*"
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       0;
        relTol          0;
    }

    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-8;
        relTol          0.01;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }

    "(U|h|e|k|epsilon|R)"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-6;
        relTol          0.1;
    }

    "(U|h|e|k|epsilon|R)Final"
    {
        $U;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor yes;
    nOuterCorrectors 1;
    nCorrectors     2;
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue       1e5;
}

設定確認 setFieldsDict

defaultFieldValues
(
    volScalarFieldValue T 300
);

regions
(
    boxToFace
    {
        box (4.5 -1000 4.5) (5.5 1e-5 5.5);

        fieldValues
        (
            volScalarFieldValue T 600
        );
    }
);

コメント

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