include/meltpooldg/radiative_transport/rte_operator.hpp Source File

Developer Documentation: include/meltpooldg/radiative_transport/rte_operator.hpp Source File
Developer Documentation
rte_operator.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/tensor.h>
4#include <deal.II/base/vectorization.h>
5
10
11
13{
14 // clang-format off
15 /*
16 * This operator computes the LHS and RHS of the radiative transport equation as described by Lin et al (2020):
17 * ∇ · (s I) + µ_A I = 0
18 * where: s (/) is the unit direction vector of the laser.
19 * I (W/m^2) is the intensity of the laser. Is a field quantity.
20 * µ_A (/) is the absorption opacity of the surface. It can be based on material constants or heaviside gradients.
21 * In the (default) gradient-based absorption opacity,
22 * it is defined as a function of the heaviside function gradient and the laser direction:
23 * 1 / 1 \
24 * µ_A = < ∇H s ------------ > = max | ∇H s ------------ , 0 |
25 * (1.- H + ϵ) \ (1.- H + ϵ) /
26 * where ϵ is a small scalar constant to avoid a division by zero (avoid_div_zero_constant)
27 * and <*> represent MacAulay brackets.
28 *
29 * The RTE cast into a weak formulation (Φ is the test function) reads as follows:
30 * ( Φ , ∇ · (s I) ) + ( Φ , µ_A I ) = 0
31 * Ω Ω
32 * The divergence term is rearranged to:
33 * ∇ · (s I) = s (∇ · I) + I (∇ · s) = s · ∇I = s*grad(I)
34 * Hence:
35 * / \
36 * | Φ, ( s · ∇I + µ_A · I )| = 0
37 * \ /
38 * Ω
39 * or with the full (default) gradient-based absorption opacity definition:
40 * / 1 \
41 * | Φ, ( s · ∇I + < ∇H · s · ------------ > · I ) | = 0
42 * \ (1.- H + ϵ) /
43 * Ω
44 */
45 // clang-format on
46 template <int dim, typename number>
48 {
49 //@todo: to avoid compiler warnings regarding hidden overriden functions
50 using OperatorMatrixFree<dim, number>::vmult;
51 using OperatorMatrixFree<dim, number>::create_rhs;
53
54 private:
57 using vector = dealii::Tensor<1, dim, dealii::VectorizedArray<number>>;
58 using scalar = dealii::VectorizedArray<number>;
59
61
63
64 const dealii::Tensor<1, dim, number> &laser_direction;
65
67
68 const unsigned int rte_dof_idx;
69 const unsigned int rte_quad_idx;
70 const unsigned int hs_dof_idx;
71
72
74
75 public:
78 const dealii::Tensor<1, dim, number> &laser_direction_in,
79 const VectorType &heaviside_in,
80 const unsigned int rte_dof_idx_in,
81 const unsigned int rte_quad_idx_in,
82 const unsigned int hs_dof_idx_in);
83
84 /*
85 * matrix-free utility
86 */
87
88 void
89 vmult(VectorType &dst, const VectorType &src) const final;
90
91 void
92 create_rhs(VectorType &dst, const VectorType &src) const final;
93
94 void
96
97 void
99
100 private:
101 void
103 FECellIntegrator<dim, 1, number> &level_set_vals,
104 const bool do_reinit_cells) const;
105 };
106} // namespace MeltPoolDG::RadiativeTransport
Operator handling matrix-free computations.
Definition operator_base.hpp:190
dealii::TrilinosWrappers::SparseMatrix SparseMatrixType
Definition operator_base.hpp:194
dealii::LinearAlgebra::distributed::Vector< number > VectorType
Definition operator_base.hpp:192
const number pure_liquid_level_set
Definition rte_operator.hpp:73
void compute_inverse_diagonal_from_matrixfree(VectorType &diagonal) const final
Compute the inverse diagonal using matrix-free techniques.
Definition rte_operator.cpp:104
const unsigned int rte_quad_idx
Definition rte_operator.hpp:69
const dealii::Tensor< 1, dim, number > & laser_direction
Definition rte_operator.hpp:64
dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > vector
Definition rte_operator.hpp:57
const unsigned int hs_dof_idx
Definition rte_operator.hpp:70
typename OperatorMatrixFree< dim, number >::VectorType VectorType
Definition rte_operator.hpp:55
void tangent_local_cell_operation(FECellIntegrator< dim, 1, number > &intensity_vals, FECellIntegrator< dim, 1, number > &level_set_vals, const bool do_reinit_cells) const
Definition rte_operator.cpp:138
const RadiativeTransportData< number > & rte_data
Definition rte_operator.hpp:62
dealii::VectorizedArray< number > scalar
Definition rte_operator.hpp:58
const ScratchData< dim, dim, number > & scratch_data
Definition rte_operator.hpp:60
void compute_system_matrix_from_matrixfree(SparseMatrixType &system_matrix) const final
Compute a sparse matrix using matrix-free techniques.
Definition rte_operator.cpp:73
void vmult(VectorType &dst, const VectorType &src) const final
Definition rte_operator.cpp:39
typename OperatorMatrixFree< dim, number >::SparseMatrixType SparseMatrixType
Definition rte_operator.hpp:56
const VectorType & heaviside
Definition rte_operator.hpp:66
void create_rhs(VectorType &dst, const VectorType &src) const final
Compute the right-hand side vector.
Definition rte_operator.cpp:64
const unsigned int rte_dof_idx
Definition rte_operator.hpp:68
Container for shared scratch data between operations/operators.
Definition scratch_data.hpp:61
Definition pseudo_rte_data.hpp:9
dealii::FEEvaluation< dim, -1, 0, n_components, number, VectorizedArrayType > FECellIntegrator
Definition fe_integrator.hpp:14
Definition radiative_transport_data.hpp:32