Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename all block Navier Stokes files using Fluid Dynamics prefix #1226

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to the Lethe project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [Master] - 2024-08-06

### Changed

- MINOR Renamed the main file related to the `lethe-fluid-block` application: `gd_navier_stokes` to `fluid_dynamics_block`. The name of the `GDNavierStokesAssembler...` classes were changed to `BlockNavierStokesAssembler...`, and the main class `GDNavierStokesSolver` was also renamed to `FluidDynamicsBlock`. [#1226](https://github.com/chaos-polymtl/lethe/pull/1226)

## [Master] - 2024-08-05

### Changed
Expand Down
2 changes: 1 addition & 1 deletion applications/lethe-fluid-block/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
add_executable(lethe-fluid-block gd_navier_stokes.cc)
add_executable(lethe-fluid-block fluid_dynamics_block.cc)
deal_ii_setup_target(lethe-fluid-block)
target_link_libraries(lethe-fluid-block lethe-solvers)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <solvers/gd_navier_stokes.h>
#include <solvers/fluid_dynamics_block.h>

#include <deal.II/base/convergence_table.h>

Expand Down Expand Up @@ -30,10 +30,10 @@ main(int argc, char *argv[])

AssertThrow(NSparam.nitsche->number_solids == 0,
SolidWarning(NSparam.nitsche->number_solids,
"gd_navier_stokes_2d",
"gls_nitsche_navier_stokes_22"));
"lethe-fluid-block",
"lethe-fluid-nitsche"));

GDNavierStokesSolver<2> problem(NSparam);
FluidDynamicsBlock<2> problem(NSparam);
problem.solve();
}

Expand All @@ -48,10 +48,10 @@ main(int argc, char *argv[])

AssertThrow(NSparam.nitsche->number_solids == 0,
SolidWarning(NSparam.nitsche->number_solids,
"gd_navier_stokes_2d",
"gls_nitsche_navier_stokes_22"));
"lethe-fluid-block",
"lethe-fluid-nitsche"));

GDNavierStokesSolver<3> problem(NSparam);
FluidDynamicsBlock<3> problem(NSparam);
problem.solve();
}

Expand Down
2 changes: 1 addition & 1 deletion doc/doxygen/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
physics_solver:e -> auxiliary_physics:w [dir=back];

navier_stokes_base_1 [label=<<B>GLSNavierStokesSolver</B> <br/>(lethe-fluid)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classGLSNavierStokesSolver.html", tooltip="GLSNavierStokesSolver"];
navier_stokes_base_2 [label=<<B>GDNavierStokesSolver</B> <br/> (lethe-fluid-block)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classGDNavierStokesSolver.html", tooltip="GDNavierStokesSolver"];
navier_stokes_base_2 [label=<<B>FluidDynamicsBlock</B> <br/> (lethe-fluid-block)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classFluidDynamicsBlock.html", tooltip="FluidDynamicsBlock"];
navier_stokes_base_3 [label=<<B>FluidDynamicsMatrixFree</B> <br/> (lethe-fluid-matrix-free)>,href="https://chaos-polymtl.github.io/lethe/doxygen/classFluidDynamicsMatrixFree.html", tooltip="FluidDynamicsMatrixFree"];

navier_stokes_base:e -> navier_stokes_base_1:w [dir=back];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* ---------------------------------------------------------------------
*/

#ifndef lethe_gd_navier_stokes_h
#define lethe_gd_navier_stokes_h
#ifndef lethe_fluid_dynamics_block_h
#define lethe_fluid_dynamics_block_h

#include <core/exceptions.h>
#include <core/vector.h>
Expand Down Expand Up @@ -72,12 +72,12 @@ class BlockSchurPreconditioner : public Subscriptor
*/

template <int dim>
class GDNavierStokesSolver
class FluidDynamicsBlock
: public NavierStokesBase<dim, GlobalBlockVectorType, std::vector<IndexSet>>
{
public:
GDNavierStokesSolver(SimulationParameters<dim> &nsparam);
~GDNavierStokesSolver();
FluidDynamicsBlock(SimulationParameters<dim> &nsparam);
~FluidDynamicsBlock();

void
solve();
Expand Down
8 changes: 4 additions & 4 deletions include/solvers/navier_stokes_assemblers.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ class GLSNavierStokesAssemblerBDF : public NavierStokesAssemblerBase<dim>


template <int dim>
class GDNavierStokesAssemblerCore : public NavierStokesAssemblerBase<dim>
class BlockNavierStokesAssemblerCore : public NavierStokesAssemblerBase<dim>
{
public:
GDNavierStokesAssemblerCore(
BlockNavierStokesAssemblerCore(
std::shared_ptr<SimulationControl> simulation_control,
const double gamma)
: simulation_control(simulation_control)
Expand Down Expand Up @@ -404,11 +404,11 @@ class GDNavierStokesAssemblerCore : public NavierStokesAssemblerBase<dim>
};

template <int dim>
class GDNavierStokesAssemblerNonNewtonianCore
class BlockNavierStokesAssemblerNonNewtonianCore
: public NavierStokesAssemblerBase<dim>
{
public:
GDNavierStokesAssemblerNonNewtonianCore(
BlockNavierStokesAssemblerNonNewtonianCore(
std::shared_ptr<SimulationControl> simulation_control,
const double gamma)
: simulation_control(simulation_control)
Expand Down
4 changes: 2 additions & 2 deletions source/solvers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_library(lethe-solvers
cahn_hilliard_filter.cc
cahn_hilliard_scratch_data.cc
flow_control.cc
gd_navier_stokes.cc
fluid_dynamics_block.cc
gls_navier_stokes.cc
gls_nitsche_navier_stokes.cc
heat_transfer.cc
Expand Down Expand Up @@ -47,7 +47,7 @@ add_library(lethe-solvers
../../include/solvers/cahn_hilliard_scratch_data.h
../../include/solvers/copy_data.h
../../include/solvers/flow_control.h
../../include/solvers/gd_navier_stokes.h
../../include/solvers/fluid_dynamics_block.h
../../include/solvers/gls_navier_stokes.h
../../include/solvers/gls_nitsche_navier_stokes.h
../../include/solvers/heat_transfer.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <core/time_integration_utilities.h>
#include <core/utilities.h>

#include <solvers/gd_navier_stokes.h>
#include <solvers/fluid_dynamics_block.h>
#include <solvers/isothermal_compressible_navier_stokes_vof_assembler.h>
#include <solvers/navier_stokes_assemblers.h>
#include <solvers/navier_stokes_vof_assemblers.h>
Expand All @@ -40,23 +40,23 @@



// Constructor for class GDNavierStokesSolver
// Constructor for class FluidDynamicsBlock
template <int dim>
GDNavierStokesSolver<dim>::GDNavierStokesSolver(
FluidDynamicsBlock<dim>::FluidDynamicsBlock(
SimulationParameters<dim> &p_nsparam)
: NavierStokesBase<dim, GlobalBlockVectorType, std::vector<IndexSet>>(
p_nsparam)
{}

template <int dim>
GDNavierStokesSolver<dim>::~GDNavierStokesSolver()
FluidDynamicsBlock<dim>::~FluidDynamicsBlock()
{
this->dof_handler.clear();
}

template <int dim>
void
GDNavierStokesSolver<dim>::setup_assemblers()
FluidDynamicsBlock<dim>::setup_assemblers()
{
this->assemblers.clear();

Expand Down Expand Up @@ -162,7 +162,7 @@ GDNavierStokesSolver<dim>::setup_assemblers()
{
// Core assembler with non-Newtonian viscosity
this->assemblers.push_back(
std::make_shared<GDNavierStokesAssemblerNonNewtonianCore<dim>>(
std::make_shared<BlockNavierStokesAssemblerNonNewtonianCore<dim>>(
this->simulation_control, gamma));
}
else
Expand All @@ -173,7 +173,7 @@ GDNavierStokesSolver<dim>::setup_assemblers()
this->simulation_parameters.stabilization.stabilization ==
Parameters::Stabilization::NavierStokesStabilization::grad_div)
this->assemblers.push_back(
std::make_shared<GDNavierStokesAssemblerCore<dim>>(
std::make_shared<BlockNavierStokesAssemblerCore<dim>>(
this->simulation_control, gamma));

else
Expand All @@ -186,7 +186,7 @@ GDNavierStokesSolver<dim>::setup_assemblers()

template <int dim>
void
GDNavierStokesSolver<dim>::update_multiphysics_time_average_solution()
FluidDynamicsBlock<dim>::update_multiphysics_time_average_solution()
{
if (this->simulation_parameters.post_processing.calculate_average_velocities)
{
Expand All @@ -198,7 +198,7 @@ GDNavierStokesSolver<dim>::update_multiphysics_time_average_solution()

template <int dim>
void
GDNavierStokesSolver<dim>::assemble_system_matrix()
FluidDynamicsBlock<dim>::assemble_system_matrix()
{
TimerOutput::Scope t(this->computing_timer, "Assemble matrix");
// this->simulation_control->set_assembly_method(this->time_stepping_method);
Expand Down Expand Up @@ -230,8 +230,8 @@ GDNavierStokesSolver<dim>::assemble_system_matrix()
this->dof_handler.begin_active(),
this->dof_handler.end(),
*this,
&GDNavierStokesSolver::assemble_local_system_matrix,
&GDNavierStokesSolver::copy_local_matrix_to_global_matrix,
&FluidDynamicsBlock::assemble_local_system_matrix,
&FluidDynamicsBlock::copy_local_matrix_to_global_matrix,
scratch_data,
StabilizedMethodsTensorCopyData<dim>(this->fe->n_dofs_per_cell(),
this->cell_quadrature->size()));
Expand All @@ -256,7 +256,7 @@ GDNavierStokesSolver<dim>::assemble_system_matrix()

template <int dim>
void
GDNavierStokesSolver<dim>::assemble_local_system_matrix(
FluidDynamicsBlock<dim>::assemble_local_system_matrix(
const typename DoFHandler<dim>::active_cell_iterator &cell,
NavierStokesScratchData<dim> &scratch_data,
StabilizedMethodsTensorCopyData<dim> &copy_data)
Expand Down Expand Up @@ -313,7 +313,7 @@ GDNavierStokesSolver<dim>::assemble_local_system_matrix(

template <int dim>
void
GDNavierStokesSolver<dim>::copy_local_matrix_to_global_matrix(
FluidDynamicsBlock<dim>::copy_local_matrix_to_global_matrix(
const StabilizedMethodsTensorCopyData<dim> &copy_data)
{
if (!copy_data.cell_is_local)
Expand All @@ -328,7 +328,7 @@ GDNavierStokesSolver<dim>::copy_local_matrix_to_global_matrix(

template <int dim>
void
GDNavierStokesSolver<dim>::assemble_system_rhs()
FluidDynamicsBlock<dim>::assemble_system_rhs()
{
TimerOutput::Scope t(this->computing_timer, "Assemble RHS");
// this->simulation_control->set_assembly_method(this->time_stepping_method);
Expand Down Expand Up @@ -369,8 +369,8 @@ GDNavierStokesSolver<dim>::assemble_system_rhs()
this->dof_handler.begin_active(),
this->dof_handler.end(),
*this,
&GDNavierStokesSolver::assemble_local_system_rhs,
&GDNavierStokesSolver::copy_local_rhs_to_global_rhs,
&FluidDynamicsBlock::assemble_local_system_rhs,
&FluidDynamicsBlock::copy_local_rhs_to_global_rhs,
scratch_data,
StabilizedMethodsTensorCopyData<dim>(this->fe->n_dofs_per_cell(),
this->cell_quadrature->size()));
Expand All @@ -383,12 +383,12 @@ GDNavierStokesSolver<dim>::assemble_system_rhs()

template <int dim>
void
GDNavierStokesSolver<dim>::setup_preconditioner()
FluidDynamicsBlock<dim>::setup_preconditioner()
{}

template <int dim>
void
GDNavierStokesSolver<dim>::assemble_local_system_rhs(
FluidDynamicsBlock<dim>::assemble_local_system_rhs(
const typename DoFHandler<dim>::active_cell_iterator &cell,
NavierStokesScratchData<dim> &scratch_data,
StabilizedMethodsTensorCopyData<dim> &copy_data)
Expand Down Expand Up @@ -454,7 +454,7 @@ GDNavierStokesSolver<dim>::assemble_local_system_rhs(

template <int dim>
void
GDNavierStokesSolver<dim>::copy_local_rhs_to_global_rhs(
FluidDynamicsBlock<dim>::copy_local_rhs_to_global_rhs(
const StabilizedMethodsTensorCopyData<dim> &copy_data)
{
if (!copy_data.cell_is_local)
Expand All @@ -470,7 +470,7 @@ GDNavierStokesSolver<dim>::copy_local_rhs_to_global_rhs(

template <int dim>
void
GDNavierStokesSolver<dim>::assemble_L2_projection()
FluidDynamicsBlock<dim>::assemble_L2_projection()
{
system_matrix = 0;
auto &system_rhs = this->system_rhs;
Expand Down Expand Up @@ -555,7 +555,7 @@ GDNavierStokesSolver<dim>::assemble_L2_projection()

template <int dim>
void
GDNavierStokesSolver<dim>::setup_dofs_fd()
FluidDynamicsBlock<dim>::setup_dofs_fd()
{
TimerOutput::Scope t(this->computing_timer, "Setup DOFs");

Expand Down Expand Up @@ -810,7 +810,7 @@ GDNavierStokesSolver<dim>::setup_dofs_fd()

template <int dim>
void
GDNavierStokesSolver<dim>::set_solution_vector(double value)
FluidDynamicsBlock<dim>::set_solution_vector(double value)
{
this->present_solution = value;
}
Expand All @@ -821,7 +821,7 @@ GDNavierStokesSolver<dim>::set_solution_vector(double value)
**/
template <int dim>
void
GDNavierStokesSolver<dim>::set_initial_condition_fd(
FluidDynamicsBlock<dim>::set_initial_condition_fd(
Parameters::InitialConditionType initial_condition_type,
bool restart)
{
Expand Down Expand Up @@ -877,8 +877,8 @@ GDNavierStokesSolver<dim>::set_initial_condition_fd(

template <int dim>
void
GDNavierStokesSolver<dim>::solve_linear_system(const bool initial_step,
const bool renewed_matrix)
FluidDynamicsBlock<dim>::solve_linear_system(const bool initial_step,
const bool renewed_matrix)
{
const double absolute_residual =
this->simulation_parameters.linear_solver.at(PhysicsID::fluid_dynamics)
Expand All @@ -904,7 +904,7 @@ GDNavierStokesSolver<dim>::solve_linear_system(const bool initial_step,

template <int dim>
void
GDNavierStokesSolver<dim>::setup_ILU()
FluidDynamicsBlock<dim>::setup_ILU()
{
TimerOutput::Scope t(this->computing_timer, "setup_ILU");

Expand Down Expand Up @@ -947,7 +947,7 @@ GDNavierStokesSolver<dim>::setup_ILU()

template <int dim>
void
GDNavierStokesSolver<dim>::setup_AMG()
FluidDynamicsBlock<dim>::setup_AMG()
{
TimerOutput::Scope t(this->computing_timer, "setup_AMG");

Expand Down Expand Up @@ -1076,10 +1076,10 @@ GDNavierStokesSolver<dim>::setup_AMG()

template <int dim>
void
GDNavierStokesSolver<dim>::solve_system_GMRES(const bool initial_step,
const double absolute_residual,
const double relative_residual,
const bool renewed_matrix)
FluidDynamicsBlock<dim>::solve_system_GMRES(const bool initial_step,
const double absolute_residual,
const double relative_residual,
const bool renewed_matrix)
{
const AffineConstraints<double> &constraints_used =
initial_step ? this->nonzero_constraints : this->zero_constraints;
Expand Down Expand Up @@ -1166,9 +1166,9 @@ GDNavierStokesSolver<dim>::solve_system_GMRES(const bool initial_step,

template <int dim>
void
GDNavierStokesSolver<dim>::solve_L2_system(const bool initial_step,
double absolute_residual,
double relative_residual)
FluidDynamicsBlock<dim>::solve_L2_system(const bool initial_step,
double absolute_residual,
double relative_residual)
{
auto &system_rhs = this->system_rhs;
auto &nonzero_constraints = this->nonzero_constraints;
Expand Down Expand Up @@ -1243,7 +1243,7 @@ GDNavierStokesSolver<dim>::solve_L2_system(const bool initial_step,
*/
template <int dim>
void
GDNavierStokesSolver<dim>::solve()
FluidDynamicsBlock<dim>::solve()
{
read_mesh_and_manifolds(
*this->triangulation,
Expand Down Expand Up @@ -1294,5 +1294,5 @@ GDNavierStokesSolver<dim>::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 GDNavierStokesSolver<2>;
template class GDNavierStokesSolver<3>;
template class FluidDynamicsBlock<2>;
template class FluidDynamicsBlock<3>;
Loading
Loading