fixedNormalSlipFvPatchField.H 7 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
6
     \\/     M anipulation  |
OpenFOAM bot's avatar
OpenFOAM bot committed
7
-------------------------------------------------------------------------------
OpenFOAM bot's avatar
OpenFOAM bot committed
8
    Copyright (C) 2011-2017 OpenFOAM Foundation
9 10 11 12
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

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

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

Class
    Foam::fixedNormalSlipFvPatchField

andy's avatar
andy committed
29 30
Group
    grpGenericBoundaryConditions grpWallBoundaryConditions
31

32
Description
33 34
    This boundary condition sets the patch-normal component to a fixed value.

35
Usage
andy's avatar
andy committed
36
    \table
37 38
        Property     | Description             | Required    | Default value
        fixedValue   | fixed value             | yes         |
andy's avatar
andy committed
39
    \endtable
40

41 42
    Example of the boundary condition specification:
    \verbatim
43
    <patchName>
44 45 46 47
    {
        type            fixedNormalSlip;
        fixedValue      uniform 0;     // example entry for a scalar field
    }
48
    \endverbatim
49

50
See also
51 52
    Foam::transformFvPatchField

53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
SourceFiles
    fixedNormalSlipFvPatchField.C

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

#ifndef fixedNormalSlipFvPatchField_H
#define fixedNormalSlipFvPatchField_H

#include "transformFvPatchField.H"

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

namespace Foam
{

/*---------------------------------------------------------------------------*\
69
                 Class fixedNormalSlipFvPatchField Declaration
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
\*---------------------------------------------------------------------------*/

template<class Type>
class fixedNormalSlipFvPatchField
:
    public transformFvPatchField<Type>
{
    // Private data

        //- Value the normal component of which the boundary is set to
        Field<Type> fixedValue_;


public:

    //- Runtime type information
    TypeName("fixedNormalSlip");


    // Constructors

        //- Construct from patch and internal field
        fixedNormalSlipFvPatchField
        (
            const fvPatch&,
            const DimensionedField<Type, volMesh>&
        );

        //- Construct from patch, internal field and dictionary
        fixedNormalSlipFvPatchField
        (
            const fvPatch&,
            const DimensionedField<Type, volMesh>&,
            const dictionary&
        );

        //- Construct by mapping given fixedNormalSlipFvPatchField
        //  onto a new patch
        fixedNormalSlipFvPatchField
        (
            const fixedNormalSlipFvPatchField<Type>&,
            const fvPatch&,
            const DimensionedField<Type, volMesh>&,
            const fvPatchFieldMapper&
        );

        //- Construct as copy
        fixedNormalSlipFvPatchField
        (
            const fixedNormalSlipFvPatchField<Type>&
        );

        //- Construct and return a clone
123
        virtual tmp<fvPatchField<Type>> clone() const
124
        {
125
            return tmp<fvPatchField<Type>>
126 127 128 129 130 131 132 133 134 135 136 137 138
            (
                new fixedNormalSlipFvPatchField<Type>(*this)
            );
        }

        //- Construct as copy setting internal field reference
        fixedNormalSlipFvPatchField
        (
            const fixedNormalSlipFvPatchField<Type>&,
            const DimensionedField<Type, volMesh>&
        );

        //- Construct and return a clone setting internal field reference
139
        virtual tmp<fvPatchField<Type>> clone
140 141 142 143
        (
            const DimensionedField<Type, volMesh>& iF
        ) const
        {
144
            return tmp<fvPatchField<Type>>
145 146 147 148 149 150 151 152
            (
                new fixedNormalSlipFvPatchField<Type>(*this, iF)
            );
        }


    // Member functions

153 154 155 156 157 158 159 160 161
        // Access

            //- Return false: this patch field is not altered by assignment
            virtual bool assignable() const
            {
                return false;
            }


162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
        // Mapping functions

            //- Map (and resize as needed) from self given a mapping object
            virtual void autoMap
            (
                const fvPatchFieldMapper&
            );

            //- Reverse map the given fvPatchField onto this fvPatchField
            virtual void rmap
            (
                const fvPatchField<Type>&,
                const labelList&
            );


        // Return defining fields

            virtual Field<Type>& fixedValue()
            {
                return fixedValue_;
            }

            virtual const Field<Type>& fixedValue() const
            {
                return fixedValue_;
            }


        // Evaluation functions

            //- Return gradient at boundary
194
            virtual tmp<Field<Type>> snGrad() const;
195 196 197 198

            //- Evaluate the patch field
            virtual void evaluate
            (
199 200
                const Pstream::commsTypes commsType =
                    Pstream::commsTypes::blocking
201 202 203
            );

            //- Return face-gradient transform diagonal
204
            virtual tmp<Field<Type>> snGradTransformDiag() const;
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241


        //- Write
        virtual void write(Ostream&) const;


    // Member operators

        virtual void operator=(const UList<Type>&) {}

        virtual void operator=(const fvPatchField<Type>&) {}
        virtual void operator+=(const fvPatchField<Type>&) {}
        virtual void operator-=(const fvPatchField<Type>&) {}
        virtual void operator*=(const fvPatchField<scalar>&) {}
        virtual void operator/=(const fvPatchField<scalar>&) {}

        virtual void operator+=(const Field<Type>&) {}
        virtual void operator-=(const Field<Type>&) {}

        virtual void operator*=(const Field<scalar>&) {}
        virtual void operator/=(const Field<scalar>&) {}

        virtual void operator=(const Type&) {}
        virtual void operator+=(const Type&) {}
        virtual void operator-=(const Type&) {}
        virtual void operator*=(const scalar) {}
        virtual void operator/=(const scalar) {}
};


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

} // End namespace Foam

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

#ifdef NoRepository
242
    #include "fixedNormalSlipFvPatchField.C"
243 244 245 246 247 248 249
#endif

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

#endif

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