DarcyDampingOperation< dim, number > Class Template Reference

Developer Documentation: MeltPoolDG::Flow::DarcyDampingOperation< dim, number > Class Template Reference
Developer Documentation
MeltPoolDG::Flow::DarcyDampingOperation< dim, number > Class Template Reference

This class computes the Darcy damping force (or Darcy source term). More...

#include <darcy_damping_operation.hpp>

Collaboration diagram for MeltPoolDG::Flow::DarcyDampingOperation< dim, number >:
[legend]

Public Types

using VectorType = dealii::LinearAlgebra::distributed::Vector< number >
 DoF vector type.
 

Public Member Functions

 DarcyDampingOperation (const DarcyDampingData< number > &data_in, const ScratchData< dim, dim, number > &scratch_data, const unsigned int flow_vel_hanging_nodes_dof_idx, const unsigned int flow_quad_idx)
 Constructor.
 
void reinit ()
 Reinitialize data structures.
 
void set_darcy_damping_at_q (const Material< number > &material, const VectorType &ls_as_heaviside, const VectorType &temperature, const unsigned int ls_hanging_nodes_dof_idx, const unsigned int heat_dof_idx)
 Loop over all cells and quadrature points (defined via flow_quad_idx), compute the Darcy damping coefficient and store it.
 
void set_darcy_damping_at_q (const Material< number > &material, const VectorType &ls_as_heaviside, const VectorType &temperature, const VectorType *interface_temperature, const unsigned int ls_hanging_nodes_dof_idx, const unsigned int heat_cut_dof_idx, const unsigned int heat_cont_no_bc_dof_idx)
 
void assemble_rhs (VectorType &force_rhs, const VectorType &velocity_vec, const bool zero_out=true)
 Assemble the Darcy damping force contribution into the right-hand side (RHS) vector force_rhs.
 
void attach_output_vectors (GenericDataOut< dim, number > &data_out) const
 Attach the element-wise damping coefficient to the output data.
 
dealii::VectorizedArray< number > & get_damping (const unsigned int cell, const unsigned int q)
 Getter function for the damping coefficients cell-wise at each quadrature point (modifiable version).
 
const dealii::VectorizedArray< number > & get_damping (const unsigned int cell, const unsigned int q) const
 Getter function for the damping coefficients cell-wise at each quadrature point (const version).
 

Private Member Functions

dealii::VectorizedArray< number > compute_darcy_damping_coefficient (const dealii::VectorizedArray< number > &solid_fraction) const
 Compute the Darcy damping coefficient based on a given solid_fraction.
 
dealii::AlignedVector< dealii::VectorizedArray< number > > & get_damping_at_q ()
 Getter function for the vector of damping coefficients, holding the values at each cell and at each quadrature point.
 

Private Attributes

const number mushy_zone_morphology
 Morphological constant C.
 
const number avoid_div_zero_constant
 Small constant b to avoid division by zero.
 
const ScratchData< dim, dim, number > & scratch_data
 Reference to scratch data used for assembling.
 
const unsigned int flow_vel_hanging_nodes_dof_idx
 Index for velocity DoF in scratch data.
 
const unsigned int flow_quad_idx
 Index for quadrature rule for flow computation.
 
VectorType damping
 Global vector to hold cell-wise damping values.
 
dealii::AlignedVector< dealii::VectorizedArray< number > > damping_at_q
 Damping coefficients evaluated at quadrature points.
 
dealii::Vector< number > damping_output
 Element-wise output vector of damping coefficient.
 

Detailed Description

template<int dim, typename number>
class MeltPoolDG::Flow::DarcyDampingOperation< dim, number >

This class computes the Darcy damping force (or Darcy source term).

    /              \

f_d = | N_a, K N_b u | \ / Ω

with the isotropic permeability of the mushy zone K given by the Kozeny-Carman equation:

            fs²

K = - C -------------— ( 1- fs )³ + b

with the solid fraction fs \in [0, 1], the morphology of the mushy zone C and the parameter b to avoid division by zero.

Note
The regularization constant b must be greater than zero.

Voller, V. R., & Prakash, C. (1987). A fixed grid numerical modelling methodology for convection-diffusion mushy region phase-change problems. International Journal of Heat and Mass Transfer, 30(8), 1709–1719. https://doi.org/10.1016/0017-9310(87)90317-6

Template Parameters
dimSpatial dimension
numberFloating-point type

Member Typedef Documentation

◆ VectorType

template<int dim, typename number >
using MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::VectorType = dealii::LinearAlgebra::distributed::Vector<number>

DoF vector type.

Constructor & Destructor Documentation

◆ DarcyDampingOperation()

template<int dim, typename number >
MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::DarcyDampingOperation ( const DarcyDampingData< number > &  data_in,
const ScratchData< dim, dim, number > &  scratch_data,
const unsigned int  flow_vel_hanging_nodes_dof_idx,
const unsigned int  flow_quad_idx 
)
explicit

Constructor.

Parameters
data_inInput parameters.
scratch_dataContainer for discretization related data structures.
flow_vel_hanging_nodes_dof_idxDoFHandler index pointing to the flow velocity in scratch_data.
flow_quad_idxQuadrature index pointing to the flow velocity in scratch_data.

Member Function Documentation

◆ assemble_rhs()

template<int dim, typename number >
void MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::assemble_rhs ( VectorType force_rhs,
const VectorType velocity_vec,
const bool  zero_out = true 
)

Assemble the Darcy damping force contribution into the right-hand side (RHS) vector force_rhs.

This function computes and adds (or sets, if zero_out is true) the contribution of the Darcy damping force, based on the provided velocity vector velocity_vec.

Parameters
force_rhsThe global force vector to which the damping contribution will be added.
velocity_vecThe velocity field used in evaluating the damping term.
zero_outIf true, the force_rhs vector is cleared before the contribution is added.
Note
The damping coefficient must be precomputed at all quadrature points of each cell and made accessible via get_damping(cell, q) or get_damping_at_q(). This setup must be completed before calling this function.

◆ attach_output_vectors()

template<int dim, typename number >
void MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::attach_output_vectors ( GenericDataOut< dim, number > &  data_out) const

Attach the element-wise damping coefficient to the output data.

Parameters
data_outContainer handling output requests.

◆ compute_darcy_damping_coefficient()

template<int dim, typename number >
dealii::VectorizedArray< number > MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::compute_darcy_damping_coefficient ( const dealii::VectorizedArray< number > &  solid_fraction) const
private

Compute the Darcy damping coefficient based on a given solid_fraction.

Parameters
solid_fractionVolume fraction of solid phase between 0 and 1.
Returns
Darcy damping coefficient.

◆ get_damping() [1/2]

template<int dim, typename number >
dealii::VectorizedArray< number > & MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::get_damping ( const unsigned int  cell,
const unsigned int  q 
)

Getter function for the damping coefficients cell-wise at each quadrature point (modifiable version).

Parameters
cellCell index.
qQuadrature point index.
Returns
Cell-wise damping coefficients at quadrature point q.

◆ get_damping() [2/2]

template<int dim, typename number >
const dealii::VectorizedArray< number > & MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::get_damping ( const unsigned int  cell,
const unsigned int  q 
) const

Getter function for the damping coefficients cell-wise at each quadrature point (const version).

Parameters
cellCell index.
qQuadrature point index.
Returns
Cell-wise damping coefficients at quadrature point q.

◆ get_damping_at_q()

template<int dim, typename number >
dealii::AlignedVector< dealii::VectorizedArray< number > > & MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::get_damping_at_q ( )
private

Getter function for the vector of damping coefficients, holding the values at each cell and at each quadrature point.

Returns
Vector of damping coefficients.

◆ reinit()

template<int dim, typename number >
void MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::reinit ( )

Reinitialize data structures.

This function needs to be called after e.g. the mesh has changed.

◆ set_darcy_damping_at_q() [1/2]

template<int dim, typename number >
void MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::set_darcy_damping_at_q ( const Material< number > &  material,
const VectorType ls_as_heaviside,
const VectorType temperature,
const unsigned int  ls_hanging_nodes_dof_idx,
const unsigned int  heat_dof_idx 
)

Loop over all cells and quadrature points (defined via flow_quad_idx), compute the Darcy damping coefficient and store it.

Parameters
materialMaterial object holding the phase parameters.
ls_as_heavisideIndicator function between gas and heavy phase.
temperatureDoF vector of the temperature field.
ls_hanging_nodes_dof_idxDoF index of the indicator field inside ScratchData.
heat_dof_idxDoF index of the temperature field.

◆ set_darcy_damping_at_q() [2/2]

template<int dim, typename number >
void MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::set_darcy_damping_at_q ( const Material< number > &  material,
const VectorType ls_as_heaviside,
const VectorType temperature,
const VectorType interface_temperature,
const unsigned int  ls_hanging_nodes_dof_idx,
const unsigned int  heat_cut_dof_idx,
const unsigned int  heat_cont_no_bc_dof_idx 
)

Same as above, but for the case that the

Parameters
temperatureDof vector is from a one-phase CutFEM operation. In that case, we use the projected
interface_temperatureto compute the Darcy damping outside the liquid domain.
materialMaterial object holding the phase parameters.
ls_as_heavisideIndicator function between gas and heavy phase.
temperatureDoF vector of the CutFEM temperature field.
interface_temperatureDoF vector of the projected interface temperature.
ls_hanging_nodes_dof_idxDoF index of the indicator field inside ScratchData.
heat_cut_dof_idxDoF index of the CutFEM temperature field.
heat_cont_no_bc_dof_idxDoF index of the projected interface temperature field.

Member Data Documentation

◆ avoid_div_zero_constant

template<int dim, typename number >
const number MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::avoid_div_zero_constant
private

Small constant b to avoid division by zero.

◆ damping

template<int dim, typename number >
VectorType MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::damping
mutableprivate

Global vector to hold cell-wise damping values.

◆ damping_at_q

template<int dim, typename number >
dealii::AlignedVector<dealii::VectorizedArray<number> > MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::damping_at_q
mutableprivate

Damping coefficients evaluated at quadrature points.

◆ damping_output

template<int dim, typename number >
dealii::Vector<number> MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::damping_output
mutableprivate

Element-wise output vector of damping coefficient.

◆ flow_quad_idx

template<int dim, typename number >
const unsigned int MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::flow_quad_idx
private

Index for quadrature rule for flow computation.

◆ flow_vel_hanging_nodes_dof_idx

template<int dim, typename number >
const unsigned int MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::flow_vel_hanging_nodes_dof_idx
private

Index for velocity DoF in scratch data.

◆ mushy_zone_morphology

template<int dim, typename number >
const number MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::mushy_zone_morphology
private

Morphological constant C.

◆ scratch_data

template<int dim, typename number >
const ScratchData<dim, dim, number>& MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::scratch_data
private

Reference to scratch data used for assembling.


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