diff --git a/applications/lethe-fluid/fluid_dynamics_matrix_based.cc b/applications/lethe-fluid/fluid_dynamics_matrix_based.cc index 1e530d21a4..22f814e56f 100644 --- a/applications/lethe-fluid/fluid_dynamics_matrix_based.cc +++ b/applications/lethe-fluid/fluid_dynamics_matrix_based.cc @@ -48,7 +48,7 @@ main(int argc, char *argv[]) "lethe-fluid", "lethe-fluid-nitsche")); - GLSNavierStokesSolver<2> problem(NSparam); + FluidDynamicsMatrixBased<2> problem(NSparam); problem.solve(); } @@ -66,7 +66,7 @@ main(int argc, char *argv[]) "lethe-fluid", "lethe-fluid-nitsche")); - GLSNavierStokesSolver<3> problem(NSparam); + FluidDynamicsMatrixBased<3> problem(NSparam); problem.solve(); } else diff --git a/doc/doxygen/main.h b/doc/doxygen/main.h index 914433ef01..1d099c2b76 100644 --- a/doc/doxygen/main.h +++ b/doc/doxygen/main.h @@ -23,7 +23,7 @@ physics_solver:e -> navier_stokes_base:w [dir=back]; physics_solver:e -> auxiliary_physics:w [dir=back]; - navier_stokes_base_1 [label=<GLSNavierStokesSolver
(lethe-fluid)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classGLSNavierStokesSolver.html", tooltip="GLSNavierStokesSolver"]; + navier_stokes_base_1 [label=<FluidDynamicsMatrixBased
(lethe-fluid)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classFluidDynamicsMatrixBased.html", tooltip="FluidDynamicsMatrixBased"]; navier_stokes_base_2 [label=<FluidDynamicsBlock
(lethe-fluid-block)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classFluidDynamicsBlock.html", tooltip="FluidDynamicsBlock"]; navier_stokes_base_3 [label=<FluidDynamicsMatrixFree
(lethe-fluid-matrix-free)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classFluidDynamicsMatrixFree.html", tooltip="FluidDynamicsMatrixFree"]; diff --git a/include/fem-dem/fluid_dynamics_sharp.h b/include/fem-dem/fluid_dynamics_sharp.h index 83d45c0b33..c92c785243 100644 --- a/include/fem-dem/fluid_dynamics_sharp.h +++ b/include/fem-dem/fluid_dynamics_sharp.h @@ -43,7 +43,7 @@ using namespace dealii; */ template -class FluidDynamicsSharp : public GLSNavierStokesSolver +class FluidDynamicsSharp : public FluidDynamicsMatrixBased { public: FluidDynamicsSharp(CFDDEMSimulationParameters &nsparam); @@ -183,7 +183,7 @@ class FluidDynamicsSharp : public GLSNavierStokesSolver else generate_cut_cells_map(); } - this->GLSNavierStokesSolver::assemble_system_matrix(); + this->FluidDynamicsMatrixBased::assemble_system_matrix(); sharp_edge(); } @@ -202,7 +202,7 @@ class FluidDynamicsSharp : public GLSNavierStokesSolver virtual void assemble_rhs() { - this->GLSNavierStokesSolver::assemble_system_rhs(); + this->FluidDynamicsMatrixBased::assemble_system_rhs(); } /** diff --git a/include/fem-dem/fluid_dynamics_vans.h b/include/fem-dem/fluid_dynamics_vans.h index 63c0666f4d..65be2ea86d 100644 --- a/include/fem-dem/fluid_dynamics_vans.h +++ b/include/fem-dem/fluid_dynamics_vans.h @@ -112,7 +112,7 @@ particle_sphere_intersection_3d(double r_particle, */ template -class FluidDynamicsVANS : public GLSNavierStokesSolver +class FluidDynamicsVANS : public FluidDynamicsMatrixBased { public: FluidDynamicsVANS(CFDDEMSimulationParameters &nsparam); diff --git a/include/solvers/fluid_dynamics_matrix_based.h b/include/solvers/fluid_dynamics_matrix_based.h index 06b146a31a..0ac976ca99 100644 --- a/include/solvers/fluid_dynamics_matrix_based.h +++ b/include/solvers/fluid_dynamics_matrix_based.h @@ -41,12 +41,12 @@ using namespace dealii; */ template -class GLSNavierStokesSolver +class FluidDynamicsMatrixBased : public NavierStokesBase { public: - GLSNavierStokesSolver(SimulationParameters &nsparam); - ~GLSNavierStokesSolver(); + FluidDynamicsMatrixBased(SimulationParameters &nsparam); + ~FluidDynamicsMatrixBased(); /** * @brief solve Solves the Navier-Stokes problem @@ -130,7 +130,7 @@ class GLSNavierStokesSolver * @brief Define the zero constraints used to solved the problem that change * with other physics' solutions. * - * It differs from GLSNavierStokesSolver::define_zero_constraints as it + * It differs from FluidDynamicsMatrixBased::define_zero_constraints as it * changes in time depending on the physics' solutions. Currently, it is only * used to constraint solid with the temperature's evolution. */ diff --git a/include/solvers/fluid_dynamics_nitsche.h b/include/solvers/fluid_dynamics_nitsche.h index 1dd8944dcb..fe05a4e9a0 100644 --- a/include/solvers/fluid_dynamics_nitsche.h +++ b/include/solvers/fluid_dynamics_nitsche.h @@ -38,7 +38,7 @@ using namespace dealii; */ template -class FluidDynamicsNitsche : public GLSNavierStokesSolver +class FluidDynamicsNitsche : public FluidDynamicsMatrixBased { public: FluidDynamicsNitsche(SimulationParameters &nsparam); diff --git a/source/fem-dem/cfd_dem_coupling.cc b/source/fem-dem/cfd_dem_coupling.cc index 087edea114..5aa3b4ddbd 100644 --- a/source/fem-dem/cfd_dem_coupling.cc +++ b/source/fem-dem/cfd_dem_coupling.cc @@ -1023,7 +1023,7 @@ CFDDEMSolver::postprocess_fd(bool first_iteration) << "---------------------------------------------------------------" << std::endl; - this->GLSNavierStokesSolver::postprocess_fd(first_iteration); + this->FluidDynamicsMatrixBased::postprocess_fd(first_iteration); // Visualization if (this->simulation_control->is_output_iteration()) diff --git a/source/fem-dem/fluid_dynamics_sharp.cc b/source/fem-dem/fluid_dynamics_sharp.cc index 86be2abea6..c2b404a429 100644 --- a/source/fem-dem/fluid_dynamics_sharp.cc +++ b/source/fem-dem/fluid_dynamics_sharp.cc @@ -21,11 +21,11 @@ #include -// Constructor for class GLSNavierStokesSolver +// Constructor for class FluidDynamicsSharp template FluidDynamicsSharp::FluidDynamicsSharp( CFDDEMSimulationParameters &p_nsparam) - : GLSNavierStokesSolver(p_nsparam.cfd_parameters) + : FluidDynamicsMatrixBased(p_nsparam.cfd_parameters) , cfd_dem_parameters(p_nsparam) , all_spheres(true) , combined_shapes() @@ -4171,7 +4171,7 @@ template void FluidDynamicsSharp::write_checkpoint() { - this->GLSNavierStokesSolver::write_checkpoint(); + this->FluidDynamicsMatrixBased::write_checkpoint(); // Write a table with all the relevant properties of the particle in a table. @@ -4314,7 +4314,7 @@ template void FluidDynamicsSharp::read_checkpoint() { - this->GLSNavierStokesSolver::read_checkpoint(); + this->FluidDynamicsMatrixBased::read_checkpoint(); TimerOutput::Scope t(this->computing_timer, "Reset Sharp-Edge particle information"); diff --git a/source/fem-dem/fluid_dynamics_vans.cc b/source/fem-dem/fluid_dynamics_vans.cc index cf36f158d8..e1c39d076a 100644 --- a/source/fem-dem/fluid_dynamics_vans.cc +++ b/source/fem-dem/fluid_dynamics_vans.cc @@ -12,7 +12,7 @@ template FluidDynamicsVANS::FluidDynamicsVANS( CFDDEMSimulationParameters &nsparam) - : GLSNavierStokesSolver(nsparam.cfd_parameters) + : FluidDynamicsMatrixBased(nsparam.cfd_parameters) , cfd_dem_simulation_parameters(nsparam) , void_fraction_dof_handler(*this->triangulation) , fe_void_fraction(nsparam.cfd_parameters.fem_parameters.void_fraction_order) @@ -57,7 +57,7 @@ template void FluidDynamicsVANS::setup_dofs() { - GLSNavierStokesSolver::setup_dofs(); + FluidDynamicsMatrixBased::setup_dofs(); void_fraction_dof_handler.distribute_dofs(fe_void_fraction); locally_owned_dofs_voidfraction = @@ -172,7 +172,7 @@ FluidDynamicsVANS::finish_time_step_fd() // ensure that the checkpointed information is correct percolate_void_fraction(); - GLSNavierStokesSolver::finish_time_step(); + FluidDynamicsMatrixBased::finish_time_step(); } template diff --git a/source/solvers/fluid_dynamics_matrix_based.cc b/source/solvers/fluid_dynamics_matrix_based.cc index fe8f5fa7c1..b78d271891 100644 --- a/source/solvers/fluid_dynamics_matrix_based.cc +++ b/source/solvers/fluid_dynamics_matrix_based.cc @@ -45,9 +45,9 @@ -// Constructor for class GLSNavierStokesSolver +// Constructor for class FluidDynamicsMatrixBased template -GLSNavierStokesSolver::GLSNavierStokesSolver( +FluidDynamicsMatrixBased::FluidDynamicsMatrixBased( SimulationParameters &p_nsparam) : NavierStokesBase(p_nsparam) { @@ -61,14 +61,14 @@ GLSNavierStokesSolver::GLSNavierStokesSolver( } template -GLSNavierStokesSolver::~GLSNavierStokesSolver() +FluidDynamicsMatrixBased::~FluidDynamicsMatrixBased() { this->dof_handler.clear(); } template void -GLSNavierStokesSolver::setup_dofs_fd() +FluidDynamicsMatrixBased::setup_dofs_fd() { TimerOutput::Scope t(this->computing_timer, "Setup DOFs"); @@ -177,7 +177,7 @@ GLSNavierStokesSolver::setup_dofs_fd() template void -GLSNavierStokesSolver::update_multiphysics_time_average_solution() +FluidDynamicsMatrixBased::update_multiphysics_time_average_solution() { if (this->simulation_parameters.post_processing .calculate_average_velocities || @@ -192,7 +192,7 @@ GLSNavierStokesSolver::update_multiphysics_time_average_solution() template void -GLSNavierStokesSolver::update_boundary_conditions() +FluidDynamicsMatrixBased::update_boundary_conditions() { if (!this->simulation_parameters.boundary_conditions.time_dependent) return; @@ -226,7 +226,7 @@ GLSNavierStokesSolver::update_boundary_conditions() template void -GLSNavierStokesSolver::define_non_zero_constraints() +FluidDynamicsMatrixBased::define_non_zero_constraints() { double time = this->simulation_control->get_current_time(); FEValuesExtractors::Vector velocities(0); @@ -314,7 +314,7 @@ GLSNavierStokesSolver::define_non_zero_constraints() template void -GLSNavierStokesSolver::define_zero_constraints() +FluidDynamicsMatrixBased::define_zero_constraints() { FEValuesExtractors::Vector velocities(0); FEValuesExtractors::Scalar pressure(dim); @@ -393,7 +393,7 @@ GLSNavierStokesSolver::define_zero_constraints() template void -GLSNavierStokesSolver::define_dynamic_zero_constraints() +FluidDynamicsMatrixBased::define_dynamic_zero_constraints() { if (!this->simulation_parameters.constrain_solid_domain.enable) return; @@ -434,7 +434,7 @@ GLSNavierStokesSolver::define_dynamic_zero_constraints() template void -GLSNavierStokesSolver::setup_assemblers() +FluidDynamicsMatrixBased::setup_assemblers() { this->assemblers.clear(); @@ -692,7 +692,7 @@ GLSNavierStokesSolver::setup_assemblers() template void -GLSNavierStokesSolver::assemble_system_matrix() +FluidDynamicsMatrixBased::assemble_system_matrix() { TimerOutput::Scope t(this->computing_timer, "Assemble matrix"); @@ -758,8 +758,8 @@ GLSNavierStokesSolver::assemble_system_matrix() this->dof_handler.begin_active(), this->dof_handler.end(), *this, - &GLSNavierStokesSolver::assemble_local_system_matrix, - &GLSNavierStokesSolver::copy_local_matrix_to_global_matrix, + &FluidDynamicsMatrixBased::assemble_local_system_matrix, + &FluidDynamicsMatrixBased::copy_local_matrix_to_global_matrix, scratch_data, StabilizedMethodsTensorCopyData(this->fe->n_dofs_per_cell(), this->cell_quadrature->size())); @@ -769,7 +769,7 @@ GLSNavierStokesSolver::assemble_system_matrix() template void -GLSNavierStokesSolver::assemble_local_system_matrix( +FluidDynamicsMatrixBased::assemble_local_system_matrix( const typename DoFHandler::active_cell_iterator &cell, NavierStokesScratchData &scratch_data, StabilizedMethodsTensorCopyData ©_data) @@ -885,7 +885,7 @@ GLSNavierStokesSolver::assemble_local_system_matrix( template void -GLSNavierStokesSolver::copy_local_matrix_to_global_matrix( +FluidDynamicsMatrixBased::copy_local_matrix_to_global_matrix( const StabilizedMethodsTensorCopyData ©_data) { if (!copy_data.cell_is_local) @@ -903,7 +903,7 @@ GLSNavierStokesSolver::copy_local_matrix_to_global_matrix( template void -GLSNavierStokesSolver::assemble_system_rhs() +FluidDynamicsMatrixBased::assemble_system_rhs() { TimerOutput::Scope t(this->computing_timer, "Assemble RHS"); @@ -971,8 +971,8 @@ GLSNavierStokesSolver::assemble_system_rhs() this->dof_handler.begin_active(), this->dof_handler.end(), *this, - &GLSNavierStokesSolver::assemble_local_system_rhs, - &GLSNavierStokesSolver::copy_local_rhs_to_global_rhs, + &FluidDynamicsMatrixBased::assemble_local_system_rhs, + &FluidDynamicsMatrixBased::copy_local_rhs_to_global_rhs, scratch_data, StabilizedMethodsTensorCopyData(this->fe->n_dofs_per_cell(), this->cell_quadrature->size())); @@ -986,7 +986,7 @@ GLSNavierStokesSolver::assemble_system_rhs() template void -GLSNavierStokesSolver::assemble_local_system_rhs( +FluidDynamicsMatrixBased::assemble_local_system_rhs( const typename DoFHandler::active_cell_iterator &cell, NavierStokesScratchData &scratch_data, StabilizedMethodsTensorCopyData ©_data) @@ -1102,7 +1102,7 @@ GLSNavierStokesSolver::assemble_local_system_rhs( template void -GLSNavierStokesSolver::copy_local_rhs_to_global_rhs( +FluidDynamicsMatrixBased::copy_local_rhs_to_global_rhs( const StabilizedMethodsTensorCopyData ©_data) { if (!copy_data.cell_is_local) @@ -1122,7 +1122,7 @@ GLSNavierStokesSolver::copy_local_rhs_to_global_rhs( **/ template void -GLSNavierStokesSolver::set_initial_condition_fd( +FluidDynamicsMatrixBased::set_initial_condition_fd( Parameters::InitialConditionType initial_condition_type, bool restart) { @@ -1312,7 +1312,7 @@ GLSNavierStokesSolver::set_initial_condition_fd( template void -GLSNavierStokesSolver::assemble_L2_projection() +FluidDynamicsMatrixBased::assemble_L2_projection() { system_matrix = 0; this->system_rhs = 0; @@ -1395,8 +1395,9 @@ GLSNavierStokesSolver::assemble_L2_projection() template void -GLSNavierStokesSolver::solve_linear_system(const bool initial_step, - const bool /* renewed_matrix */) +FluidDynamicsMatrixBased::solve_linear_system( + const bool initial_step, + const bool /* renewed_matrix */) { const double absolute_residual = this->simulation_parameters.linear_solver.at(PhysicsID::fluid_dynamics) @@ -1432,7 +1433,7 @@ GLSNavierStokesSolver::solve_linear_system(const bool initial_step, template void -GLSNavierStokesSolver::setup_preconditioner() +FluidDynamicsMatrixBased::setup_preconditioner() { if (this->simulation_parameters.linear_solver.at(PhysicsID::fluid_dynamics) .preconditioner == Parameters::LinearSolver::PreconditionerType::ilu) @@ -1457,7 +1458,7 @@ GLSNavierStokesSolver::setup_preconditioner() template void -GLSNavierStokesSolver::setup_ILU() +FluidDynamicsMatrixBased::setup_ILU() { TimerOutput::Scope t(this->computing_timer, "Setup ILU"); @@ -1477,7 +1478,7 @@ GLSNavierStokesSolver::setup_ILU() template void -GLSNavierStokesSolver::setup_AMG() +FluidDynamicsMatrixBased::setup_AMG() { TimerOutput::Scope t(this->computing_timer, "setup_AMG"); @@ -1550,9 +1551,10 @@ GLSNavierStokesSolver::setup_AMG() template void -GLSNavierStokesSolver::solve_system_GMRES(const bool initial_step, - const double absolute_residual, - const double relative_residual) +FluidDynamicsMatrixBased::solve_system_GMRES( + const bool initial_step, + const double absolute_residual, + const double relative_residual) { const unsigned int max_iter = 3; unsigned int iter = 0; @@ -1694,7 +1696,7 @@ GLSNavierStokesSolver::solve_system_GMRES(const bool initial_step, // it will go back to its original value at the end of the restart process. template void -GLSNavierStokesSolver::solve_system_BiCGStab( +FluidDynamicsMatrixBased::solve_system_BiCGStab( const bool initial_step, const double absolute_residual, const double relative_residual) @@ -1801,9 +1803,10 @@ GLSNavierStokesSolver::solve_system_BiCGStab( template void -GLSNavierStokesSolver::solve_system_direct(const bool initial_step, - const double absolute_residual, - const double relative_residual) +FluidDynamicsMatrixBased::solve_system_direct( + const bool initial_step, + const double absolute_residual, + const double relative_residual) { auto &system_rhs = this->system_rhs; auto &nonzero_constraints = this->nonzero_constraints; @@ -1838,7 +1841,7 @@ GLSNavierStokesSolver::solve_system_direct(const bool initial_step, template void -GLSNavierStokesSolver::solve() +FluidDynamicsMatrixBased::solve() { this->computing_timer.enter_subsection("Read mesh and manifolds"); @@ -1888,5 +1891,5 @@ GLSNavierStokesSolver::solve() // Pre-compile the 2D and 3D Navier-Stokes solver to ensure that the library is // valid before we actually compile the solver This greatly helps with debugging -template class GLSNavierStokesSolver<2>; -template class GLSNavierStokesSolver<3>; +template class FluidDynamicsMatrixBased<2>; +template class FluidDynamicsMatrixBased<3>; diff --git a/source/solvers/fluid_dynamics_nitsche.cc b/source/solvers/fluid_dynamics_nitsche.cc index b974a5cd49..787e68358e 100644 --- a/source/solvers/fluid_dynamics_nitsche.cc +++ b/source/solvers/fluid_dynamics_nitsche.cc @@ -36,7 +36,7 @@ template FluidDynamicsNitsche::FluidDynamicsNitsche( SimulationParameters &p_nsparam) - : GLSNavierStokesSolver(p_nsparam) + : FluidDynamicsMatrixBased(p_nsparam) { const unsigned int n_solids = this->simulation_parameters.nitsche->number_solids; @@ -948,9 +948,9 @@ template void FluidDynamicsNitsche::assemble_matrix_and_rhs() { - this->GLSNavierStokesSolver::assemble_system_matrix(); + this->FluidDynamicsMatrixBased::assemble_system_matrix(); - this->GLSNavierStokesSolver::assemble_system_rhs(); + this->FluidDynamicsMatrixBased::assemble_system_rhs(); assemble_nitsche_restriction(); } @@ -959,7 +959,7 @@ template void FluidDynamicsNitsche::assemble_rhs() { - this->GLSNavierStokesSolver::assemble_system_rhs(); + this->FluidDynamicsMatrixBased::assemble_system_rhs(); assemble_nitsche_restriction(); } @@ -980,7 +980,7 @@ FluidDynamicsNitsche::write_checkpoint() } // Call regular checkpointing routine - this->GLSNavierStokesSolver::write_checkpoint(); + this->FluidDynamicsMatrixBased::write_checkpoint(); std::string prefix = this->simulation_parameters.simulation_control.output_folder + @@ -1009,7 +1009,7 @@ template void FluidDynamicsNitsche::read_checkpoint() { - this->GLSNavierStokesSolver::read_checkpoint(); + this->FluidDynamicsMatrixBased::read_checkpoint(); TimerOutput::Scope t(this->computing_timer, "Nitsche reload solid mesh and particles"); diff --git a/tests/solvers/restart_01.cc b/tests/solvers/restart_01.cc index caef35afba..11f67bfc30 100644 --- a/tests/solvers/restart_01.cc +++ b/tests/solvers/restart_01.cc @@ -80,11 +80,11 @@ MMSSineForcingFunction::vector_value(const Point &p, template -class RestartNavierStokes : public GLSNavierStokesSolver +class RestartNavierStokes : public FluidDynamicsMatrixBased { public: RestartNavierStokes(SimulationParameters nsparam) - : GLSNavierStokesSolver(nsparam) + : FluidDynamicsMatrixBased(nsparam) {} void run();