2 2

Next: Model setting without an Up: Alternative formulation Previous: Alternative formulation   Contents   Index

Boundary and Initial condition

  • Initial and boundary conditions are stored in directories named with numbers
  • Number in directory name stands for time layer of the solution
  • Usually initial conditions are stored in directory 0
  • In case of solver icoFoam one imposes pressure p and velocity U.
  • It is necessary to impose initial and boundary conditions in the first time layer (typically 0 )
  • Let us take a look for example at the pressure:
    # cat $FOAM_RUN/icoFoam/cavity/0/p
    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  2.2.1                                 |
    |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       volScalarField;
        object      p;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    

     

    dimensions      [0 2 -2 0 0 0 0];
    
  • Parameter dimensions stands for physical dimensions according to SI unit system:
    SI [kg m s K mol A cd], e.g. for pressure: $ \color{white} m^{2}s^{-2}$ (kinematic pressure)

     

    internalField   uniform 0;
    
  • Parameter internalField defines values in cell volumes of the mesh
  • Values can be constant all over the flow field (uniform) with corresponding value
  • Or values can be non-constant (nonuniform, i.e. possibly different value in each cell) with list of values (according to cell IDs)

     

    boundaryField
    {
        movingWall      
        {
            type            zeroGradient;
        }
    
        fixedWalls      
        {
            type            zeroGradient;
        }
    
        frontAndBack    
        {
            type            empty;
        }
    }
    
    // ************************************************************************* //
    
  • boundaryField defines boundary conditions for mesh boundaries
  • type defines real boundary condition
  • e.g. zeroGradient is so called homogeneous Neumann boundary condition, which means that quantity gradient is zero in direction perpendicular to the boundary
  • Boundary condition empty means, that there is no flow in direction perpendicular to the boundary, this boundary condition must correspond to definition in polyMesh/boundary

     

  • Let us take a look at the velocity file :
    # cat $FOAM_RUN/icoFoam/cavity/0/U

     

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  2.2.1                                 |
    |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       volVectorField;
        object      U;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    dimensions      [0 1 -1 0 0 0 0];
    
    internalField   uniform (0 0 0);
    
    boundaryField
    {
        movingWall      
        {
            type            fixedValue;
            value           uniform (1 0 0);
        }
    
        fixedWalls      
        {
            type            fixedValue;
            value           uniform (0 0 0);
        }
    
        frontAndBack    
        {
            type            empty;
        }
    }
    
    // ************************************************************************* //
    

     

  • Velocity U is a vector and has three components (Ux, Uy, Uz)
  • At the wall there is often prescribed fixed value for velocity (Dirichlet boundary condition): fixedValuewhich needs its value, either uniform or nonuniform
  • Condition uniform (0 0 0) means the velocity is zero at the wall
  • Condition uniform (1 0 0) means the velocity is 1 m/s in magnitude and points in the direction of the coordinate x axis (wall is moving)