![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <fluid_dynamics_matrix_based.h>
Public Member Functions | |
| FluidDynamicsMatrixBased (SimulationParameters< dim > &nsparam, const FluidDynamicsFormulation fluid_dynamics_formulation=FluidDynamicsFormulation::standard) | |
| ~FluidDynamicsMatrixBased () | |
| virtual void | solve () |
| 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 |
Protected Member Functions | |
| 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 | assemble_system_matrix () override |
| virtual void | assemble_system_rhs () 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) |
| 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) |
| virtual void | read_checkpoint () |
| 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 () |
| virtual void | write_checkpoint () |
| 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 | |
| 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 |
Private Member Functions | |
| void | assemble_L2_projection () |
| void | solve_L2_system (const double absolute_residual, const double relative_residual) |
| void | solve_system_GMRES (const double absolute_residual, const double relative_residual) |
| void | solve_system_BiCGStab (const double absolute_residual, const double relative_residual) |
| void | solve_system_direct (const double absolute_residual, const double relative_residual) |
| void | setup_AMG () |
| void | setup_ILU () |
Private Attributes | |
| SparsityPattern | sparsity_pattern |
| std::shared_ptr< TrilinosWrappers::PreconditionILU > | ilu_preconditioner |
| std::shared_ptr< TrilinosWrappers::PreconditionAMG > | amg_preconditioner |
| int | current_preconditioner_fill_level |
| int | initial_preconditioner_fill_level |
Additional Inherited Members | |
| Public Attributes inherited from PhysicsSolver< GlobalVectorType > | |
| ConditionalOStream | pcout |
| Parameters::SimulationControl::TimeSteppingMethod | time_stepping_method |
A solver class for the Navier-Stokes equation using GLS stabilization.
| dim | An integer that denotes the dimension of the space in which the flow is solved |
Definition at line 33 of file fluid_dynamics_matrix_based.h.
| FluidDynamicsMatrixBased< dim >::FluidDynamicsMatrixBased | ( | SimulationParameters< dim > & | nsparam, |
| const FluidDynamicsFormulation | fluid_dynamics_formulation = FluidDynamicsFormulation::standard ) |
Construct the matrix-based Navier-Stokes solver.
| [in] | nsparam | Relevant parameters for the solver. |
| [in] | fluid_dynamics_formulation | The formulation of the fluid dynamics equations. Whether the solver solves the volume-averaged Navier-Stokes (VANS) equations or the standard Navier-Stokes equations. |
Definition at line 41 of file fluid_dynamics_matrix_based.cc.
References Parameters::LinearSolver::amg, fluid_dynamics, initial_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::NavierStokesBase(), and NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters.
| FluidDynamicsMatrixBased< dim >::~FluidDynamicsMatrixBased | ( | ) |
Definition at line 58 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler.
|
private |
Assembles an L2_projection matrix for the velocity and the pressure. This L2 projection matrix can be used to set the initial condition for the Navier-Stokes problem.
Definition at line 1422 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::cell_quadrature, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, NavierStokesBase< dim, GlobalVectorType, IndexSet >::get_mapping(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::nonzero_constraints, pressure, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, system_matrix, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs.
|
protectedvirtual |
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 |
Reimplemented in FluidDynamicsSharp< dim >, and FluidDynamicsVANS< dim, PropertiesIndex >.
Definition at line 826 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::assemblers, cahn_hilliard, NavierStokesScratchData< dim >::calculate_physical_properties(), StabilizedMethodsTensorCopyData< dim >::cell_is_local, CLS, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, heat_transfer, StabilizedMethodsTensorCopyData< dim >::local_dof_indices, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::previous_solutions, NavierStokesScratchData< dim >::reinit(), NavierStokesScratchData< dim >::reinit_ale(), NavierStokesScratchData< dim >::reinit_cahn_hilliard(), NavierStokesScratchData< dim >::reinit_cls(), NavierStokesScratchData< dim >::reinit_curvature(), NavierStokesScratchData< dim >::reinit_heat_transfer(), NavierStokesScratchData< dim >::reinit_mortar(), NavierStokesScratchData< dim >::reinit_projected_phase_indicator_gradient(), StabilizedMethodsTensorCopyData< dim >::reset(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::sdirk_vectors, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation.
|
protectedvirtual |
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 in FluidDynamicsSharp< dim >, and FluidDynamicsVANS< dim, PropertiesIndex >.
Definition at line 1072 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::assemblers, cahn_hilliard, NavierStokesScratchData< dim >::calculate_physical_properties(), StabilizedMethodsTensorCopyData< dim >::cell_is_local, CLS, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, heat_transfer, StabilizedMethodsTensorCopyData< dim >::local_dof_indices, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::previous_solutions, NavierStokesScratchData< dim >::reinit(), NavierStokesScratchData< dim >::reinit_ale(), NavierStokesScratchData< dim >::reinit_cahn_hilliard(), NavierStokesScratchData< dim >::reinit_cls(), NavierStokesScratchData< dim >::reinit_curvature(), NavierStokesScratchData< dim >::reinit_heat_transfer(), NavierStokesScratchData< dim >::reinit_mortar(), NavierStokesScratchData< dim >::reinit_projected_phase_indicator_gradient(), StabilizedMethodsTensorCopyData< dim >::reset(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::sdirk_vectors, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation.
|
overrideprotectedvirtual |
Assembles the matrix associated with the solver.
Implements PhysicsSolver< GlobalVectorType >.
Reimplemented in FluidDynamicsNitsche< dim, spacedim >, FluidDynamicsSharp< dim >, and FluidDynamicsVANS< dim, PropertiesIndex >.
Definition at line 736 of file fluid_dynamics_matrix_based.cc.
References assemble_local_system_matrix(), cahn_hilliard, CLS, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, copy_local_matrix_to_global_matrix(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, heat_transfer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mortar_coupling_operator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, setup_assemblers(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and system_matrix.
|
overrideprotectedvirtual |
Assemble the rhs associated with the solver.
Implements PhysicsSolver< GlobalVectorType >.
Reimplemented in FluidDynamicsNitsche< dim, spacedim >, FluidDynamicsSharp< dim >, and FluidDynamicsVANS< dim, PropertiesIndex >.
Definition at line 970 of file fluid_dynamics_matrix_based.cc.
References assemble_local_system_rhs(), cahn_hilliard, CLS, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, copy_local_rhs_to_global_rhs(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, heat_transfer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mortar_coupling_operator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, setup_assemblers(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs.
|
protectedvirtual |
Copy local cell information to global matrix.
Reimplemented in FluidDynamicsSharp< dim >, and FluidDynamicsVANS< dim, PropertiesIndex >.
Definition at line 952 of file fluid_dynamics_matrix_based.cc.
References StabilizedMethodsTensorCopyData< dim >::cell_is_local, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dynamic_zero_constraints, StabilizedMethodsTensorCopyData< dim >::local_dof_indices, StabilizedMethodsTensorCopyData< dim >::local_matrix, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.
|
protectedvirtual |
Copy local cell rhs information to global rhs.
Reimplemented in FluidDynamicsSharp< dim >, and FluidDynamicsVANS< dim, PropertiesIndex >.
Definition at line 1197 of file fluid_dynamics_matrix_based.cc.
References StabilizedMethodsTensorCopyData< dim >::cell_is_local, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dynamic_zero_constraints, StabilizedMethodsTensorCopyData< dim >::local_dof_indices, StabilizedMethodsTensorCopyData< dim >::local_rhs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.
|
protected |
Define the zero constraints used to solved the problem that change with other physics' solutions.
It differs from FluidDynamicsMatrixBased::define_zero_constraints as it changes in time depending on the physics' solutions. Currently, it is only used to constraint solid with the temperature's evolution.
Definition at line 288 of file fluid_dynamics_matrix_based.cc.
References CLS, NavierStokesBase< dim, GlobalVectorType, IndexSet >::constrain_stasis_with_temperature(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::constrain_stasis_with_temperature_cls(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dynamic_zero_constraints, heat_transfer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_owned_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_relevant_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, NavierStokesBase< dim, GlobalVectorType, IndexSet >::stasis_constraint_structs, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.
|
protected |
Fix a constant pressure on the minimum dof index. This can be enabled in the simulation control parameters.
Definition at line 330 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_relevant_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::nonzero_constraints, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.
|
overrideprotectedvirtual |
Calculate \( k_i \) from \( u*_i : k_i = \frac{u*_i - u_n}{time_step*a_ii} - \sum{j=1}^{i-1} a_ij * k_j \) Update \( \sum_{i=1}^{N_{stages}} b_i * k_i \).
| stage | An unsigned integer which gives the index of the current stage |
| method | SDIRK methods for now (BDF methods are single stage) |
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 2197 of file fluid_dynamics_matrix_based.cc.
References SDIRKStageData::a_ij, SDIRKStageData::b_i, NavierStokesBase< dim, GlobalVectorType, IndexSet >::local_evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::present_solution, NavierStokesBase< dim, GlobalVectorType, IndexSet >::previous_solutions, sdirk_table(), and NavierStokesBase< dim, GlobalVectorType, IndexSet >::sdirk_vectors.
|
overrideprotectedvirtual |
Update the sum_over_previous_stages variable to use it in the solver.
| stage | An unsigned integer which gives the index of the current stage |
| method | SDIRK method for now (BDF methods are single stage) |
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 2153 of file fluid_dynamics_matrix_based.cc.
References SDIRKStageData::a_ij, sdirk_table(), and NavierStokesBase< dim, GlobalVectorType, IndexSet >::sdirk_vectors.
|
overrideprotectedvirtual |
Sets the initial condition for the solver.
If the simulation is restarted from a checkpoint, the initial solution setting is bypassed and the checkpoint is instead read.
| initial_condition_type | The type of initial condition to be set |
| restart | A boolean that indicates if the simulation is being restarted. if set to true, the initial conditions are never set, but are instead overridden by the read_checkpoint functionality. |
Set the initial condition using a L2 or a viscous solver
Implements NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 1217 of file fluid_dynamics_matrix_based.cc.
References announce_string(), assemble_L2_projection(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::average_velocities, NavierStokesBase< dim, GlobalVectorType, IndexSet >::finish_time_step(), Parameters::L2projection, NavierStokesBase< dim, GlobalVectorType, IndexSet >::local_evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::newton_update, Parameters::nodal, Parameters::Timer::none, PhysicsSolver< GlobalVectorType >::pcout, NavierStokesBase< dim, GlobalVectorType, IndexSet >::present_solution, Parameters::ramp, read_checkpoint(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::set_nodal_values(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::set_solution_from_checkpoint(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, PhysicsSolver< VectorType >::solve_governing_system(), solve_L2_system(), Parameters::SimulationControl::steady, and Parameters::viscous.
|
private |
Set-up AMG preconditioner.
Definition at line 1586 of file fluid_dynamics_matrix_based.cc.
References amg_preconditioner, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, current_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, fluid_dynamics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, system_matrix, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::velocity_fem_degree.
|
protectedvirtual |
sets up the vector of assembler functions
Reimplemented in FluidDynamicsSharp< dim >, and FluidDynamicsVANS< dim, PropertiesIndex >.
Definition at line 382 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::assemblers, NavierStokesBase< dim, GlobalVectorType, IndexSet >::check_existance_of_bc(), Parameters::VelocitySource::darcy_phase_change, BoundaryConditions::function_weak, Parameters::Stabilization::gls, BoundaryConditions::neumann_traction, Parameters::VelocitySource::none, BoundaryConditions::outlet, BoundaryConditions::partial_slip, BoundaryConditions::pressure, Parameters::Stabilization::pspg_supg, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, Parameters::VelocitySource::srf, and time_stepping_is_bdf().
|
overrideprotectedvirtual |
setup_dofs_fd Setup the degree of freedom, system matrix and solution vectors Navier-Stokes problem
Implements NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 65 of file fluid_dynamics_matrix_based.cc.
References amg_preconditioner, NavierStokesBase< dim, GlobalVectorType, IndexSet >::average_velocities, Parameters::average_velocity_profile, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, current_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::define_non_zero_constraints(), define_pressure_constraints(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::define_zero_constraints(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::fe, fluid_dynamics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::get_mapping(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::get_nonzero_constraints(), ilu_preconditioner, initial_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::local_evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_owned_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_relevant_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mortar_coupling_operator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::newton_update, NavierStokesBase< dim, GlobalVectorType, IndexSet >::nonzero_constraints, PhysicsSolver< GlobalVectorType >::pcout, NavierStokesBase< dim, GlobalVectorType, IndexSet >::present_solution, NavierStokesBase< dim, GlobalVectorType, IndexSet >::previous_solutions, NavierStokesBase< dim, GlobalVectorType, IndexSet >::reinit_mortar_operators(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::rotate_rotor_mapping(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::sdirk_vectors, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, system_matrix, NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation.
|
private |
Set-up ILU preconditioner.
Definition at line 1566 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, current_preconditioner_fill_level, fluid_dynamics, ilu_preconditioner, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and system_matrix.
|
overrideprotectedvirtual |
Set-up the appropriate preconditioner.
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 1541 of file fluid_dynamics_matrix_based.cc.
References Parameters::LinearSolver::amg, fluid_dynamics, Parameters::LinearSolver::ilu, setup_AMG(), setup_ILU(), and NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters.
|
virtual |
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 in CFDDEMSolver< dim, PropertiesIndex >, FluidDynamicsNitsche< dim, spacedim >, FluidDynamicsSharp< dim >, and FluidDynamicsVANS< dim, PropertiesIndex >.
Definition at line 2263 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::box_refine_mesh(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, NavierStokesBase< dim, GlobalVectorType, IndexSet >::connect_mortar_weight_signals(), define_dynamic_zero_constraints(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::dynamic_flow_control(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::enable_dynamic_zero_constraints_fd(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::finish_simulation(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::finish_time_step(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::iterate(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::mapping_cache, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, PhysicsSolver< GlobalVectorType >::pcout, NavierStokesBase< dim, GlobalVectorType, IndexSet >::postprocess(), read_mesh_and_manifolds(), read_mesh_and_manifolds_for_stator_and_rotor(), NavierStokesBase< dim, VectorType, DofsType >::refine_mesh(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::rotate_rotor_mapping(), 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, NavierStokesBase< dim, GlobalVectorType, IndexSet >::triangulation, NavierStokesBase< dim, GlobalVectorType, IndexSet >::update_forcing_and_boundary_conditions(), update_mortar_configuration(), update_multiphysics_time_average_solution(), and NavierStokesBase< dim, GlobalVectorType, IndexSet >::velocity_fem_degree.
|
private |
Solver for the L2 Projection linear system at the initial time step to apply this initial condition. It always uses the GMRES solver with ILU(N) by default.
| [in] | absolute_residual | Absolute residual for the solver stopping criterion. |
| [in] | relative_residual | Relative residual for the solver stopping criterion. |
Definition at line 1838 of file fluid_dynamics_matrix_based.cc.
References Parameters::LinearSolver::amg, amg_preconditioner, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, current_preconditioner_fill_level, Parameters::extra_verbose, fluid_dynamics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::get_residual_rescale_metric(), Parameters::LinearSolver::ilu, ilu_preconditioner, initial_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_owned_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::newton_update, NavierStokesBase< dim, GlobalVectorType, IndexSet >::nonzero_constraints, PhysicsSolver< GlobalVectorType >::pcout, Parameters::quiet, setup_preconditioner(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, system_matrix, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs.
|
overrideprotectedvirtual |
Call for the assembly of the linear system of equation.
| initial_step | Indicates if this is the first solution of the linear system. If this is the case, the non_zero version of the constraints are used for the Dirichlet boundary conditions |
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 1505 of file fluid_dynamics_matrix_based.cc.
References Parameters::LinearSolver::bicgstab, Parameters::LinearSolver::direct, fluid_dynamics, Parameters::LinearSolver::gmres, NavierStokesBase< dim, GlobalVectorType, IndexSet >::rescale_pressure_dofs_in_newton_update(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, solve_system_BiCGStab(), solve_system_direct(), and solve_system_GMRES().
|
private |
BiCGStab solver with ILU(N) preconditioning.
| [in] | absolute_residual | Absolute residual for the solver stopping criterion. |
| [in] | relative_residual | Relative residual for the solver stopping criterion. |
Definition at line 1986 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, current_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dynamic_zero_constraints, Parameters::extra_verbose, fluid_dynamics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::get_residual_rescale_metric(), Parameters::LinearSolver::ilu, ilu_preconditioner, initial_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_owned_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::newton_update, PhysicsSolver< GlobalVectorType >::pcout, Parameters::quiet, setup_preconditioner(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, system_matrix, NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.
|
private |
Direct solver using TrilinosWrappers::SolverDirect The use of this solver should be avoided for 3D problems.
Definition at line 2115 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::dynamic_zero_constraints, fluid_dynamics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::get_residual_rescale_metric(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_owned_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::newton_update, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, system_matrix, NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.
|
private |
GMRES solver with ILU(N) preconditioning or AMG preconditioning.
| [in] | absolute_residual | Absolute residual for the solver stopping criterion. |
| [in] | relative_residual | Relative residual for the solver stopping criterion. |
Definition at line 1658 of file fluid_dynamics_matrix_based.cc.
References Parameters::LinearSolver::amg, amg_preconditioner, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, current_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::dynamic_zero_constraints, Parameters::extra_verbose, fluid_dynamics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::get_residual_rescale_metric(), Parameters::LinearSolver::ilu, ilu_preconditioner, initial_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_owned_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::newton_update, PhysicsSolver< GlobalVectorType >::pcout, Parameters::quiet, setup_preconditioner(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, system_matrix, NavierStokesBase< dim, GlobalVectorType, IndexSet >::system_rhs, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::zero_constraints.
|
overrideprotectedvirtual |
Update mortar configuration.
When the rotor domain is rotated, the mortar cells need to be reinitialized according to the new rotor-stator interface configuration.
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 207 of file fluid_dynamics_matrix_based.cc.
References amg_preconditioner, NavierStokesBase< dim, GlobalVectorType, IndexSet >::computing_timer, current_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::define_non_zero_constraints(), define_pressure_constraints(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::define_zero_constraints(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::dof_handler, NavierStokesBase< dim, GlobalVectorType, IndexSet >::get_nonzero_constraints(), ilu_preconditioner, initial_preconditioner_fill_level, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_owned_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::locally_relevant_dofs, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mortar_coupling_operator, NavierStokesBase< dim, GlobalVectorType, IndexSet >::mpi_communicator, Parameters::MeshAdaptation::none, NavierStokesBase< dim, GlobalVectorType, IndexSet >::reinit_mortar_operators(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::rotate_rotor_mapping(), NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_control, NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters, and system_matrix.
|
overrideprotectedvirtual |
\( u_{n+1} = u_n + time_step * \sum_{i=1}^{N_{stages}} b_i * k_i \)
| time_step | The current time step to build the solution at the next time step |
Reimplemented from NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 2243 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::local_evaluation_point, NavierStokesBase< dim, GlobalVectorType, IndexSet >::present_solution, NavierStokesBase< dim, GlobalVectorType, IndexSet >::previous_solutions, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::sdirk_vectors.
|
overrideprotectedvirtual |
Updates the average velocity field solution in the multiphyscics interface.
Implements NavierStokesBase< dim, GlobalVectorType, IndexSet >.
Definition at line 273 of file fluid_dynamics_matrix_based.cc.
References NavierStokesBase< dim, GlobalVectorType, IndexSet >::average_velocities, Parameters::average_velocity_profile, fluid_dynamics, NavierStokesBase< dim, GlobalVectorType, IndexSet >::multiphysics, and NavierStokesBase< dim, GlobalVectorType, IndexSet >::simulation_parameters.
|
private |
Definition at line 318 of file fluid_dynamics_matrix_based.h.
|
private |
Definition at line 319 of file fluid_dynamics_matrix_based.h.
|
private |
Definition at line 317 of file fluid_dynamics_matrix_based.h.
|
private |
Definition at line 320 of file fluid_dynamics_matrix_based.h.
|
private |
Definition at line 316 of file fluid_dynamics_matrix_based.h.
|
protected |
Members
Definition at line 313 of file fluid_dynamics_matrix_based.h.