![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <multiphysics_interface.h>
Public Member Functions | |
| MultiphysicsInterface (const SimulationParameters< dim > &nsparam, const std::shared_ptr< parallel::DistributedTriangulationBase< dim > > &p_triangulation, std::shared_ptr< SimulationControl > p_simulation_control, ConditionalOStream &p_pcout, const FluidDynamicsFormulation p_fluid_dynamics_formulation=FluidDynamicsFormulation::standard) | |
| virtual | ~MultiphysicsInterface ()=default |
| std::vector< PhysicsID > | get_active_physics () |
| FluidDynamicsFormulation | get_fluid_dynamics_formulation () const |
| void | enable_projected_particle_fields (PhysicsID physics_id) |
| void | announce_physics (const PhysicsID physics_id) |
| void | solve (const bool fluid_dynamics_has_been_solved, const Parameters::SimulationControl::TimeSteppingMethod time_stepping_method) |
| void | solve_physics (const PhysicsID physics_id, const Parameters::SimulationControl::TimeSteppingMethod time_stepping_method) |
| void | solve_block_physics (const PhysicsID physics_id, const Parameters::SimulationControl::TimeSteppingMethod time_stepping_method) |
| std::vector< OutputStruct< dim, GlobalVectorType > > | gather_output_hook_global_vector () |
| std::vector< OutputStruct< dim, GlobalBlockVectorType > > | gather_output_hook_global_block_vector () |
| void | finish_simulation () |
| void | percolate_time_vectors (const bool fluid_dynamics_has_been_solved) |
| void | update_boundary_conditions () |
| void | prepare_for_postprocessing () |
| void | postprocess (bool first_iteration) |
| void | output_per_iteration_timer () |
| void | prepare_for_mesh_adaptation () |
| void | post_mesh_adaptation () |
| void | setup_dofs () |
| void | set_initial_conditions () |
| void | solve_linear_system (const PhysicsID physics_id) |
| bool | fluid_dynamics_is_block () const |
| const DoFHandler< dim > & | get_dof_handler (const PhysicsID physics_id) |
| const Mapping< dim > & | get_mapping (const PhysicsID physics_id) |
| const GlobalVectorType & | get_solution (const PhysicsID physics_id) |
| const GlobalVectorType & | get_filtered_solution (const PhysicsID physics_id) |
| const GlobalBlockVectorType & | get_block_solution (const PhysicsID physics_id) |
| const GlobalVectorType & | get_time_average_solution (const PhysicsID physics_id) |
| const GlobalBlockVectorType & | get_block_time_average_solution (const PhysicsID physics_id) |
| const std::vector< std::shared_ptr< SolidBase< dim, dim > > > & | get_solids (const int number_solids) |
| const GlobalVectorType & | get_projected_phase_indicator_gradient_solution () |
| const GlobalVectorType & | get_curvature_solution () |
| const DoFHandler< dim > & | get_curvature_dof_handler () |
| const DoFHandler< dim > & | get_projected_phase_indicator_gradient_dof_handler () |
| std::shared_ptr< Shape< dim > > | get_immersed_solid_shape () |
| void | set_immersed_solid_shape (const std::shared_ptr< Shape< dim > > &shape) |
| const std::vector< GlobalVectorType > & | get_previous_solutions (const PhysicsID physics_id) |
| const std::vector< GlobalBlockVectorType > & | get_block_previous_solutions (const PhysicsID physics_id) |
| void | set_dof_handler (const PhysicsID physics_id, std::shared_ptr< DoFHandler< dim > > dof_handler) |
| void | set_mapping (const PhysicsID physics_id, std::shared_ptr< Mapping< dim > > mapping) |
| void | set_solid (std::shared_ptr< std::vector< std::shared_ptr< SolidBase< dim, dim > > > > solids_input) |
| void | set_solution (const PhysicsID physics_id, std::shared_ptr< GlobalVectorType > solution_vector) |
| void | set_filtered_solution (const PhysicsID physics_id, std::shared_ptr< GlobalVectorType > filtered_solution_vector) |
| void | set_time_average_solution (const PhysicsID physics_id, std::shared_ptr< GlobalVectorType > solution_vector) |
| void | set_block_solution (const PhysicsID physics_id, std::shared_ptr< GlobalBlockVectorType > solution_vector) |
| void | set_block_time_average_solution (const PhysicsID physics_id, std::shared_ptr< GlobalBlockVectorType > solution_vector) |
| void | set_previous_solutions (const PhysicsID physics_id, std::shared_ptr< std::vector< GlobalVectorType > > previous_solutions_vector) |
| void | set_block_previous_solutions (const PhysicsID physics_id, std::shared_ptr< std::vector< GlobalBlockVectorType > > previous_solutions_vector) |
| virtual void | compute_error_estimate (const std::pair< const Variable, Parameters::MultipleAdaptationParameters > &ivar, dealii::Vector< float > &estimated_error_per_cell) |
| virtual void | write_checkpoint () |
| virtual void | read_checkpoint () |
| template<typename VectorType> | |
| void | postprocess_probes (const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const VectorType &present_solution, const Variable variable, const ConditionalOStream &pcout) |
Private Member Functions | |
| void | inspect_multiphysics_models_dependencies (const SimulationParameters< dim > &nsparam) |
| bool | is_field_available (const PhysicsID physics_id) const |
Definition at line 48 of file multiphysics_interface.h.
| MultiphysicsInterface< dim >::MultiphysicsInterface | ( | const SimulationParameters< dim > & | nsparam, |
| const std::shared_ptr< parallel::DistributedTriangulationBase< dim > > & | p_triangulation, | ||
| std::shared_ptr< SimulationControl > | p_simulation_control, | ||
| ConditionalOStream & | p_pcout, | ||
| const FluidDynamicsFormulation | p_fluid_dynamics_formulation = FluidDynamicsFormulation::standard ) |
Construct the Multiphysics interface from the simulation parameters. Depending on which multiphysics element is enabled, the appropriate auxiliary physics is instantiated. Auxiliary physics that have no volume-averaged (VANS) form yet throw at construction time when p_fluid_dynamics_formulation is FluidDynamicsFormulation::VANS.
| [in] | nsparam | Simulation parameters. |
| [in] | p_triangulation | Distributed triangulation shared by all physics. |
| [in] | p_simulation_control | Simulation control shared by all physics. |
| [in] | p_pcout | Parallel output stream. |
| [in] | p_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 102 of file multiphysics_interface.cc.
References active_physics, cahn_hilliard, CLS, continuum_solid_dynamics, electromagnetics, fluid_dynamics, fluid_dynamics_formulation, heat_transfer, inspect_multiphysics_models_dependencies(), SimulationParameters< dim >::linear_solver, multiphysics_parameters, pcout, physics, SimulationParameters< dim >::physics_solving_strategy, probe_postprocessor, Parameters::quiet, standard, tracer, VANS, Parameters::verbose, and verbosity.
|
virtualdefault |
Default destructor.
|
inline |
Write physic solved in the terminal.
| physics_id | number associated with auxiliary physics in multiphysics.h |
Definition at line 131 of file multiphysics_interface.h.
References announce_string(), cahn_hilliard, CLS, continuum_solid_dynamics, electromagnetics, heat_transfer, pcout, and tracer.
|
inlinevirtual |
Compute error estimator for mesh refinement according to the auxiliary physic parameters.
| [in] | ivar | The current element of the map simulation_parameters.mesh_adaptation.variables |
| [in,out] | estimated_error_per_cell | The deal.II vector of estimated_error_per_cell |
Definition at line 949 of file multiphysics_interface.h.
References block_physics, and physics.
|
inline |
Make a field projected by the particle projector of the VANS solvers available in the interface. The VANS solvers call it in their constructor: always for the void fraction, and for the particle temperature in thermal CFD-DEM simulations (solver type = dem_mp).
| [in] | physics_id | The ID of the projected field to enable. |
Definition at line 106 of file multiphysics_interface.h.
References particle_temperature, particle_temperature_field_enabled, particle_void_fraction_field_enabled, and void_fraction.
|
inline |
Carry out the operations required to finish a simulation correctly for all auxiliary physics.
Definition at line 313 of file multiphysics_interface.h.
References block_physics, and physics.
|
inline |
fluid_dynamics_is_block Verify if the fluid dynamics solution is stored as a block vector or not.
Definition at line 527 of file multiphysics_interface.h.
References block_physics_solutions, and fluid_dynamics.
|
inline |
Gather and return vector of output structs that are particular to some applications.
Definition at line 293 of file multiphysics_interface.h.
References block_physics.
|
inline |
Gather and return vector of output structs that are particular to some applications.
Definition at line 273 of file multiphysics_interface.h.
References physics.
|
inline |
Definition at line 82 of file multiphysics_interface.h.
References active_physics.
|
inline |
Request the reference to the vector of previous solutions of a given block physics.
| [in] | physics_id | The physics ID of the solution being requested |
Definition at line 738 of file multiphysics_interface.h.
References active_physics, and block_physics_previous_solutions.
|
inline |
Request the reference to the present block solution of a given physics.
| [in] | physics_id | The physics ID of the solution being requested |
Definition at line 613 of file multiphysics_interface.h.
References active_physics, and block_physics_solutions.
|
inline |
Request the reference to the present block average solution of a given physics.
| [in] | physics_id | The physics ID of the solution being requested |
Definition at line 643 of file multiphysics_interface.h.
References active_physics, and block_physics_time_average_solutions.
| const DoFHandler< dim > & MultiphysicsInterface< dim >::get_curvature_dof_handler | ( | ) |
Request the reference to the projected curvature DOF handler.
Definition at line 284 of file multiphysics_interface.cc.
References active_physics, CLS, get_curvature_dof_handler(), multiphysics_parameters, and physics.
| const GlobalVectorType & MultiphysicsInterface< dim >::get_curvature_solution | ( | ) |
Request the reference to the present solution of the curvature.
Definition at line 267 of file multiphysics_interface.cc.
References active_physics, CLS, get_curvature_solution(), multiphysics_parameters, and physics.
|
inline |
Request a DOF handler for a given physics ID.
| physics_id | The physics of the DOF handler being requested |
Definition at line 542 of file multiphysics_interface.h.
References is_field_available(), and physics_dof_handler.
|
inline |
Request the reference to the present filtered solution of a given physics (used in CLS or CahnHilliard physics for STF calculation in the momentum balance).
| [in] | physics_id | ID of the physics for which the filtered solution is being requested |
Definition at line 598 of file multiphysics_interface.h.
References active_physics, and physics_filtered_solutions.
|
inline |
Get the formulation of the fluid dynamics solver driving this interface.
Definition at line 92 of file multiphysics_interface.h.
References fluid_dynamics_formulation.
| std::shared_ptr< Shape< dim > > MultiphysicsInterface< dim >::get_immersed_solid_shape | ( | ) |
Request shared pointer to immersed solid shape.
Definition at line 318 of file multiphysics_interface.cc.
References immersed_solid_shape.
|
inline |
Request a mapping for a given physics ID.
| physics_id | The physics of the mapping being requested |
Definition at line 560 of file multiphysics_interface.h.
References is_field_available(), and physics_mapping.
|
inline |
Request the reference to the vector of previous solutions of a given physics.
| [in] | physics_id | The physics ID of the solution being requested |
Definition at line 721 of file multiphysics_interface.h.
References is_field_available(), and physics_previous_solutions.
| const DoFHandler< dim > & MultiphysicsInterface< dim >::get_projected_phase_indicator_gradient_dof_handler | ( | ) |
Request the reference to the projected phase indicator gradient (PIG) DOF handler.
Definition at line 301 of file multiphysics_interface.cc.
References active_physics, CLS, get_projected_phase_indicator_gradient_dof_handler(), multiphysics_parameters, and physics.
| const GlobalVectorType & MultiphysicsInterface< dim >::get_projected_phase_indicator_gradient_solution | ( | ) |
Request the reference to the present solution vector of the projected phase indicator gradient (PIG).
Definition at line 250 of file multiphysics_interface.cc.
References active_physics, CLS, get_projected_phase_indicator_gradient_solution(), multiphysics_parameters, and physics.
|
inline |
Request the solid objects. Used an auxiliary physics needs to apply a boundary condition on a solid through Nitsche immersed boundary method.
| [in] | number_solids | The number of solids declared in the parameter file. The value is used to ensure that at least one solid has been declared. |
Definition at line 665 of file multiphysics_interface.h.
References solids.
|
inline |
Request the reference to the present solution of a given physics.
| physics_id | The physics ID of the solution being requested |
Definition at line 578 of file multiphysics_interface.h.
References is_field_available(), and physics_solutions.
|
inline |
Request the reference to the time-average solution of a given physics.
| [in] | physics_id | The physics ID of the solution being requested |
Definition at line 628 of file multiphysics_interface.h.
References active_physics, and physics_time_average_solutions.
|
private |
Checks the required dependencies between multiphase models and handles the corresponding assertions.
| [in] | nsparam | Simulation parameters. |
Definition at line 335 of file multiphysics_interface.cc.
References _unused, and SimulationParameters< dim >::multiphysics.
|
private |
Return true if the fields of physics_id are registered in the interface: either the physics is active, or it is a field projected under the VANS formulation and enabled with enable_projected_particle_fields().
| [in] | physics_id | The ID of the physics to check. |
physics_id are registered in the interface, false otherwise. Definition at line 419 of file multiphysics_interface.cc.
References active_physics, fluid_dynamics_formulation, particle_temperature, particle_temperature_field_enabled, particle_void_fraction_field_enabled, VANS, and void_fraction.
|
inline |
Output the per iteration wallclock times.
Definition at line 421 of file multiphysics_interface.h.
References block_physics, and physics.
|
inline |
Rearrange vector solution correctly for transient simulations for all auxiliary physics.
| fluid_dynamics_has_been_solved | Boolean that states if the fluid dynamics has been already solved or not. See the map solve_pre_fluid to know which subphysics are solved before the fluid dynamics. |
Definition at line 334 of file multiphysics_interface.h.
References block_physics, physics, and solve_pre_fluid.
|
inline |
Interpolate solution onto new mesh.
Definition at line 454 of file multiphysics_interface.h.
References block_physics, and physics.
|
inline |
Postprocess the auxiliary physics results. Post-processing this case implies the calculation of all derived quantities using the solution vector of the physics. It does not concern the output of the solution using the DataOutObject, which is accomplished through the attach_solution_to_output function.
Definition at line 403 of file multiphysics_interface.h.
References block_physics, physics, and probe_postprocessor.
|
inline |
Checks validity of the variable and if valid, calls the appropriate PostprocessingProbes::postprocess_probes() function for the specified variable.
| VectorType | Type of vector of the solution vector. |
| [in] | mapping | Mapping of the domain. |
| [in] | dof_handler | DoF handler associated to the solution field. |
| [in] | present_solution | Vector containing the scalar solution field. For distributed meshes, ghost elements must be updated. |
| [in] | variable | Variable of interest. |
| [in] | pcout | Parallel console output stream. |
Definition at line 1015 of file multiphysics_interface.h.
References pcout, and probe_postprocessor.
|
inline |
Prepare the auxiliary physics for mesh adaptation.
Definition at line 438 of file multiphysics_interface.h.
References block_physics, and physics.
|
inline |
Prepares for the postprocessing of the current time step.
Definition at line 388 of file multiphysics_interface.h.
References probe_postprocessor.
|
inlinevirtual |
Read solution from checkpoint from auxiliary physics.
Definition at line 986 of file multiphysics_interface.h.
References block_physics, physics, and probe_postprocessor.
|
inline |
Sets the pointer to the vector of previous solutions of the block physics in the multiphysics interface.
| [in] | physics_id | The physics of the DOF handler |
| [in] | previous_solutions_vector | The shared pointer to the vector of previous block vector solutions |
Definition at line 927 of file multiphysics_interface.h.
References active_physics, and block_physics_previous_solutions.
|
inline |
Sets the reference to the solution of the physics in the multiphysics interface.
| [in] | physics_id | The physics ID of the DOF handler being requested |
| [in] | solution_vector | The shared pointer to the solution vector of the requested physics |
Definition at line 867 of file multiphysics_interface.h.
References active_physics, and block_physics_solutions.
|
inline |
Sets the shared pointer to the time-average solution of the block physics in the multiphysics interface.
| [in] | physics_id | The physics ID of the time averaged block vector solution being set |
| [in] | solution_vector | The shared pointer to the block solution vector of the physics |
Definition at line 887 of file multiphysics_interface.h.
References active_physics, and block_physics_time_average_solutions.
|
inline |
Sets the shared pointer to the DOFHandler of the physics in the multiphysics interface.
| [in] | physics_id | The physics of the DOF handler being requested |
| [in] | dof_handler | Shared pointer to the dof handler for which the reference is stored |
Definition at line 756 of file multiphysics_interface.h.
References is_field_available(), and physics_dof_handler.
|
inline |
Sets the shared pointer to the filtered solution of the physics in the multiphysics interface (used in CLS or CahnHilliard physics for STF calculation in the momentum balance).
| [in] | physics_id | ID of the physics for which the filtered solution is being set |
| [in] | filtered_solution_vector | Shared pointer to the filtered solution vector of the physics; this was implemented for CLS and CahnHilliard physics |
Definition at line 827 of file multiphysics_interface.h.
References active_physics, and physics_filtered_solutions.
| void MultiphysicsInterface< dim >::set_immersed_solid_shape | ( | const std::shared_ptr< Shape< dim > > & | shape | ) |
Share immersed solid shape.
| [in] | shape | The reference to the shared pointer pointing to the immersed solid shape |
Definition at line 327 of file multiphysics_interface.cc.
References immersed_solid_shape.
|
inline |
Sets-up the initial conditions associated with the physics. Generally, physics only support imposing nodal values, but some physics additionally support the use of L2 projection or steady-state solutions.
Definition at line 492 of file multiphysics_interface.h.
References block_physics, and physics.
|
inline |
Sets the shared pointer to the Mapping of the physics in the multiphysics interface.
| [in] | physics_id | The physics of the mapping being requested |
| [in] | mapping | Shared pointer to the mapping for which the reference is stored |
Definition at line 774 of file multiphysics_interface.h.
References is_field_available(), and physics_mapping.
|
inline |
Sets the pointer to the vector of previous solutions of the physics in the multiphysics interface.
| [in] | physics_id | The physics of the DOF handler |
| [in] | previous_solutions_vector | The shared pointer to the vector of previous solutions |
Definition at line 907 of file multiphysics_interface.h.
References is_field_available(), and physics_previous_solutions.
|
inline |
Sets the shared pointer to the vector of the SolidBase object. This allows the use of the solid base object in multiple physics at the same time.
| [in] | solids_input | Shared pointer to the vector of solidBase object |
Definition at line 790 of file multiphysics_interface.h.
References solids.
|
inline |
Sets the shared pointer to the solution of the physics in the multiphysics interface.
| [in] | physics_id | The physics ID the present solution being set |
| [in] | solution_vector | Shared pointer to the solution vector of the physics |
Definition at line 806 of file multiphysics_interface.h.
References is_field_available(), and physics_solutions.
|
inline |
Sets the shared pointer to the time-average solution of the physics in the multiphysics interface.
| [in] | physics_id | The physics ID of the time averaged solution being set |
| [in] | solution_vector | The shared pointer to the time averaged solution vector of the physics |
Definition at line 849 of file multiphysics_interface.h.
References active_physics, and physics_time_average_solutions.
|
inline |
Set-up the DofHandler and the degree of freedom associated with the physics.
Definition at line 472 of file multiphysics_interface.h.
References block_physics, and physics.
|
inline |
Call for the solution of the physics that should be solved.
| fluid_dynamics_has_been_solved | Boolean that states if the fluid dynamics has been already solved or not. See the map solve_pre_fluid to know which subphysics are solved before the fluid dynamics. |
| time_stepping_method | Time-Stepping method with which the assembly is called |
Definition at line 176 of file multiphysics_interface.h.
References block_physics, physics, solve_block_physics(), solve_physics(), and solve_pre_fluid.
|
inline |
Call for the solution of a single block physic.
| time_stepping_method | Time-Stepping method with which the assembly is called |
Definition at line 250 of file multiphysics_interface.h.
References active_physics, announce_physics(), block_physics, Parameters::quiet, and verbosity.
|
inline |
Call for the solution of the linear system of an auxiliary physics.
Definition at line 510 of file multiphysics_interface.h.
References active_physics, and physics.
|
inline |
Call for the solution of a single physic.
| time_stepping_method | Time-Stepping method with which the assembly is called |
Definition at line 227 of file multiphysics_interface.h.
References active_physics, announce_physics(), physics, Parameters::quiet, and verbosity.
|
inline |
| Update | the boundary conditions of the auxiliary physics if they are time-dependent |
Definition at line 372 of file multiphysics_interface.h.
References block_physics, and physics.
|
inlinevirtual |
Prepares auxiliary physics to write simulation checkpoint.
Definition at line 968 of file multiphysics_interface.h.
References block_physics, physics, and probe_postprocessor.
|
private |
Definition at line 1064 of file multiphysics_interface.h.
|
private |
Definition at line 1083 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective filtered solutions. Same as MultiphysicsInterface::physics_filtered_solutions, but used with BlockVector.
Definition at line 1120 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective vector of previous solutions. Same as MultiphysicsInterface::physics_previous_solutions, but used with BlockVector.
Definition at line 1136 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective solutions. Same as MultiphysicsInterface::physics_solutions, but used with BlockVector.
Definition at line 1103 of file multiphysics_interface.h.
|
private |
Definition at line 1163 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective time-averaged solutions. Same as MultiphysicsInterface::physics_time_average_solutions, but used with BlockVector.
Definition at line 1152 of file multiphysics_interface.h.
|
private |
Definition at line 1054 of file multiphysics_interface.h.
|
private |
Shared pointer to immersed solid shapes to be used by auxiliary physics.
Definition at line 1155 of file multiphysics_interface.h.
|
private |
Definition at line 1051 of file multiphysics_interface.h.
|
private |
Definition at line 1061 of file multiphysics_interface.h.
|
private |
Definition at line 1057 of file multiphysics_interface.h.
|
private |
Definition at line 1053 of file multiphysics_interface.h.
|
private |
Definition at line 1079 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective DoFHandler.
Definition at line 1086 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective filtered solutions. These solutions are used with both CLS and Cahn-Hilliard multiphase flow approaches for surface tension force calculation in the momentum equation.
Definition at line 1112 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective Mapping.
Definition at line 1089 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective vector of previous solutions.
Definition at line 1127 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective solutions.
Definition at line 1095 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective previous (n-1) solutions.
Definition at line 1161 of file multiphysics_interface.h.
|
private |
Map of physics and shared pointers to their respective time-averaged solutions.
Definition at line 1143 of file multiphysics_interface.h.
|
private |
Probe postprocessing object.
Definition at line 1185 of file multiphysics_interface.h.
|
private |
Shared pointer to the vector containing shared pointers to solid objects.
Definition at line 1092 of file multiphysics_interface.h.
|
private |
Definition at line 1068 of file multiphysics_interface.h.
|
private |
Definition at line 1052 of file multiphysics_interface.h.