Skip to content

Use the correct number of nodes for boundary conditions in GridGenerator

In the past, we tried two different versions for setting the number of boundary condition nodes in GridGenerator.cpp

With this merge we use this version again:

            para->getParH(level)->velocityBC.numberOfBCnodes = numberOfVelocityValues;

We used the following code for some time:

            blocks = (numberOfVelocityValues / para->getParH(level)->numberofthreads) + 1;
            para->getParH(level)->velocityBC.numberOfBCnodes = blocks * para->getParH(level)->numberofthreads;

History of this code snippet:

Why do we change this again?

Not using the exact number of nodes causes problems when calculating mean values over all boundary nodes: Multiplying by the number of blocks adds some extra nodes to numberOfBCnodes. When you do a calculation that needs the values of all boundary nodes and use numberOfBCnodes, you get incorrect results.

Tests:

We added a regression test with multiple boundary conditions in https://git.rz.tu-bs.de/irmb/VirtualFluids_dev/-/merge_requests/222. When we compared both versions of the code snippets above in the regression test, we found no differences.

To do:

Edited by Anna Wellmann

Merge request reports

Loading