Skip to content

Commit

Permalink
Fix issue with constraints in the VANS solver and update boycott (cha…
Browse files Browse the repository at this point in the history
…os-polymtl#895)

Description of the problem
There was a major issue with the void fraction constraints in the VANS and CFD-DEM solver which led to an assertion being thrown in debug mode. The constraints were not reinited with the right size

Description of the solution
Fix this issue by reiniting the constraints correctly
Also fixed an issue with an example while I was there

How Has This Been Tested?
All tests should now pass in debug

Comments
Some part of the VANS solver and the unresolved CFD-DEM solver are still a bit of a mess. I will revisit this slowly but surely within the coming months.
  • Loading branch information
blaisb authored Oct 2, 2023
1 parent 5d41fb7 commit 5b8c54a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
8 changes: 7 additions & 1 deletion 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] - 2023-09-30

### Fixed

- MINOR Affine constraints used to bound the void fraction and used as boundary conditions within the heat transfer and the block Navier-stokes solver were corrected [#885](https://github.com/lethe-cfd/lethe/pull/895): There was an error in the application of the affine constraints used to clip the void fraction in the lethe-fluid-vans and lethe-fluid-particles solvers. This led to assertions being thrown in debug. This has been corrected by reiniting the constraints with the appropriate size. For the heat transfer and the block Navier-stokes, the issue was that the constraints were never reinited with the correct size, so they contained ghosted elements. This was caught by a new assert introduced in 2023-09 within deal.II master.

## [Master] - 2023-09-20

### Deprecated
Expand Down Expand Up @@ -36,4 +42,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

### Fixed

- MAJOR/MINOR/PATCH Description (#PR).
- MAJOR/MINOR/PATCH Description (#PR).
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ subsection cfd-dem
set shear force = true
set pressure force = true
set drag model = difelice
set post processing = true
set coupling frequency = 250
set grad-div length scale = 0.005
set vans model = modelA
Expand Down
8 changes: 7 additions & 1 deletion source/fem-dem/gls_vans.cc
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,14 @@ GLSVANSSolver<dim>::update_solution_and_constraints()
system_rhs_void_fraction);

void_fraction_constraints.clear();

// reinitialize affine constraints
void_fraction_constraints.reinit(locally_relevant_dofs_voidfraction);

// Remake hanging node constraints
DoFTools::make_hanging_node_constraints(void_fraction_dof_handler,
void_fraction_constraints);
active_set.clear();
std::vector<bool> dof_touched(void_fraction_dof_handler.n_dofs(), false);

for (const auto &cell : void_fraction_dof_handler.active_cell_iterators())
{
Expand Down
4 changes: 4 additions & 0 deletions source/solvers/gd_navier_stokes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ GDNavierStokesSolver<dim>::setup_dofs_fd()
auto &nonzero_constraints = this->nonzero_constraints;
{
nonzero_constraints.clear();
nonzero_constraints.reinit(locally_relevant_dofs_acquisition);


DoFTools::make_hanging_node_constraints(this->dof_handler,
nonzero_constraints);
Expand Down Expand Up @@ -627,6 +629,8 @@ GDNavierStokesSolver<dim>::setup_dofs_fd()

{
this->zero_constraints.clear();
this->zero_constraints.reinit(locally_relevant_dofs_acquisition);

DoFTools::make_hanging_node_constraints(this->dof_handler,
this->zero_constraints);

Expand Down
2 changes: 2 additions & 0 deletions source/solvers/heat_transfer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ HeatTransfer<dim>::setup_dofs()

{
nonzero_constraints.clear();
nonzero_constraints.reinit(this->locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(this->dof_handler,
nonzero_constraints);

Expand All @@ -1043,6 +1044,7 @@ HeatTransfer<dim>::setup_dofs()
// Boundary conditions for Newton correction
{
zero_constraints.clear();
zero_constraints.reinit(this->locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(this->dof_handler,
zero_constraints);

Expand Down

0 comments on commit 5b8c54a

Please sign in to comment.