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 fluidMulticomponentThermo;
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  //- Get the thermo from the given database
111  static const fluidMulticomponentThermo& thermo
112  (
113  const objectRegistry& db
114  );
115 
116 
117  // Constructors
118 
119  //- Construct from patch, internal field and dictionary
121  (
122  const fvPatch&,
124  const dictionary&
125  );
126 
127  //- Construct by mapping given
128  // specieTransferMassFractionFvPatchScalarField
129  // onto a new patch
131  (
133  const fvPatch&,
135  const fieldMapper&
136  );
137 
138  //- Disallow copy without setting internal field reference
140  (
142  ) = delete;
143 
144  //- Copy constructor setting internal field reference
146  (
149  );
150 
151 
152  // Member Functions
153 
154  // Mapping functions
155 
156  //- Map the given fvPatchField onto this fvPatchField
157  virtual void map(const fvPatchScalarField&, const fieldMapper&);
158 
159  //- Reset the fvPatchField to the given fvPatchField
160  // Used for mesh to mesh mapping
161  virtual void reset(const fvPatchScalarField&);
162 
163 
164  // Evaluation functions
165 
166  //- Return the flux of this species
167  virtual tmp<scalarField> calcPhiYp() const = 0;
168 
169  //- Return the flux of this species
170  virtual const scalarField& phiYp() const;
171 
172  //- Update the coefficients associated with the patch field
173  virtual void updateCoeffs();
174 
175 
176  // Member Operators
177 
178  using mixedFvPatchScalarField::operator=;
179 
180 
181  //- Write
182  virtual void write(Ostream&) const;
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 
193 #endif
194 
195 // ************************************************************************* //
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
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Base-class for multi-component fluid thermodynamic properties.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
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.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
static const fluidMulticomponentThermo & thermo(const objectRegistry &db)
Get the thermo from the given database.
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