extrudeModel.H 4 KB
Newer Older
1 2 3 4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
OpenFOAM bot's avatar
OpenFOAM bot committed
5
    \\  /    A nd           | www.openfoam.com
OpenFOAM bot's avatar
OpenFOAM bot committed
6 7
     \\/     M anipulation  |
-------------------------------------------------------------------------------
OpenFOAM bot's avatar
OpenFOAM bot committed
8 9
    Copyright (C) 2011-2015 OpenFOAM Foundation
    Copyright (C) 2019 OpenCFD Ltd.
10 11 12 13
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

14 15 16 17
    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.
18 19 20 21 22 23 24

    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
25
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
26 27

Class
28
    Foam::extrudeModel
29 30

Description
31 32
    Top level extrusion model class

33 34 35 36 37 38 39
    Dictionary entries
    \table
        Property       | Description                        | Required | Default
        nLayer         | Number of extrusion layers         | no  | 1
        expansionRatio | Expansion ratio                    | no  | 1
    \endtable

40 41
SourceFiles
    extrudeModel.C
42 43 44

\*---------------------------------------------------------------------------*/

45 46
#ifndef extrudeModel_H
#define extrudeModel_H
47

48
#include "dictionary.H"
49
#include "point.H"
50 51
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
52 53 54 55 56 57 58

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

namespace Foam
{

/*---------------------------------------------------------------------------*\
59
                        Class extrudeModel Declaration
60 61
\*---------------------------------------------------------------------------*/

62
class extrudeModel
63
{
64 65 66 67
protected:

    // Protected data

68
        label nLayers_;
69

70 71
        const scalar expansionRatio_;

72 73 74 75
        const dictionary& coeffDict_;


    // Private Member Functions
76

77 78
        //- No copy construct
        extrudeModel(const extrudeModel&) = delete;
79

80 81
        //- No copy assignment
        void operator=(const extrudeModel&) = delete;
82 83 84 85


public:

86 87 88 89
    //- Runtime type information
    TypeName("extrudeModel");

    //- Declare runtime constructor selection table
90

91
        declareRunTimeSelectionTable
92
        (
93 94 95 96 97 98 99 100 101 102 103 104
            autoPtr,
            extrudeModel,
            dictionary,
            (
                const dictionary& dict
            ),
            (dict)
        );


    // Constructors

105 106 107
        //- Construct from dictionary for given model type
        //  The corresponding model Coeffs dictionary must exist.
        extrudeModel(const word& modelType, const dictionary& dict);
108 109 110 111 112


    // Selectors

        //- Select null constructed
113
        static autoPtr<extrudeModel> New(const dictionary& dict);
114 115 116


    //- Destructor
117
    virtual ~extrudeModel() = default;
118 119 120 121 122 123


    // Member Functions

        // Access

124 125
        //- Return the number of layers
        label nLayers() const;
126

127 128
        //- Return the expansion ratio
        scalar expansionRatio() const;
129

130 131 132

    // Member Operators

133 134 135 136
        //- Helper: calculate cumulative relative thickness for layer.
        //  (layer=0 -> 0; layer=nLayers -> 1)
        scalar sumThickness(const label layer) const;

137
        virtual point operator()
138 139 140 141
        (
            const point& surfacePoint,
            const vector& surfaceNormal,
            const label layer
142
        ) const = 0;
143 144 145 146 147 148 149 150 151 152 153 154
};


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

} // End namespace Foam

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

#endif

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