include/meltpooldg/radiative_transport/pseudo_rte_operator.hpp Source File

Developer Documentation: include/meltpooldg/radiative_transport/pseudo_rte_operator.hpp Source File
Developer Documentation
pseudo_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
6#include <deal.II/lac/trilinos_sparse_matrix.h>
7
12
13
15{
16 // clang-format off
17 /*
18 * This operator solves for a (pseudo-)time dependent problem
19 * of the Radiative Transport Equation (RTE) problem with an optional diffusion term.
20 * It can be used to solve for a predictor to the plain RTE problem,
21 * or to solve fully (pseudo-)time dependent problem.
22 *
23 * The semi-discrete pseudo-time dependent RTE problem is:
24 * I^(n+1) = I^(n) + dt * [ - ∇ · (s I^(n)) - µ_A I^(n) + D ΔI^(n) ]
25 * where: s (/) is the unit direction vector of the laser.
26 * I (W/m^2) is the intensity of the laser. Is a field quantity.
27 * D (/) is the diffusion term scaling, or intensity diffusivity coefficient.
28 * It is optional, not physical and is only to create numerical diffusion.
29 * µ_A (/) is the absorption opacity of the surface. It can be based on material constants or heaviside gradients.
30 * In the (default) gradient-based absorption opacity,
31 * it is defined as a function of the heaviside function gradient and the laser direction:
32 * 1 / 1 \
33 * µ_A = < ∇H s ------------ > = max | ∇H s ------------ , 0 |
34 * (1.- H + ϵ) \ (1.- H + ϵ) /
35 * where ϵ is a small scalar constant to avoid a division by zero (avoid_div_zero_constant)
36 * and <*> represent MacAulay brackets.
37 * The pseudo-RTE cast into a weak formulation (Φ is the test function) reads as follows:
38 * ( Φ , I^(n+1) ) = ( Φ , I^(n) + dt * [ - ∇ · (s I^(n)) - µ_A · I^(n) + D · ΔI^(n) ] )
39 * Ω Ω
40 * The divergence term is rearranged to:
41 * ∇ · (s I) = s (∇ · I) + I (∇ · s) = s · ∇I = s*grad(I)
42 * Hence:
43 * / \ / \
44 * | Φ, I^(n+1)| = | Φ, I^(n) + dt * (-s · ∇I^(n) - µ_A · I^(n) + D · ΔI^(n) )|
45 * \ / \ /
46 * Ω Ω
47 * or with the full (default) gradient-based absorption opacity definition:
48 * / \ / 1 \
49 * | Φ, I^(n+1)| = | Φ, I^(n) + dt * (-s · ∇I^(n) - < ∇H · s · ------------ > · I^(n) + D · ΔI^(n) )|
50 * \ / \ (1.- H + ϵ) /
51 * Ω
52 */
53 // clang-format on
54
55
56 template <int dim, typename number>
57 class PseudoRTEOperator : public OperatorMatrixFree<dim, number>
58 {
59 using OperatorMatrixFree<dim, number>::vmult;
60 using OperatorMatrixFree<dim, number>::create_rhs;
62
63 private:
66 using vector = dealii::Tensor<1, dim, dealii::VectorizedArray<number>>;
67 using scalar = dealii::VectorizedArray<number>;
69
71
72 const dealii::Tensor<1, dim, number> &laser_direction;
73
75
76 const unsigned int rte_dof_idx;
77 const unsigned int rte_quad_idx;
78 const unsigned int hs_dof_idx;
79
80 const number pure_gas_level_set;
82
83 public:
85 const RadiativeTransportData<number> &rte_data_in,
86 const dealii::Tensor<1, dim, number> &laser_direction_in,
87 const VectorType &heaviside_in,
88 const unsigned int rte_dof_idx_in,
89 const unsigned int rte_quad_idx_in,
90 const unsigned int hs_dof_idx_in);
91
92 /*
93 * matrix-free utility
94 */
95
96 void
97 vmult(VectorType &dst, const VectorType &src) const final;
98
99 void
100 create_rhs(VectorType &dst, const VectorType &src) const final;
101 void
103
104 void
106
107 private:
108 void
110 };
111} // 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
Definition pseudo_rte_operator.hpp:58
dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > vector
Definition pseudo_rte_operator.hpp:66
void compute_inverse_diagonal_from_matrixfree(VectorType &diagonal) const final
Compute the inverse diagonal using matrix-free techniques.
Definition pseudo_rte_operator.cpp:143
const VectorType & heaviside
Definition pseudo_rte_operator.hpp:74
void create_rhs(VectorType &dst, const VectorType &src) const final
Compute the right-hand side vector.
Definition pseudo_rte_operator.cpp:62
const ScratchData< dim, dim, number > & scratch_data
Definition pseudo_rte_operator.hpp:68
void tangent_local_cell_operation(FECellIntegrator< dim, 1, number > &intensity_vals) const
Definition pseudo_rte_operator.cpp:174
typename OperatorMatrixFree< dim, number >::VectorType VectorType
Definition pseudo_rte_operator.hpp:64
typename OperatorMatrixFree< dim, number >::SparseMatrixType SparseMatrixType
Definition pseudo_rte_operator.hpp:65
const unsigned int hs_dof_idx
Definition pseudo_rte_operator.hpp:78
const number pure_liquid_level_set
Definition pseudo_rte_operator.hpp:81
void vmult(VectorType &dst, const VectorType &src) const final
Definition pseudo_rte_operator.cpp:40
const dealii::Tensor< 1, dim, number > & laser_direction
Definition pseudo_rte_operator.hpp:72
const unsigned int rte_dof_idx
Definition pseudo_rte_operator.hpp:76
const unsigned int rte_quad_idx
Definition pseudo_rte_operator.hpp:77
dealii::VectorizedArray< number > scalar
Definition pseudo_rte_operator.hpp:67
void compute_system_matrix_from_matrixfree(SparseMatrixType &system_matrix) const final
Compute a sparse matrix using matrix-free techniques.
Definition pseudo_rte_operator.cpp:121
const number pure_gas_level_set
Definition pseudo_rte_operator.hpp:80
const RadiativeTransportData< number > & rte_data
Definition pseudo_rte_operator.hpp:70
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