![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <fluid_dynamics_nitsche.h>
Public Member Functions | |
| FluidDynamicsNitsche (SimulationParameters< spacedim > &nsparam) | |
| virtual void | solve () 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 () |
| virtual double | get_current_residual () |
| virtual bool | allow_skip_linear_solve_when_residual_is_below_tolerance () const |
| unsigned int | get_current_newton_iteration () const |
Private Member Functions | |
| template<bool assemble_matrix> | |
| void | assemble_nitsche_restriction () |
| Tensor< 1, spacedim > | calculate_forces_on_solid (const unsigned int i_solid) |
| Tensor< 1, 3 > | calculate_torque_on_solid (const unsigned int i_solid) |
| Tensor< 1, 3 > | calculate_torque_on_solid () |
| void | postprocess_solid_forces (const unsigned int i_solid, bool first_solid_forces) |
| void | postprocess_solid_torques (const unsigned int i_solid, bool first_solid_torques) |
| virtual void | assemble_system_matrix () override |
| virtual void | assemble_system_rhs () override |
| void | assemble_matrix_and_rhs () |
| void | assemble_rhs () |
| void | output_solid_particles (const unsigned int i_solid) |
| void | output_solid_triangulation (const unsigned int i_solid) |
| virtual void | refine_mesh () override |
| std::vector< OutputStructTableHandler > | gather_tables () override |
| virtual void | write_checkpoint () override |
| virtual void | read_checkpoint () override |
| Tensor< 1, 3 > | calculate_forces_on_solid (const unsigned int i_solid) |
Private Attributes | |
| std::shared_ptr< std::vector< std::shared_ptr< SolidBase< dim, spacedim > > > > | solids |
| std::vector< PVDHandler > | pvdhandler_solid_triangulation |
| std::vector< PVDHandler > | pvdhandler_solid_particles |
| std::vector< TableHandler > | solid_forces_table |
| std::vector< TableHandler > | solid_torques_table |
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 |
| virtual void | assemble_local_system_matrix (const typename DoFHandler< dim >::active_cell_iterator &cell, NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) |
| virtual void | assemble_local_system_rhs (const typename DoFHandler< dim >::active_cell_iterator &cell, NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) |
| virtual void | setup_assemblers () |
| virtual void | copy_local_matrix_to_global_matrix (const StabilizedMethodsTensorCopyData< dim > ©_data) |
| virtual void | copy_local_rhs_to_global_rhs (const StabilizedMethodsTensorCopyData< dim > ©_data) |
| 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 | postprocess_fd (bool first_iteration) |
| 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) |
| 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< OutputStruct< dim, GlobalVectorType > > | gather_output_hook () |
| 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 Nitsche immersed boundary method
| dim | An integer that denotes the dimension of the space in which the flow is solved |
Definition at line 25 of file fluid_dynamics_nitsche.h.
| FluidDynamicsNitsche< dim, spacedim >::FluidDynamicsNitsche | ( | SimulationParameters< spacedim > & | nsparam | ) |
Definition at line 24 of file fluid_dynamics_nitsche.cc.
References FluidDynamicsMatrixBased< dim >::FluidDynamicsMatrixBased(), pvdhandler_solid_particles, pvdhandler_solid_triangulation, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, solid_forces_table, solid_torques_table, and solids.
|
private |
Same as in fluid_dynamics_matrix_based, but calls assemble_nitsche_restriction() when global matrix and rhs are assembled.
Definition at line 898 of file fluid_dynamics_nitsche.cc.
References assemble_nitsche_restriction(), FluidDynamicsMatrixBased< dim >::assemble_system_matrix(), and FluidDynamicsMatrixBased< dim >::assemble_system_rhs().
|
private |
Adds the nitsche restriction to the global matrix and global rhs on the cells surrounding the immersed solid.
Definition at line 58 of file fluid_dynamics_nitsche.cc.
References compute_cell_diameter(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, solids, Parameters::SimulationControl::steady, FluidDynamicsMatrixBased< dim >::system_matrix, NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs, velocity, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.
|
private |
Same as in fluid_dynamics_matrix_based, but calls assemble_nitsche_restriction() when rhs is assembled.
Definition at line 909 of file fluid_dynamics_nitsche.cc.
References assemble_nitsche_restriction(), and FluidDynamicsMatrixBased< dim >::assemble_system_rhs().
|
inlineoverrideprivatevirtual |
Call for the assembly of the matrix.
Reimplemented from FluidDynamicsMatrixBased< dim >.
Definition at line 89 of file fluid_dynamics_nitsche.h.
References assemble_matrix_and_rhs().
|
inlineoverrideprivatevirtual |
Call for the assembly of the right-hand side.
Reimplemented from FluidDynamicsMatrixBased< dim >.
Definition at line 98 of file fluid_dynamics_nitsche.h.
References assemble_rhs().
|
private |
Calculates the force due to the fluid motion on the solid.
Definition at line 317 of file fluid_dynamics_nitsche.cc.
References compute_cell_diameter(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and velocity.
|
private |
Definition at line 230 of file fluid_dynamics_nitsche.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, pressure, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters.
|
private |
Calculates the torque due to the fluid motion on the solid.
|
private |
Calculates the torque due to the fluid motion on the solid.
Definition at line 393 of file fluid_dynamics_nitsche.cc.
References compute_cell_diameter(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and velocity.
|
overrideprivatevirtual |
Returns a vector of references to TableHandler objects that needs to be serialized/deserialized for a given solver.
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 918 of file fluid_dynamics_nitsche.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, solid_forces_table, and solid_torques_table.
|
private |
Outputs a vtu file for each output frequency of the particles.
Definition at line 787 of file fluid_dynamics_nitsche.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, pvdhandler_solid_particles, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, and write_vtu_and_pvd().
|
private |
Outputs a vtu file for each output frequency of the solid triangulation.
Definition at line 815 of file fluid_dynamics_nitsche.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, pvdhandler_solid_triangulation, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, and write_vtu_and_pvd().
|
private |
Post-process for forces on solid after an iteration.
| i_solid | is the solid index |
| first_solid_forces | is a boolean set to true for the first call of this method, used for table output formatting |
Definition at line 492 of file fluid_dynamics_nitsche.cc.
References calculate_forces_on_solid(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, make_table_scalars_tensors(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, solid_forces_table, NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation, and Parameters::verbose.
|
private |
Post-process for torques on solid after an iteration.
| i_solid | is the solid index |
| first_solid_torques | is a boolean set to true for the first call of this method, used for table output formatting |
Definition at line 577 of file fluid_dynamics_nitsche.cc.
References calculate_torque_on_solid(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, make_table_scalars_tensors(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, solid_torques_table, NavierStokesBase< dim, GlobalVectorType, IndexSet >::this_mpi_process, NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation, and Parameters::verbose.
|
overrideprivatevirtual |
Read a gls_nitsche simulation checkpoint and initiate simulation restart.
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 1012 of file fluid_dynamics_nitsche.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, deserialize_tables_vector(), NavierStokesBase< dim, VectorType, DofsType >::gather_tables(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, pvdhandler_solid_particles, pvdhandler_solid_triangulation, NavierStokesBase< dim, GlobalVectorType, IndexSet >::read_checkpoint(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and solids.
|
overrideprivatevirtual |
Allow the refinement of the mesh according to one of the 2 methods proposed. Overrides the regular mesh adaptation by ensuring that the Nitsche solids are prepared for adaptation.
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 863 of file fluid_dynamics_nitsche.cc.
References Parameters::MeshAdaptation::adaptive, Parameters::MeshAdaptation::none, NavierStokesBase< dim, GlobalVectorType, IndexSet >::refine_mesh_adaptive(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::refine_mesh_uniform(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, solids, and Parameters::MeshAdaptation::uniform.
|
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 661 of file fluid_dynamics_nitsche.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::finish_simulation(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::finish_time_step(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::iterate(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, output_solid_particles(), output_solid_triangulation(), PhysicsSolver< GlobalVectorType >::pcout, NavierStokesBase< dim, GlobalVectorType, IndexSet >::postprocess(), postprocess_solid_forces(), postprocess_solid_torques(), read_mesh_and_manifolds(), refine_mesh(), 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, solids, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation.
|
overrideprivatevirtual |
Write a gls_nitsche simulation checkpointing to allow for gls_nitsche simulation restart.
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 961 of file fluid_dynamics_nitsche.cc.
References NavierStokesBase< dim, VectorType, DofsType >::gather_tables(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::pvdhandler, pvdhandler_solid_particles, pvdhandler_solid_triangulation, serialize_tables_vector(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, solids, NavierStokesBase< dim, GlobalVectorType, IndexSet >::write_checkpoint(), and write_checkpoint().
|
private |
Definition at line 171 of file fluid_dynamics_nitsche.h.
|
private |
Definition at line 170 of file fluid_dynamics_nitsche.h.
|
private |
Definition at line 173 of file fluid_dynamics_nitsche.h.
|
private |
Definition at line 174 of file fluid_dynamics_nitsche.h.
|
private |
Definition at line 169 of file fluid_dynamics_nitsche.h.