Skip to content
Snippets Groups Projects
yPlus.H 5.31 KiB
Newer Older
  • Learn to ignore specific revisions
  • /*---------------------------------------------------------------------------*\
      =========                 |
      \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
       \\    /   O peration     |
    
    OpenFOAM bot's avatar
    OpenFOAM bot committed
        \\  /    A nd           | www.openfoam.com
    
         \\/     M anipulation  |
    -------------------------------------------------------------------------------
    
    OpenFOAM bot's avatar
    OpenFOAM bot committed
        Copyright (C) 2013-2016 OpenFOAM Foundation
    
        Copyright (C) 2015-2023 OpenCFD Ltd.
    
    -------------------------------------------------------------------------------
    License
        This file is part of OpenFOAM.
    
        OpenFOAM is free software: you can redistribute it and/or modify it
        under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.
    
        OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
        FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        for more details.
    
        You should have received a copy of the GNU General Public License
        along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
    
    Class
    
    Description
    
        Computes the near wall \f$y_1^+\f$ for turbulence models.
    
        Operands:
        \table
          Operand        | Type           | Location
          input          | -              | -
          output file    | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\>
          output field   | volScalarField | $FOAM_CASE/\<time\>/\<outField\>
        \endtable
    
        Minimal example by using \c system/controlDict.functions:
    
            // Mandatory entries (unmodifiable)
    
            libs        (fieldFunctionObjects);
    
            useWallFunction true;
            writeFields     true;
    
            // Optional (inherited) entries
    
        where the entries mean:
    
          Property   | Description                        | Type | Req'd | Dflt
          type       | Type name: yPlus                   | word |  yes  | -
          libs       | Library name: fieldFunctionObjects | word |  yes  | -
    
          useWallFunction | Flag to use the local expressions of <!--
                          --> the selected nut wall function to compute yPlus, <!--
                          --> otherwise directly compute yPlus from flow field <!--
                          -->                             | bool | no    | true
    
          writeFields | Flag to write yPlus field         | bool |  no   | true
    
        The inherited entries are elaborated in:
         - \link functionObject.H \endlink
         - \link writeFile.H \endlink
    
        Minimal example by using the \c postProcess utility:
        \verbatim
            <solver> -postProcess -func yPlus
        \endverbatim
    
    Note
        The \c writeFields flag currently defaults to \c true
        (for consistency with previous versions that did not have that flag)
        but this is subject to change in the near future for consistency
        with other function objects.
    
    
        - Foam::functionObject
        - Foam::functionObjects::fvMeshFunctionObject
        - Foam::functionObjects::writeFile
        - ExtendedCodeGuide::functionObjects::field::yPlus
    
    SourceFiles
    
    
    \*---------------------------------------------------------------------------*/
    
    
    #ifndef Foam_functionObjects_yPlus_H
    #define Foam_functionObjects_yPlus_H
    
    #include "writeFile.H"
    
    #include "volFieldsFwd.H"
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    namespace Foam
    {
    
    
    /*---------------------------------------------------------------------------*\
    
    \*---------------------------------------------------------------------------*/
    
    
            //- Use the wall function expressions to compute yPlus ?
    
            //- Write the yPlus field ?
            bool writeFields_;
    
    
        // Private Member Functions
    
    
            //- File header information
    
            virtual void writeFileHeader(Ostream& os) const;
    
    
    public:
    
        //- Runtime type information
    
            //- Construct from Time and dictionary
    
            (
                const word& name,
    
                const Time& runTime,
                const dictionary& dict
    
            //- No copy construct
            yPlus(const yPlus&) = delete;
    
            //- No copy assignment
            void operator=(const yPlus&) = delete;
    
    
    
        //- Destructor
    
        virtual ~yPlus() = default;
    
    
    
        // Member Functions
    
    
            //- Read the yPlus data
    
            virtual bool read(const dictionary&);
    
            //- Calculate the yPlus field
    
            //- Report min/max/avg (per patch) and log to file,
            //- write the yPlus volume field.
    
    };
    
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    
    } // End namespace Foam
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    #endif
    
    // ************************************************************************* //