OpenFOAM

T721_301 chargedWire

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

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

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

ベース

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

引用元

<チュートリアルフォルダ>\electromagnetics\electrostaticFoam\chargedWire

結果図

作業

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

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

//計算実行//
electrostaticFoam

//ParaView用VTK変換//
foamToVTK

全体構造

//初期フォルダ・ファイル構成
chargedWire        
├ 0                          
│ ├ phi                     
│ └ rho                     
├ constant                   
│ └ physicalProperties      
└ system                     
   ├ blockMeshDict           
   ├ controlDict             
   ├ fvSchemes               
   └ fvSolution              

0

phi (単位時間あたりの磁束 = V(電圧))

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

internalField   uniform 0;

boundaryField
{
    left
    {
        type            symmetryPlane;
    }

    right
    {
        type            symmetryPlane;
    }

    down
    {
        type            symmetryPlane;
    }

    up
    {
        type            fixedValue;
        value           uniform 0;
    }

    hole
    {
        type            fixedValue;
        value           uniform 45000;
    }

    defaultFaces
    {
        type            empty;
    }
}

rho 電荷密度(単位体積あたりの電荷)

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

internalField   uniform 0;

boundaryField
{
    left
    {
        type            symmetryPlane;
    }

    right
    {
        type            symmetryPlane;
    }

    down
    {
        type            symmetryPlane;
    }

    up
    {
        type            zeroGradient;
    }

    hole
    {
        type            fixedValue;
        value           uniform 3.57e-05;
    }

    defaultFaces
    {
        type            empty;
    }
}

constant

physicalProperties

epsilon0        8.85419e-12;

k               0.00016;

system

blockMeshDict

scale   1;

vertices
(
    (0.001 0 0)
    (0.038 0 0)
    (0.076 0 0)
    (0.076 0.02687 0)
    (0.02687 0.02687 0)
    (0.0007071 0.0007071 0)
    (0.076 0.114 0)
    (0.02687 0.114 0)
    (0 0.114 0)
    (0 0.038 0)
    (0 0.001 0)
    (0.001 0 0.5)
    (0.038 0 0.5)
    (0.076 0 0.5)
    (0.076 0.02687 0.5)
    (0.02687 0.02687 0.5)
    (0.0007071 0.0007071 0.5)
    (0.076 0.114 0.5)
    (0.02687 0.114 0.5)
    (0 0.114 0.5)
    (0 0.038 0.5)
    (0 0.001 0.5)
);

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

edges
(
    arc 0 5 origin (0 0 0)
    arc 5 10 origin (0 0 0)
    arc 1 4 origin (0 0 0)
    arc 4 9 origin (0 0 0)
    arc 11 16 origin (0 0 0.5)
    arc 16 21 origin (0 0 0.5)
    arc 12 15 origin (0 0 0.5)
    arc 15 20 origin (0 0 0.5)
);

boundary
(
    left
    {
        type symmetryPlane;
        faces
        (
            (8 9 20 19)
            (9 10 21 20)
        );
    }
    right
    {
        type symmetryPlane;
        faces
        (
            (2 3 14 13)
            (3 6 17 14)
        );
    }
    down
    {
        type symmetryPlane;
        faces
        (
            (0 1 12 11)
            (1 2 13 12)
        );
    }
    up
    {
        type patch;
        faces
        (
            (7 8 19 18)
            (6 7 18 17)
        );
    }
    hole
    {
        type patch;
        faces
        (
            (10 5 16 21)
            (5 0 11 16)
        );
    }
);

controlDict

application     electrostaticFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         0.02;

deltaT          5e-05;

writeControl    timeStep;

writeInterval   100;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

fvSchemes

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         leastSquares;
}

divSchemes
{
    default         none;
    div(rhoFlux,rho) Gauss upwind;
}

laplacianSchemes
{
    default         none;
    laplacian(phi)  Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fvSolution

solvers
{
    phi
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-08;
        relTol          0.2;
    }

    rho
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-08;
        relTol          0.2;
    }
}

コメント

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