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-2023 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, internal field and dictionary
118  (
119  const fvPatch&,
121  const dictionary&
122  );
123 
124  //- Construct by mapping given
125  // specieTransferMassFractionFvPatchScalarField
126  // onto a new patch
128  (
130  const fvPatch&,
132  const fvPatchFieldMapper&
133  );
134 
135  //- Disallow copy without setting internal field reference
137  (
139  ) = delete;
140 
141  //- Copy constructor setting internal field reference
143  (
146  );
147 
148 
149  // Member Functions
150 
151  // Mapping functions
152 
153  //- Map the given fvPatchField onto this fvPatchField
154  virtual void map
155  (
156  const fvPatchScalarField&,
157  const fvPatchFieldMapper&
158  );
159 
160  //- Reset the fvPatchField to the given fvPatchField
161  // Used for mesh to mesh mapping
162  virtual void reset(const fvPatchScalarField&);
163 
164 
165  // Evaluation functions
166 
167  //- Return the flux of this species
168  virtual tmp<scalarField> calcPhiYp() const = 0;
169 
170  //- Return the flux of this species
171  virtual const scalarField& phiYp() const;
172 
173  //- Update the coefficients associated with the patch field
174  virtual void updateCoeffs();
175 
176 
177  // Member Operators
178 
179  using mixedFvPatchScalarField::operator=;
180 
181 
182  //- Write
183  virtual void write(Ostream&) const;
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 
194 #endif
195 
196 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Specialisation of basicMixture for a mixture consisting of a number for molecular species.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
Registry of regIOobjects.
Abstract base class for specie-transferring mass fraction boundary conditions.
virtual const scalarField & phiYp() const
Return the flux of this species.
virtual tmp< scalarField > calcPhiYp() const =0
Return the flux of this species.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
static const basicSpecieMixture & composition(const objectRegistry &db)
Access the composition for the given database.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchScalarField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
static const NamedEnum< property, 4 > propertyNames_
Property type names.
specieTransferMassFractionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
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