ThermoLookupTableInjection.H 6.01 KB
Newer Older
1
2
3
4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
5
    \\  /    A nd           | Copyright (C) 2011-2017 OpenFOAM Foundation
6
7
8
9
10
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

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

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

Class
    Foam::ThermoLookupTableInjection

27
28
29
Group
    grpLagrangianIntermediateInjectionSubModels

30
31
32
33
34
Description
    Particle injection sources read from look-up table. Each row corresponds to
    an injection site.

    (
35
36
37
38
        (x y z) (u v w) d rho mDot T cp  // injector 1
        (x y z) (u v w) d rho mDot T cp  // injector 2
        ...
        (x y z) (u v w) d rho mDot T cp  // injector N
39
40
41
42
43
44
45
    );

    where:
        x, y, z = global cartesian co-ordinates [m]
        u, v, w = global cartesian velocity components [m/s]
        d       = diameter [m]
        rho     = density [kg/m3]
46
        mDot    = mass flow rate [kg/s]
47
48
49
50
51
52
53
54
55
56
57
58
        T       = temperature [K]
        cp      = specific heat capacity [J/kg/K]

SourceFiles
    ThermoLookupTableInjection.C

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

#ifndef ThermoLookupTableInjection_H
#define ThermoLookupTableInjection_H

#include "InjectionModel.H"
59
#include "kinematicParcelInjectionDataIOList.H"
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

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

namespace Foam
{

/*---------------------------------------------------------------------------*\
                Class ThermoLookupTableInjection Declaration
\*---------------------------------------------------------------------------*/

template<class CloudType>
class ThermoLookupTableInjection
:
    public InjectionModel<CloudType>
{
    // Private data

        //- Name of file containing injector/parcel data
        const word inputFileName_;

        //- Injection duration - common to all injection sources
81
        scalar duration_;
82
83

        //- Number of parcels per injector - common to all injection sources
84
        const scalar parcelsPerSecond_;
85

86
87
88
        //- Flag to indicate to randomise injection positions
        bool randomise_;

89
90
        //- List of injectors
        kinematicParcelInjectionDataIOList injectors_;
91

92
93
94
95
96
97
98
99
        //- List of cell labels corresoponding to injector positions
        labelList injectorCells_;

        //- List of tetFace labels corresoponding to injector positions
        labelList injectorTetFaces_;

        //- List of tetPt labels corresoponding to injector positions
        labelList injectorTetPts_;
100
101
102
103
104


public:

    //- Runtime type information
105
    TypeName("thermoLookupTableInjection");
106
107
108
109
110


    // Constructors

        //- Construct from dictionary
111
112
113
114
115
116
        ThermoLookupTableInjection
        (
            const dictionary& dict,
            CloudType& owner,
            const word& modelName
        );
117
118

        //- Construct copy from owner cloud and injection model
119
120
        ThermoLookupTableInjection
        (
121
122
            CloudType& owner,
            const ThermoLookupTableInjection<CloudType>& im
123
124
        );

125
        //- Construct and return a clone using supplied owner cloud
126
        virtual autoPtr<InjectionModel<CloudType>> clone() const
127
        {
128
            return autoPtr<InjectionModel<CloudType>>
129
130
131
132
133
            (
                new ThermoLookupTableInjection<CloudType>(*this)
            );
        }

134
135
136
137
138
139
140

    //- Destructor
    virtual ~ThermoLookupTableInjection();


    // Member Functions

141
142
143
        //- Set injector locations when mesh is updated
        virtual void updateMesh();

144
145
146
        //- Return the end-of-injection time
        scalar timeEnd() const;

147
148
149
150
151
152
153
        //- Number of parcels to introduce relative to SOI
        virtual label parcelsToInject(const scalar time0, const scalar time1);

        //- Volume of parcels to introduce relative to SOI
        virtual scalar volumeToInject(const scalar time0, const scalar time1);


154
155
156

        // Injection geometry

157
            //- Set the injection position and owner cell, tetFace and tetPt
158
159
160
161
162
163
            virtual void setPositionAndCell
            (
                const label parcelI,
                const label nParcels,
                const scalar time,
                vector& position,
164
                label& cellOwner,
165
                label& tetFacei,
Henry Weller's avatar
Henry Weller committed
166
                label& tetPti
167
168
            );

Andrew Heather's avatar
Andrew Heather committed
169
            //- Set the parcel properties
170
171
172
173
174
            virtual void setProperties
            (
                const label parcelI,
                const label nParcels,
                const scalar time,
Andrew Heather's avatar
Andrew Heather committed
175
                typename CloudType::parcelType& parcel
176
177
            );

Andrew Heather's avatar
Andrew Heather committed
178
            //- Flag to identify whether model fully describes the parcel
179
180
181
182
183
            virtual bool fullyDescribed() const
            {
                return true;
            }

184
            //- Return flag to identify whether or not injection of parcelI is
185
186
187
188
189
190
191
192
193
194
195
196
            //  permitted
            virtual bool validInjection(const label parcelI);
};


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

} // End namespace Foam

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

#ifdef NoRepository
197
    #include "ThermoLookupTableInjection.C"
198
199
200
201
202
203
204
#endif

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

#endif

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