mappedFlowRateFvPatchVectorField.H 5.43 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-2016 OpenFOAM Foundation
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
-------------------------------------------------------------------------------
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
27
    Foam::mappedFlowRateFvPatchVectorField
28

andy's avatar
andy committed
29 30
Group
    grpInletBoundaryConditions grpCoupledBoundaryConditions
31

32 33 34 35
Description
    Describes a volumetric/mass flow normal vector boundary condition by its
    magnitude as an integral over its area.

36
    The inlet mass flux is taken from the neighbour region.
37 38

    The basis of the patch (volumetric or mass) is determined by the
39 40 41
    dimensions of the flux, phi.  The current density is used to correct the
    velocity when applying the mass basis.

42
Usage
andy's avatar
andy committed
43
    \table
44 45 46 47
        Property     | Description             | Required    | Default value
        phi          | flux field name         | no          | phi
        rho          | density field name      | no          | rho
        neigPhi      | name of flux field on neighbour mesh | yes |
andy's avatar
andy committed
48
    \endtable
49 50

    Example of the boundary condition specification:
andy's avatar
andy committed
51
    \verbatim
52
    <patchName>
53
    {
54
        type            mappedFlowRate;
55 56
        phi             phi;
        rho             rho;
57
        neigPhi         phi;
58 59
        value           uniform (0 0 0); // placeholder
    }
andy's avatar
andy committed
60
    \endverbatim
61 62

SourceFiles
63
    mappedFlowRateFvPatchVectorField.C
64 65 66

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

67 68
#ifndef mappedFlowRateFvPatchVectorField_H
#define mappedFlowRateFvPatchVectorField_H
69 70 71 72 73 74 75 76 77 78 79

#include "fixedValueFvPatchFields.H"

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

namespace Foam
{
/*---------------------------------------------------------------------------*\
               Class flowRateInletVelocityFvPatch Declaration
\*---------------------------------------------------------------------------*/

80
class mappedFlowRateFvPatchVectorField
81 82 83 84 85
:
    public fixedValueFvPatchVectorField
{
    // Private data

Andrew Heather's avatar
Andrew Heather committed
86
        //- Name of the neighbour flux setting the inlet mass flux
87 88 89 90 91 92 93 94 95 96 97 98
        word nbrPhiName_;

        //- Name of the local mass flux
        word phiName_;

        //- Name of the density field used to normalize the mass flux
        word rhoName_;


public:

   //- Runtime type information
99
   TypeName("mappedFlowRate");
100 101 102 103 104


   // Constructors

        //- Construct from patch and internal field
105
        mappedFlowRateFvPatchVectorField
106 107 108 109 110 111
        (
            const fvPatch&,
            const DimensionedField<vector, volMesh>&
        );

        //- Construct from patch, internal field and dictionary
112
        mappedFlowRateFvPatchVectorField
113 114 115 116 117 118 119
        (
            const fvPatch&,
            const DimensionedField<vector, volMesh>&,
            const dictionary&
        );

        //- Construct by mapping given
120
        //  mappedFlowRateFvPatchVectorField
121
        //  onto a new patch
122
        mappedFlowRateFvPatchVectorField
123
        (
124
            const mappedFlowRateFvPatchVectorField&,
125 126 127 128 129 130
            const fvPatch&,
            const DimensionedField<vector, volMesh>&,
            const fvPatchFieldMapper&
        );

        //- Construct as copy
131
        mappedFlowRateFvPatchVectorField
132
        (
133
            const mappedFlowRateFvPatchVectorField&
134 135 136 137 138 139 140
        );

        //- Construct and return a clone
        virtual tmp<fvPatchVectorField> clone() const
        {
            return tmp<fvPatchVectorField>
            (
141
                new mappedFlowRateFvPatchVectorField(*this)
142 143 144 145
            );
        }

        //- Construct as copy setting internal field reference
146
        mappedFlowRateFvPatchVectorField
147
        (
148
            const mappedFlowRateFvPatchVectorField&,
149 150 151 152 153 154 155 156 157 158 159
            const DimensionedField<vector, volMesh>&
        );

        //- Construct and return a clone setting internal field reference
        virtual tmp<fvPatchVectorField> clone
        (
            const DimensionedField<vector, volMesh>& iF
        ) const
        {
            return tmp<fvPatchVectorField>
            (
160
                new mappedFlowRateFvPatchVectorField(*this, iF)
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
            );
        }


    // Member functions


        //- Update the coefficients associated with the patch field
        virtual void updateCoeffs();

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

};


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

} // End namespace Foam

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

#endif

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