-
Notifications
You must be signed in to change notification settings - Fork 61
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
Refactor void fraction out of solver #1392
Conversation
e3db630
to
2ea7c62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass. I will redo it later, but I feel there's not much else to do. It is very nice that it is a separate class now!
e8745f9
to
d7e3e42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a first pass, it's nice to see code files getting lighter and features more portable from one file to another. Nice work :)
Co-authored-by: Amishga Alphonius <107414376+AmishgaAlphonius@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last minor comments/suggestions :)
include/fem-dem/void_fraction.h
Outdated
public: | ||
VoidFractionBase( | ||
parallel::DistributedTriangulationBase<dim> *triangulation, | ||
std::shared_ptr<Parameters::VoidFractionParameters<dim>> input_parameters, | ||
const Parameters::LinearSolver &linear_solver_parameters, | ||
Particles::ParticleHandler<dim> *particle_handler, | ||
const unsigned int fe_degree, | ||
const bool simplex, | ||
const ConditionalOStream &pcout) | ||
: PhysicsLinearSubequationsSolver(pcout) | ||
, dof_handler(*triangulation) | ||
, triangulation(triangulation) | ||
, void_fraction_parameters(input_parameters) | ||
, linear_solver_parameters(linear_solver_parameters) | ||
// BB TODO verify if the particle handler can be remade const | ||
, particle_handler(particle_handler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still missing the brief for the constructor
source/fem-dem/void_fraction.cc
Outdated
const MPI_Comm mpi_communicator = dof_handler.get_communicator(); | ||
|
||
dof_handler.distribute_dofs(*fe); | ||
locally_owned_dofs = dof_handler.locally_owned_dofs(); | ||
|
||
locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler); | ||
|
||
void_fraction_constraints.clear(); | ||
void_fraction_constraints.reinit(locally_relevant_dofs); | ||
DoFTools::make_hanging_node_constraints(dof_handler, | ||
void_fraction_constraints); | ||
|
||
/// TODO ADD Periodic constraints | ||
void_fraction_constraints.close(); | ||
|
||
void_fraction_locally_relevant.reinit(locally_owned_dofs, | ||
locally_relevant_dofs, | ||
mpi_communicator); | ||
|
||
this->previous_void_fraction.resize(maximum_number_of_previous_solutions()); | ||
|
||
// Initialize vector of previous solutions for the void fraction | ||
for (auto &solution : this->previous_void_fraction) | ||
{ | ||
solution.reinit(this->locally_owned_dofs, | ||
this->locally_relevant_dofs, | ||
this->triangulation->get_communicator()); | ||
} | ||
|
||
void_fraction_locally_owned.reinit(locally_owned_dofs, | ||
this->triangulation->get_communicator()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, why is the local copy not used everywhere here?
Co-authored-by: Amishga Alphonius <107414376+AmishgaAlphonius@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All clear
Thanks for the nice thorough review @AmishgaAlphonius and @voferreira . Really helped a lot. |
Description
The facilities required to calculate the void fraction were all contained within the unresolved CFD-DEM solver and the VANS solver. This is very problematic, because it makes it difficult to develop new void fraction schemes, but also prevents the development of new VANS schemes (e.g. matrix free). Consequently, I Have used the new interface developed by @AmishgaAlphonius to refactor the void fraction calculation completely out of the VANS and unresolved CFD-DEM solver. The result is very lightweight.
I also took the opportunity to deprecate the bounding of the void fraction. This feature was never used and was actually dangerous for convergence. Consequently, it has now been fully deprecated and the documentation has been adapted.
Testing
None of the tests results were changed, this is great since nothing should have changed.
Documentation
I have removed the documentation related to the bounding of the void fraction and all of its mention within the examples.
Miscellaneous (will be removed when merged)
Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
Pull request related list: