OpenFOAM

T721_211 bubbleColumn

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

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

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

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

ベース

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

引用元

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

結果図

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

作業

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

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

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

//コマンド実行
setFields

//計算実行//
twoPhaseEulerFoam

//ParaView用VTK変換//
foamToVTK

全体構造

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

0.orig

alpha.air

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 0.5;
    }

    outlet
    {
        type            inletOutlet;
        phi             phi.air;
        inletValue      uniform 1;
        value           uniform 1;
    }

    walls
    {
        type            zeroGradient;
    }
}

p

FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}dimensions          [1 -1 -2 0 0 0 0];

internalField       uniform 1e5;

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

    outlet
    {
        type               calculated;
        value              $internalField;
    }

    walls
    {
        type               calculated;
        value              $internalField;
    }
}

p_rgh

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

internalField       uniform 1e5;

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

    outlet
    {
        type            prghPressure;
        p               $internalField;
        value           $internalField;
    }

    walls
    {
        type            fixedFluxPressure;
        value           $internalField;
    }
}

T.air

dimensions          [0 0 0 1 0 0 0];

internalField       uniform 300;

boundaryField
{
    walls
    {
        type               zeroGradient;
    }

    outlet
    {
        type               inletOutlet;
        phi                phi.air;
        inletValue         $internalField;
        value              $internalField;
    }

    inlet
    {
        type               fixedValue;
        value              $internalField;
    }

    frontAndBackPlanes
    {
        type               empty;
    }
}

T.water

dimensions          [0 0 0 1 0 0 0];

internalField       uniform 350;

boundaryField
{
    walls
    {
        type               zeroGradient;
    }

    outlet
    {
        type               inletOutlet;
        phi                phi.water;
        inletValue         $internalField;
        value              $internalField;
    }

    inlet
    {
        type               fixedValue;
        value              $internalField;
    }

    frontAndBackPlanes
    {
        type               empty;
    }
}

Theta

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

internalField   uniform 0.0;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 1.0e-7;
    }

    outlet
    {
        type            inletOutlet;
        inletValue      uniform 1.0e-7;
        value           uniform 1.0e-7;
    }

    walls
    {
        type            zeroGradient;
    }

    defaultFaces
    {
        type            empty;
    }
}

U.air

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

internalField   uniform (0 0.1 0);

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

    outlet
    {
        type               pressureInletOutletVelocity;
        phi                phi.air;
        value              $internalField;
    }

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

U.water

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

internalField   uniform (0 0 0);

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

    outlet
    {
        type               pressureInletOutletVelocity;
        phi                phi.water;
        value              $internalField;
    }

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

constant

g

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

phaseProperties

phases          (air water);

air
{
    diameterModel   isothermal;
    isothermalCoeffs
    {
        d0              3e-3;
        p0              1e5;
    }

    residualAlpha   1e-6;
}

water
{
    diameterModel   constant;
    constantCoeffs
    {
        d               1e-4;
    }

    residualAlpha   1e-6;
}

blending
{
    default
    {
        type            linear;
        maxFullyDispersedAlpha.air 0.3;
        maxPartlyDispersedAlpha.air 0.5;
        maxFullyDispersedAlpha.water 0.3;
        maxPartlyDispersedAlpha.water 0.5;
    }
}

sigma
(
    (air and water)     0.07
);

aspectRatio
(
    (air in water)
    {
        type            constant;
        E0              1.0;
    }

    (water in air)
    {
        type            constant;
        E0              1.0;
    }
);

drag
(
    (air in water)
    {
        type            SchillerNaumann;
        residualRe      1e-3;
        swarmCorrection
        {
            type        none;
        }
    }

    (water in air)
    {
        type            SchillerNaumann;
        residualRe      1e-3;
        swarmCorrection
        {
            type        none;
        }
    }

    (air and water)
    {
        type            segregated;
        residualAlpha   1e-6;
        m               0.5;
        n               8;
        swarmCorrection
        {
            type        none;
        }
    }
);

virtualMass
(
    (air in water)
    {
        type            constantCoefficient;
        Cvm             0.5;
    }

    (water in air)
    {
        type            constantCoefficient;
        Cvm             0.5;
    }
);

heatTransfer
(
    (air in water)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }

    (water in air)
    {
        type            RanzMarshall;
        residualAlpha   1e-4;
    }
);

lift
(
);

wallLubrication
(
);

turbulentDispersion
(
);

// Minimum allowable pressure
pMin            10000;

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.water

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

mixture
{
    specie
    {
        molWeight   18;
    }
    equationOfState
    {
        R           3000;
        rho0        1027;
    }
    thermodynamics
    {
        Cv          4195;
        Hf          0;
    }
    transport
    {
        mu          3.645e-4;
        Pr          2.289;
    }
}

turbulenceProperties.air

simulationType  laminar;

turbulenceProperties.water

simulationType  laminar;

system

blockMeshDict

scale   1;

vertices
(
    (0 0 0)
    (0.15 0 0)
    (0.15 1 0)
    (0 1 0)
    (0 0 0.1)
    (0.15 0 0.1)
    (0.15 1 0.1)
    (0 1 0.1)
);

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

edges
(
);

patches
(
    patch inlet
    (
        (1 5 4 0)
    )
    patch outlet
    (
        (3 7 6 2)
    )
    wall walls
    (
        (0 4 7 3)
        (2 6 5 1)
    )
);

mergePatchPairs
(
);

controlDict

application     twoPhaseEulerFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         100;

deltaT          0.005;

writeControl    runTime;

writeInterval   1;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  no;

maxCo           0.5;

maxDeltaT       1;

functions
{
    add1
    {
        type            add;
        libs            (fieldFunctionObjects);
        fields          (U.air U.water);
        result          U.total;
        writeControl    writeTime;
    }

    fieldAverage1
    {
        type            fieldAverage;
        libs            (fieldFunctionObjects);
        writeControl    writeTime;
        fields
        (
            U.air
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }

            U.water
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }

            alpha.air
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }

            p
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }
        );
    }
}

fvSchemes

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default                         none;

    div(phi,alpha.air)              Gauss vanLeer;
    div(phir,alpha.air)             Gauss vanLeer;

    "div\(alphaRhoPhi.*,U.*\)"      Gauss limitedLinearV 1;
    "div\(phi.*,U.*\)"              Gauss limitedLinearV 1;

    "div\(alphaRhoPhi.*,(h|e).*\)"  Gauss limitedLinear 1;
    "div\(alphaRhoPhi.*,K.*\)"      Gauss limitedLinear 1;
    "div\(alphaPhi.*,p\)"           Gauss limitedLinear 1;

    "div\(\(\(\(alpha.*\*thermo:rho.*\)*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear uncorrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         uncorrected;
}

fvSolution

solvers
{
    alpha.air
    {
        nAlphaCorr      1;
        nAlphaSubCycles 2;
    }

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

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }

    "U.*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-5;
        relTol          0;
        minIter         1;
    }

    "e.*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-8;
        relTol          0;
        minIter         1;
    }
}

PIMPLE
{
    nOuterCorrectors 3;
    nCorrectors      1;
    nNonOrthogonalCorrectors 0;
}

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

setFieldsDict

defaultFieldValues
(
    volScalarFieldValue alpha.air 1
);

regions
(
    boxToCell
    {
        box (0 0 -0.1) (0.15 0.701 0.1);
        fieldValues
        (
            volScalarFieldValue alpha.air 0
        );
    }
);

コメント

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