![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <fluid_dynamics_sharp.h>
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 > ©_data) override |
| void | assemble_local_system_rhs (const typename DoFHandler< dim >::active_cell_iterator &cell, NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override |
| void | setup_assemblers () override |
| void | copy_local_matrix_to_global_matrix (const StabilizedMethodsTensorCopyData< dim > ©_data) override |
| void | copy_local_rhs_to_global_rhs (const StabilizedMethodsTensorCopyData< dim > ©_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 |
A solver class for the Navier-Stokes equation using GLS stabilization and Sharp-Edge immersed boundaries
| dim | An integer that denotes the dimension of the space in which the flow is solved |
Definition at line 37 of file fluid_dynamics_sharp.h.
| FluidDynamicsSharp< dim >::FluidDynamicsSharp | ( | CFDDEMSimulationParameters< dim > & | nsparam | ) |
Definition at line 36 of file fluid_dynamics_sharp.cc.
References all_spheres, cfd_dem_parameters, combined_shapes, and FluidDynamicsMatrixBased< dim >::FluidDynamicsMatrixBased().
|
default |
|
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.
Reimplemented from PhysicsSolver< GlobalVectorType >.
Definition at line 576 of file fluid_dynamics_sharp.h.
|
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.
| [in,out] | particle | Particle whose position, orientation, velocity and angular velocity are updated. |
| [in] | time | Time at the end of the current time step. |
| [in] | dt | Current 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.
|
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.
| cell | The cell for which the local matrix is assembled. |
| scratch_data | The 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_data | The 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.
|
overrideprivatevirtual |
Assemble the local rhs for a given cell.
| cell | The cell for which the local matrix is assembled. |
| scratch_data | The 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_data | The copy data which is used to store the results of the assembly over a cell |
Reimplemented from FluidDynamicsMatrixBased< dim >.
Definition at line 4237 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.
|
inlineprivatevirtual |
Call for the assembly of the matrix and the right hand side.
Definition at line 155 of file fluid_dynamics_sharp.h.
References all_spheres, FluidDynamicsMatrixBased< dim >::assemble_system_matrix(), force_on_ib(), generate_cut_cells_map(), PhysicsSolver< GlobalVectorType >::get_current_newton_iteration(), integrate_particles(), optimized_generate_cut_cells_map(), sharp_edge(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, some_particles_are_coupled, and update_precalculations_for_ib().
|
inlineprivatevirtual |
Call for the assembly of the right hand side.
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().
|
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().
|
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().
|
private |
Build the DEM-style particle-particle contact containers of the Sharp-IB particles, used for the force-chain output.
| particle_container | Map from particle ids to particle iterators in the temporary particle handler. |
| local_particle_ids | Set of locally owned particle ids on the current MPI rank. |
| local_adjacent_particles | Particle-particle contacts where both particles are locally owned. |
| ghost_adjacent_particles | Particle-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.
|
private |
Build a temporary DEM particle handler from the current Sharp-IB particles.
| particle_handler | Particle handler that stores the locally owned and ghosted Sharp-IB particles. |
| particle_container | Map from particle ids to particle iterators in the temporary particle handler. |
| local_particle_ids | Set 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().
|
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().
|
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.
| cell,the | cell that we verify whether it is cut or not. |
| local_dof_indices,a | container for the local dof indices used during the function call. |
| support_points,a | mapping of support points for the DOFs. |
|
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.
| cell,the | cell that we verify whether it is cut or not. |
| support_points,a | mapping of support points for the DOFs. |
| p,the | particle 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.
|
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.
| cell,the | cell that we verify whether it is cut or not. |
| local_dof_indices,a | container for the local dof indices used during the function call. |
| support_points,a | mapping of support points for the DOFs. |
|
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.
|
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.
|
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.
|
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.
|
private |
Fill DEM particle properties from a Sharp-IB particle state.
| particle | Sharp-IB particle whose properties are exported. |
| properties | DEM 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.
|
private |
Store the solution of the particles dynamics parameters for integration. Defines the table to store the history of each of the particles.
Definition at line 2724 of file fluid_dynamics_sharp.cc.
References DEM::omega, particles, PhysicsSolver< GlobalVectorType >::pcout, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, some_particles_are_coupled, Parameters::SimulationControl::steady, table_all_p, table_p, tensor_nd_to_2d(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::this_mpi_process, DEM::velocity, and Parameters::verbose.
|
private |
Evaluate the forces applied on each of the IB particle.
Definition at line 1031 of file fluid_dynamics_sharp.cc.
References calculate_shear_rate_magnitude(), IBStencil< dim >::coefficients(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, cut_cells_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, dof_with_more_then_one_particle, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::face_quadrature, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, ib_done, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::number_quadrature_points, particles, IBStencil< dim >::point_for_cell_detection(), pressure, shear_rate, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, IBStencil< dim >::support_points_for_interpolation(), temperature, tensor_nd_to_3d(), and vertices_to_cell.
|
overrideprivatevirtual |
Adds levelset to output files.
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 1697 of file fluid_dynamics_sharp.cc.
References combined_shapes, cut_cells_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, levelset_gradient_postprocessor, levelset_postprocessor, overconstrained_fluid_cell_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::present_solution, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation.
|
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().
|
private |
This function creates a map (cut_cells_map) that indicates if a cell is cut, and the particle id of the particle that cut it.
Definition at line 84 of file fluid_dynamics_sharp.cc.
References cell_cut_by_p_absolute_distance(), cells_inside_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, cut_cells_map, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, dof_overconstrained, dof_with_more_then_one_particle, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, local_dof_overconstrained, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_owned_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_relevant_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, overconstrained_fluid_cell_map, particles, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters.
|
inlineoverrideprivatevirtual |
A override of the get_current_residual to take into account the particles coupling residual.
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.
|
private |
Mirror DEM-style particle output and post-processing for Sharp-IB particles.
Definition at line 3176 of file fluid_dynamics_sharp.cc.
References build_contact_containers(), build_ib_particle_handler(), Visualization< dim, PropertiesIndex >::build_patches(), cfd_dem_parameters, ib_particles_pvdhandler, ib_particles_pvdhandler_force_chains, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, DEM::CFDDEMProperties::n_properties, set_force_chains_contact_force_model(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation, and write_vtu_and_pvd().
|
private |
Integrate the particle velocity and position based on the forces and torques and applies the next value to the particle.
Definition at line 2158 of file fluid_dynamics_sharp.cc.
References apply_prescribed_particle_motion(), combined_shapes, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, LetheGridTools::find_cell_around_point_with_tree(), fluid_dynamics, PhysicsSolver< GlobalVectorType >::get_current_newton_iteration(), ib_dem, number_of_previous_solutions(), DEM::omega, particle_residual, particles, PhysicsSolver< GlobalVectorType >::pcout, Parameters::quiet, shear_rate, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, some_particles_are_coupled, temperature, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation.
|
private |
Definition at line 4708 of file fluid_dynamics_sharp.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, fill_string_vectors_from_file(), particles, PhysicsSolver< GlobalVectorType >::pcout, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters.
|
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.
| initial_refinement | A 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.
|
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.
|
private |
Return a bool that describes if a cell contains a specific point.
| cell,The | initial cell for which we want to check if the point is inside. |
| point,The | point that we wish to check |
|
overrideprivatevirtual |
Same function as its standard GLS counterpart but it used the error evaluation that takes into account the particle’s position.
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 1774 of file fluid_dynamics_sharp.cc.
References calculate_L2_error_particles(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::error_table, NavierStokesBase< dim, GlobalVectorType, IndexSet >::exact_solution, PhysicsSolver< GlobalVectorType >::pcout, NavierStokesBase< dim, VectorType, DofsType >::postprocess_fd(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, Parameters::SimulationControl::steady, NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation, and Parameters::verbose.
|
overrideprivatevirtual |
Restart a previous simulation from a checkpoint file.
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 4473 of file fluid_dynamics_sharp.cc.
References cfd_dem_parameters, check_whether_all_particles_are_sphere(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, fill_table_from_file(), fill_vectors_from_file(), ib_dem, ib_particles_pvdhandler, particles, NavierStokesBase< dim, GlobalVectorType, IndexSet >::read_checkpoint(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, table_p, and update_precalculations_for_ib().
|
private |
Regroup and organize the refinement process around the IB particle.
| initial_refinement,A | bool that indicate if this is the initial refinement. |
Definition at line 372 of file fluid_dynamics_sharp.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::box_refine_mesh(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, mesh_adapt_ib(), particles, PhysicsSolver< GlobalVectorType >::pcout, NavierStokesBase< dim, VectorType, DofsType >::refine_mesh(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation, and update_precalculations_for_ib().
|
overrideprivatevirtual |
sets up the vector of assembler functions This function is modified compared to the GLS function to take into account the cells that are cut or inside a particle. Refer to 2 different assembler depending on what type of equations is assembled inside the particles.
Reimplemented from FluidDynamicsMatrixBased< dim >.
Definition at line 4014 of file fluid_dynamics_sharp.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::assemblers, assemblers_inside_ib, NavierStokesBase< dim, GlobalVectorType, IndexSet >::check_existance_of_bc(), BoundaryConditions::function_weak, BoundaryConditions::outlet, BoundaryConditions::partial_slip, BoundaryConditions::pressure, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, Parameters::VelocitySource::srf, time_stepping_is_bdf(), and time_stepping_is_sdirk().
|
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.
|
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().
|
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.
|
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.
|
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().
|
private |
Write in a specifique file for each of the paticles its forces, velocity, position at each time step.
Definition at line 1672 of file fluid_dynamics_sharp.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, particles, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, table_p, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::this_mpi_process.
|
private |
Definition at line 667 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 719 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 708 of file fluid_dynamics_sharp.h.
|
private |
Members
Definition at line 665 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 736 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 684 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 702 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 703 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 733 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 715 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 721 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 723 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 742 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 740 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 701 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 695 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 726 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 725 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 670 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 729 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 728 of file fluid_dynamics_sharp.h.
|
private |
Definition at line 674 of file fluid_dynamics_sharp.h.