![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <navier_stokes_base.h>
Classes | |
| struct | SDIRKVectors |
Protected Member Functions | |
| NavierStokesBase (SimulationParameters< dim > &nsparam, const FluidDynamicsFormulation fluid_dynamics_formulation=FluidDynamicsFormulation::standard) | |
| virtual | ~NavierStokesBase ()=default |
| virtual VectorType & | get_evaluation_point () override |
| virtual VectorType & | get_local_evaluation_point () override |
| virtual VectorType & | get_newton_update () override |
| virtual VectorType & | get_present_solution () override |
| virtual VectorType & | 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 | setup_dofs_fd ()=0 |
| virtual void | update_mortar_configuration () |
| virtual void | update_multiphysics_time_average_solution ()=0 |
| virtual void | update_solutions_for_multiphysics () |
| virtual void | update_solutions_for_fluid_dynamics () |
| virtual void | set_initial_condition_fd (Parameters::FluidDynamicsInitialConditionType initial_condition_type, bool restart=false)=0 |
| void | postprocessing_forces (const VectorType &evaluation_point) |
| void | postprocessing_torques (const VectorType &evaluation_point) |
| virtual void | dynamic_flow_control () |
| virtual void | multi_stage_preresolution (unsigned int stage, Parameters::SimulationControl::TimeSteppingMethod method) |
| virtual void | multi_stage_postresolution (unsigned int stage, Parameters::SimulationControl::TimeSteppingMethod method, double time_step) |
| virtual void | update_multi_stage_solution (double time_step) |
| 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, VectorType > &solution_transfer, std::vector< SolutionTransfer< dim, VectorType > > &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, VectorType > > | gather_output_hook () |
| void | gather_output_results (const VectorType &solution, std::vector< OutputStruct< dim, VectorType > > &solution_output_structs) |
| void | write_output_results (const VectorType &solution) |
| void | write_output_forces () |
| void | write_output_torques () |
| void | rescale_pressure_dofs_in_newton_update () |
| VectorType | init_temporary_vector () |
| void | verify_consistency_of_boundary_conditions () |
Protected Attributes | |
| DofsType | locally_owned_dofs |
| DofsType | 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 |
| VectorType | evaluation_point |
| VectorType | local_evaluation_point |
| VectorType | newton_update |
| std::shared_ptr< VectorType > | present_solution |
| VectorType | system_rhs |
| std::shared_ptr< std::vector< VectorType > > | 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, VectorType, DofsType > > | average_velocities |
| VectorType | 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 |
Additional Inherited Members | |
| Public Member Functions inherited from PhysicsSolver< VectorType > | |
| PhysicsSolver (const Parameters::NonLinearSolver non_linear_solver_parameters) | |
| PhysicsSolver () | |
| virtual | ~PhysicsSolver () |
| virtual void | assemble_system_matrix ()=0 |
| virtual void | assemble_system_rhs ()=0 |
| virtual void | setup_preconditioner ()=0 |
| virtual void | solve_linear_system ()=0 |
| 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 |
| Public Attributes inherited from PhysicsSolver< VectorType > | |
| ConditionalOStream | pcout |
| Parameters::SimulationControl::TimeSteppingMethod | time_stepping_method |
A base class for all the Navier-Stokes equation This class regroups common facilities that are shared by all the Navier-Stokes implementations to reduce code multiplicity
| dim | An integer that denotes the dimension of the space in which the flow is solved |
| VectorType | The Vector type used for the solvers |
| DofsType | the type of dof storage indices |
Definition at line 120 of file navier_stokes_base.h.
|
protected |
Construct the Navier-Stokes base and the multiphysics interface.
| [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 49 of file navier_stokes_base.cc.
References computing_timer, dof_handler, flow_control, fluid_dynamics, mesh_controller, mpi_communicator, n_mpi_processes, number_quadrature_points, PhysicsSolver< VectorType >::pcout, PhysicsSolver< VectorType >::physics_solving_strategy, PhysicsSolver< VectorType >::PhysicsSolver(), pressure_fem_degree, simulation_parameters, this_mpi_process, and velocity_fem_degree.
|
protectedvirtualdefault |
|
inlineprotected |
Indicate whether the time-averaged velocity object holds vectors that must be preserved. The averaging is used either when it is explicitly requested through the post-processing parameters or when the initial condition is an average velocity profile, which is read back from a checkpoint. This condition must be identical everywhere the average velocity vectors are serialized, deserialized or transferred to a new mesh partition, otherwise the accumulated sums are silently lost.
Definition at line 497 of file navier_stokes_base.h.
References simulation_parameters.
|
protected |
Allow the initial refinement of all cells of the principal mesh that are partially contained in one of the cells of the box refinement mesh given in the parameter.
| restart | Indicator if the simulation is being restarted or not. |
Definition at line 828 of file navier_stokes_base.cc.
|
inlineprotected |
Checks and identifies if the cell is located in the constraining domain defined by a plane with its outward-pointing normal vector. The check is done through a scalar product between a vector formed by a vertex of the cell to @plane_point and @plane_normal_vector. If one of the vertices of the cell results in a negative scalar product result, the cell is excluded from the constrained domain.
| [in] | cell | Pointer to an active cell of the fluid dynamics DoFHandler. |
| [in] | plane_point | Coordinates of a point on the restriction plane for the stasis constraint application domain. |
| [in] | plane_normal_vector | Outward-pointing normal vector to define the restriction plane for the stasis constraint application domain. |
true) or not (false). Definition at line 668 of file navier_stokes_base.h.
|
protected |
Check if a specifique boundary condition exist.
| bc,the | boundary type that we want to check if it exists |
Definition at line 270 of file navier_stokes_base.cc.
References simulation_parameters.
|
protected |
Connect weight signals for load balancing of mortar cells. Cells touching mortar boundaries can be assigned assigned higher weight for better load distribution across processors.
Definition at line 3277 of file navier_stokes_base.cc.
References simulation_parameters, and triangulation.
|
protected |
Constrain a fluid's subdomains according to the temperature field to null velocity and pressure fields to model solid subdomains.
| [in] | dof_handler_ht | DoFHandler of the Heat Transfer (HT) auxiliary physic. |
Definition at line 2369 of file navier_stokes_base.cc.
References cell_in_constraining_domain(), cell_quadrature, dof_handler, fe, get_cell_temperature_values(), heat_transfer, identify_cell_and_constrain_velocity(), multiphysics, simulation_parameters, and stasis_constraint_structs.
|
protected |
Constrain fluids' subdomains according to the temperature field to null velocity and pressure fields to model solid subdomains in Volume of Fluid (CLS) simulations.
| [in] | dof_handler_cls | DoFHandler of the CLS auxiliary physic. |
| [in] | dof_handler_ht | DoFHandler of the Heat Transfer (HT) auxiliary physic. |
Definition at line 2422 of file navier_stokes_base.cc.
References cell_in_constraining_domain(), cell_quadrature, CLS, dof_handler, fe, get_cell_filtered_phase_indicator_values(), get_cell_temperature_values(), heat_transfer, identify_cell_and_constrain_velocity(), multiphysics, simulation_parameters, and stasis_constraint_structs.
|
protected |
Define the non-zero constraints used to solve the problem.
Definition at line 1801 of file navier_stokes_base.cc.
References dof_handler, fe, BoundaryConditions::function, get_mapping(), get_nonzero_constraints(), locally_relevant_dofs, make_solid_domain(), nonzero_constraints, BoundaryConditions::noslip, BoundaryConditions::periodic, pressure, simulation_control, simulation_parameters, BoundaryConditions::slip, and use_manifold_for_normal.
|
protected |
Define the zero constraints used to solve the problem.
TODO ADD ASSERTION for the default case here.
Definition at line 1914 of file navier_stokes_base.cc.
References dof_handler, fe, BoundaryConditions::function, BoundaryConditions::function_weak, get_mapping(), locally_relevant_dofs, make_solid_domain(), BoundaryConditions::neumann_traction, BoundaryConditions::none, BoundaryConditions::noslip, BoundaryConditions::outlet, BoundaryConditions::partial_slip, BoundaryConditions::periodic, BoundaryConditions::pressure, pressure, simulation_parameters, BoundaryConditions::slip, use_manifold_for_normal, and zero_constraints.
|
protectedvirtual |
If set to enable, dynamic_flow_control allows to control the flow by executing space-average velocity and beta coefficient force calculation at each time step.
Reimplemented in CFDDEMMatrixFree< dim, PropertiesIndex >, and CFDDEMSolver< dim, PropertiesIndex >.
Definition at line 231 of file navier_stokes_base.cc.
References announce_string(), calculate_average_velocity(), dof_handler, flow_control, PhysicsSolver< VectorType >::pcout, present_solution, simulation_control, simulation_parameters, Parameters::SimulationControl::steady, and Parameters::verbose.
|
protectedvirtual |
Enable the use of dynamic zero constraints by initializing required FEValues objects.
Definition at line 762 of file navier_stokes_base.cc.
References simulation_parameters.
|
inlineprotected |
Finish the simulation by calling all the post-processing elements that are required.
Generic interface routine to allow the CFD solver to cooperate with the multiphysics modules
Definition at line 207 of file navier_stokes_base.h.
References finish_simulation_fd(), and multiphysics.
|
protected |
Finishes the simulation for fluid dynamics by calling the post-processing elements that are required.
Definition at line 504 of file navier_stokes_base.cc.
References error_table, simulation_parameters, Parameters::SimulationControl::steady, write_output_forces(), and write_output_torques().
|
protectedvirtual |
Finishes the time step of the fluid dynamics. Post-processing and time stepping.
Key physics component for fluid dynamics
Definition at line 572 of file navier_stokes_base.cc.
References computing_timer, simulation_parameters, and Parameters::SimulationControl::steady.
|
protectedvirtual |
Gather and return vector of output structs that are particular to some applications.
Reimplemented in FluidDynamicsSharp< dim >, FluidDynamicsVANS< dim, PropertiesIndex >, and FluidDynamicsVANSMatrixFree< dim, PropertiesIndex >.
Definition at line 2534 of file navier_stokes_base.cc.
|
protected |
Gather solution information to generate output results.
| [in] | solution | Vector of the present solution |
| [in,out] | solution_output_structs | Vector of OutputStructs that will be used to write the output results as VTU files |
Definition at line 2541 of file navier_stokes_base.cc.
References average_velocities, Parameters::average_velocity_profile, dof_handler, gather_output_hook(), simulation_parameters, Parameters::VelocitySource::srf, and triangulation.
|
protectedvirtual |
Returns a vector of references to TableHandler objects that needs to be serialized/ deserialized for a given solver.
Reimplemented in CFDDEMMatrixFree< dim, PropertiesIndex >, CFDDEMSolver< dim, PropertiesIndex >, and FluidDynamicsNitsche< dim, spacedim >.
Definition at line 3000 of file navier_stokes_base.cc.
References Parameters::PostProcessing< dim >::apparent_viscosity_output_name, apparent_viscosity_table, Parameters::PostProcessing< dim >::calculate_apparent_viscosity, Parameters::PostProcessing< dim >::calculate_enstrophy, Parameters::PostProcessing< dim >::calculate_flow_rate, Parameters::PostProcessing< dim >::calculate_kinetic_energy, Parameters::PostProcessing< dim >::calculate_pressure_drop, Parameters::PostProcessing< dim >::calculate_pressure_power, Parameters::PostProcessing< dim >::calculate_viscous_dissipation, Parameters::PostProcessing< dim >::enstrophy_output_name, enstrophy_table, error_table, Parameters::PostProcessing< dim >::flow_rate_output_name, flow_rate_table, forces_tables, Parameters::PostProcessing< dim >::kinetic_energy_output_name, kinetic_energy_table, Parameters::PostProcessing< dim >::pressure_drop_output_name, pressure_drop_table, Parameters::PostProcessing< dim >::pressure_power_output_name, pressure_power_table, simulation_parameters, torques_tables, Parameters::PostProcessing< dim >::viscous_dissipation_output_name, and viscous_dissipation_table.
|
inlineprotected |
Get cell's local filtered phase indicator values at quadrature points.
| [in] | cell | Pointer to an active cell of the fluid dynamics DoFHandler. |
| [in] | dof_handler_cls | DoFHandler of the Conservative Level Set (CLS) auxiliary physic. |
| [in] | filtered_phase_indicator_solution | Filtered phase indicator solution vector from the CLS auxiliary physic. |
| [out] | local_filtered_phase_indicator_values | Cell's local filtered phase indicator values at quadrature points. |
Definition at line 732 of file navier_stokes_base.h.
References fe_values_cls, and triangulation.
|
inlineprotected |
Get cell's local temperature values at quadrature points.
| [in] | cell | Pointer to an active cell of the fluid dynamics DoFHandler. |
| [in] | dof_handler_ht | DoFHandler of the Heat Transfer (HT) auxiliary physic. |
| [in] | temperature_solution | Temperature solution vector from the HT auxiliary physic. |
| [out] | local_temperature_values | Cell's local temperature values at quadrature points. |
Definition at line 702 of file navier_stokes_base.h.
References fe_values_temperature, and triangulation.
|
inlineoverrideprotectedvirtual |
Getter methods to get the private attributes for the physic currently solved.
| current_physics_id | Indicates the number associated with the physic currently solved. If the solver is only solving for a fluid dynamics problem, then the value will always be PhysicsID::fluid_dynamics. |
Implements PhysicsSolver< VectorType >.
Definition at line 145 of file navier_stokes_base.h.
References evaluation_point.
|
inlineoverrideprotectedvirtual |
Implements PhysicsSolver< VectorType >.
Definition at line 150 of file navier_stokes_base.h.
References local_evaluation_point.
|
inlineprotected |
Returns the mapping shared pointer. A MappingQCache is necessary for prescribed rotation in rotor-stator configurations.
Definition at line 560 of file navier_stokes_base.h.
References mapping, mapping_cache, and simulation_parameters.
|
inlineoverrideprotectedvirtual |
Implements PhysicsSolver< VectorType >.
Definition at line 155 of file navier_stokes_base.h.
References newton_update.
|
inlineoverrideprotectedvirtual |
Implements PhysicsSolver< VectorType >.
Definition at line 170 of file navier_stokes_base.h.
References nonzero_constraints.
|
inlineoverrideprotectedvirtual |
Implements PhysicsSolver< VectorType >.
Definition at line 160 of file navier_stokes_base.h.
References present_solution.
|
inlineoverrideprotectedvirtual |
Return the metric for residual rescaling. By default, should return 1. If the rescale_residual_by_volume is set to true, the method returns the global volume of the triangulation.
Implements PhysicsSolver< VectorType >.
Definition at line 189 of file navier_stokes_base.h.
References fluid_dynamics, mapping, simulation_parameters, and triangulation.
|
inlineoverrideprotectedvirtual |
Implements PhysicsSolver< VectorType >.
Definition at line 165 of file navier_stokes_base.h.
References system_rhs.
|
protected |
Identify if temperature DOFs of the cell are within the constraining range. If they are, velocity DOFs of the cell are constrained.
| [in] | local_dof_indices | Vector of a cell's local DOF indices. |
| [in] | local_temperature_values | Cell's local temperature values at quadrature points. |
| [in,out] | stasis_constraint_struct | Struct containing flagged DOF containers, temperature range information and fluid id. |
Definition at line 2513 of file navier_stokes_base.cc.
References constrain_solid_cell_velocity_dofs(), dynamic_zero_constraints, fe, StasisConstraintWithTemperature::max_solid_temperature, StasisConstraintWithTemperature::min_solid_temperature, and temperature.
|
inlineprotected |
This function initializes correctly a temporary vector depending on the vector type.
Definition at line 3258 of file navier_stokes_base.cc.
References locally_owned_dofs, and locally_relevant_dofs.
|
protectedvirtual |
Do a regular CFD iteration.
Reimplemented in FluidDynamicsVANS< dim, PropertiesIndex >.
Definition at line 660 of file navier_stokes_base.cc.
References announce_string(), SDIRKTable::c, fluid_dynamics, SimulationControl::get_number_of_stages(), multi_stage_postresolution(), multi_stage_preresolution(), multiphysics, PhysicsSolver< VectorType >::pcout, Parameters::quiet, sdirk_table(), sdirk_vectors, set_specified_fluid_dynamics_solution(), simulation_control, simulation_parameters, PhysicsSolver< VectorType >::solve_governing_system(), update_forcing_and_boundary_conditions(), update_multi_stage_solution(), and update_solutions_for_multiphysics().
|
protected |
Turn regions of the mesh where the material_id>0 into a solid block by injecting velocity and pressure DOFs into the zero constraints.
It is achieved by imposing \(\mathbf{u}=0\) within the cells which have a material_id>0. In addition, solid cells which are not connected to the fluid by any means also get a pressure Dirichlet boundary condition which fixes the pressure to 0. It ensures that the linear system is well-posed. Right now, this routine only supports the usage of 1 solid domain, but eventually it could be extended to more than one. By default, the fluid domain is assumed to have a material_id=0 and the rest of the domains have a material_id>0.
| [in] | dof_handler | DoFHandler for which the solid region is established. In the majority of cases this is the DoFHandler that is a member of this class, but if a multigrid preconditioner, constraints must be built at every level. In this case, this DoFHandler can be the DoFHandler at any of the multigrid level. |
| [in] | non_zero_constraints | If this parameter is true, it indicates that non-zero constraints are being constrained for the solid domain. If this is set to false, homogeneous constraints are constrained in the solid domain. |
| [in] | constraints | Set of constraints on which the solid domain constraint is applied. These constraints can be either zero or non-zero constraints, which is decided by the non_zero_constraints flag. |
Definition at line 2349 of file navier_stokes_base.cc.
References dof_handler, establish_solid_domain(), locally_owned_dofs, and simulation_parameters.
|
protectedvirtual |
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 method for now (BDF methods are single stage) |
| time_step | The current time step to build the solution at the next time step |
Reimplemented in FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, and FluidDynamicsMatrixFree< dim >.
Definition at line 621 of file navier_stokes_base.cc.
|
protectedvirtual |
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 in FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, and FluidDynamicsMatrixFree< dim >.
Definition at line 613 of file navier_stokes_base.cc.
|
overrideprotectedvirtual |
Output the L2 and Linfty norms of the correction vector.
Implements PhysicsSolver< VectorType >.
Definition at line 3181 of file navier_stokes_base.cc.
References computing_timer, dof_handler, fe, mpi_communicator, newton_update, PhysicsSolver< VectorType >::pcout, and pressure.
|
protectedvirtual |
finish_time_step Finishes the time step of the fluid dynamics Post-processing and time stepping
Definition at line 560 of file navier_stokes_base.cc.
References present_solution, and previous_solutions.
|
inlineprotectedvirtual |
Post-process simulation after an iteration.
| first_iteration | Indicator if the simulation is at its first simulation or not. |
Definition at line 219 of file navier_stokes_base.h.
References multiphysics, postprocess_fd(), present_solution, simulation_control, and write_output_results().
|
protectedvirtual |
Post-process fluid dynamics after an iteration.
Reimplemented in CFDDEMMatrixFree< dim, PropertiesIndex >, CFDDEMSolver< dim, PropertiesIndex >, and FluidDynamicsSharp< dim >.
Definition at line 1292 of file navier_stokes_base.cc.
References announce_string(), apparent_viscosity_table, average_velocities, calculate_apparent_viscosity(), calculate_enstrophy(), calculate_flow_rate(), calculate_kinetic_energy(), calculate_L2_error(), calculate_pressure_drop(), calculate_pressure_power(), calculate_viscous_dissipation(), cell_quadrature, computing_timer, dof_handler, enstrophy_table, error_table, exact_solution, face_quadrature, flow_rate_table, get_mapping(), kinetic_energy_table, local_evaluation_point, mapping, multiphysics, PhysicsSolver< VectorType >::pcout, postprocessing_forces(), postprocessing_torques(), present_solution, pressure, pressure_drop_table, pressure_power_table, simulation_control, simulation_parameters, Parameters::SimulationControl::steady, triangulation, velocity, Parameters::verbose, viscous_dissipation_table, write_output_forces(), and write_output_torques().
|
protected |
Post-processing function Outputs the forces acting on each boundary condition.
End of key physics components for fluid dynamics
Definition at line 289 of file navier_stokes_base.cc.
References computing_timer, and evaluation_point.
|
protected |
Post-processing function Outputs the torque acting on each boundary condition.
Definition at line 425 of file navier_stokes_base.cc.
References computing_timer, and evaluation_point.
|
protectedvirtual |
Restart a previous simulation from a checkpoint file.
Reimplemented in CFDDEMMatrixFree< dim, PropertiesIndex >, CFDDEMSolver< dim, PropertiesIndex >, FluidDynamicsNitsche< dim, spacedim >, and FluidDynamicsSharp< dim >.
Definition at line 2198 of file navier_stokes_base.cc.
References computing_timer, deserialize_tables_vector(), flow_control, gather_tables(), mpi_communicator, multiphysics, pvdhandler, pvdhandler_boundary, set_solution_from_checkpoint(), simulation_control, and simulation_parameters.
|
protectedvirtual |
Allow the refinement of the mesh according to one of the 2 methods proposed.
Reimplemented in FluidDynamicsNitsche< dim, spacedim >.
Definition at line 811 of file navier_stokes_base.cc.
References simulation_control.
|
protected |
Allow the refinement of the mesh based on an error estimator.
Definition at line 945 of file navier_stokes_base.cc.
References average_velocities, average_velocities_are_enabled(), computing_timer, connect_mortar_weight_signals(), dof_handler, face_quadrature, fe, Parameters::MeshAdaptation::fraction, get_mapping(), Parameters::MultipleAdaptationParameters::kelly, locally_owned_dofs, locally_relevant_dofs, mapping, mapping_cache, mesh_controller, mpi_communicator, multiphysics, Parameters::MeshAdaptation::number, present_solution, pressure, previous_solutions, setup_dofs(), simulation_parameters, transfer_solution(), triangulation, and velocity.
|
protected |
Allow the uniform refinement of all the mesh.
Definition at line 1192 of file navier_stokes_base.cc.
References average_velocities, average_velocities_are_enabled(), computing_timer, connect_mortar_weight_signals(), dof_handler, mapping, mapping_cache, multiphysics, present_solution, previous_solutions, setup_dofs(), simulation_parameters, transfer_solution(), and triangulation.
|
protected |
Initialize mortar coupling manager, operator, and evaluator.
Definition at line 2032 of file navier_stokes_base.cc.
References cell_quadrature, Parameters::Mortar< dim >::circular, computing_timer, dof_handler, get_mapping(), Parameters::Mortar< dim >::linear, mortar_coupling_evaluator, mortar_coupling_operator, mortar_manager, simulation_parameters, and zero_constraints.
|
protected |
This function is used to rescale pressure DOFs in the newton correction.
Definition at line 3133 of file navier_stokes_base.cc.
References computing_timer, dof_handler, fe, newton_update, and simulation_parameters.
|
protected |
Restore the state of the time-averaged velocity object after its vectors have been deserialized.
The deserialization fills the vectors with locally_relevant (owned + ghost), since only those are serialized, whereas the averaging routines accumulate into the locally owned vectors. The locally owned vectors must therefore be reset from their locally_relevant version after a checkpoint, otherwise the averaging silently restarts from zero. The checkpointed average is also discarded here if the initial time for averaging has not been reached yet, which lets a simulation be restarted with a later averaging start time.
This function must be called at the end of every read_checkpoint() implementation that deserializes the average velocity vectors.
Definition at line 2318 of file navier_stokes_base.cc.
References average_velocities, average_velocities_are_enabled(), Parameters::average_velocity_profile, PhysicsSolver< VectorType >::pcout, simulation_control, and simulation_parameters.
|
protected |
Rotate rotor mapping in mortar method.
| [in] | is_first | Whether this is the first mapping rotation. This boolean is used only for printing output purposes; since the mapping needs to be rotated before setting up dofs, but also after the constraints are first defined, this function is called twice before the iterate() loop. The parameter is_first just prevents the mortar verbosity from being printed twice |
Definition at line 2080 of file navier_stokes_base.cc.
References announce_string(), Parameters::Mortar< dim >::circular, computing_timer, dof_handler, Parameters::extra_verbose, Parameters::Mortar< dim >::linear, mapping, mapping_cache, mortar_workload_imbalance(), PhysicsSolver< VectorType >::pcout, LetheGridTools::rotate_mapping(), simulation_control, simulation_parameters, triangulation, and Parameters::verbose.
|
inlineprotectedvirtual |
Set the initial condition.
| initial_condition_type | Type of method use to impose initial condition. |
| restart | Indicator if the simulation is being restarted or not. |
Reimplemented in CFDDEMMatrixFree< dim, PropertiesIndex >, and CFDDEMSolver< dim, PropertiesIndex >.
Definition at line 255 of file navier_stokes_base.h.
References multiphysics, postprocess_fd(), present_solution, refine_mesh(), set_initial_condition_fd(), simulation_control, simulation_parameters, and write_output_results().
|
protectedpure virtual |
Implemented in FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, and FluidDynamicsMatrixFree< dim >.
References evaluation_point.
|
protected |
Set the nodal values of velocity and pressure.
Definition at line 1755 of file navier_stokes_base.cc.
References dof_handler, get_mapping(), Parameters::SimulationControl::initial_solution, newton_update, nonzero_constraints, present_solution, pressure, previous_solutions, and simulation_parameters.
|
protectedvirtual |
Read the solution from a checkpoint file and set it as the current solution.
Definition at line 2233 of file navier_stokes_base.cc.
References average_velocities, average_velocities_are_enabled(), check_file_exists(), dof_handler, enable_dynamic_zero_constraints_fd(), locally_owned_dofs, locally_relevant_dofs, mpi_communicator, present_solution, previous_solutions, restore_average_velocities_after_checkpoint(), setup_dofs(), and triangulation.
|
protectedvirtual |
Specify the fluid dynamics solution instead of solving for it.
When the fluid dynamics is disabled (fluid dynamics = false in the multiphysics subsection), the velocity and the pressure fields are not solved for, but rather imposed. They are either taken from the average velocity profile or re-established from the initial condition, which may be time-dependent.
Definition at line 634 of file navier_stokes_base.cc.
References average_velocities, Parameters::average_velocity_profile, local_evaluation_point, present_solution, and simulation_parameters.
|
inlineprotectedvirtual |
Initialize the degree of freedom and the memory associated with them for fluid dynamics and enabled auxiliary physics.
Reimplemented in FluidDynamicsVANS< dim, PropertiesIndex >, and FluidDynamicsVANSMatrixFree< dim, PropertiesIndex >.
Definition at line 238 of file navier_stokes_base.h.
References multiphysics, setup_dofs_fd(), and verify_consistency_of_boundary_conditions().
|
protectedpure virtual |
Initialize the dofs for fluid dynamics.
Implemented in FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, and FluidDynamicsMatrixFree< dim >.
|
protected |
Transfer solution after mesh refinement.
Definition at line 1255 of file navier_stokes_base.cc.
References average_velocities, average_velocities_are_enabled(), init_temporary_vector(), multiphysics, nonzero_constraints, present_solution, previous_solutions, and update_multiphysics_time_average_solution().
|
protected |
Update non-zero constraints if the boundary is time dependent. Note: not implemented for the block fluid dynamics application.
Definition at line 2147 of file navier_stokes_base.cc.
References define_non_zero_constraints(), BoundaryConditions::function, BoundaryConditions::function_weak, local_evaluation_point, BoundaryConditions::neumann_traction, nonzero_constraints, BoundaryConditions::partial_slip, present_solution, BoundaryConditions::pressure, simulation_control, and simulation_parameters.
|
protectedvirtual |
Set the time of the forcing function and of the time-dependent boundary conditions to the current time of the simulation control, and re-impose the non-zero constraints on the present solution.
This is called at the beginning of every time step and, for multi-stage (SDIRK) methods, at every stage so that the forcing and the boundary conditions are evaluated at the stage time \(t_n + c_i \Delta t\).
Reimplemented in FluidDynamicsMatrixFree< dim >.
Definition at line 749 of file navier_stokes_base.cc.
References forcing_function, simulation_control, and update_boundary_conditions().
|
inlineprotectedvirtual |
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 in FluidDynamicsMatrixBased< dim >, and FluidDynamicsMatrixFree< dim >.
Definition at line 329 of file navier_stokes_base.h.
|
protectedvirtual |
\( 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 in FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, and FluidDynamicsMatrixFree< dim >.
Definition at line 629 of file navier_stokes_base.cc.
|
protectedpure virtual |
Update the time average velocity field solution.
Implemented in FluidDynamicsBlock< dim >, FluidDynamicsMatrixBased< dim >, and FluidDynamicsMatrixFree< dim >.
|
inlineprotectedvirtual |
Required only for the matrix-free solver to update multiphysics solutions within iterate function.
Reimplemented in FluidDynamicsMatrixFree< dim >.
Definition at line 349 of file navier_stokes_base.h.
|
inlineprotectedvirtual |
Required only for the matrix-free solver to update solutions within iterate function.
Reimplemented in FluidDynamicsMatrixFree< dim >.
Definition at line 342 of file navier_stokes_base.h.
|
inlineprotected |
Verify consistency of the input parameters for boundary conditions to ensure that for every boundary condition within the triangulation, a boundary condition has been specified in the input file.
Definition at line 870 of file navier_stokes_base.h.
References simulation_parameters, and triangulation.
|
protectedvirtual |
Write the checkpoint.
Reimplemented in CFDDEMMatrixFree< dim, PropertiesIndex >, CFDDEMSolver< dim, PropertiesIndex >, FluidDynamicsNitsche< dim, spacedim >, and FluidDynamicsSharp< dim >.
Definition at line 3070 of file navier_stokes_base.cc.
References average_velocities, average_velocities_are_enabled(), computing_timer, dof_handler, flow_control, gather_tables(), mpi_communicator, multiphysics, present_solution, previous_solutions, pvdhandler, pvdhandler_boundary, serialize_tables_vector(), simulation_control, simulation_parameters, and triangulation.
|
protected |
Writes the forces per boundary condition to a text file output.
Definition at line 2958 of file navier_stokes_base.cc.
References computing_timer, forces_tables, simulation_parameters, and this_mpi_process.
|
protected |
Generate post-processing parallel VTU files from vector of solution_output_struct.
| [in] | solution | Vector of present solution |
Definition at line 2794 of file navier_stokes_base.cc.
References computing_timer, dof_handler, gather_output_results(), get_mapping(), mpi_communicator, multiphysics, present_solution, pvdhandler, pvdhandler_boundary, simulation_control, simulation_parameters, velocity_fem_degree, write_boundaries_vtu_and_pvd(), and write_vtu_and_pvd().
|
protected |
Writes the torques per boundary condition to a text file output.
Definition at line 2979 of file navier_stokes_base.cc.
References computing_timer, simulation_parameters, this_mpi_process, and torques_tables.
|
protected |
Definition at line 987 of file navier_stokes_base.h.
|
protected |
Definition at line 974 of file navier_stokes_base.h.
|
protected |
Definition at line 992 of file navier_stokes_base.h.
|
protected |
Definition at line 991 of file navier_stokes_base.h.
|
protected |
Definition at line 961 of file navier_stokes_base.h.
|
protected |
Definition at line 897 of file navier_stokes_base.h.
|
protected |
Definition at line 894 of file navier_stokes_base.h.
|
protected |
Dynamic homogeneous constraints used for temperature-dependent solid domain constraints
Definition at line 1016 of file navier_stokes_base.h.
|
protected |
Definition at line 983 of file navier_stokes_base.h.
|
protected |
Definition at line 998 of file navier_stokes_base.h.
|
protected |
Definition at line 919 of file navier_stokes_base.h.
|
protected |
Definition at line 904 of file navier_stokes_base.h.
|
protected |
Definition at line 962 of file navier_stokes_base.h.
|
protected |
Definition at line 895 of file navier_stokes_base.h.
|
protected |
FEValues object used for temperature-dependent solid domain constraints in CLS simulations
Definition at line 1010 of file navier_stokes_base.h.
|
protected |
FEValues object used for temperature-dependent solid domain constraints.
Definition at line 1007 of file navier_stokes_base.h.
|
protected |
Definition at line 908 of file navier_stokes_base.h.
|
protected |
Definition at line 989 of file navier_stokes_base.h.
|
protected |
Definition at line 1002 of file navier_stokes_base.h.
|
protected |
Definition at line 1003 of file navier_stokes_base.h.
|
protected |
Definition at line 905 of file navier_stokes_base.h.
|
protected |
Definition at line 986 of file navier_stokes_base.h.
|
protected |
Definition at line 920 of file navier_stokes_base.h.
|
protected |
Definition at line 886 of file navier_stokes_base.h.
|
protected |
Definition at line 887 of file navier_stokes_base.h.
|
protected |
Definition at line 960 of file navier_stokes_base.h.
|
protected |
Definition at line 971 of file navier_stokes_base.h.
|
protected |
Definition at line 995 of file navier_stokes_base.h.
|
protected |
Definition at line 968 of file navier_stokes_base.h.
|
protected |
Definition at line 966 of file navier_stokes_base.h.
|
protected |
Definition at line 965 of file navier_stokes_base.h.
|
protected |
Definition at line 889 of file navier_stokes_base.h.
|
protected |
Definition at line 977 of file navier_stokes_base.h.
|
protected |
Definition at line 890 of file navier_stokes_base.h.
|
protected |
Definition at line 921 of file navier_stokes_base.h.
|
protected |
Definition at line 912 of file navier_stokes_base.h.
|
protected |
Definition at line 957 of file navier_stokes_base.h.
|
protected |
Definition at line 922 of file navier_stokes_base.h.
|
protected |
Definition at line 988 of file navier_stokes_base.h.
|
protected |
Definition at line 956 of file navier_stokes_base.h.
|
protected |
Definition at line 984 of file navier_stokes_base.h.
|
protected |
Definition at line 926 of file navier_stokes_base.h.
|
protected |
Definition at line 900 of file navier_stokes_base.h.
|
protected |
Definition at line 901 of file navier_stokes_base.h.
|
protected |
Instance of SDIRK-related vectors.
Definition at line 952 of file navier_stokes_base.h.
|
protected |
Definition at line 980 of file navier_stokes_base.h.
|
protected |
Definition at line 899 of file navier_stokes_base.h.
|
protected |
Vector containing solid domain constraint structs for temperature-dependent solid domain constraints in CLS simulations
Definition at line 1013 of file navier_stokes_base.h.
|
protected |
Definition at line 923 of file navier_stokes_base.h.
|
protected |
Definition at line 891 of file navier_stokes_base.h.
|
protected |
Definition at line 1004 of file navier_stokes_base.h.
|
protected |
Definition at line 893 of file navier_stokes_base.h.
|
protected |
Definition at line 916 of file navier_stokes_base.h.
|
protected |
Definition at line 955 of file navier_stokes_base.h.
|
protected |
Definition at line 985 of file navier_stokes_base.h.
|
protected |
Definition at line 911 of file navier_stokes_base.h.