OpenFOAM

T721_102 multi4phase damBreak

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

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

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

ベース

バージョン : WINDOWS v2206

引用元

<チュートリアルフォルダ>\multiphase \compressibleMultiphaseInterFoam\laminar\damBreak4phase

類似:T721_101 multiPhase damBreak

結果図

赤:空気 黄:油 緑:水 青:水銀

4種類の物性組になります。

作業

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

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

//コマンド実行
setFields

//計算実行//
compressibleMultiphaseInterFoam

//ParaView用VTK変換//
foamToVTK

実行モジュールが圧縮性ありになります。

全体構造

//初期フォルダ・ファイル構成
damBreak4phase                  
├ 0.orig                                
│ ├ alpha.air                          
│ ├ alpha.mercury                      
│ ├ alpha.oil                          
│ ├ alpha.water                        
│ ├ alphas                             
│ ├ p                                  
│ ├ p_rgh                              
│ ├ T                                  
│ └ U                                  
├ constant                              
│ ├ g                                  
│ ├ thermophysicalProperties           
│ ├ thermophysicalProperties.air       
│ ├ thermophysicalProperties.mercury   
│ ├ thermophysicalProperties.oil       
│ ├ thermophysicalProperties.water     
│ └ turbulenceProperties               
├ system                                
│ ├ blockMeshDict                      
│ ├ controlDict                        
│ ├ decomposeParDict                   
│ ├ fvSchemes                          
│ ├ fvSolution                         
│ └ setFieldsDict                      
├ Allclean                              
└ Allrun                                

0.orig

alpha.air

    class       volScalarField;
    object      alpha.air;
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    leftWall
    {
        type            alphaContactAngle;
        thetaProperties
        (
            ( water air ) 90 0 0 0
            ( oil air ) 90 0 0 0
            ( mercury air ) 90 0 0 0
            ( water oil ) 90 0 0 0
            ( water mercury ) 90 0 0 0
            ( oil mercury ) 90 0 0 0
        );
        value           uniform 0;
    }

    rightWall
    {
        type            alphaContactAngle;
        thetaProperties
        (
            ( water air ) 90 0 0 0
            ( oil air ) 90 0 0 0
            ( mercury air ) 90 0 0 0
            ( water oil ) 90 0 0 0
            ( water mercury ) 90 0 0 0
            ( oil mercury ) 90 0 0 0
        );
        value           uniform 1;
    }

    lowerWall
    {
        type            alphaContactAngle;
        thetaProperties
        (
            ( water air ) 90 0 0 0
            ( oil air ) 90 0 0 0
            ( mercury air ) 90 0 0 0
            ( water oil ) 90 0 0 0
            ( water mercury ) 90 0 0 0
            ( oil mercury ) 90 0 0 0
        );
        value           uniform 0;
    }

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

    defaultFaces
    {
        type            empty;
    }
}

alpha.mercury

    class       volScalarField;
    object      alpha.mercury;
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    leftWall
    {
        type            zeroGradient;
    }

    rightWall
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            zeroGradient;
    }

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

    defaultFaces
    {
        type            empty;
    }
}

alpha.oil

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    leftWall
    {
        type            zeroGradient;
    }

    rightWall
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            zeroGradient;
    }

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

    defaultFaces
    {
        type            empty;
    }
}

alpha.water

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    leftWall
    {
        type            zeroGradient;
    }

    rightWall
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            zeroGradient;
    }

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

    defaultFaces
    {
        type            empty;
    }
}

alphas

    class       volScalarField;
    object      alphas;
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    leftWall
    {
        type            zeroGradient;
    }

    rightWall
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            zeroGradient;
    }

    atmosphere
    {
        type            zeroGradient;
    }

    defaultFaces
    {
        type            empty;
    }
}

p

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

internalField   uniform 1e5;

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

    rightWall
    {
        type            calculated;
        value           $internalField;
    }

    lowerWall
    {
        type            calculated;
        value           $internalField;
    }

    atmosphere
    {
        type            calculated;
        value           $internalField;
    }

    defaultFaces
    {
        type            empty;
    }
}

p_rgh

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

internalField   uniform 1e5;

boundaryField
{
    leftWall
    {
        type            fixedFluxPressure;
        value           $internalField;
    }

    rightWall
    {
        type            fixedFluxPressure;
        value           $internalField;
    }

    lowerWall
    {
        type            fixedFluxPressure;
        value           $internalField;
    }

    atmosphere
    {
        type            totalPressure;
        p0              uniform 1e5;
    }

    defaultFaces
    {
        type            empty;
    }
}

T

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 293;

boundaryField
{
    leftWall
    {
        type            fixedValue;
        value           $internalField;
    }

    rightWall
    {
        type            fixedValue;
        value           $internalField;
    }

    lowerWall
    {
        type            fixedValue;
        value           uniform 293;
    }

    atmosphere
    {
        type            inletOutlet;
        phi             rhoPhi;
        inletValue      $internalField;
    }

    defaultFaces
    {
        type            empty;
    }
}

U

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

internalField   uniform (0 0 0);

boundaryField
{
    leftWall
    {
        type            noSlip;
    }

    rightWall
    {
        type            noSlip;
    }

    lowerWall
    {
        type            noSlip;
    }

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

    defaultFaces
    {
        type            empty;
    }
}

constant

g

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

thermophysicalProperties

phases          (water oil mercury air);

pMin            10000;

sigmas
(
    (air water)     0.07
    (air oil)       0.07
    (air mercury)   0.07
    (water oil)     0.07
    (water mercury) 0.07
    (oil mercury)   0.07
);

thermophysicalProperties.air

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

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

thermophysicalProperties.mercury

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectFluid;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        molWeight   200.59;
    }
    equationOfState
    {
        R           6818;
        rho0        13529;
    }
    thermodynamics
    {
        Cp          139;
        Hf          0;
    }
    transport
    {
        mu          1.522e-3;
        Pr          0.022;
    }
}

thermophysicalProperties.oil

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectFluid;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        molWeight   100.21;
    }
    equationOfState
    {
        R           3564;
        rho0        684;
    }
    thermodynamics
    {
        Cp          2240;
        Hf          0;
    }
    transport
    {
        mu          3.76e-4;
        Pr          6;
    }
}

thermophysicalProperties.water

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectFluid;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        molWeight   18.0;
    }
    equationOfState
    {
        R           7255;
        rho0        1027;
    }
    thermodynamics
    {
        Cp          4195;
        Hf          0;
    }
    transport
    {
        mu          3.645e-4;
        Pr          2.289;
    }
}

turbulenceProperties

simulationType  laminar;

system

blockMeshDict

scale   0.146;

vertices
(
    (0 0 0)
    (2 0 0)
    (2.16438 0 0)
    (4 0 0)
    (0 0.32876 0)
    (2 0.32876 0)
    (2.16438 0.32876 0)
    (4 0.32876 0)
    (0 4 0)
    (2 4 0)
    (2.16438 4 0)
    (4 4 0)
    (0 0 0.1)
    (2 0 0.1)
    (2.16438 0 0.1)
    (4 0 0.1)
    (0 0.32876 0.1)
    (2 0.32876 0.1)
    (2.16438 0.32876 0.1)
    (4 0.32876 0.1)
    (0 4 0.1)
    (2 4 0.1)
    (2.16438 4 0.1)
    (4 4 0.1)
);

blocks
(
    hex (0 1 5 4 12 13 17 16) (23 8 1) simpleGrading (1 1 1)
    hex (2 3 7 6 14 15 19 18) (19 8 1) simpleGrading (1 1 1)
    hex (4 5 9 8 16 17 21 20) (23 42 1) simpleGrading (1 1 1)
    hex (5 6 10 9 17 18 22 21) (4 42 1) simpleGrading (1 1 1)
    hex (6 7 11 10 18 19 23 22) (19 42 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    leftWall
    {
        type wall;
        faces
        (
            (0 12 16 4)
            (4 16 20 8)
        );
    }
    rightWall
    {
        type wall;
        faces
        (
            (7 19 15 3)
            (11 23 19 7)
        );
    }
    lowerWall
    {
        type wall;
        faces
        (
            (0 1 13 12)
            (1 5 17 13)
            (5 6 18 17)
            (2 14 18 6)
            (2 3 15 14)
        );
    }
    atmosphere
    {
        type patch;
        faces
        (
            (8 20 21 9)
            (9 21 22 10)
            (10 22 23 11)
        );
    }
);

mergePatchPairs
(
);

controlDict

application     compressibleMultiphaseInterFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         10;

deltaT          0.001;

writeControl    adjustable;

writeInterval   0.05;

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

method          simple;

coeffs
{
    n           (2 2 1);
}

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,.*rho.*\)" Gauss upwind;
    div(rhoPhi,T)  Gauss upwind;
    div(rhoPhi,K)  Gauss upwind;
    div(phi,p)      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.*"
    {
        nAlphaSubCycles 4;
        cAlpha          1;
    }

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

    ".*(rho|rhoFinal)"
    {
        solver          diagonal;
    }

    p_rgh
    {
        solver          GAMG;
        tolerance       1e-07;
        relTol          0.05;
        smoother        GaussSeidel;
    }

    p_rghFinal
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance       1e-07;
            relTol          0;
            nVcycles        2;
            smoother        GaussSeidel;
        }
        tolerance       1e-07;
        relTol          0;
        maxIter         20;
    }

    "(U|T|k|B|nuTilda)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-08;
        relTol          0.1;
        nSweeps         1;
    }

    "(U|T|k|B|nuTilda)Final"
    {
        $U;
        relTol          0;
    }
}

PIMPLE
{
    nCorrectors     2;
    nNonOrthogonalCorrectors 0;
}

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

setFieldsDict

defaultFieldValues
(
    volScalarFieldValue alpha.air 1
    volScalarFieldValue alpha.water 0
    volScalarFieldValue alpha.oil 0
    volScalarFieldValue alpha.mercury 0
    volVectorFieldValue U (0 0 0)
);

regions
(
    boxToCell
    {
        box (0 0 -1) (0.1461 0.292 1);
        fieldValues
        (
            volScalarFieldValue alpha.water 1
            volScalarFieldValue alpha.oil 0
            volScalarFieldValue alpha.mercury 0
            volScalarFieldValue alpha.air 0
        );
    }
    boxToCell
    {
        box (0.1461 0 -1) (0.2922 0.292 1);
        fieldValues
        (
            volScalarFieldValue alpha.water 0
            volScalarFieldValue alpha.oil 1
            volScalarFieldValue alpha.mercury 0
            volScalarFieldValue alpha.air 0
        );
    }
    boxToCell
    {
        box (0 0 -1) (0.1461 0.1 1);
        fieldValues
        (
            volScalarFieldValue alpha.water 0
            volScalarFieldValue alpha.oil 0
            volScalarFieldValue alpha.mercury 1
            volScalarFieldValue alpha.air 0
        );
    }
);

スポンサーリンク

コメント

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