OpenFOAM

T721_111 multiphase Obstacle

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

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

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

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

引用元

<チュートリアルフォルダ>\multiphase\interFoam\laminar\damBreakWithObstacle

結果図

気層、液相のモデルになります。

作業

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

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

//コマンド実行
topoSet
subsetMesh -overwrite c0 -patch walls
setFields

//計算実行//
interFoam

//ParaView用VTK変換//
foamToVTK

モデル

設定値の抜粋まとめ

全体構造

//初期フォルダ・ファイル構成
damBreakWithObstacle
├ 0.orig                      
│ ├ alpha.water              
│ ├ k                        
│ ├ nut                      
│ ├ omega                    
│ ├ p_rgh                    
│ └ U                        
├ constant                    
│ ├ dynamicMeshDict          
│ ├ g                        
│ ├ transportProperties      :物性値
│ └ turbulenceProperties     
├ system                      
│ ├ blockMeshDict            :ブロックメッシュ定義
│ ├ controlDict              :解析ジョブ設定
│ ├ decomposeParDict         :未使用(win)
│ ├ fvSchemes                :ソルバー設定
│ ├ fvSolution               :ソルバー設定
│ ├ setFieldsDict            
│ └ topoSetDict              
├ Allclean                    
└ Allrun                              

0.orig

設定確認 alpha.water

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    walls
    {
        type            zeroGradient;
    }

    obstacle
    {
        type            zeroGradient;
    }

    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
}

k

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

internalField   uniform 0.00015;

boundaryField
{
    atmosphere
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }

    "(obstacle|walls)"
    {
        type            kqRWallFunction;
        value           $internalField;
    }
}

nut

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

internalField   uniform 5e-07;

boundaryField
{
    atmosphere
    {
        type            zeroGradient;
    }

    "(obstacle|walls)"
    {
        type            nutkRoughWallFunction;
        Ks              uniform 100e-6;
        Cs              uniform 0.5;
        value           $internalField;
    }
}

omega

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

internalField   uniform 2;

boundaryField
{
    atmosphere
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }

    "(obstacle|walls)"
    {
        type            omegaWallFunction;
        value           $internalField;
    }
}

p_rgh

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

internalField   uniform 0;

boundaryField
{
    walls
    {
        type            fixedFluxPressure;
        phi             phiAbs;
        value           uniform 0;
    }

    obstacle
    {
        type            fixedFluxPressure;
        phi             phiAbs;
        value           uniform 0;
    }

    atmosphere
    {
        type            totalPressure;
        p0              uniform 0;
    }
}

U

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

internalField   uniform (0 0 0);

boundaryField
{
    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }

    "(obstacle|walls)"
    {
        type            uniformFixedValue;
        uniformValue    (0 0 0);
    }
}

constant

dynamicMeshDict

dynamicFvMesh   dynamicRefineFvMesh;

// How often to refine
refineInterval  1;

// Field to be refinement on
field           alpha.water;

// Refine field inbetween lower..upper
lowerRefineLevel 0.001;
upperRefineLevel 0.999;

// If value < unrefineLevel unrefine
unrefineLevel   10;

// Have slower than 2:1 refinement
nBufferLayers   1;

// Refine cells only up to maxRefinement levels
maxRefinement   2;

// Stop refinement if maxCells reached
maxCells        200000;

// Flux field and corresponding velocity field. Fluxes on changed
// faces get recalculated by interpolating the velocity. Use 'none'
// on surfaceScalarFields that do not need to be reinterpolated.
correctFluxes
(
    (phi none)
    (nHatf none)
    (rhoPhi none)
    (alphaPhi0.water none)
    (ghf none)
    (alphaPhiUn none)
);

// Write the refinement level as a volScalarField
dumpLevel       true;

g

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

設定確認 transportProperties

phases          (water air);

water
{
    transportModel  Newtonian;
    nu              1e-06;
    rho             1000;
}

air
{
    transportModel  Newtonian;
    nu              1.48e-05;
    rho             1;
}

sigma           0.07;

turbulenceProperties

simulationType  laminar;

system

設定確認 blockMeshDict

scale   1;

vertices
(
    (0 0 0)
    (1 0 0)
    (1 1 0)
    (0 1 0)
    (0 0 1)
    (1 0 1)
    (1 1 1)
    (0 1 1)
);

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

edges
(
);

boundary
(
    atmosphere
    {
        type patch;
        faces
        (
            (3 7 6 2)
        );
    }
    walls
    {
        type wall;
        faces
        (
            (0 4 7 3)
            (2 6 5 1)
            (1 5 4 0)
            (0 3 2 1)
            (4 5 6 7)
        );
    }
);

mergePatchPairs
(
);

設定確認 controlDict

application     interFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         2;

deltaT          0.001;

writeControl    adjustable;

writeInterval   0.02;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo           0.5;

maxAlphaCo      0.5;

maxDeltaT       1;

decomposeParDict

numberOfSubdomains  6;

method              scotch;

設定確認 fvSchemes

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    div(rhoPhi,U)   Gauss upwind;
    div(phi,alpha)  Gauss vanLeer;
    div(phirb,alpha) Gauss linear;
    div(phi,k)      Gauss upwind;
    div(phi,omega)  Gauss upwind;
    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

wallDist
{
    method          meshWave;
}

設定確認 fvSolution

solvers
{
    "alpha.water.*"
    {
        nAlphaCorr      1;
        nAlphaSubCycles 3;
        cAlpha          1;
    }

    p_rgh
    {
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.01;
        smoother        DIC;
        cacheAgglomeration no;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }

    "pcorr.*"
    {
        $p_rghFinal;
        tolerance       0.0001;
    }

    U
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance       1e-06;
        relTol          0;
        nSweeps         1;
    }

    "(k|omega|B|nuTilda).*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-08;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor no;
    nCorrectors     3;
    nNonOrthogonalCorrectors 0;

    pRefPoint      (0.51 0.51 0.51);
    pRefValue      0;
}

設定確認 setFieldsDict

defaultFieldValues
(
    volScalarFieldValue alpha.water 0
    volVectorFieldValue U (0 0 0)
);

regions
(
    boxToCell
    {
        box (0 0 0) (0.6 0.1875 0.75);
        fieldValues
        (
            volScalarFieldValue alpha.water 1
        );
    }
 );

topoSetDict

actions
(
    {
        name    c0;
        type    cellSet;
        action  clear;
    }
    {
        name    c0;
        type    cellSet;
        action  invert;
    }
    {
        name    c0;
        type    cellSet;
        action  subtract;
        source  boxToCell;
        box     (0.375 0.375 0) (0.625 0.625 0.25);
    }
);

コメント

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