OpenFOAM

T721_125 multiPhase Ras float

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

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

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

次ページ:メッシュの置き換え

ベース

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

引用元

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

結果図

気相、液相のモデルになります。
出力間隔を10倍にして実行。writeInterval 0.01;

作業

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

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

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

//計算実行//
interFoam

//ParaView用VTK変換//
foamToVTK

モデル

設定値の抜粋まとめ

全体構造

//初期フォルダ・ファイル構成
floatingObject                 
├ 0.orig                      
│ ├ alpha.water              
│ ├ epsilon                  
│ ├ k                        
│ ├ nut                      
│ ├ p_rgh                    
│ ├ pointDisplacement        
│ └ U                        
├ constant                    
│ ├ dynamicMeshDict          
│ ├ dynamicMeshDict.sixDoF   
│ ├ 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
{
    stationaryWalls
    {
        type            zeroGradient;
    }

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

    floatingObject
    {
        type            zeroGradient;
    }
}

epsilon

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

internalField   uniform 0.1;

boundaryField
{
    stationaryWalls
    {
        type            epsilonWallFunction;
        value           uniform 0.1;
    }

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

    floatingObject
    {
        type            epsilonWallFunction;
        value           uniform 0.1;
    }
}

k

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

internalField   uniform 0.1;

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

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

    floatingObject
    {
        type            kqRWallFunction;
        value           uniform 0.1;
    }
}

nut

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

internalField   uniform 0;

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

    atmosphere
    {
        type            calculated;
        value           uniform 0;
    }

    floatingObject
    {
        type            nutkWallFunction;
        value           uniform 0;
    }
}

p_rgh

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

internalField   uniform 0;

boundaryField
{
    stationaryWalls
    {
        type            fixedFluxPressure;
    }

    atmosphere
    {
        type            totalPressure;
        p0              uniform 0;
    }

    floatingObject
    {
        type            fixedFluxPressure;
    }
}

pointDisplacement

dimensions      [0 1 0 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    stationaryWalls
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    atmosphere
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    floatingObject
    {
        type            calculated;
        value           uniform (0 0 0);
    }
}

U

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

internalField   uniform (0 0 0);

boundaryField
{
    stationaryWalls
    {
        type            noSlip;
    }

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

    floatingObject
    {
        type            movingWallVelocity;
        value           uniform (0 0 0);
    }
}

constant

dynamicMeshDict

dynamicFvMesh       dynamicMotionSolverFvMesh;

motionSolverLibs   (rigidBodyMeshMotion);

motionSolver       rigidBodyMotion;

rigidBodyMotionCoeffs
{
    report          on;

    solver
    {
        type Newmark;
    }

    accelerationRelaxation 0.7;

    bodies
    {
        floatingObject
        {
            type            cuboid;
            parent          root;

            // Cuboid dimensions
            Lx              0.3;
            Ly              0.2;
            Lz              0.5;

            // Density of the cuboid
            rho             500;

            // Cuboid mass
            mass            #eval{ $rho*$Lx*$Ly*$Lz };
            L               ($Lx $Ly $Lz);
            centreOfMass    (0 0 0.25);
            transform       (1 0 0 0 1 0 0 0 1) (0.5 0.45 0.1);

            joint
            {
                type            composite;
                joints
                (
                    {
                        type Py;
                    }
                    {
                        type Ry;
                    }
                );
            }

            patches         (floatingObject);
            innerDistance   0.05;
            outerDistance   0.35;
        }
    }
}

dynamicMeshDict.sixDoF

dynamicFvMesh       dynamicMotionSolverFvMesh;

motionSolverLibs    (sixDoFRigidBodyMotion);

motionSolver        sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
    patches         (floatingObject);
    innerDistance   0.05;
    outerDistance   0.35;

    centreOfMass    (0.5 0.45 0.35);

    // Cuboid dimensions
    Lx              0.3;
    Ly              0.2;
    Lz              0.5;

    // Density of the solid
    rhoSolid        500;

    // Cuboid mass
    mass            #eval{ $rhoSolid*$Lx*$Ly*$Lz };

    // Cuboid moment of inertia about the centre of mass
    momentOfInertia #codeStream
    {
        codeInclude
        #{
            #include "diagTensor.H"
        #};

        code
        #{
            scalar sqrLx = sqr($Lx);
            scalar sqrLy = sqr($Ly);
            scalar sqrLz = sqr($Lz);
            os  <<
                $mass
               *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0;
        #};
    };

    report          on;
    accelerationRelaxation 0.7;
    //accelerationDamping 0;

    solver
    {
        type Newmark;
    }

    constraints
    {
        // fixedPoint
        // {
        //     sixDoFRigidBodyMotionConstraint point;
        //     centreOfRotation (0.5 0.45 0.1);
        // }

        fixedLine
        {
            sixDoFRigidBodyMotionConstraint line;
            centreOfRotation (0.5 0.45 0.1);
            direction (0 1 0);
        }

        fixedAxis
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis (0 1 0);
        }
    }
}

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      RAS;

RAS
{
    RASModel        kEpsilon;

    turbulence      on;

    printCoeffs     on;
}

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) (20 20 30) simpleGrading (1 1 1)
);

edges
(
);

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

mergePatchPairs
(
);

設定確認 controlDict

application     interFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         6;

deltaT          0.01;

writeControl    adjustable;

writeInterval   0.1;

purgeWrite      0;

writeFormat     ascii;

writePrecision  12;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo           1;

maxAlphaCo      1;

maxDeltaT       1;

decomposeParDict

numberOfSubdomains 8;

method          scotch;

設定確認 fvSchemes

ddtSchemes
{
    default         CrankNicolson 0.5;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    div(rhoPhi,U)  Gauss vanLeerV;
    div(phi,alpha)  Gauss vanLeer;
    div(phirb,alpha) Gauss linear;
    div(phi,k)      Gauss upwind;
    div(phi,epsilon) Gauss upwind;
    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      3;
        nAlphaSubCycles 1;
        cAlpha          1;

        MULESCorr       yes;
        nLimiterIter    5;
        alphaApplyPrevCorr  yes;

        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-8;
        relTol          0;
    }

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

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

    p_rghFinal
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance       1e-8;
            relTol          0;
            nVcycles        2;
            smoother        DICGaussSeidel;
            nPreSweeps      2;
        }
        tolerance       1e-8;
        relTol          0;
        maxIter         20;
    }

    "(U|k|epsilon)"
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance       1e-6;
        relTol          0.1;
        nSweeps         1;
    }

    "(U|k|epsilon)Final"
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance       1e-6;
        relTol          0;
        nSweeps         1;
    }
}

PIMPLE
{
    momentumPredictor   no;
    nOuterCorrectors    3;
    nCorrectors         1;
    nNonOrthogonalCorrectors 0;
    correctPhi          yes;
    moveMeshOuterCorrectors yes;
}

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

設定確認 setFieldsDict

defaultFieldValues
(
    volScalarFieldValue alpha.water 0
);

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

    boxToCell
    {
        box (0.7 0.8 -100) (100 100 0.65);
        fieldValues ( volScalarFieldValue alpha.water 1 );
    }
);

topoSetDict

actions
(
    {
        name    c0;
        type    cellSet;
        action  new;
        source  boxToCell;
        box     (0.35 0.35 0.1) (0.65 0.55 0.6);
    }

    {
        name    c0;
        type    cellSet;
        action  invert;
    }
);

その他

次ページ以降

コメント

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