Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
FluidDynamicsSharp< dim > Class Template Reference

#include <fluid_dynamics_sharp.h>

Inheritance diagram for FluidDynamicsSharp< dim >:
[legend]

Classes

struct  Visualization_IB

Public Member Functions

 FluidDynamicsSharp (CFDDEMSimulationParameters< dim > &nsparam)
 ~FluidDynamicsSharp ()
void solve () override
void assemble_system_matrix () override
void assemble_system_rhs () override
Public Member Functions inherited from FluidDynamicsMatrixBased< dim >
 FluidDynamicsMatrixBased (SimulationParameters< dim > &nsparam, const FluidDynamicsFormulation fluid_dynamics_formulation=FluidDynamicsFormulation::standard)
 ~FluidDynamicsMatrixBased ()
Public Member Functions inherited from PhysicsSolver< GlobalVectorType >
 PhysicsSolver (const Parameters::NonLinearSolver non_linear_solver_parameters)
virtual ~PhysicsSolver ()
void solve_governing_system ()
virtual void apply_constraints ()
unsigned int get_current_newton_iteration () const

Private Member Functions

void assemble_local_system_matrix (const typename DoFHandler< dim >::active_cell_iterator &cell, NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > &copy_data) override
void assemble_local_system_rhs (const typename DoFHandler< dim >::active_cell_iterator &cell, NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > &copy_data) override
void setup_assemblers () override
void copy_local_matrix_to_global_matrix (const StabilizedMethodsTensorCopyData< dim > &copy_data) override
void copy_local_rhs_to_global_rhs (const StabilizedMethodsTensorCopyData< dim > &copy_data) override
virtual void assemble_matrix_and_rhs ()
virtual void assemble_rhs ()
void vertices_cell_mapping ()
void define_particles ()
void force_on_ib ()
void sharp_edge ()
void write_force_ib ()
void integrate_particles ()
void apply_prescribed_particle_motion (IBParticle< dim > &particle, const double time, const double dt) const
void finish_time_step_particles ()
void handle_dem_particle_output_and_postprocessing ()
void build_ib_particle_handler (Particles::ParticleHandler< dim, dim > &particle_handler, typename DEM::dem_data_structures< dim >::particle_index_iterator_map &particle_container, std::unordered_set< unsigned int > &local_particle_ids) const
void build_contact_containers (const typename DEM::dem_data_structures< dim >::particle_index_iterator_map &particle_container, const std::unordered_set< unsigned int > &local_particle_ids, typename DEM::dem_data_structures< dim >::adjacent_particle_pairs &local_adjacent_particles, typename DEM::dem_data_structures< dim >::adjacent_particle_pairs &ghost_adjacent_particles) const
void fill_particle_properties (const IBParticle< dim > &particle, std::vector< double > &properties) const
std::pair< double, double > calculate_L2_error_particles ()
virtual void postprocess_fd (bool firstIter) override
virtual std::vector< OutputStruct< dim, GlobalVectorType > > gather_output_hook () override
void mesh_adapt_ib (const bool initial_refinement)
void check_whether_all_particles_are_sphere ()
void generate_cut_cells_map ()
void optimized_generate_cut_cells_map ()
std::pair< bool, bool > generate_cut_cell_candidates (const typename DoFHandler< dim >::cell_iterator &cell, const unsigned int p_id)
std::tuple< bool, unsigned int, std::vector< types::global_dof_index > > cell_cut (const typename DoFHandler< dim >::active_cell_iterator &cell, std::vector< types::global_dof_index > &local_dof_indices, std::map< types::global_dof_index, Point< dim > > &support_points)
bool cell_cut_by_p_absolute_distance (const typename DoFHandler< dim >::active_cell_iterator &cell, std::map< types::global_dof_index, Point< dim > > &support_points, unsigned int p)
std::tuple< bool, unsigned int, std::vector< types::global_dof_index > > cell_inside (const typename DoFHandler< dim >::active_cell_iterator &cell, std::vector< types::global_dof_index > &local_dof_indices, std::map< types::global_dof_index, Point< dim > > &support_points)
virtual void write_checkpoint () override
virtual void read_checkpoint () override
void load_particles_from_file ()
void refinement_control (const bool initial_refinement)
bool point_inside_cell (const typename DoFHandler< dim >::active_cell_iterator &cell, Point< dim > point)
double get_current_residual () override
bool allow_skip_linear_solve_when_residual_is_below_tolerance () const override
void update_precalculations_for_ib ()

Private Attributes

CFDDEMSimulationParameters< dim > cfd_dem_parameters
bool all_spheres
bool some_particles_are_coupled
std::map< unsigned int, std::set< typename DoFHandler< dim >::active_cell_iterator > > vertices_to_cell
std::map< typename DoFHandler< dim >::active_cell_iterator, std::tuple< bool, unsigned int, std::vector< unsigned int > > > cut_cells_map
std::map< typename DoFHandler< dim >::active_cell_iterator, std::tuple< bool, unsigned int, double > > overconstrained_fluid_cell_map
GlobalVectorType local_dof_overconstrained
GlobalVectorType dof_overconstrained
std::map< unsigned int, bool > dof_with_more_then_one_particle
std::map< typename DoFHandler< dim >::active_cell_iterator, std::tuple< bool, unsigned int > > cells_inside_map
std::map< unsigned int, std::pair< bool, typename DoFHandler< dim >::active_cell_iterator > > ib_done
std::vector< std::shared_ptr< NavierStokesAssemblerBase< dim > > > assemblers_inside_ib
PVDHandler ib_particles_pvdhandler
PVDHandler ib_particles_pvdhandler_force_chains
std::vector< IBParticle< dim > > particles
double particle_residual
std::vector< TableHandler > table_p
TableHandler table_all_p
IBParticlesDEM< dim > ib_dem
std::shared_ptr< Shape< dim > > combined_shapes
std::shared_ptr< LevelsetPostprocessor< dim > > levelset_postprocessor
std::shared_ptr< LevelsetGradientPostprocessor< dim > > levelset_gradient_postprocessor

Additional Inherited Members

Public Attributes inherited from PhysicsSolver< GlobalVectorType >
ConditionalOStream pcout
Parameters::SimulationControl::TimeSteppingMethod time_stepping_method
Protected Member Functions inherited from FluidDynamicsMatrixBased< dim >
virtual void setup_dofs_fd () override
void multi_stage_preresolution (unsigned int stage, Parameters::SimulationControl::TimeSteppingMethod method) override
virtual void multi_stage_postresolution (unsigned int stage, Parameters::SimulationControl::TimeSteppingMethod method, double time_step) override
virtual void update_multi_stage_solution (double time_step) override
virtual void set_initial_condition_fd (Parameters::FluidDynamicsInitialConditionType initial_condition_type, bool restart=false) override
virtual void update_multiphysics_time_average_solution () override
void setup_preconditioner () override
void define_dynamic_zero_constraints ()
void define_pressure_constraints ()
virtual void update_mortar_configuration () override
void solve_linear_system () override
Protected Member Functions inherited from NavierStokesBase< dim, GlobalVectorType, IndexSet >
 NavierStokesBase (SimulationParameters< dim > &nsparam, const FluidDynamicsFormulation fluid_dynamics_formulation=FluidDynamicsFormulation::standard)
virtual ~NavierStokesBase ()=default
virtual GlobalVectorType & get_evaluation_point () override
virtual GlobalVectorType & get_local_evaluation_point () override
virtual GlobalVectorType & get_newton_update () override
virtual GlobalVectorType & get_present_solution () override
virtual GlobalVectorType & get_system_rhs () override
virtual AffineConstraints< double > & get_nonzero_constraints () override
virtual void output_newton_update_norms () override
double get_residual_rescale_metric () const override
void finish_simulation ()
virtual void postprocess (bool first_iteration)
virtual void setup_dofs ()
virtual void set_initial_condition (const Parameters::FluidDynamicsInitialConditionType initial_condition_type, const bool restart=false)
virtual void finish_time_step ()
virtual void percolate_time_vectors_fd ()
void finish_simulation_fd ()
virtual void update_solutions_for_multiphysics ()
virtual void update_solutions_for_fluid_dynamics ()
void postprocessing_forces (const GlobalVectorType &evaluation_point)
void postprocessing_torques (const GlobalVectorType &evaluation_point)
virtual void dynamic_flow_control ()
virtual void set_specified_fluid_dynamics_solution ()
virtual void iterate ()
virtual void enable_dynamic_zero_constraints_fd ()
void box_refine_mesh (const bool restart)
virtual void refine_mesh ()
void refine_mesh_adaptive ()
void refine_mesh_uniform ()
void transfer_solution (SolutionTransfer< dim, GlobalVectorType > &solution_transfer, std::vector< SolutionTransfer< dim, GlobalVectorType > > &previous_solutions_transfer)
bool average_velocities_are_enabled () const
void restore_average_velocities_after_checkpoint ()
virtual void set_solution_from_checkpoint (const std::string &checkpoint_file_prefix)
void set_nodal_values ()
void define_non_zero_constraints ()
void define_zero_constraints ()
void reinit_mortar_operators ()
std::shared_ptr< Mapping< dim > > get_mapping ()
void rotate_rotor_mapping (const bool is_first)
void connect_mortar_weight_signals ()
void update_boundary_conditions ()
virtual void update_forcing_and_boundary_conditions ()
bool check_existance_of_bc (BoundaryConditions::FluidDynamicsBoundaryType bc)
void make_solid_domain (const DoFHandler< dim > &dof_handler, const bool non_zero_constraints, AffineConstraints< double > &constraints)
bool cell_in_constraining_domain (const typename DoFHandler< dim >::active_cell_iterator &cell, const Point< dim > &plane_point, const Tensor< 1, dim > &plane_normal_vector)
void get_cell_temperature_values (const typename DoFHandler< dim >::active_cell_iterator &cell, const DoFHandler< dim > *dof_handler_ht, const GlobalVectorType &temperature_solution, std::vector< double > &local_temperature_values)
void get_cell_filtered_phase_indicator_values (const typename DoFHandler< dim >::active_cell_iterator &cell, const DoFHandler< dim > *dof_handler_cls, const GlobalVectorType &filtered_phase_indicator_solution, std::vector< double > &local_filtered_phase_indicator_values)
void identify_cell_and_constrain_velocity (const std::vector< types::global_dof_index > &local_dof_indices, const std::vector< double > &local_temperature_values, StasisConstraintWithTemperature &stasis_constraint_struct)
void constrain_stasis_with_temperature (const DoFHandler< dim > *dof_handler_ht)
void constrain_stasis_with_temperature_cls (const DoFHandler< dim > *dof_handler_cls, const DoFHandler< dim > *dof_handler_ht)
virtual std::vector< OutputStructTableHandler > gather_tables ()
void gather_output_results (const GlobalVectorType &solution, std::vector< OutputStruct< dim, GlobalVectorType > > &solution_output_structs)
void write_output_results (const GlobalVectorType &solution)
void write_output_forces ()
void write_output_torques ()
void rescale_pressure_dofs_in_newton_update ()
GlobalVectorType init_temporary_vector ()
void verify_consistency_of_boundary_conditions ()
Protected Attributes inherited from FluidDynamicsMatrixBased< dim >
TrilinosWrappers::SparseMatrix system_matrix
Protected Attributes inherited from NavierStokesBase< dim, GlobalVectorType, IndexSet >
IndexSet locally_owned_dofs
IndexSet locally_relevant_dofs
MPI_Comm mpi_communicator
const unsigned int n_mpi_processes
const unsigned int this_mpi_process
std::shared_ptr< parallel::DistributedTriangulationBase< dim > > triangulation
std::shared_ptr< DoFHandler< dim > > dof_handler
std::shared_ptr< FESystem< dim > > fe
TimerOutput computing_timer
SimulationParameters< dim > simulation_parameters
PVDHandler pvdhandler
PVDHandler pvdhandler_boundary
Function< dim > * exact_solution
std::shared_ptr< Function< dim > > forcing_function
FlowControl< dim > flow_control
AffineConstraints< double > zero_constraints
AffineConstraints< double > nonzero_constraints
bool use_manifold_for_normal
GlobalVectorType evaluation_point
GlobalVectorType local_evaluation_point
GlobalVectorType newton_update
std::shared_ptr< GlobalVectorType > present_solution
GlobalVectorType system_rhs
std::shared_ptr< std::vector< GlobalVectorType > > previous_solutions
SDIRKVectors sdirk_vectors
const unsigned int velocity_fem_degree
const unsigned int pressure_fem_degree
unsigned int number_quadrature_points
std::shared_ptr< Mapping< dim > > mapping
std::shared_ptr< Quadrature< dim > > cell_quadrature
std::shared_ptr< Quadrature< dim - 1 > > face_quadrature
std::shared_ptr< MortarManagerBase< dim > > mortar_manager
std::shared_ptr< CouplingOperator< dim, double > > mortar_coupling_operator
std::shared_ptr< NavierStokesCouplingEvaluationSIPG< dim, double > > mortar_coupling_evaluator
std::shared_ptr< MappingQCache< dim > > mapping_cache
std::vector< std::shared_ptr< NavierStokesAssemblerBase< dim > > > assemblers
std::shared_ptr< MultiphysicsInterface< dim > > multiphysics
std::shared_ptr< SimulationControl > simulation_control
TableHandler enstrophy_table
TableHandler pressure_power_table
TableHandler viscous_dissipation_table
TableHandler kinetic_energy_table
TableHandler apparent_viscosity_table
TableHandler pressure_drop_table
TableHandler flow_rate_table
std::shared_ptr< AverageVelocities< dim, GlobalVectorType, IndexSet > > average_velocities
GlobalVectorType average_solution
MeshController mesh_controller
ConvergenceTable error_table
std::vector< std::map< types::boundary_id, Tensor< 1, dim > > > forces_on_boundaries
std::map< types::boundary_id, TableHandler > forces_tables
std::map< types::boundary_id, TableHandler > torques_tables
std::shared_ptr< FEValues< dim > > fe_values_temperature
std::shared_ptr< FEValues< dim > > fe_values_cls
std::vector< StasisConstraintWithTemperature > stasis_constraint_structs
AffineConstraints< double > dynamic_zero_constraints

Detailed Description

template<int dim>
class FluidDynamicsSharp< dim >

A solver class for the Navier-Stokes equation using GLS stabilization and Sharp-Edge immersed boundaries

Template Parameters
dimAn integer that denotes the dimension of the space in which the flow is solved

Definition at line 37 of file fluid_dynamics_sharp.h.

Constructor & Destructor Documentation

◆ FluidDynamicsSharp()

template<int dim>
FluidDynamicsSharp< dim >::FluidDynamicsSharp ( CFDDEMSimulationParameters< dim > & nsparam)

◆ ~FluidDynamicsSharp()

template<int dim>
FluidDynamicsSharp< dim >::~FluidDynamicsSharp ( )
default

Member Function Documentation

◆ allow_skip_linear_solve_when_residual_is_below_tolerance()

template<int dim>
bool FluidDynamicsSharp< dim >::allow_skip_linear_solve_when_residual_is_below_tolerance ( ) const
inlineoverrideprivatevirtual

Sharp may keep the outer nonlinear iteration active because of the particle-coupling residual even when the assembled fluid residual is already below tolerance.

In that situation, the inner fluid linear solve is unnecessary and may be skipped while the outer coupled iteration continues.

Returns
true because Sharp allows skipping the inner fluid linear solve once the assembled fluid residual is already below the nonlinear tolerance.

Reimplemented from PhysicsSolver< GlobalVectorType >.

Definition at line 576 of file fluid_dynamics_sharp.h.

◆ apply_prescribed_particle_motion()

template<int dim>
void FluidDynamicsSharp< dim >::apply_prescribed_particle_motion ( IBParticle< dim > & particle,
const double time,
const double dt ) const
private

Apply the prescribed motion of a particle whose dynamics is not integrated, at the end of the current time step. The motion is given by the functions of the particle subsection or, if the particles are loaded from a file, by the constant velocity and angular velocity of the particle.

Parameters
[in,out]particleParticle whose position, orientation, velocity and angular velocity are updated.
[in]timeTime at the end of the current time step.
[in]dtCurrent time step.

Definition at line 2107 of file fluid_dynamics_sharp.cc.

References IBParticle< dim >::f_omega, IBParticle< dim >::f_orientation, IBParticle< dim >::f_position, IBParticle< dim >::f_velocity, IBParticle< dim >::omega, IBParticle< dim >::orientation, IBParticle< dim >::position, IBParticle< dim >::previous_orientation, IBParticle< dim >::previous_positions, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and IBParticle< dim >::velocity.

◆ assemble_local_system_matrix()

template<int dim>
void FluidDynamicsSharp< dim >::assemble_local_system_matrix ( const typename DoFHandler< dim >::active_cell_iterator & cell,
NavierStokesScratchData< dim > & scratch_data,
StabilizedMethodsTensorCopyData< dim > & copy_data )
overrideprivatevirtual

Assemble the local matrix for a given cell.

This function is used by the WorkStream class to assemble the system matrix. It is a thread safe function.

Parameters
cellThe cell for which the local matrix is assembled.
scratch_dataThe scratch data which is used to store the calculated finite element information at the gauss point. See the documentation for NavierStokesScratchData for more information
copy_dataThe copy data which is used to store the results of the assembly over a cell This function is modified compared to the GLS function to take into account the cells that are cut or inside a particle

Reimplemented from FluidDynamicsMatrixBased< dim >.

Definition at line 4146 of file fluid_dynamics_sharp.cc.

References NavierStokesBase< dim, GlobalVectorType, IndexSet >::assemblers, assemblers_inside_ib, NavierStokesScratchData< dim >::calculate_physical_properties(), StabilizedMethodsTensorCopyData< dim >::cell_is_cut, StabilizedMethodsTensorCopyData< dim >::cell_is_local, cells_inside_map, CLS, cut_cells_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, StabilizedMethodsTensorCopyData< dim >::local_dof_indices, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, overconstrained_fluid_cell_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::previous_solutions, NavierStokesScratchData< dim >::reinit(), NavierStokesScratchData< dim >::reinit_cls(), StabilizedMethodsTensorCopyData< dim >::reset(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::sdirk_vectors, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation.

◆ assemble_local_system_rhs()

template<int dim>
void FluidDynamicsSharp< dim >::assemble_local_system_rhs ( const typename DoFHandler< dim >::active_cell_iterator & cell,
NavierStokesScratchData< dim > & scratch_data,
StabilizedMethodsTensorCopyData< dim > & copy_data )
overrideprivatevirtual

◆ assemble_matrix_and_rhs()

template<int dim>
virtual void FluidDynamicsSharp< dim >::assemble_matrix_and_rhs ( )
inlineprivatevirtual

◆ assemble_rhs()

template<int dim>
virtual void FluidDynamicsSharp< dim >::assemble_rhs ( )
inlineprivatevirtual

Call for the assembly of the right hand side.

Deprecated
This function is to be deprecated when the non-linear solvers have been refactored to call for rhs and matrix assembly seperately.

Modified version of assemble_matrix_and_rhs to include the presence of extra steps. For more detail see the same function in the fluid_dynamics_matrix_based.h solver.

Definition at line 194 of file fluid_dynamics_sharp.h.

References FluidDynamicsMatrixBased< dim >::assemble_system_rhs().

◆ assemble_system_matrix()

template<int dim>
void FluidDynamicsSharp< dim >::assemble_system_matrix ( )
inlineoverridevirtual

Call for the assembly of the matrix.

Reimplemented from FluidDynamicsMatrixBased< dim >.

Definition at line 51 of file fluid_dynamics_sharp.h.

References assemble_matrix_and_rhs().

◆ assemble_system_rhs()

template<int dim>
void FluidDynamicsSharp< dim >::assemble_system_rhs ( )
inlineoverridevirtual

Call for the assembly of the right-hand side.

Reimplemented from FluidDynamicsMatrixBased< dim >.

Definition at line 60 of file fluid_dynamics_sharp.h.

References assemble_rhs(), and sharp_edge().

◆ build_contact_containers()

template<int dim>
void FluidDynamicsSharp< dim >::build_contact_containers ( const typename DEM::dem_data_structures< dim >::particle_index_iterator_map & particle_container,
const std::unordered_set< unsigned int > & local_particle_ids,
typename DEM::dem_data_structures< dim >::adjacent_particle_pairs & local_adjacent_particles,
typename DEM::dem_data_structures< dim >::adjacent_particle_pairs & ghost_adjacent_particles ) const
private

Build the DEM-style particle-particle contact containers of the Sharp-IB particles, used for the force-chain output.

Parameters
particle_containerMap from particle ids to particle iterators in the temporary particle handler.
local_particle_idsSet of locally owned particle ids on the current MPI rank.
local_adjacent_particlesParticle-particle contacts where both particles are locally owned.
ghost_adjacent_particlesParticle-particle contacts involving a ghost particle.

Definition at line 3111 of file fluid_dynamics_sharp.cc.

References ib_dem, particle_particle_contact_info< dim >::particle_two, particle_particle_contact_info< dim >::rolling_resistance_spring_torque, and particle_particle_contact_info< dim >::tangential_displacement.

◆ build_ib_particle_handler()

template<int dim>
void FluidDynamicsSharp< dim >::build_ib_particle_handler ( Particles::ParticleHandler< dim, dim > & particle_handler,
typename DEM::dem_data_structures< dim >::particle_index_iterator_map & particle_container,
std::unordered_set< unsigned int > & local_particle_ids ) const
private

Build a temporary DEM particle handler from the current Sharp-IB particles.

Parameters
particle_handlerParticle handler that stores the locally owned and ghosted Sharp-IB particles.
particle_containerMap from particle ids to particle iterators in the temporary particle handler.
local_particle_idsSet of locally owned particle ids on the current MPI rank.

Definition at line 3065 of file fluid_dynamics_sharp.cc.

References NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, fill_particle_properties(), LetheGridTools::find_cell_around_point_with_tree(), particles, and update_particle_container().

◆ calculate_L2_error_particles()

template<int dim>
std::pair< double, double > FluidDynamicsSharp< dim >::calculate_L2_error_particles ( )
private

Evaluate the L2 error on the computational domain if an analytical solution is given. This function is slightly different from its standard GLS counterpart as the cells that are cut by an immersed boundary should not be taken into account in the error evaluation. See "computation domain" definition in: L. Barbeau, S. Étienne, C. Béguin & B. Blais, «Development of a high-order continuous Galerkin sharp-interface immersed boundary method and its application to incompressible flow problems,» Computers & Fluids, 2020, in press, ref. CAF-D-20-0077.

Definition at line 1839 of file fluid_dynamics_sharp.cc.

References cells_inside_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::check_existance_of_bc(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, cut_cells_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::exact_solution, NavierStokesBase< dim, GlobalVectorType, IndexSet >::face_quadrature, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, BoundaryConditions::function_weak, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::number_quadrature_points, overconstrained_fluid_cell_map, PhysicsSolver< GlobalVectorType >::pcout, NavierStokesBase< dim, GlobalVectorType, IndexSet >::present_solution, pressure, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and FluidDynamicsVelocityFunctionDefined< dim >::value().

◆ cell_cut()

template<int dim>
std::tuple< bool, unsigned int, std::vector< types::global_dof_index > > FluidDynamicsSharp< dim >::cell_cut ( const typename DoFHandler< dim >::active_cell_iterator & cell,
std::vector< types::global_dof_index > & local_dof_indices,
std::map< types::global_dof_index, Point< dim > > & support_points )
private

Return a bool to define if a cell is cut by an IB particle and the local DOFs of the cell for later us. If the cell is cut, the function will return the id of the particle that cut it, else it returns 0.

Parameters
cell,thecell that we verify whether it is cut or not.
local_dof_indices,acontainer for the local dof indices used during the function call.
support_points,amapping of support points for the DOFs.

◆ cell_cut_by_p_absolute_distance()

template<int dim>
bool FluidDynamicsSharp< dim >::cell_cut_by_p_absolute_distance ( const typename DoFHandler< dim >::active_cell_iterator & cell,
std::map< types::global_dof_index, Point< dim > > & support_points,
unsigned int p )
private

Return a bool to define if a cell is cut by an IB. This function is built to handle special cases where the level set is always positive.

Parameters
cell,thecell that we verify whether it is cut or not.
support_points,amapping of support points for the DOFs.
p,theparticle index of the particle used in the check

Definition at line 459 of file fluid_dynamics_sharp.cc.

References NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, and particles.

◆ cell_inside()

template<int dim>
std::tuple< bool, unsigned int, std::vector< types::global_dof_index > > FluidDynamicsSharp< dim >::cell_inside ( const typename DoFHandler< dim >::active_cell_iterator & cell,
std::vector< types::global_dof_index > & local_dof_indices,
std::map< types::global_dof_index, Point< dim > > & support_points )
private

Return a bool to define if a cell is contains inside an IB particle and the local DOFs of the cell for later us. If the cell is cut, the function will return the id of the particle, else it returns 0.

Parameters
cell,thecell that we verify whether it is cut or not.
local_dof_indices,acontainer for the local dof indices used during the function call.
support_points,amapping of support points for the DOFs.

◆ check_whether_all_particles_are_sphere()

template<int dim>
void FluidDynamicsSharp< dim >::check_whether_all_particles_are_sphere ( )
private

This function checks if all particles are spheres. If one of them is not, the code will use the regular generate_cut_cells function. If all particles are spheres, it uses the optimized_generate_cut_cells.

Definition at line 60 of file fluid_dynamics_sharp.cc.

References all_spheres.

◆ copy_local_matrix_to_global_matrix()

template<int dim>
void FluidDynamicsSharp< dim >::copy_local_matrix_to_global_matrix ( const StabilizedMethodsTensorCopyData< dim > & copy_data)
overrideprivatevirtual

Copy local cell information to global matrix This function is modified compared to the GLS function to take into account the cells that are cut or inside a particle.

Reimplemented from FluidDynamicsMatrixBased< dim >.

Definition at line 4223 of file fluid_dynamics_sharp.cc.

References StabilizedMethodsTensorCopyData< dim >::cell_is_cut, StabilizedMethodsTensorCopyData< dim >::cell_is_local, StabilizedMethodsTensorCopyData< dim >::local_dof_indices, StabilizedMethodsTensorCopyData< dim >::local_matrix, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.

◆ copy_local_rhs_to_global_rhs()

template<int dim>
void FluidDynamicsSharp< dim >::copy_local_rhs_to_global_rhs ( const StabilizedMethodsTensorCopyData< dim > & copy_data)
overrideprivatevirtual

Copy local cell rhs information to global rhs This function is modified compared to the GLS function to take into account the cells that are cut or inside a particle.

Reimplemented from FluidDynamicsMatrixBased< dim >.

Definition at line 4316 of file fluid_dynamics_sharp.cc.

References StabilizedMethodsTensorCopyData< dim >::cell_is_cut, StabilizedMethodsTensorCopyData< dim >::cell_is_local, StabilizedMethodsTensorCopyData< dim >::local_dof_indices, StabilizedMethodsTensorCopyData< dim >::local_rhs, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.

◆ define_particles()

template<int dim>
void FluidDynamicsSharp< dim >::define_particles ( )
private

Defines the particle structure and value based on the parameter file. This structure gives access to the position, velocity, force and other proprieties of each IB particle. All the variables defined for each of the particle are described in the class: IBparticle. see: \ib_particle.h.

Definition at line 774 of file fluid_dynamics_sharp.cc.

References cfd_dem_parameters, check_whether_all_particles_are_sphere(), combined_shapes, ib_dem, load_particles_from_file(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, particles, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, some_particles_are_coupled, and table_p.

◆ fill_particle_properties()

template<int dim>
void FluidDynamicsSharp< dim >::fill_particle_properties ( const IBParticle< dim > & particle,
std::vector< double > & properties ) const
private

Fill DEM particle properties from a Sharp-IB particle state.

Parameters
particleSharp-IB particle whose properties are exported.
propertiesDEM property vector to populate.

Definition at line 3024 of file fluid_dynamics_sharp.cc.

References IBParticle< dim >::fluid_forces, IBParticle< dim >::fluid_torque, IBParticle< dim >::mass, IBParticle< dim >::omega, IBParticle< dim >::radius, and IBParticle< dim >::velocity.

◆ finish_time_step_particles()

◆ force_on_ib()

◆ gather_output_hook()

◆ generate_cut_cell_candidates()

template<int dim>
std::pair< bool, bool > FluidDynamicsSharp< dim >::generate_cut_cell_candidates ( const typename DoFHandler< dim >::cell_iterator & cell,
const unsigned int p_id )
private

This function abstracts the generation of cell candidates that possibly are cut.

Definition at line 654 of file fluid_dynamics_sharp.cc.

References particles, and point_inside_cell().

◆ generate_cut_cells_map()

◆ get_current_residual()

template<int dim>
double FluidDynamicsSharp< dim >::get_current_residual ( )
inlineoverrideprivatevirtual

A override of the get_current_residual to take into account the particles coupling residual.

Returns
The maximum between the fluid residual and the particle residual time the scaling.

Reimplemented from PhysicsSolver< GlobalVectorType >.

Definition at line 553 of file fluid_dynamics_sharp.h.

References fluid_dynamics, particle_residual, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs.

◆ handle_dem_particle_output_and_postprocessing()

◆ integrate_particles()

◆ load_particles_from_file()

◆ mesh_adapt_ib()

template<int dim>
void FluidDynamicsSharp< dim >::mesh_adapt_ib ( const bool initial_refinement)
private

Adapt the mesh around each immersed-boundary particle. The refinement zone is defined by a ring in 2D and a shell in 3D. The outside and inside radius of this ring\shell are defined relative to the particle radius by the immersed-boundary parameters "refine mesh inside radius factor" and "refine mesh outside radius factor". When enabled, distance-based coarsening is also applied outside the corresponding coarsening threshold.

Parameters
initial_refinementA bool that indicates if this is the initial refinement cycle.

Definition at line 834 of file fluid_dynamics_sharp.cc.

References NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, particles, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters.

◆ optimized_generate_cut_cells_map()

template<int dim>
void FluidDynamicsSharp< dim >::optimized_generate_cut_cells_map ( )
private

This function is only applied if all particles are spheres. It creates two maps (cut_cells_map and cells_inside_map) to access the cells cut by particles and inside the particles, respectively. The map keys are the particle's IDs. The algorithm was optimized to reduce the cost of this step.

Definition at line 516 of file fluid_dynamics_sharp.cc.

References cells_inside_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, cut_cells_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, generate_cut_cell_candidates(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping, and particles.

◆ point_inside_cell()

template<int dim>
bool FluidDynamicsSharp< dim >::point_inside_cell ( const typename DoFHandler< dim >::active_cell_iterator & cell,
Point< dim > point )
private

Return a bool that describes if a cell contains a specific point.

Parameters
cell,Theinitial cell for which we want to check if the point is inside.
point,Thepoint that we wish to check

◆ postprocess_fd()

◆ read_checkpoint()

◆ refinement_control()

◆ setup_assemblers()

template<int dim>
void FluidDynamicsSharp< dim >::setup_assemblers ( )
overrideprivatevirtual

◆ sharp_edge()

template<int dim>
void FluidDynamicsSharp< dim >::sharp_edge ( )
private

Modify the system matrix to impose IB condition using the sharp_edge approach. The detail of this approach are presented in : L. Barbeau, S. Étienne, C. Béguin & B. Blais, «Development of a high-order continuous Galerkin sharp-interface immersed boundary method and its application to incompressible flow problems,» Computers & Fluids, 2020, in press, ref. CAF-D-20-00773.

Definition at line 3262 of file fluid_dynamics_sharp.cc.

References cell_cut(), IBStencil< dim >::coefficients(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, cut_cells_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, LetheGridTools::find_cell_around_point_with_neighbors(), LetheGridTools::find_cell_around_point_with_tree(), LetheGridTools::find_cells_around_cell(), ib_done, IBStencil< dim >::ib_velocity(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_owned_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping, NavierStokesBase< dim, GlobalVectorType, IndexSet >::nonzero_constraints, IBStencil< dim >::number_of_interpolation_support_points(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::number_quadrature_points, overconstrained_fluid_cell_map, particles, IBStencil< dim >::point_for_cell_detection(), pressure, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, Parameters::SimulationControl::steady, IBStencil< dim >::support_points_for_interpolation(), FluidDynamicsMatrixBased< dim >::system_matrix, NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation, vertices_to_cell, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.

◆ solve()

template<int dim>
void FluidDynamicsSharp< dim >::solve ( )
overridevirtual

solve Solves the Navier-Stokes problem

This functions solves the problem defined by the Navier-Stokes parameter by iterating through time or through the mesh refinements.

Reimplemented from FluidDynamicsMatrixBased< dim >.

Definition at line 4989 of file fluid_dynamics_sharp.cc.

References all_spheres, cfd_dem_parameters, define_particles(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dynamic_flow_control(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::face_quadrature, NavierStokesBase< dim, GlobalVectorType, IndexSet >::finish_simulation(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::finish_time_step(), finish_time_step_particles(), force_on_ib(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::forcing_function, generate_cut_cells_map(), handle_dem_particle_output_and_postprocessing(), ib_dem, ib_done, integrate_particles(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::iterate(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, optimized_generate_cut_cells_map(), particles, PhysicsSolver< GlobalVectorType >::pcout, NavierStokesBase< dim, GlobalVectorType, IndexSet >::postprocess(), read_mesh_and_manifolds(), refinement_control(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::set_initial_condition(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::setup_dofs(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, some_particles_are_coupled, NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation, NavierStokesBase< dim, GlobalVectorType, IndexSet >::update_boundary_conditions(), FluidDynamicsMatrixBased< dim >::update_multiphysics_time_average_solution(), update_precalculations_for_ib(), vertices_cell_mapping(), and write_force_ib().

◆ update_precalculations_for_ib()

template<int dim>
void FluidDynamicsSharp< dim >::update_precalculations_for_ib ( )
private

This function updates the precalculations for every immersed particle.

Definition at line 4976 of file fluid_dynamics_sharp.cc.

References NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, and particles.

◆ vertices_cell_mapping()

template<int dim>
void FluidDynamicsSharp< dim >::vertices_cell_mapping ( )
private

Map the vertex index to the cell that includes that vertex. This map is used to find all the cell close to a specific vertex.

Definition at line 50 of file fluid_dynamics_sharp.cc.

References NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, LetheGridTools::vertices_cell_mapping(), and vertices_to_cell.

◆ write_checkpoint()

template<int dim>
void FluidDynamicsSharp< dim >::write_checkpoint ( )
overrideprivatevirtual

Write a gls_sharp simulation checkpointing to allow for gls_sharp simulation restart This function stores all the previous' particles states in one file. Each row corresponds to one particle state. The file is structured as follows:

P0 state at time t

P0 state at time t-dt

P0 state at time t-2dt

P1 state at time t

P1 state at time t-dt

P1 state at time t-2dt

etc

Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.

Definition at line 4331 of file fluid_dynamics_sharp.cc.

References ib_particles_pvdhandler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, particles, NavierStokesBase< dim, GlobalVectorType, IndexSet >::pvdhandler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::write_checkpoint().

◆ write_force_ib()

Member Data Documentation

◆ all_spheres

template<int dim>
bool FluidDynamicsSharp< dim >::all_spheres
private

Definition at line 667 of file fluid_dynamics_sharp.h.

◆ assemblers_inside_ib

template<int dim>
std::vector<std::shared_ptr<NavierStokesAssemblerBase<dim> > > FluidDynamicsSharp< dim >::assemblers_inside_ib
private

Definition at line 719 of file fluid_dynamics_sharp.h.

◆ cells_inside_map

template<int dim>
std::map<typename DoFHandler<dim>::active_cell_iterator, std::tuple<bool, unsigned int> > FluidDynamicsSharp< dim >::cells_inside_map
private

Definition at line 708 of file fluid_dynamics_sharp.h.

◆ cfd_dem_parameters

template<int dim>
CFDDEMSimulationParameters<dim> FluidDynamicsSharp< dim >::cfd_dem_parameters
private

Members

Definition at line 665 of file fluid_dynamics_sharp.h.

◆ combined_shapes

template<int dim>
std::shared_ptr<Shape<dim> > FluidDynamicsSharp< dim >::combined_shapes
private

Definition at line 736 of file fluid_dynamics_sharp.h.

◆ cut_cells_map

template<int dim>
std::map<typename DoFHandler<dim>::active_cell_iterator, std::tuple<bool, unsigned int, std::vector<unsigned int> > > FluidDynamicsSharp< dim >::cut_cells_map
private

Definition at line 684 of file fluid_dynamics_sharp.h.

◆ dof_overconstrained

template<int dim>
GlobalVectorType FluidDynamicsSharp< dim >::dof_overconstrained
private

Definition at line 702 of file fluid_dynamics_sharp.h.

◆ dof_with_more_then_one_particle

template<int dim>
std::map<unsigned int, bool> FluidDynamicsSharp< dim >::dof_with_more_then_one_particle
private

Definition at line 703 of file fluid_dynamics_sharp.h.

◆ ib_dem

template<int dim>
IBParticlesDEM<dim> FluidDynamicsSharp< dim >::ib_dem
private

Definition at line 733 of file fluid_dynamics_sharp.h.

◆ ib_done

template<int dim>
std::map<unsigned int, std::pair<bool, typename DoFHandler<dim>::active_cell_iterator> > FluidDynamicsSharp< dim >::ib_done
private

Definition at line 715 of file fluid_dynamics_sharp.h.

◆ ib_particles_pvdhandler

template<int dim>
PVDHandler FluidDynamicsSharp< dim >::ib_particles_pvdhandler
private

Definition at line 721 of file fluid_dynamics_sharp.h.

◆ ib_particles_pvdhandler_force_chains

template<int dim>
PVDHandler FluidDynamicsSharp< dim >::ib_particles_pvdhandler_force_chains
private

Definition at line 723 of file fluid_dynamics_sharp.h.

◆ levelset_gradient_postprocessor

template<int dim>
std::shared_ptr<LevelsetGradientPostprocessor<dim> > FluidDynamicsSharp< dim >::levelset_gradient_postprocessor
private

Definition at line 742 of file fluid_dynamics_sharp.h.

◆ levelset_postprocessor

template<int dim>
std::shared_ptr<LevelsetPostprocessor<dim> > FluidDynamicsSharp< dim >::levelset_postprocessor
private

Definition at line 740 of file fluid_dynamics_sharp.h.

◆ local_dof_overconstrained

template<int dim>
GlobalVectorType FluidDynamicsSharp< dim >::local_dof_overconstrained
private

Definition at line 701 of file fluid_dynamics_sharp.h.

◆ overconstrained_fluid_cell_map

template<int dim>
std::map<typename DoFHandler<dim>::active_cell_iterator, std::tuple<bool, unsigned int, double> > FluidDynamicsSharp< dim >::overconstrained_fluid_cell_map
private

Definition at line 695 of file fluid_dynamics_sharp.h.

◆ particle_residual

template<int dim>
double FluidDynamicsSharp< dim >::particle_residual
private

Definition at line 726 of file fluid_dynamics_sharp.h.

◆ particles

template<int dim>
std::vector<IBParticle<dim> > FluidDynamicsSharp< dim >::particles
private

Definition at line 725 of file fluid_dynamics_sharp.h.

◆ some_particles_are_coupled

template<int dim>
bool FluidDynamicsSharp< dim >::some_particles_are_coupled
private

Definition at line 670 of file fluid_dynamics_sharp.h.

◆ table_all_p

template<int dim>
TableHandler FluidDynamicsSharp< dim >::table_all_p
private

Definition at line 729 of file fluid_dynamics_sharp.h.

◆ table_p

template<int dim>
std::vector<TableHandler> FluidDynamicsSharp< dim >::table_p
private

Definition at line 728 of file fluid_dynamics_sharp.h.

◆ vertices_to_cell

template<int dim>
std::map<unsigned int, std::set<typename DoFHandler<dim>::active_cell_iterator> > FluidDynamicsSharp< dim >::vertices_to_cell
private

Definition at line 674 of file fluid_dynamics_sharp.h.


The documentation for this class was generated from the following files: