semiPermeableBaffleMassFractionFvPatchScalarField.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::semiPermeableBaffleMassFractionFvPatchScalarField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 This is a mass-fraction boundary condition for a semi-permeable baffle.
34
35 This condition models a baffle which is permeable to a some species and
36 impermeable to others. It must be used in conjunction with the
37 corresponding velocity condition,
38 semiPermeableBaffleVelocityFvPatchVectorField.
39
40 The mass flux of a species is calculated as a coefficient multiplied by the
41 difference in mass fraction across the baffle.
42 \f[
43 \phi_{Yi} = c A (Y_i - Y_{i,n})
44 \f]
45 where
46 \vartable
47 \phi_{Yi} | flux of the permeable species [kg/s]
48 c | transfer coefficient [kg/m2/s]
49 A | patch face area [m2]
50 Y_i | mass fraction on the patch []
51 Y_{i,n} | mass fraction on the neighbour patch []
52 \endvartable
53
54 A species that the baffle is permable to will, therefore, have a
55 coefficient greater than zero, whilst a species that does not transfer will
56 have a coefficient equal to zero.
57
58 This condition calculates the species flux. The fluxes are summed up by the
59 velocity consition to generate the net mass transfer across the baffle.
60 This mass-fraction condition then generates a corrective diffusive flux to
61 ensure that the correct amounts of the permeable species are transferred.
62
63Usage
64 \table
65 Property | Description | Req'd? | Default
66 c | Transfer coefficient | no | 0
67 phi | Name of the flux field | no | phi
68 \endtable
69
70See also
71 Foam::semiPermeableBaffleVelocityFvPatchVectorField
72
73SourceFiles
74 semiPermeableBaffleMassFractionFvPatchScalarField.C
75
76\*---------------------------------------------------------------------------*/
77
78#ifndef semiPermeableBaffleMassFractionFvPatchScalarField_H
79#define semiPermeableBaffleMassFractionFvPatchScalarField_H
80
81#include "mappedPatchBase.H"
82#include "mixedFvPatchFields.H"
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86namespace Foam
87{
88
89/*---------------------------------------------------------------------------*\
90 Class semiPermeableBaffleMassFractionFvPatchScalarField Declaration
91\*---------------------------------------------------------------------------*/
92
93class semiPermeableBaffleMassFractionFvPatchScalarField
94:
95 public mappedPatchBase,
96 public mixedFvPatchScalarField
97{
98 // Private data
99
100 //- Transfer coefficient
101 const scalar c_;
102
103 //- Name of the flux field
104 const word phiName_;
105
106
107public:
108
109 //- Runtime type information
110 TypeName("semiPermeableBaffleMassFraction");
111
112
113 // Constructors
114
115 //- Construct from patch and internal field
117 (
118 const fvPatch&,
119 const DimensionedField<scalar, volMesh>&
120 );
121
122 //- Construct from patch, internal field and dictionary
124 (
125 const fvPatch&,
126 const DimensionedField<scalar, volMesh>&,
128 );
129
130 //- Construct by mapping given fixedValueTypeFvPatchField
131 // onto a new patch
133 (
135 const fvPatch&,
137 const fvPatchFieldMapper&
138 );
139
140 //- Construct as copy
142 (
144 );
145
146 //- Construct and return a clone
147 virtual tmp<fvPatchScalarField> clone() const
148 {
150 (
152 );
153 }
154
155 //- Construct as copy setting internal field reference
157 (
160 );
161
162 //- Construct and return a clone setting internal field reference
164 (
166 ) const
167 {
169 (
171 (
172 *this,
173 iF
174 )
175 );
176 }
177
178
179 // Member functions
180
181 // Evaluation functions
182
183 //- Return the flux of this species through the baffle
184 tmp<scalarField> phiY() const;
185
186 //- Update the coefficients associated with the patch field
187 virtual void updateCoeffs();
188
189
190 //- Write
191 virtual void write(Ostream&) const;
192};
193
194
195// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196
197} // End namespace Foam
198
199// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200
201
202#endif
203
204// ************************************************************************* //
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:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
This is a mass-fraction boundary condition for a semi-permeable baffle.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
TypeName("semiPermeableBaffleMassFraction")
Runtime type information.
tmp< scalarField > phiY() const
Return the flux of this species through the baffle.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
semiPermeableBaffleMassFractionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73