semiPermeableBaffleMassFractionFvPatchScalarField Class Reference

This is a mass-fraction boundary condition for a semi-permeable baffle. More...

Inheritance diagram for semiPermeableBaffleMassFractionFvPatchScalarField:
[legend]
Collaboration diagram for semiPermeableBaffleMassFractionFvPatchScalarField:
[legend]

Public Member Functions

 TypeName ("semiPermeableBaffleMassFraction")
 Runtime type information. More...
 
 semiPermeableBaffleMassFractionFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &)
 Construct from patch and internal field. More...
 
 semiPermeableBaffleMassFractionFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
 Construct from patch, internal field and dictionary. More...
 
 semiPermeableBaffleMassFractionFvPatchScalarField (const semiPermeableBaffleMassFractionFvPatchScalarField &, const fvPatch &, const DimensionedField< scalar, volMesh > &, const fvPatchFieldMapper &)
 Construct by mapping given fixedValueTypeFvPatchField. More...
 
 semiPermeableBaffleMassFractionFvPatchScalarField (const semiPermeableBaffleMassFractionFvPatchScalarField &)
 Construct as copy. More...
 
virtual tmp< fvPatchScalarFieldclone () const
 Construct and return a clone. More...
 
 semiPermeableBaffleMassFractionFvPatchScalarField (const semiPermeableBaffleMassFractionFvPatchScalarField &, const DimensionedField< scalar, volMesh > &)
 Construct as copy setting internal field reference. More...
 
virtual tmp< fvPatchScalarFieldclone (const DimensionedField< scalar, volMesh > &iF) const
 Construct and return a clone setting internal field reference. More...
 
tmp< scalarFieldphiY () const
 Return the flux of this species through the baffle. More...
 
virtual void updateCoeffs ()
 Update the coefficients associated with the patch field. More...
 
virtual void write (Ostream &) const
 Write. More...
 
- Public Member Functions inherited from mappedPatchBase
 TypeName ("mappedPatchBase")
 Runtime type information. More...
 
 mappedPatchBase (const polyPatch &)
 Construct from patch. More...
 
 mappedPatchBase (const polyPatch &pp, const word &sampleRegion, const sampleMode sampleMode, const word &samplePatch, const vectorField &offsets)
 Construct with offsetMode=non-uniform. More...
 
 mappedPatchBase (const polyPatch &pp, const word &sampleRegion, const sampleMode sampleMode, const word &samplePatch, const vector &uniformOffset)
 Construct from offsetMode=uniform. More...
 
 mappedPatchBase (const polyPatch &pp, const word &sampleRegion, const sampleMode sampleMode, const word &samplePatch, const scalar normalDistance)
 Construct from offsetMode=normal and distance. More...
 
 mappedPatchBase (const polyPatch &, const dictionary &)
 Construct from dictionary. More...
 
 mappedPatchBase (const polyPatch &, const sampleMode, const dictionary &)
 Construct from dictionary and (collocated) sample mode. More...
 
 mappedPatchBase (const polyPatch &, const mappedPatchBase &)
 Construct as copy, resetting patch. More...
 
 mappedPatchBase (const polyPatch &, const mappedPatchBase &, const labelUList &mapAddressing)
 Construct as copy, resetting patch, map original data. More...
 
virtual ~mappedPatchBase ()
 Destructor. More...
 
void clearOut ()
 
void setOffset (const scalar normalDist)
 Change to normal offset with given distance. More...
 
void setOffset (const vector &uniformOffset)
 Change to uniform offset with value. More...
 
void setOffset (const vectorField &offsets)
 Change to non-uniform offsets. More...
 
sampleMode mode () const noexcept
 What to sample. More...
 
const wordsampleWorld () const noexcept
 World to sample. More...
 
const wordsampleRegion () const
 Region to sample. More...
 
const wordsamplePatch () const
 Patch (only if NEARESTPATCHFACE) More...
 
const wordcoupleGroup () const
 PatchGroup (only if NEARESTPATCHFACE) More...
 
label sampleSize () const
 Return size of mapped mesh/patch/boundary. More...
 
const vectoroffset () const noexcept
 Offset vector (from patch faces to destination mesh objects) More...
 
const vectorFieldoffsets () const noexcept
 Offset vectors (from patch faces to destination mesh objects) More...
 
label getCommunicator () const
 Get the communicator (worldComm or world-to-world) More...
 
label comm () const
 Identical to getCommunicator() More...
 
bool sameWorld () const
 Is sample world the local world? More...
 
bool masterWorld () const
 Is my world ordered before the sampleWorld? More...
 
bool sameRegion () const noexcept
 Cached sampleRegion != mesh.name() More...
 
const mapDistributemap () const
 Return reference to the parallel distribution map. More...
 
const AMIPatchToPatchInterpolationAMI (const bool forceUpdate=false) const
 Return reference to the AMI interpolator. More...
 
bool owner () const
 Is it owner. More...
 
const autoPtr< Foam::searchableSurface > & surfPtr () const
 Return a pointer to the AMI projection surface. More...
 
const polyMeshsampleMesh () const
 Get the region mesh. More...
 
const polyPatchsamplePolyPatch () const
 Get the patch on the region. More...
 
tmp< pointFieldsamplePoints () const
 Get the sample points. More...
 
const fileNamesampleDatabasePath () const
 
bool sampleDatabase () const
 
virtual fileName sendPath (const label proci) const
 
virtual fileName receivePath (const label proci) const
 
template<class Type >
void distribute (List< Type > &lst) const
 Wrapper around map/interpolate data distribution. More...
 
template<class Type , class CombineOp >
void distribute (List< Type > &lst, const CombineOp &cop) const
 Wrapper around map/interpolate data distribution with operation. More...
 
template<class Type >
void reverseDistribute (List< Type > &lst) const
 Wrapper around map/interpolate data distribution. More...
 
template<class Type , class CombineOp >
void reverseDistribute (List< Type > &lst, const CombineOp &cop) const
 Wrapper around map/interpolate data distribution with operation. More...
 
virtual void write (Ostream &os) const
 Write as a dictionary. More...
 

Additional Inherited Members

- Public Types inherited from mappedPatchBase
enum  sampleMode {
  NEARESTCELL , NEARESTPATCHFACE , NEARESTPATCHFACEAMI , NEARESTPATCHPOINT ,
  NEARESTFACE , NEARESTONLYCELL
}
 Mesh items to sample. More...
 
enum  offsetMode { UNIFORM , NONUNIFORM , NORMAL }
 How to project face centres. More...
 
typedef Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
 Helper class for finding nearest. More...
 
typedef Tuple2< nearInfo, label > nearInfoWorld
 nearest + world More...
 
- Static Public Member Functions inherited from mappedPatchBase
static pointIndexHit facePoint (const polyMesh &, const label facei, const polyMesh::cellDecomposition)
 Get a point on the face given a face decomposition method: More...
 
static fileName sendPath (const fileName &root, const label proci)
 Helper: return path to store data to be sent to processor i. More...
 
static fileName receivePath (const fileName &root, const label proci)
 
static const objectRegistrysubRegistry (const objectRegistry &obr, const fileName &path)
 
template<class Type >
static void storeField (objectRegistry &obr, const word &fieldName, const Field< Type > &values)
 Store an IOField on the objectRegistry relative to obr. More...
 
static void writeDict (const objectRegistry &obr, dictionary &dict)
 Convert objectRegistry contents into dictionary. More...
 
static void readDict (const dictionary &d, objectRegistry &obr)
 (recursively) construct and register IOFields from dictionary More...
 
- Static Public Attributes inherited from mappedPatchBase
static const Enum< sampleModesampleModeNames_
 
static const Enum< offsetModeoffsetModeNames_
 
- Protected Member Functions inherited from mappedPatchBase
bool addWorldConnection ()
 Add a world-world connection. More...
 
label getWorldCommunicator () const
 Get the communicator for the world-world connection. More...
 
const polyMeshlookupMesh (const word &region) const
 Lookup mesh. More...
 
const polyPatchlookupPatch (const word &sampleRegion, const word &samplePatch) const
 Lookup patch. More...
 
tmp< pointFieldfacePoints (const polyPatch &) const
 
void collectSamples (const label mySampleWorld, const pointField &facePoints, pointField &samples, labelList &patchFaceWorlds, labelList &patchFaceProcs, labelList &patchFaces, pointField &patchFc) const
 
void findLocalSamples (const sampleMode mode, const label sampleWorld, const word &sampleRegion, const word &samplePatch, const pointField &samplePoints, List< nearInfoWorld > &nearest) const
 Find (local) cells/faces containing samples. More...
 
void findSamples (const sampleMode mode, const label myWorldIndex, const pointField &, const labelList &wantedWorlds, const labelList &origProcs, labelList &sampleProcs, labelList &sampleIndices, pointField &sampleLocations) const
 Find (global) cells/faces containing samples. More...
 
tmp< pointFieldsamplePoints (const pointField &) const
 Get the sample points given the face points. More...
 
void calcMapping () const
 Calculate mapping. More...
 
void calcAMI () const
 Calculate AMI interpolator. More...
 
- Static Protected Member Functions inherited from mappedPatchBase
static autoPtr< fileNamereadDatabase (const dictionary &dict)
 Read optional database name from dictionary. More...
 
static const objectRegistrysubRegistry (const objectRegistry &obr, const wordList &names, const label index)
 
template<class Type >
static bool writeIOField (const regIOobject &obj, dictionary &dict)
 Attempt to detect an IOField<Type> and write to dictionary. More...
 
template<class Type >
static bool constructIOField (const word &name, token &tok, Istream &is, objectRegistry &obr)
 Attempt to read an IOField<Type> and store on objectRegistry. More...
 
- Protected Attributes inherited from mappedPatchBase
const polyPatchpatch_
 Patch to sample. More...
 
word sampleWorld_
 World to sample. More...
 
word sampleRegion_
 Region to sample. More...
 
const sampleMode mode_
 What to sample. More...
 
word samplePatch_
 Patch (if in sampleMode NEARESTPATCH*) More...
 
const coupleGroupIdentifier coupleGroup_
 PatchGroup (if in sampleMode NEARESTPATCH*) More...
 
const autoPtr< fileNamesampleDatabasePtr_
 Empty or location of database. More...
 
offsetMode offsetMode_
 How to obtain samples. More...
 
vector offset_
 Offset vector (uniform) More...
 
vectorField offsets_
 Offset vector (nonuniform) More...
 
scalar distance_
 Offset distance (normal) More...
 
label communicator_
 Communicator. More...
 
bool sameRegion_
 Same region. More...
 
autoPtr< mapDistributemapPtr_
 Communication schedule: More...
 
const bool AMIReverse_
 Flag to indicate that slave patch should be reversed for AMI. More...
 
autoPtr< AMIPatchToPatchInterpolationAMIPtr_
 Pointer to AMI interpolator. More...
 
autoPtr< searchableSurfacesurfPtr_
 Pointer to projection surface employed by AMI interpolator. More...
 
dictionary surfDict_
 Dictionary storing projection surface description. More...
 

Detailed Description

This is a mass-fraction boundary condition for a semi-permeable baffle.

This condition models a baffle which is permeable to a some species and impermeable to others. It must be used in conjunction with the corresponding velocity condition, semiPermeableBaffleVelocityFvPatchVectorField.

The mass flux of a species is calculated as a coefficient multiplied by the difference in mass fraction across the baffle.

\[ \phi_{Yi} = c A (Y_i - Y_{i,n}) \]

where

\( \phi_{Yi} \) = flux of the permeable species [kg/s]
\( c \) = transfer coefficient [kg/m2/s]
\( A \) = patch face area [m2]
\( Y_i \) = mass fraction on the patch []
\( Y_{i,n} \) = mass fraction on the neighbour patch []

A species that the baffle is permable to will, therefore, have a coefficient greater than zero, whilst a species that does not transfer will have a coefficient equal to zero.

This condition calculates the species flux. The fluxes are summed up by the velocity consition to generate the net mass transfer across the baffle. This mass-fraction condition then generates a corrective diffusive flux to ensure that the correct amounts of the permeable species are transferred.

Usage
Property Description Req'd? Default
c Transfer coefficient no 0
phi Name of the flux field no phi
See also
Foam::semiPermeableBaffleVelocityFvPatchVectorField
Source files

Definition at line 127 of file semiPermeableBaffleMassFractionFvPatchScalarField.H.

Constructor & Destructor Documentation

◆ semiPermeableBaffleMassFractionFvPatchScalarField() [1/5]

Construct from patch and internal field.

Definition at line 38 of file semiPermeableBaffleMassFractionFvPatchScalarField.C.

References Foam::Zero.

◆ semiPermeableBaffleMassFractionFvPatchScalarField() [2/5]

semiPermeableBaffleMassFractionFvPatchScalarField ( const fvPatch p,
const DimensionedField< scalar, volMesh > &  iF,
const dictionary dict 
)

Construct from patch, internal field and dictionary.

Definition at line 56 of file semiPermeableBaffleMassFractionFvPatchScalarField.C.

References dict, fvPatchField< scalar >::operator=(), p, UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ semiPermeableBaffleMassFractionFvPatchScalarField() [3/5]

Construct by mapping given fixedValueTypeFvPatchField.

onto a new patch

Definition at line 77 of file semiPermeableBaffleMassFractionFvPatchScalarField.C.

◆ semiPermeableBaffleMassFractionFvPatchScalarField() [4/5]

◆ semiPermeableBaffleMassFractionFvPatchScalarField() [5/5]

Construct as copy setting internal field reference.

Definition at line 106 of file semiPermeableBaffleMassFractionFvPatchScalarField.C.

Member Function Documentation

◆ TypeName()

TypeName ( "semiPermeableBaffleMassFraction"  )

Runtime type information.

◆ clone() [1/2]

virtual tmp< fvPatchScalarField > clone ( ) const
inlinevirtual

Construct and return a clone.

Definition at line 181 of file semiPermeableBaffleMassFractionFvPatchScalarField.H.

◆ clone() [2/2]

virtual tmp< fvPatchScalarField > clone ( const DimensionedField< scalar, volMesh > &  iF) const
inlinevirtual

Construct and return a clone setting internal field reference.

Definition at line 197 of file semiPermeableBaffleMassFractionFvPatchScalarField.H.

◆ phiY()

Foam::tmp< Foam::scalarField > phiY ( ) const

Return the flux of this species through the baffle.

Definition at line 123 of file semiPermeableBaffleMassFractionFvPatchScalarField.C.

References mapDistribute::distribute(), fvPatch::lookupPatchField(), mappedPatchBase::map(), Time::New(), fvPatchField< Type >::patchInternalField(), and Foam::Zero.

Here is the call graph for this function:

◆ updateCoeffs()

void updateCoeffs ( )
virtual

Update the coefficients associated with the patch field.

Definition at line 144 of file semiPermeableBaffleMassFractionFvPatchScalarField.C.

References turbulenceModel::propertiesName.

◆ write()

void write ( Ostream os) const
virtual

Write.

Reimplemented from mappedPatchBase.

Definition at line 169 of file semiPermeableBaffleMassFractionFvPatchScalarField.C.

References os(), ObukhovLength::write(), and Ostream::writeEntryIfDifferent().

Here is the call graph for this function:

The documentation for this class was generated from the following files: