ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / lagrangian / intermediate / submodels / Kinematic / PatchInteractionModel / LocalInteraction / LocalInteraction.H
blob8a6283b814546bafaa0179f32b009aae596b6133
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::LocalInteraction
27 Description
28     Patch interaction specified on a patch-by-patch basis
30 \*---------------------------------------------------------------------------*/
32 #ifndef LocalInteraction_H
33 #define LocalInteraction_H
35 #include "PatchInteractionModel.H"
36 #include "patchInteractionDataList.H"
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 namespace Foam
42 /*---------------------------------------------------------------------------*\
43                       Class LocalInteraction Declaration
44 \*---------------------------------------------------------------------------*/
46 template<class CloudType>
47 class LocalInteraction
49     public PatchInteractionModel<CloudType>
51     // Private data
53         //- List of participating patches
54         const patchInteractionDataList patchData_;
57         // Counters for initial particle fates
59             //- Number of parcels escaped
60             List<label> nEscape0_;
62             //- Mass of parcels escaped
63             List<scalar> massEscape0_;
65             //- Number of parcels stuck to patches
66             List<label> nStick0_;
68             //- Mass of parcels stuck to patches
69             List<scalar> massStick0_;
72         // Counters for particle fates
74             //- Number of parcels escaped
75             List<label> nEscape_;
77             //- Mass of parcels escaped
78             List<scalar> massEscape_;
80             //- Number of parcels stuck to patches
81             List<label> nStick_;
83             //- Mass of parcels stuck to patches
84             List<scalar> massStick_;
87     // Private Member Functions
89         //- Read interaction properties from file
90         void readProps();
92         //- Write interaction properties to file
93         void writeProps
94         (
95             const labelList& nEscape,
96             const scalarList& massEscape,
97             const labelList& nStick,
98             const scalarList& massStick
99         ) const;
102 public:
104     //- Runtime type information
105     TypeName("localInteraction");
108     // Constructors
110         //- Construct from dictionary
111         LocalInteraction(const dictionary& dict, CloudType& owner);
113         //- Construct copy from owner cloud and patch interaction model
114         LocalInteraction(const LocalInteraction<CloudType>& pim);
116         //- Construct and return a clone using supplied owner cloud
117         virtual autoPtr<PatchInteractionModel<CloudType> > clone() const
118         {
119             return autoPtr<PatchInteractionModel<CloudType> >
120             (
121                 new LocalInteraction<CloudType>(*this)
122             );
123         }
126     //- Destructor
127     virtual ~LocalInteraction();
130     // Member Functions
132         //- Apply velocity correction
133         //  Returns true if particle remains in same cell
134         virtual bool correct
135         (
136             typename CloudType::parcelType& p,
137             const polyPatch& pp,
138             bool& keepParticle,
139             const scalar trackFraction,
140             const tetIndices& tetIs
141         );
144         // I-O
146             //- Write patch interaction info to stream
147             virtual void info(Ostream& os) const;
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 } // End namespace Foam
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 #ifdef NoRepository
158 #   include "LocalInteraction.C"
159 #endif
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 #endif
165 // ************************************************************************* //