include/meltpooldg/phase_change/evaporation_operation.hpp Source File

Developer Documentation: include/meltpooldg/phase_change/evaporation_operation.hpp Source File
Developer Documentation
evaporation_operation.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/aligned_vector.h>
4#include <deal.II/base/numbers.h>
5#include <deal.II/base/point.h>
6#include <deal.II/base/tensor.h>
7#include <deal.II/base/vectorization.h>
8
9#include <deal.II/grid/tria.h>
10
11#include <deal.II/lac/la_parallel_block_vector.h>
12#include <deal.II/lac/la_parallel_vector.h>
13
23
24#include <memory>
25#include <tuple>
26#include <vector>
27
29{
45 template <int dim, typename number>
46 class EvaporationOperation
47 {
48 private:
49 using VectorType = dealii::LinearAlgebra::distributed::Vector<number>;
50 using BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector<number>;
51
52 const ScratchData<dim, dim, number> &scratch_data;
56 const EvaporationData<number> &evapor_data;
57
58 const MaterialData<number> &material_data;
62 const VectorType &level_set_as_heaviside;
63 const BlockVectorType &normal_vector;
67 const unsigned int normal_dof_idx;
68 const unsigned int evapor_vel_dof_idx;
69 const unsigned int evapor_mass_flux_dof_idx;
70 const unsigned int ls_hanging_nodes_dof_idx;
71 const unsigned int ls_quad_idx;
72 /*
73 * cut-off value for normalizing the normal vector field
74 */
75 const number tolerance_normal_vector;
76
80 VectorType evaporative_mass_flux;
84 dealii::AlignedVector<dealii::Tensor<1, dim, dealii::VectorizedArray<number>>>
85 evaporation_velocities;
89 VectorType evaporation_velocity;
90
91 bool do_analytical_evaporative_mass_flux = false;
92
93 std::shared_ptr<EvaporationModelBase<number>> evapor_model;
94 std::shared_ptr<EvaporationMassFluxOperatorBase<dim, number>> evapor_mass_flux_operator;
95 std::shared_ptr<EvaporationSourceTermsBase<dim, number>> evapor_source_terms_operator;
96
97 public:
98 EvaporationOperation(const ScratchData<dim, dim, number> &scratch_data_in,
99 const VectorType &level_set_as_heaviside_in,
100 const BlockVectorType &normal_vector_in,
101 const EvaporationData<number> &evapor_data_in,
102 const MaterialData<number> &material_data_in,
103 const unsigned int normal_dof_idx_in,
104 const unsigned int evapor_vel_dof_idx_in,
105 const unsigned int evapor_vel_quad_idx_in,
106 const unsigned int evapor_mass_flux_dof_idx_in,
107 const unsigned int ls_hanging_nodes_dof_idx_in,
108 const unsigned int ls_quad_idx_in);
109
133 void
134 compute_evaporative_mass_flux(
135 const number &time,
136 const VectorType *temperature = nullptr,
137 const unsigned int heat_no_bc_dof_idx = dealii::numbers::invalid_unsigned_int);
138
150 void
151 compute_analytical_evaporative_mass_flux(const number &time);
152
166 void
167 compute_temperature_dependent_evaporative_mass_flux(const VectorType &temperature,
168 const unsigned int heat_no_bc_dof_idx);
169
170 void
171 compute_evaporation_velocity();
172
173 void
174 compute_level_set_source_term(VectorType &rhs,
175 const unsigned int ls_dof_idx,
176 const VectorType &level_set,
177 const unsigned int pressure_dof_idx);
178
179 void
180 compute_mass_balance_source_term(VectorType &mass_balance_rhs,
181 const unsigned int pressure_dof_idx,
182 const unsigned int pressure_quad_idx,
183 bool zero_out);
184
185 void
186 register_surface_mesh(
187 const std::vector<
188 std::tuple<const typename dealii::Triangulation<dim, dim>::cell_iterator /*cell*/,
189 std::vector<dealii::Point<dim>> /*quad_points*/,
190 std::vector<number> /*weights*/
191 >> &surface_mesh_info);
192 void
193 reinit();
194 /*
195 * attach functions
196 */
197 void
198 attach_dim_vectors(std::vector<VectorType *> &vectors);
199
200 void
201 attach_vectors(std::vector<VectorType *> &vectors);
202
203 void
204 distribute_constraints();
205
206 void
207 attach_output_vectors(GenericDataOut<dim, number> &data_out) const;
208
209 /*
210 * getter functions
211 */
212 inline dealii::Tensor<1, dim, dealii::VectorizedArray<number>> *
213 begin_evaporation_velocity(const unsigned int macro_cell);
214
215 inline const dealii::Tensor<1, dim, dealii::VectorizedArray<number>> &
216 begin_evaporation_velocity(const unsigned int macro_cell) const;
217
218 const VectorType &
219 get_velocity() const;
220
221 VectorType &
222 get_velocity();
223
224 const VectorType &
225 get_evaporative_mass_flux() const;
226
227 VectorType &
228 get_evaporative_mass_flux();
229 };
230} // namespace MeltPoolDG::Evaporation
Definition evaporation_data.hpp:15
dealii::LinearAlgebra::distributed::BlockVector< number > BlockVectorType
Definition utilities_matrixfree.hpp:17
dealii::LinearAlgebra::distributed::Vector< number > VectorType
Definition utilities_matrixfree.hpp:15