Fixed Out of Bounds NNCs#894
Conversation
|
I'm creating this PR in draft mode because it depends on, and contains, the earlier PR #814. I will keep the PR in a draft state until such time as it is ready for review and merging. |
|
Woud it make sense to have a separate PR with just the bugfix? |
For what it's worth, this is the separate PR. I'd like to get #814 into master first. |
4ea01c4 to
1a63207
Compare
b1097e2 to
307f2dd
Compare
47bbe2b to
0e49135
Compare
The earlier PR was merged into the master branch. I'm marking this PR as "ready for review" and I'm running a build check. |
|
jenkins build this please |
f0e5267 to
d24419e
Compare
There was a problem hiding this comment.
I have the feeling that I have made some of these comments somewhere else before.
We need tests in test_minpvprocessor.cpp that test these chnages and also a regression test for the changes of the processing of thin cells.
Maybe I am missing something, but somehow the treatment of thin cells is changed by this PR and we might end up with NNCs over active thin cells. Is that what we want?
A more elaborate description explaining ALL changes would help.
| bool c_thin = (thickness[c] <= z_tolerance); | ||
| bool c_thin_inactive = !c_active && c_thin; | ||
| bool c_low_pv_active = pv[c] < minpvv[c] && c_active; | ||
| bool c_low_pv_active = (pv[c] < minpvv[c] && c_active) || (c_thin && c_active); |
There was a problem hiding this comment.
This (and all the changes below checking the thickness of active cells) seem suspicious as we should never create NNCs over active cells. Aren't these changes allowing this?
If you change the meaning of a variable then you should probably also change the name to reflect this.
There was a problem hiding this comment.
The case this fixed was when all cells where pinched but pv>0 i.e. pv \approx 1e-14. It should not be any difference between c_thin && active and (pv < minpvv[c]) && active treatment.
| auto owner = cell_part[index]; | ||
| exportProcs.insert(std::make_pair(owner, 0)); | ||
| if ( trans ) { | ||
| if ( trans && false) { |
There was a problem hiding this comment.
You have a draft pullrequest on the same. It include communication even if trans=0 in case one have other effects like thermal or mechanics over this.
| if (kk==0 || kk_iter == dims_[2]) { | ||
| kk = kk_iter; | ||
| continue; | ||
| } | ||
| //bottom cell not active, hence no nnc is created | ||
| if (!actnum.empty() && !actnum[c_below]) { | ||
| kk = kk_iter; | ||
| continue; | ||
| } |
There was a problem hiding this comment.
I guess this the first part of the bug fix?
There was a problem hiding this comment.
It make do the same in this branch as in the other so one do not iterate for ever.
| continue; | ||
| } | ||
| //bottom cell not active, hence no nnc is created | ||
| if (!actnum.empty() && !actnum[c_below]) { |
There was a problem hiding this comment.
This seems to be missing the pore volume check that was commented out above.
|
|
||
| // create nnc if false or merge the cells if true | ||
| if (mergeMinPVCells && c_low_pv_active) { | ||
| if (mergeMinPVCells){// && c_low_pv_active) { |
| if ( nnc_allowed && | ||
| (actnum.empty() || (actnum[c_above] && actnum[c_below])) && | ||
| pv[c_above] > minpvv[c_above] && pv[c_below] > minpvv[c_below]) { | ||
| !(above_small_pv) && !(below_small_pv) ){ |
There was a problem hiding this comment.
I guess, this is the second part of the bug fix if we would skip the thickness check above?
|
General comment: this fixes does two tings (if I remember correctly)
The part on mergeMinPV true is motivated by having a possibility to do pinchlike processing without needing to add artificial faces. This is need for doing mechanics. It probably will be highly favorable in other cases like thermal also. There still a bug I do not know how to handle properly which is that the active cells between process_grdecl and minpvprocessor may be different due to the pv = 0 and c_thin may not be the same. |
16d86d0 to
99db4f7
Compare
274cde7 to
8dcfa1f
Compare
75218a9 to
6de91ac
Compare
d619840 to
e64be84
Compare
5f2277a to
491647a
Compare
fc302aa to
6d4e19f
Compare
012f0dd to
dee76d4
Compare
2a5ec1e to
11ae9a5
Compare
e9c5771 to
7dbfaf0
Compare
-- still observer some race condition on strange files with temperature
Still observer some race condition on strange files with temperature