specieTransferMassFractionFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::specieTransferMassFractionFvPatchScalarField
26 
27 Description
28  Abstract base class for specie-transferring mass fraction boundary
29  conditions.
30 
31  Derived classes compute the actual species flux. Those fluxes are summed up
32  by the specieTransferVelocityFvPatchVectorField velocity condition to
33  generate the net mass transfer into or out of the patch. This mass-fraction
34  condition then generates a corrective diffusive flux to ensure that the
35  correct amounts of the transferring species are transported through the
36  patch.
37 
38 SourceFiles
39  specieTransferMassFractionFvPatchScalarField.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef specieTransferMassFractionFvPatchScalarField_H
44 #define specieTransferMassFractionFvPatchScalarField_H
45 
46 #include "mixedFvPatchFields.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 class basicSpecieMixture;
54 
55 /*---------------------------------------------------------------------------*\
56  Class specieTransferMassFractionFvPatchScalarField Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 :
61  public mixedFvPatchScalarField
62 {
63 public:
64 
65  //- Enumeration for the property driving the transfer
66  enum property
67  {
72  };
73 
74  //- Property type names
76 
77 
78 private:
79 
80  // Private Data
81 
82  //- Name of the flux field
83  const word phiName_;
84 
85  //- Name of the velocity field
86  const word UName_;
87 
88  //- Flux of this species
89  mutable scalarField phiYp_;
90 
91  //- Current time index
92  mutable label timeIndex_;
93 
94 
95 protected:
96 
97  // Protected Data
98 
99  //- Transfer coefficient
100  const scalar c_;
101 
102  //- Property driving the transfer
103  const property property_;
104 
105 
106 public:
107 
108  // Static member functions
109 
110  //- Access the composition for the given database
111  static const basicSpecieMixture& composition(const objectRegistry& db);
112 
113 
114  // Constructors
115 
116  //- Construct from patch and internal field
118  (
119  const fvPatch&,
121  );
122 
123  //- Construct from patch, internal field and dictionary
125  (
126  const fvPatch&,
128  const dictionary&
129  );
130 
131  //- Construct by mapping given fixedValueTypeFvPatchField
132  // onto a new patch
134  (
136  const fvPatch&,
138  const fvPatchFieldMapper&
139  );
140 
141  //- Copy constructor
143  (
145  );
146 
147  //- Copy constructor setting internal field reference
149  (
152  );
153 
154 
155  // Member Functions
156 
157  // Mapping functions
158 
159  //- Map (and resize as needed) from self given a mapping object
160  // Used to update fields following mesh topology change
161  virtual void autoMap(const fvPatchFieldMapper&);
162 
163  //- Reverse map the given fvPatchField onto this fvPatchField
164  // Used to reconstruct fields
165  virtual void rmap(const fvPatchScalarField&, const labelList&);
166 
167 
168  // Evaluation functions
169 
170  //- Return the flux of this species
171  virtual tmp<scalarField> calcPhiYp() const = 0;
172 
173  //- Return the flux of this species
174  virtual const scalarField& phiYp() const;
175 
176  //- Update the coefficients associated with the patch field
177  virtual void updateCoeffs();
178 
179 
180  //- Write
181  virtual void write(Ostream&) const;
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 
192 #endif
193 
194 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
Specialization of basicMixture for a mixture consisting of a number for molecular species...
static const basicSpecieMixture & composition(const objectRegistry &db)
Access the composition for the given database.
specieTransferMassFractionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual const scalarField & phiYp() const
Return the flux of this species.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Abstract base class for specie-transferring mass fraction boundary conditions.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual tmp< scalarField > calcPhiYp() const =0
Return the flux of this species.
A class for managing temporary objects.
Definition: PtrList.H:53
Registry of regIOobjects.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
static const NamedEnum< property, 4 > propertyNames_
Property type names.
Namespace for OpenFOAM.