1

Previous: Implementation Up: Creating new OpenFOAM solver Next: Running test case using
This is an automatically generated documentation by LaTeX2HTML utility. In case of any issue, please, contact us at info@cfdsupport.com.

Test case set up

  • Copy cavity test case:
    # cd $FOAM_RUN
    # cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity ./cavityTemp
    # cd $FOAM_RUN /cavityTemp

     

  • In file constant/transportProperties add constant for heat conductivity kappa:

     

    nu              [ 0 2 -1 0 0 0 0 ] 0.01;
    
    kappa           [ 0 2 -1 0 0 0 0 ] 0.001;
    

     

  • Initial and boundary conditions for temperature create e.g. from pressure:
    # cp 0/p 0/T

     

  • In file 0/T replace letter p with T
  • Change dimensions to Kelvin: dimensions [0 0 0 1 0 0 0];
  • Set initial and boundary conditions according to temperature
  • Initial temperature of the fluid is e.g. 300 K
  • At the moving wall temperature is e.g. 350 K
  • At the three rigid wall temperature is e.g. 300 K

     

    /*--------------------------------*- 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      T;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    dimensions       [0 0 0 1 0 0 0];
    
    internalField    uniform 300;
    
    boundaryField
    {
        movingWall
        {
            type        fixedValue;
            value       uniform 350;
        }
    
        fixedWalls
        {
            type        fixedValue;
            value       uniform 300;
        }
    
        frontAndBack
        {
            type        empty;
        }
    }
    // ************************************************************************* //
    

     

  • In file system/fvSchemes set divergence scheme and laplacian scheme for temperature:

     

    divSchemes
    {
        default         none;
        div(phi,U)      Gauss linear;
        div(phi,T)      Gauss upwind;
    }
    
    laplacianSchemes
    {
        default         Gauss linear orthogonal;
        laplacian(kappa,T)   Gauss linear corrected;
    }
    

     

  • In file system/fvSolution set linear system solver for temperature:

     

        U
        {
            solver          smoothSolver;
            smoother        symGaussSeidel;
            tolerance       1e-05;
            relTol          0;
        }
    
        T
        {
            solver          smoothSolver;
            smoother        symGaussSeidel;
            tolerance       1e-07;
            relTol          0;
        }