1

Previous: Running the simulation Up: Running the simulation Next: Results evaluation

This is an automatically generated documentation by LaTeX2HTML utility. In case of any issue, please, contact us at info@cfdsupport.com.

Solver setup

  • Initial and boundary conditions as well as the numerical schemes and linear solvers are set.
  • The initial and boundary condition values for turbulent kinetic energy 168 and specific dissipation 169 have been computed using the following relations:

170(17.2)

171(17.3)

  • The turbulence intensity 172 is usually set to 2 – 5%.
  • The turbulent length scale 173 is related to the hydraulic parameter 174 by
175(17.4)
  • 174 can be e.g. the length or width of the computational domain.

  • The file controlDict contains a reference to the function object, that is going to compute drag 176 and lift  coefficients during the computation.

    177

  • The function object is in the auxiliary file aeroCoeffs in system directory.
  • Reference to function object setup should be located at the end of controlDict.
     functions
     {
       #include "aeroCoeffs"
     }
    

  • Function object aeroCoeffs setup:
    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  2.2.1                                 |
    |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    
    forces
    {
        type        forceCoeffs;
        functionObjectLibs ( "libforces.so" );
        writeControl timeStep;
        writeInterval 1;          // output interval
    
        patches     ( "car.*" );   // surfaces from which to compute Cd and Cl
        pName       p;
        UName       U;
        rho         rhoInf;        // reference density (incompressible case)
        log         true;          // make log file with output?.
        rhoInf      1;             // reference density value
        liftDir     (0 1 0);       // direction of lift
        dragDir     (1 0 0);       // direction of drag
        CofR        (-13.4 0 0);   // moment of force reference centre
        pitchAxis   (0 0 1);       // rotation axis vector (moment computation)
        magUInf     20;            // mean flow velocity..
        lRef        3.5;           // reference lengt (moment computation)
        Aref        2.24;          // reference area (lift and drag computation)
    }
    
    
    // ************************************************************************* //
    

  • All the function object parameters are described in the listing above.
  • The type of a function object is defined by its name. It is forceCoeffs in our case (computation of lift and drag coefficients).
  • The parameter functionObjectLibs loads the library in which the chosen function object resides – into which it has been compiled.

  • Now it is the right moment to set the inlet velocity profile.
  • First we need to create file 0/U from 0/U.org.
    # cp -f 0/U.org 0/U
  • Run the command setVelocityProfile, that sets the parabolic velocity profile in the inlet.
    # setVelocityProfile
  • One can look into boundary condition for velocity (file U in the directory 0 ) and see what happened.
  • The test case will be computed in parallel on two CPUs.
  • In the file system/decomposeParDict set the simple method of decomposition, set the division along the $ x$ axis and the number of subdomains to two.
  • Run the utility decomposePar -force , which decomposes the case to two CPUs. The switch -force removes any existing directories processor*.
  • And now run the computation:
    # mpiexec -np 2 simpleFoam -parallel > log &