OpenFOAM

T721_231 testTubeMixer

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

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

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

ベース

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

引用元

<チュートリアルフォルダ>\multiphase\interFoam\RAS\floatingObject

結果図

気相と液相を揺すっています。

作業

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

//チュートリアルからサンプルをコピーしておきます。//
//0.origから0へ(.org削除)

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

//コマンド実行
setFields

//計算実行//
interFoam

//ParaView用VTK変換//
foamToVTK

全体構造

//初期フォルダ・ファイル構成
testTubeMixer              
├ 0.orig                  
│ ├ alpha.water          
│ ├ p_rgh                
│ └ U                    
├ constant                
│ ├ dynamicMeshDict      
│ ├ g                    
│ ├ transportProperties  
│ └ turbulenceProperties 
├ system                  
│ ├ blockMeshDict        
│ ├ controlDict          
│ ├ decomposeParDict     
│ ├ fvSchemes            
│ ├ fvSolution           
│ └ setFieldsDict        
├ Allclean                
└ Allrun                  

0.orig

alpha.water

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    walls
    {
        type            zeroGradient;
    }
}

p_rgh

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

internalField   uniform 0;

boundaryField
{
    walls
    {
        type            fixedFluxPressure;
    }
}

U

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

internalField   uniform (0 0 0);

boundaryField
{
    walls
    {
        type            movingWallVelocity;
        value           uniform (0 0 0);
    }
}

constant

dynamicMeshDict

dynamicFvMesh   dynamicMotionSolverFvMesh;

motionSolver    solidBody;

solidBodyMotionFunction multiMotion;

// Table rotating in z axis
rotatingTable
{
    solidBodyMotionFunction rotatingMotion;
    rotatingMotionCoeffs
    {
        origin          (0 0.1 0);
        axis            (0 0 1);
        omega           6.2832; // rad/s
    }
}

//// Box rotates on rotating table
//rotatingBox
//{
//    solidBodyMotionFunction rotatingMotion;
//    rotatingMotionCoeffs
//    {
//        origin          (0 0 0);
//        axis            (1 0 0);
//        omega           12.5664; // rad/s
//    }
//}

// Tube rocking on rotating table
rotatingBox
{
    solidBodyMotionFunction oscillatingRotatingMotion;
    oscillatingRotatingMotionCoeffs
    {
        origin          (0 0 0);
        omega           40;         // rad/s
        amplitude       (45 0 0);   // 45 degrees max tilt
    }
}

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             998.2;
}

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

sigma           0;

turbulenceProperties

simulationType  laminar;

system

blockMeshDict

scale   0.01;

vertices
(
    (-0.5 -5 -0.5)
    ( 0.5 -5 -0.5)
    ( 0.5  5 -0.5)
    (-0.5  5 -0.5)
    (-0.5 -5  0.5)
    ( 0.5 -5  0.5)
    ( 0.5  5  0.5)
    (-0.5  5  0.5)
);

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

edges
(
);

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

controlDict

application     interFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         1;

deltaT          0.0001;

writeControl    adjustable;

writeInterval   0.01;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

adjustTimeStep  yes;

maxCo           0.5;

maxAlphaCo      0.5;

maxDeltaT       1;

decomposeParDict

numberOfSubdomains 16;

method          hierarchical;

coeffs
{
    n           (4 2 2);
}

fvSchemes

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

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

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fvSolution

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

    "pcorr.*"
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance       1e-05;
            relTol          0;
            smoother        DICGaussSeidel;
            cacheAgglomeration no;
        }

        tolerance       1e-05;
        relTol          0;
        maxIter         100;
    }

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

    p_rghFinal
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance       2e-09;
            relTol          0;
            nVcycles        2;
            smoother        DICGaussSeidel;
            nPreSweeps      2;
        }

        tolerance       2e-09;
        relTol          0;
        maxIter         20;
    }

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

PIMPLE
{
    momentumPredictor no;
    nCorrectors     2;
    nNonOrthogonalCorrectors 0;
    correctPhi      no;

    pRefPoint       (0.0013 0.0017 0.0017);
    pRefValue       1e5;
}

relaxationFactors
{
    equations
    {
        "U.*"           1;
    }
}

setFieldsDict

defaultFieldValues
(
    volScalarFieldValue alpha.water 0
);

regions
(
    boxToCell
    {
        box (-100 -100 -100) ( 100 100 -0.0025);
        fieldValues
        (
            volScalarFieldValue alpha.water 1
        );
    }
);

コメント

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