FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ > Class Template Reference

Burgers operator assembly class. More...

#include <burgers_assembler.hpp>

Public Types

typedef DataType_ DataType
 the datatype we use here More...
 

Public Member Functions

 BurgersAssembler ()
 default constructor More...
 
template<typename Space_ , typename CubatureFactory_ >
void assemble_matrix (LAFEM::SparseMatrixBCSR< DataType_, IndexType_, dim_, dim_ > &matrix, const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &convect, const Space_ &space, const CubatureFactory_ &cubature_factory, const DataType_ scale=DataType_(1)) const
 Assembles the Burgers operator into a matrix. More...
 
template<typename Matrix_ , typename Space_ , typename CubatureFactory_ >
void assemble_scalar_matrix (Matrix_ &matrix, const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &convect, const Space_ &space, const CubatureFactory_ &cubature_factory, const DataType_ scale=DataType_(1)) const
 Assembles the Burgers operator into a scalar matrix. More...
 
template<typename Space_ , typename CubatureFactory_ >
void assemble_vector (LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &vector, const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &convect, const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &primal, const Space_ &space, const CubatureFactory_ &cubature_factory, const DataType_ scale=DataType_(1)) const
 Assembles the Burgers operator into a vector. More...
 
template<typename LocalVector_ , typename Mirror_ >
void set_sd_v_norm (const Global::Vector< LocalVector_, Mirror_ > &convect)
 Sets the convection field norm \(\|v\|_\Omega\) for the streamline diffusion parameter delta_T. More...
 
void set_sd_v_norm (const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &convect)
 Sets the convection field norm \(\|v\|_\Omega\) for the local streamline diffusion parameter delta_T. More...
 

Public Attributes

DataType_ beta
 scaling parameter for convective operator K More...
 
bool deformation
 specifies whether to use the deformation tensor More...
 
DataType_ frechet_beta
 scaling parameter for Frechet derivative of convective operator K' More...
 
DataType_ nu
 scaling parameter for diffusive operator L (aka viscosity) More...
 
DataType_ sd_delta
 scaling parameter for streamline diffusion stabilization operator S More...
 
DataType_ sd_nu
 viscosity parameter nu_S for streamline diffusion (usually equal to nu) More...
 
DataType_ sd_v_norm
 velocity norm for streamline diffusion More...
 
DataType_ theta
 scaling parameter for reactive operator M More...
 

Detailed Description

template<typename DataType_, typename IndexType_, int dim_>
class FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >

Burgers operator assembly class.

This class is responsible for assembling the scalar and vector-valued Burgers operators:

\[\mathbf{N}(v,u,\psi) := \nu \mathbf{L}(u,\psi) + \theta \mathbf{M}(u,\psi) + \beta \mathbf{K}(v,u,\psi) + \beta' \mathbf{K'(v,u,\psi)} + \delta \mathbf{S}(v,u,\psi)\]

where

  • L is the diffusive operator, which is either
    • the gradient tensor:

      \[\mathbf{L}(u,\psi) := \int_\Omega \nabla u \cdot \nabla \psi \]

    • or the deformation tensor:

      \[\mathbf{L}(u,\psi) := \frac{1}{4} \int_\Omega (\nabla+\nabla^\top) u : (\nabla+\nabla^\top) \psi\]

  • M is the reactive operator:

    \[\mathbf{M}(u,\psi) := \int_\Omega u\psi\]

  • K is the convective operator:

    \[\mathbf{K}(v,u,\psi) := \int_\Omega v\cdot \nabla u \psi\]

  • K' is the Frechet derivative of the convective operator:

    \[\mathbf{K'}(v,u,\psi) := \int_\Omega \nabla v u \psi\]

  • S is the Samarskij-style streamline-diffusion stabilization operator:

    \[\mathbf{S}(v,u,\psi) := \sum_{T\in\mathcal{T}_h}\delta_{T}\int_T (v\cdot\nabla u)\cdot(v\cdot\nabla\psi)\]

    where

    \[\delta_T := \frac{h_T}{\|v\|_\Omega}\cdot\frac{2Re_T}{1+Re_T}\qquad\textnormal{and}\qquad Re_T := \frac{\|v\|_T\cdot h_T}{\nu_\mathbf{S}}\]

Notes on Streamline Diffusion Stabilization:
The implementation of the streamline diffusion stabilization is based on Turek's CFD book (see [TurekCFD], pages 119 – 123), however, in the formula above, the local stabilization parameter \(\delta_T\) is not pre- multiplied by the global parameter \(\delta^*\), compare eq. (3.75) in the book, as we use delta as a scaling parameter for the whole operator S in the definition of the full operator N, see above. To enable streamline diffusion stabilization, you have to perform several tasks:

  1. Set the global stabilization parameter sd_delta, which corresponds to the delta* parameter in the CFD book. According to the book (and previous FEAT versions), the value should be in range [0.1, 2], but according to my personal experience, even smaller values may be a good choice (e.g. 0.02).
  2. Set the viscosity parameter sd_nu, which is usually set equal to nu. The only reason for this extra parameter is so that you can use this assembler class to assemble the stabilization without necessarily also assembling the diffusion operator, which is what would happen if you set nu to a non-zero value.
  3. Set the (maximum) velocity norm sd_v_norm of the convection field, which corresponds to \(\|v\|_\Omega\) and is required for the computation of the local delta_T parameters. You can do this by either specifying the value directly or, more conveniently, use one of this class's set_sd_v_norm() functions to compute this norm from a (local or global) convection field vector.
Author
Peter Zajac

Definition at line 62 of file burgers_assembler.hpp.

Member Typedef Documentation

◆ DataType

template<typename DataType_ , typename IndexType_ , int dim_>
typedef DataType_ FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::DataType

the datatype we use here

Definition at line 66 of file burgers_assembler.hpp.

Constructor & Destructor Documentation

◆ BurgersAssembler()

template<typename DataType_ , typename IndexType_ , int dim_>
FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::BurgersAssembler ( )
inline

default constructor

Definition at line 93 of file burgers_assembler.hpp.

Member Function Documentation

◆ assemble_matrix()

template<typename DataType_ , typename IndexType_ , int dim_>
template<typename Space_ , typename CubatureFactory_ >
void FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::assemble_matrix ( LAFEM::SparseMatrixBCSR< DataType_, IndexType_, dim_, dim_ > &  matrix,
const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &  convect,
const Space_ &  space,
const CubatureFactory_ &  cubature_factory,
const DataType_  scale = DataType_(1) 
) const
inline

◆ assemble_scalar_matrix()

template<typename DataType_ , typename IndexType_ , int dim_>
template<typename Matrix_ , typename Space_ , typename CubatureFactory_ >
void FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::assemble_scalar_matrix ( Matrix_ &  matrix,
const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &  convect,
const Space_ &  space,
const CubatureFactory_ &  cubature_factory,
const DataType_  scale = DataType_(1) 
) const
inline

◆ assemble_vector()

template<typename DataType_ , typename IndexType_ , int dim_>
template<typename Space_ , typename CubatureFactory_ >
void FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::assemble_vector ( LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &  vector,
const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &  convect,
const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &  primal,
const Space_ &  space,
const CubatureFactory_ &  cubature_factory,
const DataType_  scale = DataType_(1) 
) const
inline

Assembles the Burgers operator into a vector.

Parameters
[in,out]vectorThe transient vector to be assembled.
[in]convectThe transient transport vector for the convection.
[in]primalThe transient primal vector, usually a solution vector.
[in]spaceThe transient velocity space.
[in]cubature_factoryThe transient cubature factory to be used for integration.
[in]scaleA scaling factor the vector to be assembled.

Definition at line 729 of file burgers_assembler.hpp.

References FEAT::Math::abs(), FEAT::Tiny::Vector< T_, n_, s_ >::axpy(), FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::beta, FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::deformation, FEAT::Tiny::dot(), FEAT::Tiny::Vector< T_, n_, s_ >::format(), FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::nu, FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::size(), FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::theta, FEAT::value, and XASSERTM.

◆ set_sd_v_norm() [1/2]

template<typename DataType_ , typename IndexType_ , int dim_>
template<typename LocalVector_ , typename Mirror_ >
void FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::set_sd_v_norm ( const Global::Vector< LocalVector_, Mirror_ > &  convect)
inline

Sets the convection field norm \(\|v\|_\Omega\) for the streamline diffusion parameter delta_T.

Note
This function automatically syncs the norm over all processes by using the vector's gate.
Parameters
[in]convectThe transient (global) convection field vector.

Definition at line 982 of file burgers_assembler.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::get_gate(), FEAT::Global::Vector< LocalVector_, Mirror_ >::local(), FEAT::Global::Gate< LocalVector_, Mirror_ >::max(), and FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::set_sd_v_norm().

◆ set_sd_v_norm() [2/2]

template<typename DataType_ , typename IndexType_ , int dim_>
void FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::set_sd_v_norm ( const LAFEM::DenseVectorBlocked< DataType_, IndexType_, dim_ > &  convect)
inline

Sets the convection field norm \(\|v\|_\Omega\) for the local streamline diffusion parameter delta_T.

Parameters
[in]convectThe transient (local) convection field vector.

Definition at line 963 of file burgers_assembler.hpp.

References FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::elements(), FEAT::Math::max(), and FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::size().

Referenced by FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::set_sd_v_norm().

Member Data Documentation

◆ beta

template<typename DataType_ , typename IndexType_ , int dim_>
DataType_ FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::beta

◆ deformation

template<typename DataType_ , typename IndexType_ , int dim_>
bool FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::deformation

◆ frechet_beta

template<typename DataType_ , typename IndexType_ , int dim_>
DataType_ FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::frechet_beta

◆ nu

template<typename DataType_ , typename IndexType_ , int dim_>
DataType_ FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::nu

◆ sd_delta

template<typename DataType_ , typename IndexType_ , int dim_>
DataType_ FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::sd_delta

◆ sd_nu

template<typename DataType_ , typename IndexType_ , int dim_>
DataType_ FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::sd_nu

viscosity parameter nu_S for streamline diffusion (usually equal to nu)

Definition at line 87 of file burgers_assembler.hpp.

◆ sd_v_norm

template<typename DataType_ , typename IndexType_ , int dim_>
DataType_ FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::sd_v_norm

◆ theta

template<typename DataType_ , typename IndexType_ , int dim_>
DataType_ FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::theta

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