4#ifndef lethe_heat_transfer_scratch_data_h
5#define lethe_heat_transfer_scratch_data_h
14#include <deal.II/base/exceptions.h>
16#include <deal.II/fe/fe_system.h>
66 const FiniteElement<dim> &fe_ht,
67 const Quadrature<dim> &quadrature,
68 const Mapping<dim> &mapping,
69 const FiniteElement<dim> &fe_fd,
70 const Quadrature<dim - 1> &face_quadrature,
71 const double delta_T_ref)
76 update_values | update_quadrature_points | update_JxW_values |
77 update_gradients | update_hessians)
81 ,
fe_values_fd(mapping, fe_fd, quadrature, update_values | update_gradients)
85 update_values | update_quadrature_points |
89 AssertThrow(delta_T_ref > 0,
90 ExcMessage(
"Reference temperature is invalid (< 0)."));
112 update_values | update_quadrature_points | update_JxW_values |
113 update_gradients | update_hessians)
120 update_values | update_gradients)
124 update_values | update_quadrature_points |
129 ExcMessage(
"Reference temperature is invalid (< 0)."));
175 template <
typename VectorType>
177 reinit(
const typename DoFHandler<dim>::active_cell_iterator &cell,
179 const std::vector<GlobalVectorType> &previous_solutions,
180 Function<dim> *source_function)
191 double cell_measure =
196 this->
fe_values_T.get_function_values(current_solution,
198 this->
fe_values_T.get_function_gradients(current_solution,
204 for (
unsigned int p = 0; p < previous_solutions.size(); ++p)
206 this->
fe_values_T.get_function_values(previous_solutions[p],
217 for (
unsigned int k = 0; k <
n_dofs; ++k)
232 if (cell->at_boundary())
247 for (
const auto face : cell->face_indices())
290 template <
typename VectorType>
293 const typename DoFHandler<dim>::active_cell_iterator &cell,
310 Tensor<1, dim> velocity_ale;
311 std::shared_ptr<Functions::ParsedFunction<dim>> velocity_ale_function =
313 Vector<double> velocity_ale_vector(dim);
318 velocity_ale_vector);
319 for (
int d = 0; d < dim; ++d)
320 velocity_ale[d] = velocity_ale_vector[d];
334 template <
typename VectorType>
356 const Quadrature<dim> &quadrature,
357 const Mapping<dim> &mapping,
374 const Quadrature<dim> &quadrature,
375 const Mapping<dim> &mapping,
376 const std::shared_ptr<ConservativeLevelSetFilterBase> &
filter);
392 template <
typename VectorType>
394 reinit_cls(
const typename DoFHandler<dim>::active_cell_iterator &cell,
400 this->
fe_values_cls->get_function_values(current_filtered_solution,
405 this->
fe_values_cls->get_function_gradients(current_solution,
424 const Quadrature<dim> &quadrature,
425 const Mapping<dim> &mapping);
440 template <
typename VectorType>
443 const typename DoFHandler<dim>::active_cell_iterator &cell,
469 std::map<field, std::vector<double>>
fields;
541 std::shared_ptr<ConservativeLevelSetFilterBase>
std::vector< double > filtered_phase_values
const FEValuesExtractors::Scalar pressure
std::vector< double > thermal_conductivity_1
std::vector< Tensor< 1, dim > > electric_field_real_values
std::vector< Tensor< 1, dim > > temperature_gradients
void reinit_cls(const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType ¤t_solution, const VectorType ¤t_filtered_solution)
Reinitialize the content of the scratch for CLS.
std::vector< double > grad_specific_heat_temperature_0
FEValuesExtractors::Vector extractor_H_imag
std::vector< Tensor< 2, dim > > velocity_gradient_values
std::vector< unsigned int > boundary_face_id
std::vector< double > grad_specific_heat_temperature
std::shared_ptr< ConservativeLevelSetFilterBase > filter
std::map< field, std::vector< double > > fields
std::vector< double > grad_specific_heat_temperature_1
FEValues< dim > fe_values_fd
Table< 2, double > laplacian_phi_T
void reinit_fluid_dynamics(const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType ¤t_solution, const Parameters::ALE< dim > &ale)
Reinitialize cell's velocity and pressure values with values calculated in the Fluid Dynamics (FD) ph...
FEValuesExtractors::Vector extractor_E_imag
void enable_cls(const FiniteElement< dim > &fe, const Quadrature< dim > &quadrature, const Mapping< dim > &mapping, const Parameters::CLS_PhaseFilter &phase_filter_parameters)
enable_cls Enables the collection of the CLS data by the scratch.
std::vector< Tensor< 1, dim > > magnetic_field_real_values
void calculate_physical_properties()
Calculates the physical properties. This method calculates the physical properties that may be requir...
std::vector< double > pressure_values
Pressure field for physical property models requiring them.
std::vector< double > electric_conductivity
std::vector< double > thermal_conductivity_0
std::vector< double > dynamic_viscosity_0
FEFaceValues< dim > fe_face_values_ht
std::vector< double > density
std::vector< double > present_temperature_values
std::vector< std::vector< double > > temperature_face_value
unsigned int n_faces_q_points
std::vector< double > shear_rate_values
std::vector< double > dynamic_viscosity
void enable_time_harmonic_maxwell(const FiniteElement< dim > &fe, const Quadrature< dim > &quadrature, const Mapping< dim > &mapping)
enable_time_harmonic_maxwell Enables the collection of the time-harmonic Maxwell data by the scratch ...
std::vector< double > density_0
FEValues< dim > fe_values_T
std::vector< Tensor< 1, dim > > filtered_phase_gradient_values
std::vector< Tensor< 1, dim > > electric_field_imag_values
PhysicalPropertiesManager properties_manager
HeatTransferScratchData(const PhysicalPropertiesManager &properties_manager, const FiniteElement< dim > &fe_ht, const Quadrature< dim > &quadrature, const Mapping< dim > &mapping, const FiniteElement< dim > &fe_fd, const Quadrature< dim - 1 > &face_quadrature, const double delta_T_ref)
Constructor. The constructor creates the fe_values that will be used to fill the member variables of ...
Table< 2, Tensor< 2, dim > > hess_phi_T
dealii::types::material_id material_id
std::vector< bool > is_boundary_face
Table< 2, double > face_JxW
std::vector< double > present_temperature_laplacians
std::vector< double > specific_heat_1
HeatTransferScratchData(const HeatTransferScratchData< dim > &sd)
Copy Constructor. Same as the main constructor. This constructor only uses the other scratch to build...
FEValuesExtractors::Vector extractor_H_real
double global_delta_T_ref
const FEValuesExtractors::Vector velocities
std::vector< Tensor< 1, dim > > phase_gradient_values
void reinit_velocity_gradient(const VectorType ¤t_solution)
Reinitialize the velocity gradient, calculated by the Fluid Dynamics.
void reinit_time_harmonic_maxwell(const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType ¤t_solution)
Reinitialize the content of the scratch for the time-harmonic Maxwell problem.
std::vector< double > electric_permittivity_imag
std::vector< double > dynamic_viscosity_1
Table< 2, Tensor< 1, dim > > grad_phi_T
Table< 3, double > phi_face_T
std::vector< double > source
std::vector< double > density_1
std::vector< double > thermal_conductivity
std::shared_ptr< FEValues< dim > > fe_values_cls
std::vector< Tensor< 1, dim > > velocity_values
std::shared_ptr< FEValues< dim > > fe_values_time_harmonic_maxwell
FEValuesExtractors::Vector extractor_E_real
std::vector< Tensor< 1, dim > > magnetic_field_imag_values
std::vector< double > specific_heat_0
std::vector< double > present_face_temperature_values
std::vector< std::vector< Tensor< 1, dim > > > previous_temperature_gradients
bool gather_time_harmonic_maxwell
std::vector< double > magnetic_permeability_imag
void reinit(const typename DoFHandler< dim >::active_cell_iterator &cell, const VectorType ¤t_solution, const std::vector< GlobalVectorType > &previous_solutions, Function< dim > *source_function)
Reinitializes the content of the scratch.
void allocate() override
Allocates the memory for the scratch.
std::vector< Point< dim > > quadrature_points
std::vector< double > specific_heat
std::vector< std::vector< double > > previous_temperature_values
An interface for all the common parameters required to consider a moving frame of reference in a simp...
bool enabled() const
Return if the ALE module is enabled.
std::shared_ptr< Functions::ParsedFunction< dim > > velocity
ALE velocity function.
Class that manages the physical properties model which are required to calculate the various physical...
Base class for scratch data objects of physics and subequations.
double compute_cell_measure_with_JxW(const std::vector< double > &JxW_values)
Computes the area (2D) or volume (3D) of the cell by integrating 1 over the cell, by summing JxW valu...
double compute_cell_diameter(const double cell_measure, const unsigned int fe_degree)
Computes equivalent cell diameter by comparing the area to a disk (2D) or the volume to a sphere (3D)...
Parameters for the phase filtration.
GlobalVectorType VectorType