DarcyDampingOperation< dim, number > Class Template Reference
|
Developer Documentation
|
This class computes the Darcy damping force (or Darcy source term). More...
#include <darcy_damping_operation.hpp>
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
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
-
dim Spatial dimension number Floating-point type
Member Typedef Documentation
◆ VectorType
| using MeltPoolDG::Flow::DarcyDampingOperation< dim, number >::VectorType = dealii::LinearAlgebra::distributed::Vector<number> |
DoF vector type.
Constructor & Destructor Documentation
◆ DarcyDampingOperation()
|
explicit |
Constructor.
- Parameters
-
data_in Input parameters. scratch_data Container for discretization related data structures. flow_vel_hanging_nodes_dof_idx DoFHandler index pointing to the flow velocity in scratch_data.flow_quad_idx Quadrature index pointing to the flow velocity in scratch_data.
Member Function Documentation
◆ assemble_rhs()
| 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_rhs The global force vector to which the damping contribution will be added. velocity_vec The velocity field used in evaluating the damping term. zero_out If true, the force_rhsvector 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()
| 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_out Container handling output requests.
◆ compute_darcy_damping_coefficient()
|
private |
Compute the Darcy damping coefficient based on a given solid_fraction.
- Parameters
-
solid_fraction Volume fraction of solid phase between 0 and 1.
- Returns
- Darcy damping coefficient.
◆ get_damping() [1/2]
| 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
-
cell Cell index. q Quadrature point index.
- Returns
- Cell-wise damping coefficients at quadrature point
q.
◆ get_damping() [2/2]
| 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
-
cell Cell index. q Quadrature point index.
- Returns
- Cell-wise damping coefficients at quadrature point
q.
◆ 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()
| 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]
| 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
-
material Material object holding the phase parameters. ls_as_heaviside Indicator function between gas and heavy phase. temperature DoF vector of the temperature field. ls_hanging_nodes_dof_idx DoF index of the indicator field inside ScratchData. heat_dof_idx DoF index of the temperature field.
◆ set_darcy_damping_at_q() [2/2]
| 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
-
temperature Dof vector is from a one-phase CutFEM operation. In that case, we use the projected interface_temperature to compute the Darcy damping outside the liquid domain. material Material object holding the phase parameters. ls_as_heaviside Indicator function between gas and heavy phase. temperature DoF vector of the CutFEM temperature field. interface_temperature DoF vector of the projected interface temperature. ls_hanging_nodes_dof_idx DoF index of the indicator field inside ScratchData. heat_cut_dof_idx DoF index of the CutFEM temperature field. heat_cont_no_bc_dof_idx DoF index of the projected interface temperature field.
Member Data Documentation
◆ avoid_div_zero_constant
|
private |
Small constant b to avoid division by zero.
◆ damping
|
mutableprivate |
Global vector to hold cell-wise damping values.
◆ damping_at_q
|
mutableprivate |
Damping coefficients evaluated at quadrature points.
◆ damping_output
|
mutableprivate |
Element-wise output vector of damping coefficient.
◆ flow_quad_idx
|
private |
Index for quadrature rule for flow computation.
◆ flow_vel_hanging_nodes_dof_idx
|
private |
Index for velocity DoF in scratch data.
◆ mushy_zone_morphology
|
private |
Morphological constant C.
◆ scratch_data
|
private |
Reference to scratch data used for assembling.
The documentation for this class was generated from the following files:
- include/meltpooldg/flow/darcy_damping_operation.hpp
- source/flow/darcy_damping_operation.cpp
Generated by