semiPermeableBaffleMassFractionFvPatchScalarField.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) 2017-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::semiPermeableBaffleMassFractionFvPatchScalarField
26 
27 Description
28  This is a mass-fraction boundary condition for a semi-permeable baffle.
29 
30  This condition models a baffle which is permeable to a some species and
31  impermeable to others. It must be used in conjunction with a
32  specieTransferVelocityFvPatchVectorField velocity condition, and a
33  specieTransferTemperatureFvPatchScalarField temperature condition.
34 
35  The mass flux of a species is calculated as a coefficient multiplied by the
36  difference in a property across the baffle.
37  \f[
38  \phi_{Yi} = c A (\psi_i - \psi_{i,n})
39  \f]
40  where
41  \vartable
42  \phi_{Yi} | Flux of the permeable specie [kg/s]
43  c | Transfer coefficient [kg/m^2/s/<property-dimensions>]
44  A | Patch face area [m^2]
45  \psi_i | Property on the patch [<property-dimensions>]
46  \psi_{i,n} | Property on the neighbour patch [<property-dimensions>]
47  \endvartable
48 
49  A species that the baffle is permeable to will, therefore, have a
50  coefficient greater than zero, whilst a species that does not transfer will
51  have a coefficient equal to zero.
52 
53 Usage
54  \table
55  Property | Description | Req'd? | Default
56  c | Transfer coefficient | no | 0
57  property | Property used to drive the transfer; massFraction, \\
58  moleFraction, molarConcentration, or partialPressure | if c is \\
59  non-zero |
60  phi | Name of the flux field | no | phi
61  U | Name of the velocity field | no | U
62  \endtable
63 
64  Example of the boundary condition specification:
65  \verbatim
66  <patchName>
67  {
68  type semiPermeableBaffleMassFraction;
69  property molarConcentration;
70  c 1e-3;
71  value $internalField;
72  }
73  \endverbatim
74 
75 See also
76  Foam::specieTransferMassFractionFvPatchScalarField
77  Foam::specieTransferVelocityFvPatchVectorField
78  Foam::specieTransferTemperatureFvPatchScalarField
79 
80 SourceFiles
81  semiPermeableBaffleMassFractionFvPatchScalarField.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef semiPermeableBaffleMassFractionFvPatchScalarField_H
86 #define semiPermeableBaffleMassFractionFvPatchScalarField_H
87 
88 #include "mappedPatchBase.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 
96 class basicSpecieMixture;
97 
98 /*---------------------------------------------------------------------------*\
99  Class semiPermeableBaffleMassFractionFvPatchScalarField Declaration
100 \*---------------------------------------------------------------------------*/
101 
102 class semiPermeableBaffleMassFractionFvPatchScalarField
103 :
104  public mappedPatchBase,
105  public specieTransferMassFractionFvPatchScalarField
106 {
107 public:
108 
109  //- Runtime type information
110  TypeName("semiPermeableBaffleMassFraction");
111 
112 
113  // Static member functions
114 
115  //- Access the composition for the given database
116  static const basicSpecieMixture& composition(const objectRegistry& db);
117 
118 
119  // Constructors
120 
121  //- Construct from patch and internal field
123  (
124  const fvPatch&,
125  const DimensionedField<scalar, volMesh>&
126  );
127 
128  //- Construct from patch, internal field and dictionary
130  (
131  const fvPatch&,
132  const DimensionedField<scalar, volMesh>&,
133  const dictionary&
134  );
135 
136  //- Construct by mapping given fixedValueTypeFvPatchField
137  // onto a new patch
139  (
141  const fvPatch&,
142  const DimensionedField<scalar, volMesh>&,
143  const fvPatchFieldMapper&
144  );
145 
146  //- Copy constructor
148  (
150  );
151 
152  //- Construct and return a clone
153  virtual tmp<fvPatchScalarField> clone() const
154  {
156  (
158  );
159  }
160 
161  //- Copy constructor setting internal field reference
163  (
166  );
167 
168  //- Construct and return a clone setting internal field reference
170  (
172  ) const
173  {
175  (
177  (
178  *this,
179  iF
180  )
181  );
182  }
183 
184 
185  // Member Functions
186 
187  // Evaluation functions
188 
189  //- Return the flux of this species through the baffle
190  virtual tmp<scalarField> calcPhiYp() const;
191 
192 
193  //- Write
194  virtual void write(Ostream&) const;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 
205 #endif
206 
207 // ************************************************************************* //
semiPermeableBaffleMassFractionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
This is a mass-fraction boundary condition for a semi-permeable baffle.
static const basicSpecieMixture & composition(const objectRegistry &db)
Access the composition for the given database.
virtual tmp< scalarField > calcPhiYp() const
Return the flux of this species through the baffle.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
TypeName("semiPermeableBaffleMassFraction")
Runtime type information.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.