![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <cls.h>
Public Member Functions | |
| ConservativeLevelSet (MultiphysicsInterface< dim > *multiphysics_interface, const SimulationParameters< dim > &p_simulation_parameters, const std::shared_ptr< parallel::DistributedTriangulationBase< dim > > &p_triangulation, std::shared_ptr< SimulationControl > p_simulation_control) | |
| ~ConservativeLevelSet ()=default | |
| void | assemble_rhs () |
| virtual std::vector< OutputStruct< dim, GlobalVectorType > > | gather_output_hook () override |
| double | calculate_L2_error () |
| template<typename VectorType> | |
| void | calculate_volume_and_mass (const GlobalVectorType &solution, const VectorType ¤t_solution_fd, const Parameters::FluidIndicator monitored_fluid) |
| template<typename VectorType> | |
| Tensor< 1, dim > | calculate_momentum (const GlobalVectorType &solution, const VectorType ¤t_solution_fd, const Parameters::FluidIndicator monitored_fluid) |
| template<typename VectorType> | |
| std::pair< Tensor< 1, dim >, Tensor< 1, dim > > | calculate_barycenter (const GlobalVectorType &solution, const VectorType ¤t_solution_fd) |
| double | compute_capillary_time_step_constraint (const bool pressure_dependent, const bool temperature_dependent) |
| void | finish_simulation () override |
| void | percolate_time_vectors () override |
| void | modify_solution () override |
| void | postprocess (bool first_iteration) override |
| void | output_per_iteration_timer () override |
| void | pre_mesh_adaptation () override |
| void | post_mesh_adaptation () override |
| void | compute_error_estimate (const std::pair< const Variable, Parameters::MultipleAdaptationParameters > &ivar, dealii::Vector< float > &estimated_error_per_cell) override |
| void | compute_kelly (dealii::Vector< float > &estimated_error_per_cell, const ComponentMask &component_mask) |
| void | write_checkpoint () override |
| void | read_checkpoint () override |
| std::vector< OutputStructTableHandler > | gather_tables () override |
| void | setup_dofs () override |
| void | define_zero_constraints () |
| void | define_non_zero_constraints () |
| void | set_initial_conditions () override |
| void | update_boundary_conditions () override |
| void | solve_linear_system () override |
| void | setup_ilu () |
| void | setup_amg () |
| const DoFHandler< dim > & | get_dof_handler () override |
| GlobalVectorType & | get_evaluation_point () override |
| GlobalVectorType & | get_local_evaluation_point () override |
| GlobalVectorType & | get_newton_update () override |
| GlobalVectorType & | get_present_solution () override |
| GlobalVectorType & | get_system_rhs () override |
| AffineConstraints< double > & | get_nonzero_constraints () override |
| const DoFHandler< dim > & | get_projected_phase_indicator_gradient_dof_handler () |
| const DoFHandler< dim > & | get_curvature_dof_handler () |
| const GlobalVectorType & | get_projected_phase_indicator_gradient_solution () |
| const GlobalVectorType & | get_curvature_solution () |
| void | output_newton_update_norms () override |
| double | get_residual_rescale_metric () const override |
| Public Member Functions inherited from AuxiliaryPhysics< dim, GlobalVectorType > | |
| AuxiliaryPhysics (const Parameters::NonLinearSolver non_linear_solver_parameters) | |
| virtual | ~AuxiliaryPhysics ()=default |
| void | setup_preconditioner () override |
| virtual bool | should_solve_auxiliary_physics () |
| 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 |
Additional Inherited Members | |
| Public Attributes inherited from PhysicsSolver< GlobalVectorType > | |
| ConditionalOStream | pcout |
| Parameters::SimulationControl::TimeSteppingMethod | time_stepping_method |
| ConservativeLevelSet< dim >::ConservativeLevelSet | ( | MultiphysicsInterface< dim > * | multiphysics_interface, |
| const SimulationParameters< dim > & | p_simulation_parameters, | ||
| const std::shared_ptr< parallel::DistributedTriangulationBase< dim > > & | p_triangulation, | ||
| std::shared_ptr< SimulationControl > | p_simulation_control ) |
CLS - Base constructor.
Definition at line 24 of file cls.cc.
References AuxiliaryPhysics< dim, GlobalVectorType >::AuxiliaryPhysics(), cell_quadrature, CLS, cls_subequations_interface, computing_timer, dof_handler, face_quadrature, fe, filtered_solution, Parameters::geometric, mapping, maximum_number_of_previous_solutions(), SignedDistanceTransformationBase::model_cast(), multiphysics, Parameters::none, PhysicsSolver< GlobalVectorType >::pcout, phase_indicator_isocontour_bounding_values_tables, PhysicsSolver< GlobalVectorType >::physics_solving_strategy, present_solution, previous_solutions, previous_solutions_transfer, sharpening_threshold, signed_distance_solver, signed_distance_transformation, simulation_control, simulation_parameters, solution_transfer, and triangulation.
|
default |
CLS - Base destructor. At the present moment this is an interface with nothing.
|
private |
Apply filter on phase indicator values.
| [in] | original_solution | CLS solution vector to which the filter is to be applied. |
| [out] | filtered_solution | Solution vector with filtered phase indicator values. |
Definition at line 3482 of file cls.cc.
References filter, filtered_solution, locally_owned_dofs, ConservativeLevelSetFilterBase::model_cast(), PhysicsSolver< GlobalVectorType >::pcout, simulation_parameters, triangulation, and Parameters::verbose.
|
private |
Assemble the system for interface sharpening.
| solution | CLS solution (phase indicator) |
| sharpening_threshold | Interface sharpening threshold that represents the mass conservation level |
Definition at line 3286 of file cls.cc.
References cell_quadrature, dof_handler, fe, mapping, nonzero_constraints, sharpening_threshold, simulation_parameters, system_matrix_phase_indicator, and system_rhs_phase_indicator.
|
privatevirtual |
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 CLSScratchData for more information |
| copy_data | The copy data which is used to store the results of the assembly over a cell |
Definition at line 378 of file cls.cc.
References assemblers, StabilizedMethodsCopyData::cell_is_local, evaluation_point, fluid_dynamics, StabilizedMethodsCopyData::local_dof_indices, multiphysics, previous_solutions, CLSScratchData< dim >::reinit(), CLSScratchData< dim >::reinit_velocity(), StabilizedMethodsCopyData::reset(), simulation_control, simulation_parameters, and triangulation.
|
privatevirtual |
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 CLSScratchData for more information |
| copy_data | The copy data which is used to store the results of the assembly over a cell |
Definition at line 623 of file cls.cc.
References assemblers, StabilizedMethodsCopyData::cell_is_local, evaluation_point, fluid_dynamics, StabilizedMethodsCopyData::local_dof_indices, multiphysics, previous_solutions, CLSScratchData< dim >::reinit(), CLSScratchData< dim >::reinit_velocity(), StabilizedMethodsCopyData::reset(), simulation_control, simulation_parameters, and triangulation.
|
private |
Assembles a mass_matrix which is used in update_solution_and_constraints function to limit the phase indicators of cells in the range of [0,1] before sharpening the interface. More information can be found in step_41 of deal.II tutorials: https://www.dealii.org/current/doxygen/deal.II/step_41.html.
| mass_matrix |
Definition at line 3447 of file cls.cc.
References cell_quadrature, dof_handler, fe, and nonzero_constraints.
|
private |
Assembles the matrix and rhs for calculation of a smooth phase indicator using a projection.
| solution | CLS solution (phase indicator) |
Definition at line 2307 of file cls.cc.
References cell_quadrature, compute_cell_diameter(), compute_cell_measure_with_JxW(), dof_handler, fe, mapping, nonzero_constraints, simulation_parameters, system_matrix_phase_indicator, and system_rhs_phase_indicator.
| void ConservativeLevelSet< dim >::assemble_rhs | ( | ) |
Call for the assembly of the right-hand side.
Definition at line 180 of file cls.cc.
References assemble_system_rhs().
|
overrideprivatevirtual |
Assembles the matrix associated with the solver.
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 231 of file cls.cc.
References assemble_system_matrix_cg(), assemble_system_matrix_dg(), computing_timer, setup_assemblers(), simulation_parameters, and system_matrix.
|
private |
Assemble the matrix associated with the solver when CG elements are used.
Definition at line 246 of file cls.cc.
References assemble_local_system_matrix(), copy_local_matrix_to_global_matrix(), dof_handler, fe, fluid_dynamics, multiphysics, simulation_control, simulation_parameters, and system_matrix.
|
private |
Assemble the matrix associated with the solver when DG elements are used.
Definition at line 275 of file cls.cc.
References assemble_local_system_matrix(), copy_local_matrix_to_global_matrix(), dof_handler, evaluation_point, StabilizedDGMethodsCopyData::face_data, fe, fluid_dynamics, inner_face_assembler, multiphysics, reinit_face_velocity_with_adequate_solution(), simulation_control, simulation_parameters, system_matrix, triangulation, and zero_constraints.
|
overrideprivatevirtual |
Assemble the rhs associated with the solver.
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 479 of file cls.cc.
References assemble_system_rhs_cg(), assemble_system_rhs_dg(), computing_timer, setup_assemblers(), simulation_parameters, and system_rhs.
|
private |
Assemble the rhs associated with the solver when CG elements are used.
Definition at line 496 of file cls.cc.
References assemble_local_system_rhs(), copy_local_rhs_to_global_rhs(), dof_handler, fe, fluid_dynamics, multiphysics, simulation_control, simulation_parameters, and system_rhs.
|
private |
Assemble the rhs associated with the solver when DG elements are used.
Definition at line 524 of file cls.cc.
References assemble_local_system_rhs(), copy_local_rhs_to_global_rhs(), dof_handler, evaluation_point, StabilizedDGMethodsCopyData::face_data, fe, fluid_dynamics, inner_face_assembler, multiphysics, reinit_face_velocity_with_adequate_solution(), simulation_control, simulation_parameters, system_rhs, triangulation, and zero_constraints.
| template std::pair< Tensor< 1, 3 >, Tensor< 1, 3 > > ConservativeLevelSet< dim >::calculate_barycenter< GlobalBlockVectorType > | ( | const GlobalVectorType & | solution, |
| const VectorType & | current_solution_fd ) |
Calculates the barycenter of the fluid and its velocity.
| [in] | solution | CLS solution |
| [in] | current_solution_fd | Fluid dynamics solution |
Definition at line 872 of file cls.cc.
References cell_quadrature, dof_handler, fe, filter, fluid_dynamics, mapping, ConservativeLevelSetFilterBase::model_cast(), multiphysics, simulation_parameters, triangulation, and velocity.
| double ConservativeLevelSet< dim >::calculate_L2_error | ( | ) |
Calculates the L2 error of the solution.
Definition at line 826 of file cls.cc.
References cell_quadrature, dof_handler, fe, mapping, present_solution, simulation_control, simulation_parameters, and triangulation.
|
private |
Calculate the mass deviation of the monitored fluid, between the current iteration and the mass at first iteration (mass_first_iteration). Used to test multiple sharpening threshold in the binary search algorithm (adaptive sharpening).
| monitored_fluid | Fluid indicator (fluid_0 or fluid_1) corresponding to the phase of interest. |
| sharpening_threshold | Interface sharpening threshold that represents the mass conservation level |
Definition at line 2233 of file cls.cc.
References calculate_volume_and_mass(), evaluation_point, fluid_dynamics, mass_first_iteration, mass_monitored, multiphysics, present_solution, sharpen_interface(), and sharpening_threshold.
| Tensor< 1, dim > ConservativeLevelSet< dim >::calculate_momentum | ( | const GlobalVectorType & | solution, |
| const VectorType & | current_solution_fd, | ||
| const Parameters::FluidIndicator | monitored_fluid ) |
Calculates the momentum for a given fluid phase. Used for conservation monitoring.
| [in] | solution | CLS solution (phase indicator) |
| [in] | current_solution_fd | current solution for the fluid dynamics |
| [in] | monitored_fluid | Fluid indicator (fluid_0 or fluid_1) corresponding to the phase of interest. |
Definition at line 1084 of file cls.cc.
References cell_quadrature, dof_handler, fe, Parameters::fluid_0, Parameters::fluid_1, fluid_dynamics, mapping, multiphysics, pressure, set_field_vector(), simulation_parameters, triangulation, and velocity.
| void ConservativeLevelSet< dim >::calculate_volume_and_mass | ( | const GlobalVectorType & | solution, |
| const VectorType & | current_solution_fd, | ||
| const Parameters::FluidIndicator | monitored_fluid ) |
Calculates the volume and mass for a given fluid phase. Used for conservation monitoring.
| solution | CLS solution (phase indicator) |
| current_solution_fd | current solution for the fluid dynamics |
| monitored_fluid | Fluid indicator (fluid_0 or fluid_1) corresponding to the phase of interest. |
Definition at line 980 of file cls.cc.
References cell_quadrature, dof_handler, fe, Parameters::fluid_0, Parameters::fluid_1, fluid_dynamics, mapping, mass_monitored, multiphysics, pressure, set_field_vector(), simulation_parameters, triangulation, and volume_monitored.
| double ConservativeLevelSet< dim >::compute_capillary_time_step_constraint | ( | const bool | pressure_dependent, |
| const bool | temperature_dependent ) |
Computes the capillary time-step constraint.
The time-step constraint for capillary-driven multiphase flows is computed according to [1]:
\[\Delta t_\sigma = \sqrt{\frac{(\rho_0 + \rho_1) h^3}{2 \pi \sigma}} \]
| [in] | pressure_dependent | Boolean indicating if the pressure field is required. The DensityIsothermalIdealGas model requires the pressure field to compute the density. |
| [in] | temperature_dependent | Boolean indicating if the temperature field is required. The SurfaceTensionLinear and SurfaceTensionPhaseChange models depend on the temperature field. |
Reference:
[1] F. Denner, F. Evrard, and B. van Wachem, “Breaching the capillary time-step constraint using a coupled VOF method with implicit surface tension,” J. Comput. Phys., vol. 459, p. 111128, Jun. 2022, doi: 10.1016/j.jcp.2022.111128
Definition at line 1188 of file cls.cc.
References cell_quadrature, compute_cell_diameter(), compute_cell_measure_with_JxW(), dof_handler, fe, fluid_dynamics, heat_transfer, mapping, multiphysics, pressure, set_field_vector(), simulation_parameters, temperature, and triangulation.
|
overridevirtual |
Compute the error estimator for mesh refinement.
| [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 |
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2513 of file cls.cc.
References compute_kelly(), fe, Parameters::MultipleAdaptationParameters::kelly, and phase.
| void ConservativeLevelSet< dim >::compute_kelly | ( | dealii::Vector< float > & | estimated_error_per_cell, |
| const ComponentMask & | component_mask ) |
Compute the Kelly error estimator on the phase variable for mesh refinement. See : https://www.dealii.org/current/doxygen/deal.II/classKellyErrorEstimator.html for more information on the Kelly error estimator.
| [in,out] | estimated_error_per_cell | The deal.II vector of estimated_error_per_cell |
| [in] | component_mask | The component mask corresponding to the phase variable |
Definition at line 2536 of file cls.cc.
References dof_handler, face_quadrature, mapping, and present_solution.
|
private |
Compute level-set field from the phase indicator field using an inverse tanh-based transformation.
| [in] | solution | Phase indicator solution field |
| [out] | level_set_solution | Level-set solution field |
Definition at line 3580 of file cls.cc.
References locally_owned_dofs, nonzero_constraints, phase, and triangulation.
|
private |
Compute the phase indicator field from level-set field using a tanh-based transformation.
| [in] | level_set_solution | Level-set solution field |
| [out] | phase_indicator_solution | Phase indicator solution field |
Definition at line 3601 of file cls.cc.
References locally_owned_dofs, nonzero_constraints, signed_distance_transformation, and triangulation.
|
privatevirtual |
Copy local cell information to global matrix.
Definition at line 465 of file cls.cc.
References StabilizedMethodsCopyData::cell_is_local, StabilizedMethodsCopyData::local_dof_indices, StabilizedMethodsCopyData::local_matrix, and zero_constraints.
|
privatevirtual |
Copy local cell rhs information to global rhs.
Definition at line 710 of file cls.cc.
References StabilizedMethodsCopyData::cell_is_local, StabilizedMethodsCopyData::local_dof_indices, StabilizedMethodsCopyData::local_rhs, and zero_constraints.
| void ConservativeLevelSet< dim >::define_non_zero_constraints | ( | ) |
defined the non zero constraints used to solve the problem.
Definition at line 2889 of file cls.cc.
References BoundaryConditions::dirichlet, dof_handler, locally_owned_dofs, locally_relevant_dofs, nonzero_constraints, BoundaryConditions::periodic, and simulation_parameters.
| void ConservativeLevelSet< dim >::define_zero_constraints | ( | ) |
defined the zero constraints used to solve the problem.
Definition at line 2850 of file cls.cc.
References BoundaryConditions::dirichlet, dof_handler, locally_owned_dofs, locally_relevant_dofs, BoundaryConditions::periodic, simulation_parameters, and zero_constraints.
|
private |
Find the sharpening threshold to ensure mass conservation of the fluid monitored, as given in the prm (CLS, subsection monitoring), by binary search.
Definition at line 2107 of file cls.cc.
References calculate_mass_deviation(), mass_first_iteration, mass_monitored, PhysicsSolver< GlobalVectorType >::pcout, Parameters::quiet, and simulation_parameters.
|
overridevirtual |
Carry out the operations required to finish a simulation correctly.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 1341 of file cls.cc.
References announce_string(), computing_timer, Parameters::Timer::end, error_table, PhysicsSolver< GlobalVectorType >::pcout, simulation_control, simulation_parameters, Parameters::SimulationControl::steady, triangulation, and Parameters::verbose.
|
overridevirtual |
Gather and return vector of output structs that are particular to some applications.
Reimplemented from AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 724 of file cls.cc.
References cls_subequations_interface, computing_timer, curvature_projection, dof_handler, filtered_solution, phase_gradient_projection, present_solution, signed_distance_solver, simulation_control, and simulation_parameters.
|
overridevirtual |
Returns a vector of references to TableHandler objects that needs to be serialized/deserialized for the CLS solver.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2552 of file cls.cc.
References error_table, phase, phase_indicator_isocontour_bounding_values_tables, simulation_parameters, table_barycenter, and table_monitoring_cls.
|
inline |
Definition at line 392 of file cls.h.
References cls_subequations_interface, and curvature_projection.
|
inline |
Definition at line 406 of file cls.h.
References cls_subequations_interface, and curvature_projection.
|
inlineoverridevirtual |
Getter methods to get the private attributes for the physic currently solved NB : dof_handler and present_solution are passed to the multiphysics interface at the end of the setup_dofs method.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 343 of file cls.h.
References dof_handler.
|
inlineoverridevirtual |
Getter methods that give access to the private attributes of the physics being solved. These methods must be provided by the physics as they are the key to solve a problem using Lethe.
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 349 of file cls.h.
References evaluation_point.
|
inlineoverridevirtual |
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 355 of file cls.h.
References local_evaluation_point.
|
inlineoverridevirtual |
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 361 of file cls.h.
References newton_update.
|
inlineoverridevirtual |
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 379 of file cls.h.
References nonzero_constraints.
|
inlineoverridevirtual |
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 367 of file cls.h.
References present_solution.
|
inline |
Definition at line 385 of file cls.h.
References cls_subequations_interface, and phase_gradient_projection.
|
inline |
Definition at line 399 of file cls.h.
References cls_subequations_interface, and phase_gradient_projection.
|
inlineoverridevirtual |
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 square root of the global volume of the triangulation.
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 431 of file cls.h.
References CLS, mapping, simulation_parameters, and triangulation.
|
inlineoverridevirtual |
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 373 of file cls.h.
References system_rhs.
|
private |
Carries out interface sharpening. It is called in the modify solution function. Launches sharpen_interface with the possibility to ensure conservation and handles output messages.
Definition at line 2064 of file cls.cc.
References Parameters::adaptive, find_sharpening_threshold(), PhysicsSolver< GlobalVectorType >::pcout, present_solution, Parameters::quiet, sharpen_interface(), sharpening_threshold, simulation_control, and simulation_parameters.
|
overridevirtual |
Carry out modifications on the auxiliary physic solution.
Reimplemented from AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2007 of file cls.cc.
References apply_phase_filter(), cls_subequations_interface, computing_timer, curvature_projection, dof_handler, filtered_solution, handle_interface_sharpening(), phase_gradient_projection, present_solution, reinitialize_interface_with_geometric_method(), reinitialize_interface_with_pde_based_method(), simulation_control, and simulation_parameters.
|
inlineoverridevirtual |
Output the L2 and Linfty norms of the correction vector.
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 415 of file cls.h.
References newton_update, and PhysicsSolver< GlobalVectorType >::pcout.
|
overridevirtual |
Output the per iteration wallclock times.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 1996 of file cls.cc.
References announce_string(), computing_timer, and PhysicsSolver< GlobalVectorType >::pcout.
|
overridevirtual |
Carry out the operations required to rearrange the values of the previous solution at the end of a time step.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 1374 of file cls.cc.
References present_solution, and previous_solutions.
|
overridevirtual |
post_mesh_adaption Interpolates the auxiliary physics variables to the new mesh
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2481 of file cls.cc.
References apply_phase_filter(), filtered_solution, locally_owned_dofs, nonzero_constraints, present_solution, previous_solutions, previous_solutions_transfer, solution_transfer, and triangulation.
|
overridevirtual |
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.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 1385 of file cls.cc.
References announce_string(), calculate_barycenter(), calculate_L2_error(), calculate_momentum(), calculate_volume_and_mass(), compute_capillary_time_step_constraint(), computing_timer, dof_handler, error_table, fe, Parameters::fluid_0, Parameters::fluid_1, fluid_dynamics, InterfaceTools::integrate_barycenter(), InterfaceTools::integrate_volume_and_surface(), make_table_scalars_tensors(), make_table_scalars_vectors(), mapping, mass_monitored, multiphysics, PhysicsSolver< GlobalVectorType >::pcout, phase, InterfaceTools::postprocess_isocontour_bounding_values(), present_solution, pressure, sharpening_threshold, simulation_control, simulation_parameters, Parameters::SimulationControl::steady, table_barycenter, table_monitoring_cls, temperature, triangulation, Parameters::verbose, volume_monitored, and InterfaceTools::write_isocontour_bounding_values_tables().
|
overridevirtual |
pre_mesh_adaption Prepares the auxiliary physics variables for a mesh refinement/coarsening
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2466 of file cls.cc.
References present_solution, previous_solutions, previous_solutions_transfer, and solution_transfer.
|
overridevirtual |
Set solution vector of Auxiliary Physics using checkpoint.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2634 of file cls.cc.
References Parameters::adaptive, apply_phase_filter(), calculate_volume_and_mass(), deserialize_tables_vector(), filtered_solution, fluid_dynamics, gather_tables(), locally_owned_dofs, mass_first_iteration, mass_monitored, multiphysics, PhysicsSolver< GlobalVectorType >::pcout, present_solution, previous_solutions, simulation_parameters, solution_transfer, and triangulation.
|
inlineprivate |
Helper function to reinit the face velocity with the adequate solution. This prevents code duplication throughout the CLS class. The function looks at the multiphysics interface to decide if the velocity is a block velocity or a regular velocity. Furthermore, it also checks if a time-averaged solution is required. Otherwise, the code here would be copied four times.
| [in] | velocity_cell | the iterator of the cell where the velocity is to be reinitialized. |
| [in] | face_no | the face index where the velocity is to be reinitialized. |
| [in,out] | scratch_data | the scratch data to be used for the reinitialization. |
Definition at line 751 of file cls.h.
References fluid_dynamics, multiphysics, and CLSScratchData< dim >::reinit_face_velocity().
|
private |
Reinitialize the interface between fluids using the geometric approach.
Definition at line 3622 of file cls.cc.
References announce_string(), compute_phase_indicator_from_level_set(), computing_timer, dof_handler, level_set, locally_owned_dofs, locally_relevant_dofs, PhysicsSolver< GlobalVectorType >::pcout, present_solution, previous_solutions, Parameters::quiet, signed_distance_solver, simulation_parameters, and triangulation.
|
private |
Reinitialize the interface between fluids using the PDE-based approach.
Definition at line 3518 of file cls.cc.
References cls_subequations_interface, computing_timer, dof_handler, local_evaluation_point, locally_owned_dofs, pde_based_interface_reinitialization, phase_gradient_projection, present_solution, previous_solutions, simulation_parameters, and triangulation.
|
overridevirtual |
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.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2931 of file cls.cc.
References Parameters::adaptive, apply_phase_filter(), calculate_volume_and_mass(), cls_subequations_interface, compute_capillary_time_step_constraint(), create_output_folder(), curvature_projection, delete_output_folder(), Parameters::diffusive, dof_handler, filtered_solution, fluid_dynamics, Parameters::geometric, mapping, mass_first_iteration, mass_monitored, multiphysics, newton_update, nonzero_constraints, percolate_time_vectors(), phase_gradient_projection, present_solution, pressure, reinitialize_interface_with_geometric_method(), simulation_control, simulation_parameters, smooth_phase_indicator(), Parameters::SimulationControl::steady, temperature, and triangulation.
| void ConservativeLevelSet< dim >::setup_amg | ( | ) |
Set up the AMG preconditioner stored in amg_preconditioner.
Definition at line 3058 of file cls.cc.
References amg_preconditioner, CLS, computing_timer, dof_handler, fe, simulation_parameters, and system_matrix.
|
privatevirtual |
sets up the vector of assembler functions
Definition at line 188 of file cls.cc.
References assemblers, inner_face_assembler, simulation_control, simulation_parameters, time_stepping_is_bdf(), and time_stepping_is_sdirk().
|
overridevirtual |
Sets-up the DofHandler and the degree of freedom associated with the physics.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2691 of file cls.cc.
References assemble_mass_matrix(), CLS, cls_subequations_interface, complete_system_matrix_phase_indicator, complete_system_rhs_phase_indicator, define_non_zero_constraints(), define_zero_constraints(), dof_handler, fe, filtered_solution, level_set, local_evaluation_point, locally_owned_dofs, locally_relevant_dofs, mapping, mass_matrix_phase_indicator, multiphysics, newton_update, nodal_phase_indicator_owned, nonzero_constraints, PhysicsSolver< GlobalVectorType >::pcout, present_solution, previous_solutions, signed_distance_solver, simulation_parameters, system_matrix, system_matrix_phase_indicator, system_rhs, system_rhs_phase_indicator, triangulation, and verify_consistency_of_boundary_conditions().
| void ConservativeLevelSet< dim >::setup_ilu | ( | ) |
Set up the ILU preconditioner stored in ilu_preconditioner.
Definition at line 3038 of file cls.cc.
References CLS, computing_timer, ilu_preconditioner, simulation_parameters, and system_matrix.
|
private |
Carries out interface sharpening. It is called in the modify solution function.
| solution | CLS solution (phase indicator) |
| sharpening_threshold | Interface sharpening threshold that represents the mass conservation level |
| sharpen_previous_solutions | Boolean true if sharpening is applied on the present and past solutions, false if the sharpening is applied on the given solution vector only. Used to determine the sharpening threshold by binary search. |
Definition at line 2258 of file cls.cc.
References assemble_L2_projection_interface_sharpening(), previous_solutions, sharpening_threshold, solve_interface_sharpening(), and update_solution_and_constraints().
|
private |
Carries out the smoothing phase indicator with a projection step (to avoid a staircase interface).
Definition at line 2298 of file cls.cc.
References assemble_projection_phase_indicator(), and solve_projection_phase_indicator().
|
private |
Solves the assembled system to sharpen the interface. The linear_solver_tolerance is hardcoded = 1e-15, and an ILU Preconditioner is used. After solving the system, this function overwrites the solution with the sharpened solution.
| solution | CLS solution (phase indicator) |
Definition at line 3379 of file cls.cc.
References CLS, Parameters::extra_verbose, ilu_preconditioner, locally_owned_dofs, nonzero_constraints, PhysicsSolver< GlobalVectorType >::pcout, simulation_parameters, system_matrix_phase_indicator, system_rhs_phase_indicator, and triangulation.
|
overridevirtual |
Call for the solution of the linear system of equation using a strategy appropriate to the auxiliary physics.
Implements PhysicsSolver< GlobalVectorType >.
Definition at line 3127 of file cls.cc.
References Parameters::LinearSolver::amg, amg_preconditioner, CLS, computing_timer, get_residual_rescale_metric(), Parameters::LinearSolver::ilu, ilu_preconditioner, locally_owned_dofs, newton_update, PhysicsSolver< GlobalVectorType >::pcout, Parameters::quiet, setup_amg(), setup_ilu(), simulation_parameters, system_matrix, system_rhs, triangulation, and zero_constraints.
|
private |
Solves smooth phase indicator system.
| solution | CLS solution (phase indicator) |
Definition at line 2412 of file cls.cc.
References CLS, ilu_preconditioner, locally_owned_dofs, nonzero_constraints, PhysicsSolver< GlobalVectorType >::pcout, Parameters::quiet, simulation_parameters, system_matrix_phase_indicator, system_rhs_phase_indicator, and triangulation.
|
overridevirtual |
Update non zero constraints if the boundary is time dependent.
Reimplemented from AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2828 of file cls.cc.
References define_non_zero_constraints(), BoundaryConditions::dirichlet, simulation_control, and simulation_parameters.
|
private |
Limit the phase indicators between 0 and 1. This is necessary before interface sharpening. More information can be found in step_41 of deal.II tutorials: https://www.dealii.org/current/doxygen/deal.II/step_41.html.
Definition at line 3211 of file cls.cc.
References bounding_constraints, complete_system_matrix_phase_indicator, dof_handler, locally_owned_dofs, mass_matrix_phase_indicator, nodal_phase_indicator_owned, phase_lower_bound, phase_upper_bound, system_rhs_phase_indicator, and triangulation.
|
inlineprivate |
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 447 of file cls.h.
References simulation_parameters, and triangulation.
|
overridevirtual |
Prepares auxiliary physics to write checkpoint.
Implements AuxiliaryPhysics< dim, GlobalVectorType >.
Definition at line 2609 of file cls.cc.
References gather_tables(), present_solution, previous_solutions, serialize_tables_vector(), solution_transfer, and triangulation.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |