Loading...
Searching...
No Matches
activeBaffleVelocityFvPatchVectorField Class Reference

This velocity boundary condition simulates the opening of a baffle due to local flow conditions, by merging the behaviours of wall and cyclic conditions. The baffle joins two mesh regions, where the open fraction determines the interpolation weights applied to each cyclic- and neighbour-patch contribution. More...

#include <activeBaffleVelocityFvPatchVectorField.H>

Inheritance diagram for activeBaffleVelocityFvPatchVectorField:
Collaboration diagram for activeBaffleVelocityFvPatchVectorField:

Public Member Functions

 TypeName ("activeBaffleVelocity")
 Runtime type information.
 activeBaffleVelocityFvPatchVectorField (const fvPatch &, const DimensionedField< vector, volMesh > &)
 Construct from patch and internal field.
 activeBaffleVelocityFvPatchVectorField (const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
 Construct from patch, internal field and dictionary.
 activeBaffleVelocityFvPatchVectorField (const activeBaffleVelocityFvPatchVectorField &, const fvPatch &, const DimensionedField< vector, volMesh > &, const fvPatchFieldMapper &)
 Construct by mapping given activeBaffleVelocityFvPatchVectorField.
 activeBaffleVelocityFvPatchVectorField (const activeBaffleVelocityFvPatchVectorField &)
 Construct as copy.
 activeBaffleVelocityFvPatchVectorField (const activeBaffleVelocityFvPatchVectorField &, const DimensionedField< vector, volMesh > &)
 Construct as copy setting internal field reference.
virtual tmp< fvPatchField< vector > > clone () const
 Return a clone.
virtual tmp< fvPatchField< vector > > clone (const DimensionedField< vector, volMesh > &iF) const
 Clone with an internal field reference.
virtual void autoMap (const fvPatchFieldMapper &)
 Map (and resize as needed) from self given a mapping object.
virtual void rmap (const fvPatchVectorField &, const labelList &)
 Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs ()
 Update the coefficients associated with the patch field.
virtual void write (Ostream &) const
 Write.

Detailed Description

This velocity boundary condition simulates the opening of a baffle due to local flow conditions, by merging the behaviours of wall and cyclic conditions. The baffle joins two mesh regions, where the open fraction determines the interpolation weights applied to each cyclic- and neighbour-patch contribution.

We determine whether the baffle is opening or closing from the sign of the net force across the baffle, from which the baffle open fraction is updated using:

\‍[        x = x_{old} + sign(F_{net})\frac{dt}{DT}
\‍]

where

$        x       $=baffle open fraction [0-1]
$        x_{old} $=baffle open fraction on previous evaluation
$        dt      $=simulation time step
$        DT      $=time taken to open the baffle
$        F_{net} $=net force across the baffle

The open fraction is then applied to scale the patch areas.

Usage
Property Description Required Default value
p pressure field name no p
cyclicPatch cylclic patch name yes
orientation 1 or -1 used to switch flow direction yes
openFraction current opatch open fraction [0-1]yes
openingTime time taken to open the baffle yes
maxOpenFractionDelta max open fraction change per timestep yes

Example of the boundary condition specification:

    <patchName>
    {
        type            activeBaffleVelocity;
        p               p;
        cyclicPatch     cyclic1;
        orientation     1;
        openFraction    0.2;
        openingTime     5.0;
        maxOpenFractionDelta 0.1;
    }
See also
Foam::fixedValueFvPatchField Foam::cyclicFvPatchField
Source files

Definition at line 158 of file activeBaffleVelocityFvPatchVectorField.H.

Constructor & Destructor Documentation

◆ activeBaffleVelocityFvPatchVectorField() [1/5]

activeBaffleVelocityFvPatchVectorField ( const fvPatch & p,
const DimensionedField< vector, volMesh > & iF )

Construct from patch and internal field.

Definition at line 30 of file activeBaffleVelocityFvPatchVectorField.C.

References p.

Referenced by activeBaffleVelocityFvPatchVectorField(), activeBaffleVelocityFvPatchVectorField(), activeBaffleVelocityFvPatchVectorField(), and TypeName().

Here is the caller graph for this function:

◆ activeBaffleVelocityFvPatchVectorField() [2/5]

activeBaffleVelocityFvPatchVectorField ( const fvPatch & p,
const DimensionedField< vector, volMesh > & iF,
const dictionary & dict )

Construct from patch, internal field and dictionary.

Definition at line 76 of file activeBaffleVelocityFvPatchVectorField.C.

References dict, fvPatchField< vector >::operator=(), p, Foam::refCast(), and Foam::Zero.

Here is the call graph for this function:

◆ activeBaffleVelocityFvPatchVectorField() [3/5]

activeBaffleVelocityFvPatchVectorField ( const activeBaffleVelocityFvPatchVectorField & ptf,
const fvPatch & p,
const DimensionedField< vector, volMesh > & iF,
const fvPatchFieldMapper & mapper )

Construct by mapping given activeBaffleVelocityFvPatchVectorField.

onto a new patch

Definition at line 52 of file activeBaffleVelocityFvPatchVectorField.C.

References activeBaffleVelocityFvPatchVectorField(), and p.

Here is the call graph for this function:

◆ activeBaffleVelocityFvPatchVectorField() [4/5]

activeBaffleVelocityFvPatchVectorField ( const activeBaffleVelocityFvPatchVectorField & ptf)

Construct as copy.

Definition at line 108 of file activeBaffleVelocityFvPatchVectorField.C.

References activeBaffleVelocityFvPatchVectorField().

Here is the call graph for this function:

◆ activeBaffleVelocityFvPatchVectorField() [5/5]

activeBaffleVelocityFvPatchVectorField ( const activeBaffleVelocityFvPatchVectorField & ptf,
const DimensionedField< vector, volMesh > & iF )

Construct as copy setting internal field reference.

Definition at line 129 of file activeBaffleVelocityFvPatchVectorField.C.

References activeBaffleVelocityFvPatchVectorField().

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "activeBaffleVelocity" )

Runtime type information.

References activeBaffleVelocityFvPatchVectorField().

Here is the call graph for this function:

◆ clone() [1/2]

virtual tmp< fvPatchField< vector > > clone ( ) const
inlinevirtual

Return a clone.

Definition at line 286 of file activeBaffleVelocityFvPatchVectorField.H.

References fvPatchField< Type >::Clone().

Here is the call graph for this function:

◆ clone() [2/2]

virtual tmp< fvPatchField< vector > > clone ( const DimensionedField< vector, volMesh > & iF) const
inlinevirtual

Clone with an internal field reference.

Definition at line 294 of file activeBaffleVelocityFvPatchVectorField.H.

References fvPatchField< Type >::Clone().

Here is the call graph for this function:

◆ autoMap()

void autoMap ( const fvPatchFieldMapper & m)
virtual

Map (and resize as needed) from self given a mapping object.

Note: cannot map field from cyclic patch anyway so just recalculate

Areas should be consistent when doing autoMap except in case of topo changes. Note: we don't want to use Sf here since triggers rebuilding of fvMesh::S() which will give problems when mapped (since already on new mesh)

Definition at line 153 of file activeBaffleVelocityFvPatchVectorField.C.

References Foam::refCast().

Here is the call graph for this function:

◆ rmap()

void rmap ( const fvPatchVectorField & ptf,
const labelList & addr )
virtual

Reverse map the given fvPatchField onto this fvPatchField.

Definition at line 185 of file activeBaffleVelocityFvPatchVectorField.C.

References Foam::refCast().

Here is the call graph for this function:

◆ updateCoeffs()

void updateCoeffs ( )
virtual

Update the coefficients associated with the patch field.

Definition at line 210 of file activeBaffleVelocityFvPatchVectorField.C.

References Foam::clamp(), e, Foam::endl(), polyPatch::faceCells(), forAll, Foam::Info, Foam::mag(), fvPatch::magSf(), Foam::min(), p, fvPatch::patch(), Foam::refCast(), fvPatch::Sf(), Foam::sign(), and timeIndex.

Here is the call graph for this function:

◆ write()

void write ( Ostream & os) const
virtual

Write.

Definition at line 288 of file activeBaffleVelocityFvPatchVectorField.C.

References os(), fvPatchField< Type >::write(), and fvPatchField< Type >::writeValueEntry().

Here is the call graph for this function:

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