Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's OpenFOAM page.

 

 

 

 

 

(OpenFOAM) OpenFoamExample3

 

./ToolOpenFoamExample3/About.txt

 

It does something. I wanted to model diffusion of gas, but decided to keep this setup. Gas diffusion is planned for ToolOpenFoamExample4

 

 

 

 

 

./ToolOpenFoamExample3/case.foam

 

 

 

 

 

 

./ToolOpenFoamExample3/ToolOpenFoamExample3.bat

 

blockMesh.exe
copy 0\alpha1.org 0\alpha1
setFields.exe
interFoam.exe
parafoam

 

 

 

 

 

./ToolOpenFoamExample3/system/controlDict

 

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         1.0;

deltaT          0.1;

writeControl    timeStep;

//Write to file every timestep
writeInterval   1;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo           0.5;
maxAlphaCo      0.5;

maxDeltaT       1;

 

 

 

 

 

./ToolOpenFoamExample3/system/fvSchemes

 

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    div(rho*phi,U)  Gauss limitedLinearV 1;
    div(phi,alpha)  Gauss vanLeer;
    div(phirb,alpha) Gauss interfaceCompression;
    div((muEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p_rgh;
    pcorr;
    alpha1;
}

 

 

 

 

 

./ToolOpenFoamExample3/system/fvSolution

 

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}

solvers
{
    pcorr
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-10;
        relTol          0;
    }

    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-07;
        relTol          0.05;
    }

    p_rghFinal
    {
        $p_rgh;
        tolerance       1e-07;
        relTol          0;
    }

    U
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance       1e-06;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor no;
    nCorrectors     3;
    nNonOrthogonalCorrectors 0;
    nAlphaCorr      1;
    nAlphaSubCycles 2;
    cAlpha          1;
    pRefCell        0;
    pRefValue       0;
}

 

 

 

 

 

./ToolOpenFoamExample3/system/setFieldsDict

 

FoamFile
{
  version     2.0;
  format      ascii;
  class       dictionary;
  location    "system";
  object      setFieldsDict;
}

//The default kinematic pressure is zero
defaultFieldValues
(
  volScalarFieldValue alpha1 0
);

//Create one special region  
regions
(
  //The region has the shape of a box, in this case a cube
  boxToCell
  {
    box (0.45 0.45 0.45) (0.55 0.55 0.55);

    //The kinematic pressure within the box is one
    fieldValues
    (
      volScalarFieldValue alpha1 1
    );
  }
);
  

 

 

 

 

 

./ToolOpenFoamExample3/constant/g

 

FoamFile
{
    version     2.0;
    format      ascii;
    class       uniformDimensionedVectorField;
    location    "constant";
    object      g;
}

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

 

 

 

 

 

./ToolOpenFoamExample3/constant/transportProperties

 

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      transportProperties;
}

phase1
{
    transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ] 1e-06;
    rho             rho [ 1 -3 0 0 0 0 0 ] 1000;
    CrossPowerLawCoeffs
    {
        nu0             nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
        nuInf           nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        m               m [ 0 0 1 0 0 0 0 ] 1;
        n               n [ 0 0 0 0 0 0 0 ] 0;
    }

    BirdCarreauCoeffs
    {
        nu0             nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
        nuInf           nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        k               k [ 0 0 1 0 0 0 0 ] 99.6;
        n               n [ 0 0 0 0 0 0 0 ] 0.1003;
    }
}

phase2
{
    transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ] 1.48e-05;
    rho             rho [ 1 -3 0 0 0 0 0 ] 1;
    CrossPowerLawCoeffs
    {
        nu0             nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
        nuInf           nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        m               m [ 0 0 1 0 0 0 0 ] 1;
        n               n [ 0 0 0 0 0 0 0 ] 0;
    }

    BirdCarreauCoeffs
    {
        nu0             nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
        nuInf           nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        k               k [ 0 0 1 0 0 0 0 ] 99.6;
        n               n [ 0 0 0 0 0 0 0 ] 0.1003;
    }
}

sigma           sigma [ 1 0 -2 0 0 0 0 ] 0.07;

 

 

 

 

 

./ToolOpenFoamExample3/constant/turbulenceProperties

 

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      turbulenceProperties;
}

simulationType  laminar;

 

 

 

 

 

./ToolOpenFoamExample3/constant/polyMesh/blockMeshDict

 

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}

//The unit of the vertices is 1.0 meter
convertToMeters 1.0;

//A cube with the following vertex indices:
//
//   7-----6
//  /|    /|
// 3-----2 |
// | |   | |
// | 4---|-5
// |/    |/
// 0-----1
//
//Each vertex is of the form (x y z)
//
//The local coordinate system is defined by the order in which the vertices are presented in the block definition according to:
//- the axis origin is the first entry in the block definition, vertex 0 in our example;
//- the x direction is described by moving from vertex 0 to vertex 1;
//- the y direction is described by moving from vertex 1 to vertex 2;
//- vertices 0, 1, 2, 3 define the plane z
//- vertex 4 is found by moving from vertex 0 in the z direction;
//- vertices 5,6 and 7 are similarly found by moving in the z direction from vertices 1,2 and 3
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)
);

//Ordered list of vertex labels and mesh size
blocks
(
  hex                   //The shape is always hex, as blocks are always hexahedra
  (0 1 2 3 4 5 6 7)     // vertex numbers
  (10 10 10)            // numbers of cells in each direction
  simpleGrading (1 1 1) // cell expansion ratios
);

//Used to describe arc or spline edges
//Keyword selection | Description    | Additional entries
//- arc             | Circular arc   | Single interpolation point
//- simpleSpline    | Spline curve   | List of interpolation points
//- polyLine        | Set of lines   | List of interpolation points
//- polySpline      | Set of splines | List of interpolation points
//- line            | Straight line  |
edges
(
  //No need to add edge descriptions here, as 'line' is used by default
  //Example for using the arc type:
  // arc 1 5 (0.9 0.5 0.0)
);

//List of patches
patches
(

);

boundary
(
  //There are multiple boundary types:
  //- movingWall:
  //- fixedWalls:
  //- frontAndBack: for two dimensional meshes
  //- inlet
  //- outlet
  //- walls

  fixedWalls
  {
    //There are multiple types:
    //- wall:
    //- patch
    //- cyclic
    type wall;

    //The vertices that make up the six faces of the cube
    //
    //Each block face is defined by a list of 4 vertex numbers.
    //The order in which the vertices are given must be such that,
    //looking from inside the block and starting with any vertex,
    //the face must be traversed in a clockwise direction to define the other vertices.
    faces
    (
      (0 3 2 1)
      (0 4 7 3)
      (1 5 4 0)
      (2 6 5 1)
      (3 7 6 2)
      (4 5 6 7)
    );
  }
);

//List of patches to be merged
mergePatchPairs
(

);

 

 

 

 

 

./ToolOpenFoamExample3/0/alpha1

 

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/*   Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt   *\
|  Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com   |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alpha1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   nonuniform List<scalar>
1000
(
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
[...]
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
)
;

boundaryField
{
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //

 

 

 

 

 

./ToolOpenFoamExample3/0/alpha1.org

 

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      alpha;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

// ************************************************************************* //

 

 

 

 

 

./ToolOpenFoamExample3/0/p_rgh

 

FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p_rgh;
}

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

internalField   uniform 0;

boundaryField
{
    leftWall
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }

    rightWall
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }

    lowerWall
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }

    atmosphere
    {
        type            totalPressure;
        p0              uniform 0;
        U               U;
        phi             phi;
        rho             rho;
        psi             none;
        gamma           1;
        value           uniform 0;
    }

    defaultFaces
    {
        type            empty;
    }
}

// ************************************************************************* //

 

 

 

 

 

./ToolOpenFoamExample3/0/U

 

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0 0 0);

boundaryField
{
    leftWall
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    rightWall
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    lowerWall
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //

 

 

 

 

 

Go back to Richel Bilderbeek's OpenFOAM page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml