25 std::vector<Vector<double>>(
n_q_points, Vector<double>(dim + 1));
93 std::vector<double>(this->n_q_points));
100 const FiniteElement<dim> &fe,
101 const Quadrature<dim> &quadrature,
102 const Mapping<dim> &mapping,
107 mapping, fe, quadrature, update_values | update_gradients);
109 std::make_shared<FEPointEvaluation<1, dim>>(mapping, fe, update_values);
120 std::vector<Tensor<1, dim>>(this->
n_q_points);
143 const FiniteElement<dim> &fe,
144 const Quadrature<dim> &quadrature,
145 const Mapping<dim> &mapping,
146 const std::shared_ptr<ConservativeLevelSetFilterBase> &
filter)
150 mapping, fe, quadrature, update_values | update_gradients);
152 std::make_shared<FEPointEvaluation<1, dim>>(mapping, fe, update_values);
163 std::vector<Tensor<1, dim>>(this->
n_q_points);
186 const FiniteElement<dim> &fe,
187 const Quadrature<dim> &quadrature,
188 const Mapping<dim> &mapping,
193 mapping, fe, quadrature, update_values | update_gradients);
202 std::vector<Tensor<1, dim>>(this->
n_q_points);
211 fields.insert(std::pair<
field, std::vector<double>>(
234 const FiniteElement<dim> &fe,
235 const Quadrature<dim> &quadrature,
236 const Mapping<dim> &mapping,
241 mapping, fe, quadrature, update_values | update_gradients);
250 std::vector<Tensor<1, dim>>(this->
n_q_points);
260 fields.insert(std::pair<
field, std::vector<double>>(
283 const FiniteElement<dim> &fe_projected_phase_indicator_gradient,
284 const Quadrature<dim> &quadrature,
285 const Mapping<dim> &mapping)
289 std::make_shared<FEValues<dim>>(mapping,
290 fe_projected_phase_indicator_gradient,
292 update_values | update_gradients);
296 std::vector<Tensor<1, dim>>(this->
n_q_points);
303 const FiniteElement<dim> &fe_curvature,
304 const Quadrature<dim> &quadrature,
305 const Mapping<dim> &mapping)
309 mapping, fe_curvature, quadrature, update_values | update_gradients);
319 const FiniteElement<dim> &fe,
320 const Quadrature<dim> &quadrature,
321 const Mapping<dim> &mapping)
331 std::make_shared<FEValues<dim>>(mapping,
334 update_values | update_gradients |
337 std::make_shared<FEPointEvaluation<1, dim>>(mapping, fe, update_values);
350 const Quadrature<dim> &quadrature,
351 const Mapping<dim> &mapping,
352 const FiniteElement<dim> &fe_particle_drag_proj,
353 const FiniteElement<dim> &fe_particle_two_way_coupling_force_proj,
354 const FiniteElement<dim> &fe_particle_velocity_proj,
355 const FiniteElement<dim> &fe_particle_momentum_transfer_coefficient)
360 mapping, fe_particle_drag_proj, quadrature, update_values);
363 std::make_shared<FEValues<dim>>(mapping,
364 fe_particle_two_way_coupling_force_proj,
368 mapping, fe_particle_velocity_proj, quadrature, update_values);
370 std::make_shared<FEValues<dim>>(mapping,
371 fe_particle_momentum_transfer_coefficient,
377 std::vector<Tensor<1, dim>>(this->
n_q_points);
386 const unsigned int n_global_max_particles_per_cell,
387 const bool enable_void_fraction_interpolation)
396 std::vector<Tensor<1, dim>>(n_global_max_particles_per_cell);
398 std::vector<Tensor<1, dim>>(n_global_max_particles_per_cell);
399 Re_particle = std::vector<double>(n_global_max_particles_per_cell);
405 n_global_max_particles_per_cell);
419 Tensor<1, dim> velocity_ale;
420 std::shared_ptr<Functions::ParsedFunction<dim>> velocity_ale_function =
422 Vector<double> velocity_ale_vector(dim);
427 velocity_ale_vector);
428 for (
int d = 0; d < dim; ++d)
429 velocity_ale[d] = velocity_ale_vector[d];
446 const typename DoFHandler<dim>::active_cell_iterator &cell,
452 const double rotor_angular_velocity =
458 if (cell->material_id() == 1)
459 omega = rotor_angular_velocity;
465 cell->material_id() < 2,
467 "The material id in a cell was identified as equal or greater than 2, however the mortar implementation is not defined for more than two materials."));
491 const FiniteElement<dim> &fe,
492 const Quadrature<dim> &quadrature,
493 const Mapping<dim> &mapping)
497 mapping, fe, quadrature, update_values | update_gradients);
506 std::vector<Tensor<1, dim>>(this->
n_q_points));
534 const Tensor<2, dim> shear_rate_tensor =
553 rheology_model->get_kinematic_viscosity_for_stabilization_vector(
557 rheology_model->get_kinematic_viscosity_scale();
568 rheology_model->get_dynamic_viscosity_vector(
density_ref,
571 rheology_model->get_dynamic_viscosity_for_stabilization_vector(
582 rheology_model->vector_jacobian(
588 const auto thermal_expansion_model =
606 rheology_model_0->get_kinematic_viscosity_scale();
608 rheology_model_1->get_kinematic_viscosity_scale();
616 const auto material_interaction_id =
620 const auto surface_tension_model =
625 surface_tension_model->vector_jacobian(
630 rheology_model_0->get_dynamic_viscosity_vector(
density_ref_0,
633 rheology_model_0->get_dynamic_viscosity_for_stabilization_vector(
637 rheology_model_1->get_dynamic_viscosity_vector(
density_ref_1,
640 rheology_model_1->get_dynamic_viscosity_for_stabilization_vector(
644 const auto thermal_expansion_model_0 =
646 const auto thermal_expansion_model_1 =
648 thermal_expansion_model_0->vector_value(
fields,
650 thermal_expansion_model_1->vector_value(
fields,
656 for (
unsigned int q = 0; q < this->
n_q_points; ++q)
673 filtered_phase_value,
686 filtered_phase_value,
697 for (
unsigned int q = 0; q < this->n_q_points; ++q)
699 double filtered_phase_value =
703 filtered_phase_value *
713 for (
unsigned int q = 0; q < this->n_q_points; ++q)
718 filter->filter_phase(this->previous_phase_values[p][q]),
728 for (
unsigned int q = 0; q < this->
n_q_points; ++q)
730 double phase_order_cahn_hilliard_value =
734 phase_order_cahn_hilliard_value,
739 phase_order_cahn_hilliard_value,
745 phase_order_cahn_hilliard_value,
754 throw std::runtime_error(
"Unsupported number of fluids (>2)");
759template <
typename PropertiesIndex>
763 for (
auto &particle :
pic)
765 auto particle_properties = particle.get_properties();
767 for (
int d = 0; d < dim; ++d)
769 particle_properties[PropertiesIndex::fem_force_two_way_coupling_x +
771 particle_properties[PropertiesIndex::fem_force_one_way_coupling_x +
773 particle_properties[PropertiesIndex::fem_drag_x + d] = 0.;
774 particle_properties[PropertiesIndex::fem_torque_x + d] = 0.;
781template <
typename PropertiesIndex>
788 unsigned int i_particle = 0;
790 for (
auto &particle :
pic)
792 auto particle_properties = particle.get_properties();
795 particle_properties[PropertiesIndex::v_x];
797 particle_properties[PropertiesIndex::v_y];
798 if constexpr (dim == 3)
800 particle_properties[PropertiesIndex::v_z];
804 M_PI * pow(particle_properties[PropertiesIndex::dp], dim) / (2 * dim);
834 double cell_void_fraction_bulk = 0;
835 cell_void_fraction_bulk =
851 unsigned int i_particle = 0;
854 for (
auto &particle :
pic)
859 particle.get_reference_location();
unsigned int maximum_number_of_previous_solutions()
Get the maximum number of previous time steps supposed by the BDF schemes implemented in Lethe.
static std::shared_ptr< CahnHilliardFilterBase > model_cast(const Parameters::CahnHilliard &cahn_hilliard_parameters)
Instantiate and return a pointer to a CahnHilliardFilterBase object by casting it to the proper child...
static std::shared_ptr< ConservativeLevelSetFilterBase > model_cast(const Parameters::CLS_PhaseFilter &phase_filter_parameters)
Instantiate and return a pointer to a ConservativeLevelSetFilterBase object by casting it to the prop...
Class that stores the information required by the assembly procedure for a Navier-Stokes equation....
void enable_projected_phase_indicator_gradient(const FiniteElement< dim > &fe_projected_phase_indicator_gradient, const Quadrature< dim > &quadrature, const Mapping< dim > &mapping)
std::vector< std::vector< double > > previous_phase_values
Table< 2, double > div_phi_u
std::vector< double > mass_source
std::vector< double > pressure_values
std::vector< Tensor< 1, dim > > sdirk_stage_sum
void enable_cahn_hilliard(const FiniteElement< dim > &fe, const Quadrature< dim > &quadrature, const Mapping< dim > &mapping, const Parameters::CahnHilliard &cahn_hilliard_parameters)
enable_cahn_hilliard Enables the collection of the CahnHilliard data by the scratch
std::vector< double > thermal_expansion_1
std::vector< Tensor< 1, dim > > force
void extract_particle_properties()
Extracts the velocity of the particles and calculates their total volume in the cell....
std::shared_ptr< FEValues< dim > > fe_values_particle_momentum_transfer_coefficient
std::vector< double > density_1
bool gather_particles_information
void reinit_mortar(const typename DoFHandler< dim >::active_cell_iterator &cell, const Parameters::Mortar< dim > &mortar_parameters)
Renitialize the content of the scratch data for mortar.
std::vector< Tensor< 1, dim > > projected_phase_indicator_gradient_values
unsigned int max_number_of_particles_per_cell
double kinematic_viscosity_scale_0
Scale of the kinematic viscosity for fluid 0.
std::vector< double > density_thermal_expansion
double pressure_scaling_factor
FEValuesExtractors::Vector velocities
std::shared_ptr< FEValues< dim > > fe_values_cls
std::vector< Tensor< 3, dim > > velocity_hessians
void enable_void_fraction(const FiniteElement< dim > &fe, const Quadrature< dim > &quadrature, const Mapping< dim > &mapping)
enable_void_fraction Enables the collection of the void fraction data by the scratch
std::vector< Tensor< 1, dim > > void_fraction_gradient_values
void calculate_physical_properties()
Calculates the physical properties. This function calculates the physical properties that may be requ...
std::shared_ptr< FEValues< dim > > fe_values_cahn_hilliard
std::vector< std::vector< Tensor< 1, dim > > > previous_velocity_values
std::vector< Tensor< 1, dim > > phase_order_cahn_hilliard_gradients
void enable_ale()
enable_ale Enables the calculation of the ALE velocity
std::shared_ptr< FEValues< dim > > fe_values_particle_velocity
Tensor< 1, dim > average_particle_velocity
std::vector< Tensor< 1, dim > > temperature_gradients
std::shared_ptr< FEPointEvaluation< 1, dim > > point_evaluator_cls
std::vector< Tensor< 1, dim > > phase_gradient_values
std::vector< std::vector< double > > previous_pressure_values
std::vector< std::vector< Tensor< 1, dim > > > previous_temperature_gradients
std::shared_ptr< FEValues< dim > > fe_values_void_fraction
std::vector< std::vector< double > > previous_temperature_values
std::vector< unsigned int > components
bool gather_projected_phase_indicator_gradient
bool interpolated_void_fraction
void enable_mortar()
enable_mortar Enables the calculation of ALE velocity within the mortar feature
std::shared_ptr< FEValues< dim > > fe_values_particle_drag
std::vector< double > cell_void_fraction
std::vector< double > compressibility_multiplier
std::vector< Tensor< 2, dim > > velocity_gradients
std::vector< double > surface_tension_gradient
void enable_heat_transfer(const FiniteElement< dim > &fe, const Quadrature< dim > &quadrature, const Mapping< dim > &mapping)
enable_heat_transfer Enables the collection of the heat transfer data (Temperature field) by the scra...
std::vector< std::vector< double > > previous_density
void reinit_ale(const Parameters::ALE< dim > &ale)
Renitialize the content of the scratch data for ALE.
FEValuesExtractors::Scalar pressure
std::vector< double > surface_tension
std::vector< double > density_0
double total_particle_volume
std::vector< Point< dim > > particle_reference_location
FEValues< dim > fe_values
void enable_particle_fluid_interactions(const unsigned int n_global_max_particles_per_cell, const bool enable_void_fraction_interpolation)
enable_particle_fluid_interactions Enables the calculation of the fluid information at the particle l...
std::vector< Tensor< 1, dim > > particle_two_way_coupling_force_values
std::vector< Point< dim > > quadrature_points
std::vector< Tensor< 1, dim > > fluid_particle_relative_velocity_at_particle_location
std::vector< double > particle_momentum_transfer_coefficient_values
Table< 2, Tensor< 1, dim > > phi_u
std::vector< Tensor< 1, dim > > advective_velocity
std::vector< double > void_fraction_values
std::vector< double > dynamic_viscosity_for_stabilization_1
std::map< field, std::vector< double > > fields
std::vector< Tensor< 1, dim > > particle_velocity_values
bool gather_cahn_hilliard
std::shared_ptr< ConservativeLevelSetFilterBase > filter
std::vector< double > dynamic_viscosity_0
double kinematic_viscosity_scale
std::vector< double > kinematic_viscosity
std::vector< double > particle_weights
std::vector< double > thermal_expansion_0
unsigned int number_of_particles
std::vector< Tensor< 1, dim > > velocity_values
std::shared_ptr< FEValues< dim > > fe_values_temperature
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< double > Re_particle
Table< 2, Tensor< 2, dim > > grad_phi_u
std::vector< double > curvature_values
bool gather_particle_field_project
Table< 2, Tensor< 3, dim > > hess_phi_u
std::shared_ptr< CahnHilliardFilterBase > cahn_hilliard_filter
std::vector< double > phase_values
Particles::ParticleHandler< dim >::particle_iterator_range pic
void enable_curvature(const FiniteElement< dim > &fe_curvature, const Quadrature< dim > &quadrature, const Mapping< dim > &mapping)
Table< 2, Tensor< 1, dim > > laplacian_phi_u
Quadrature< dim > gather_particles_reference_location()
Creates an object of type Quadrature<dim> that contains the particle reference location....
std::vector< std::vector< double > > previous_void_fraction_values
std::vector< double > shear_rate
std::vector< double > phase_order_cahn_hilliard_values
std::vector< Tensor< 1, dim > > particle_velocity
std::vector< Tensor< 1, dim > > filtered_phase_gradient_values
std::shared_ptr< FEPointEvaluation< 1, dim > > point_evaluator_void_fraction
std::shared_ptr< FEValues< dim > > fe_values_projected_phase_indicator_gradient
void reinit_particle_fluid_forces()
Reinitializes the fluid forces and torques on the particles in the cell to zero.
std::vector< double > dynamic_viscosity_1
std::vector< double > temperature_values
bool gather_void_fraction
std::vector< Tensor< 1, dim > > velocity_gradient_divergence
const std::shared_ptr< SimulationControl > simulation_control
std::vector< double > kinematic_viscosity_for_stabilization
std::vector< Vector< double > > rhs_force
std::vector< double > filtered_phase_values
std::vector< Tensor< 1, dim > > particle_drag_values
void allocate() override
Allocates the memory for the scratch.
std::vector< double > velocity_divergences
std::vector< Tensor< 1, dim > > rotor_linear_velocity_values
std::vector< double > dynamic_viscosity_for_stabilization
Values of the dynamic viscosity used in the SUPG and PSPG stabilizations.
std::vector< double > density_at_particle_location
std::vector< double > kinematic_viscosity_at_particle_location
void enable_particle_field_projection(const Quadrature< dim > &quadrature, const Mapping< dim > &mapping, const FiniteElement< dim > &fe_particle_drag_proj, const FiniteElement< dim > &fe_particle_two_way_coupling_force_proj, const FiniteElement< dim > &fe_particle_velocity_proj, const FiniteElement< dim > &fe_particle_momentum_transfer_coefficient)
enable_particle_field_projection Enables the collection of the particle fields projection data by the...
Table< 2, Tensor< 1, dim > > grad_phi_p
std::vector< double > dynamic_viscosity
std::vector< double > grad_kinematic_viscosity_shear_rate
std::vector< double > density
std::shared_ptr< FEValues< dim > > fe_values_curvature
std::vector< double > filtered_phase_order_cahn_hilliard_values
std::vector< Tensor< 1, dim > > pressure_gradients
Tensor< 1, dim > explicit_particle_volumetric_acceleration_on_fluid
Table< 2, Tensor< 1, dim > > gradient_divergence_phi_u
std::vector< double > thermal_expansion
void calculate_cell_void_fraction(const double &total_particle_volume)
Computes the cell void fraction.
std::vector< Tensor< 1, dim > > velocity_laplacians
const PhysicalPropertiesManager properties_manager
std::vector< double > dynamic_viscosity_for_stabilization_0
std::shared_ptr< FEValues< dim > > fe_values_particle_two_way_coupling_force
std::vector< double > chemical_potential_cahn_hilliard_values
double kinematic_viscosity_scale_1
Scale of the kinematic viscosity for fluid 1.
An interface for all the common parameters required to consider a moving frame of reference in a simp...
std::shared_ptr< Functions::ParsedFunction< dim > > velocity
ALE velocity function.
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 calculate_point_property(const double phase, const double property0, const double property1)
Calculate the equivalent properties for a given phase. Method called in quadrature points loops in CL...
double calculate_point_property_cahn_hilliard(const double phase_cahn_hilliard, const double property0, const double property1)
Calculate the equivalent property for a given phase.
PropertiesIndex
Particle property indices for CFD-DEM multiphysics simulations.
PropertiesIndex
Particle property indices for CFD-DEM simulations.
@ phase_order_cahn_hilliard_filtered
@ phase_order_cahn_hilliard
void set_field_vector(const field &id, const std::vector< double > &data, std::map< field, std::vector< double > > &fields)
double calculate_shear_rate_magnitude(const Tensor< 2, dim > shear_rate)
Calculates the magnitude of the shear rate tensor given as input.
Parameters for the phase filtration.
Mortar - Defines parameters used to construct mortar elements.
Point< dim > center_of_rotation
Center of rotation of the rotor domain.
std::shared_ptr< Functions::ParsedFunction< dim > > rotor_angular_velocity
Angular velocity of the rotor domain.
unsigned int rotation_axis_direction
Rotation axis direction.