-
Notifications
You must be signed in to change notification settings - Fork 111
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
Additional Functionality needed for PINCH Option(4) ALL support #4181
Conversation
jenkins build this please |
One question here is also whether to set |
jenkins build this opm-grid=756 opm-simulators=5577 please |
jenkins build this opm-grid=756 opm-simulators=5577 please |
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.
Looks good, should be merged after addressing issues. One potential (not new!) bug, otherwise mostly suggestions for small improvements.
@@ -160,6 +160,9 @@ namespace Opm { | |||
/// Will return a vector a length num_active; where the value | |||
/// of each element is the corresponding global index. | |||
const std::vector<int>& getActiveMap() const; | |||
/// \brief get cell center, and center and normal of bottom face | |||
std::tuple<std::array<double, 3>,std::array<double, 3>,std::array<double, 3>> |
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.
This is fine, but if/when we merge this module with opm-grid, then Dune::FieldVector would be available. Do you think that would be a good idea to user throughout here?
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.
It might reduce code duplication and facilitate code reuse, indeed. ... once the modules are merged.
*(Y.begin() + 6), | ||
*(Z.begin() + 6)}; | ||
|
||
for(const auto cornerIndex: bottomIndices) |
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.
I suggest instead doing the cross product of the diagonals, that is the same order of accuracy, and less complex to write and read.
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.
I know that the code is complex. It basically mirrors the way it is done in opm-grid (which does the same but due to lack of docs is even harder to understand). I had the same reaction when I saw that code as you now.
But (after contemplating about the original code for some time) I think that the complexity is there for a reason. The problem is that we are talking about corner point grids. Where the corners of the top and bottom face do not need to span a plan. For a plane there is no difference,
But those points can e.g. lie rather awkwardly on the columns, such that the face is actually kind of curved and flat. Then doing it this way (with the additional center of mass) is a better approximation to the curved "plane", I think...
std::swap(item.cell1, item.cell2); | ||
}); | ||
std::sort(m_input.begin() + old_size, m_input.end()); | ||
std::inplace_merge(m_input.begin(), m_input.begin() + old_size, m_input.end()); |
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.
This requires that both partial ranges are sorted, and for the incoming data that is ensured here in this function. Could this be changed to combine two NNC objects instead, or would that be inefficient for some reason? Then both ranges would already be sorted, since addNNC() already ensures this.
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.
Probably. I will see what I can do.
Not even sure anymore, whether I will need this.
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.
Actually, there is nothing to be done here. as the m_input should always be sorted, see load_input
and the likes.
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.
They are both sorted, see load_input and the likes.
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.
If so, then this function can be reduced to just:
const auto old_size = m_input.size();
m_input.insert(m_input.end(), data.begin(), data.end());
std::inplace_merge(m_input.begin(), m_input.begin() + old_size, m_input.end());
(If my reading of load_input() is correct.)
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.
I should not have said both.
I do not want to rely on anything here for the function parameter. Hence I need to make sure that the indices are correct and sort that one. That is what I am doing.
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.
thanks a lot for the review. I will try to address most of those. First I need to fix some still lingering bugs (materializing in the real wold) in the approach, though.
*(Y.begin() + 6), | ||
*(Z.begin() + 6)}; | ||
|
||
for(const auto cornerIndex: bottomIndices) |
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.
I know that the code is complex. It basically mirrors the way it is done in opm-grid (which does the same but due to lack of docs is even harder to understand). I had the same reaction when I saw that code as you now.
But (after contemplating about the original code for some time) I think that the complexity is there for a reason. The problem is that we are talking about corner point grids. Where the corners of the top and bottom face do not need to span a plan. For a plane there is no difference,
But those points can e.g. lie rather awkwardly on the columns, such that the face is actually kind of curved and flat. Then doing it this way (with the additional center of mass) is a better approximation to the curved "plane", I think...
@@ -160,6 +160,9 @@ namespace Opm { | |||
/// Will return a vector a length num_active; where the value | |||
/// of each element is the corresponding global index. | |||
const std::vector<int>& getActiveMap() const; | |||
/// \brief get cell center, and center and normal of bottom face | |||
std::tuple<std::array<double, 3>,std::array<double, 3>,std::array<double, 3>> |
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.
It might reduce code duplication and facilitate code reuse, indeed. ... once the modules are merged.
std::swap(item.cell1, item.cell2); | ||
}); | ||
std::sort(m_input.begin() + old_size, m_input.end()); | ||
std::inplace_merge(m_input.begin(), m_input.begin() + old_size, m_input.end()); |
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.
Probably. I will see what I can do.
Not even sure anymore, whether I will need this.
e87c5a5
to
c9bea68
Compare
e035942
to
97afe21
Compare
jenkins build this opm-grid=756 opm-simulators=5577 please |
4006afc
to
6240728
Compare
jenkins build this opm-grid=756 opm-simulators=5577 please |
1 similar comment
jenkins build this opm-grid=756 opm-simulators=5577 please |
I notice that there's a merge conflict here, but that the PR otherwise is marked ready for review. What's the status of this overall feature–i.e., this PR and its downstream companion PRs? Is everything ready for review? |
6240728
to
4d8ba69
Compare
Shoot. Somehow I forgot pushing yesterday. |
jenkins build this opm-grid=756 opm-simulators=5577 please |
4d8ba69
to
990b6be
Compare
990b6be
to
6de2cdb
Compare
I will rebase this to make it work for users again. Just note, that I am factoring out another PR (for OPERATER), but some tests are still giving bad results- |
6de2cdb
to
5fbe4f9
Compare
5fbe4f9
to
e2ef76a
Compare
This is needed to calculate Z transmissibilities for pinched out cells.
This will be needed when computing transmissibilties for pinched cells. Then we will need to apply them only for a subset of cells.
This is needed for PINCH optio 4 ALL.
These are the keywords that are needed to calculate transmissibilties for the deactivated cells for the case that PINCH(4) is ALL: PERM*, TRANZ* (for the transmissibility multiplier). After we process PINCH we make those local again. To mark these keywords we use keyword_info::local_in_schedule
This cleaner and does not increase the storage size for the normal NNCs. It will also be needed for correct multiplier application.
30f6ded
to
10ad859
Compare
jenkins build this opm-grid=756 opm-simulators=5577 please |
Unfortunately my answers are not seen here in threaded mode. I gues you have to go to the "Files changed" tab to see the context. Seems like there currently is nothing to here. |
jenkins build this opm-grid=756 opm-simulators=5577 please |
1 similar comment
jenkins build this opm-grid=756 opm-simulators=5577 please |
Why the heck should this change alugrid results? Branches were out of sync. Retrying... |
jenkins build this opm-grid=756 opm-simulators=5577 please |
Seems like my push in opm-simulators was previously not successful. Let's try again |
jenkins build this opm-grid=756 opm-simulators=5577 please |
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.
Having reread the changed parts, I think that aside from some very minor issues, this is ready to be merged. Will be looking at the PRs in the other repos next.
bool global = false; | ||
/// \brief Supply global storage but remove it once the SCHEDULE is executed | ||
/// | ||
/// Needed to get rid off global storage for keywords needed for PINCH |
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.
Typo: "rid of".
return *this; | ||
} | ||
|
||
keyword_info<T>& global_kw_until_edit() { | ||
this->global = this->local_in_schedule = true; |
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.
While correct code, it is easy to misread in a hurry. I would very much prefer a single assignment per line.
jenkins build this opm-grid=756 opm-simulators=5577 please |
jenkins build this please |
Can be merged alone but triggering jenkins for the whole chain anyway. |
jenkins build this opm-grid=756 opm-simulators=5577 please |
And another time. To test typo fixes in opm-grid... |
jenkins build this opm-grid=756 opm-simulators=5577 please |
We will need to be able to
There are upcoming PRs in opm-grid and opm-simulators, but they still need some. I'll make this WIP because of that as changes migth be needed.