-
Notifications
You must be signed in to change notification settings - Fork 114
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
salt solubility table allowing specification of solubility per region #2593
Conversation
|
||
namespace Opm { | ||
|
||
class DeckItem; |
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.
did you mean to forward DeckRecord here?
Also in general we do not indent for namespace. Maybe whatever you used as blueprint did but please do not replicate the mistake.
jenkins build this please |
Many other tables are managed by the If you decide it is best to stick with the current implementation - that is OK to, but maybe comment on it. |
I followed for this table the SDENSITY table implementation which has the same structure. This PR is needed for coming PRs of @goncalvesmachadoc and myself. Would it be OK to merge as it is so we can go ahead? |
|
||
#include <vector> | ||
#include <opm/parser/eclipse/Deck/DeckItem.hpp> | ||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp> |
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.
Don't need the DeckKeyword
include
@@ -897,6 +902,10 @@ std::optional<JFunc> make_jfunc(const Deck& deck) { | |||
return getTables("SALTPVD"); | |||
} | |||
|
|||
const TableContainer& TableManager::getSaltsolTables() const { |
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.
Will this work? Does not look like this tablecontainer is initialized at all.
size_t numTables = m_tabdims.getNumPVTTables(); | ||
saltsoltables.resize(numTables); | ||
|
||
const auto& keyword = deck.getKeyword("SALTSOL"); |
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 will not compile any longer:
#include <opm/parser/eclipse/Parser/ParserKeywords/S.hpp>
...
const auto& keyword = deck.get<ParserKeywords::S::SALTSOL>().back();
...
I must say I find this a bit amusing; I suggest a change which I think is an improvement and in particular aligning with how most of the other tables are implemented[1]. Then after nearly four months of silence you come back and ask if it can be merged unmodified. Have you considered my suggestion? Maybe it was a poor suggestion after all. If you still prefer the current implementation you should at least add some tests. [1]: The
and the code should automatically work with the first table for all regions - that will not work out of the box with the current code. |
jenkins build this please |
I have been encouraged to withdraw from this PR - please disregard all my previous comments and wait for someone else to review and merge it. Joakim |
We appreciate your comments explaining the benefits of changing approach. We are working on modifying the table to use the SimpleTableContainer framework. |
The table implementation is modified following the suggestion of @joakim-hove to use the |
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 will review this more carefully later, but I noticed a couple of issues that, at least superficially, look unexpected. I'm probably missing something though, so please correct my understanding.
Thanks @bska for catching the accidental mistakes. I fixed them. |
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 think this looks good in general, and I'd like to get it into the master branch. I do however have a couple of questions regarding the table schema for the multirecord version of SALTSOL
. In particular, I wonder what the most general structure of the keyword will be in the case of NTPVT > 1
and how that structure is reflected in the JSON
keyword representation.
{ | ||
"name": "DATA", | ||
"value_type": "DOUBLE", | ||
"size_type": "ALL", |
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.
@joakim-hove will know the exact details, but I believe entering size_type: ALL
here means that it is possible to parse a table with the following structure (assume NTPVT = 3
)
SALTSOL
0.1 0.2 0.3 /
/
0.123 /
Is that intentional? If not, what is the expected structure of a fully general SALTSOL
table?
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.
For NTPVT = 3, we would want to have:
SALTSOL
0.1 /
0.2 /
0.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.
The table you (@bska ) mentioned is indeed not intended.
What I understood from @joakim-hove 's comment earlier that for NTPVT=3
also the table
SALTSOL
0.1 /
/
/
is allowed for which region 2 and 3 takes the value of region 1.
As far I can see all tables use "ALL"
for size_type
. Is that observation 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.
Is that observation correct?
Yes, you're right. There may be an exception somewhere that I've overlooked, but using size_type = "ALL"
does appear to be the typical case.
tests/parser/SaltTableTests.cpp
Outdated
"550 0.5/\n" | ||
"\n" | ||
"SALTSOL\n" | ||
"8.0/\n" |
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 test data has a single record for SALTSOL
, but NTPVT = 2
. Is that supposed to work? Would you mind adding an example case that uses a fully general SALTSOL
table?
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
"TABDIMS\n"
"1 1/\n"
So shouldn't be NTPVT = 1 in this test case?
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.
So shouldn't be
NTPVT = 1
in this test case?
Yes, you're right. My mistake. I was confused by the layout of the RWGSALT
table data.
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.
Thank you for adding a test case with NTPVT > 1
. This looks good to me now. I'll run a final build check and then merge once it comes back clear.
tests/parser/SaltTableTests.cpp
Outdated
"550 0.5/\n" | ||
"\n" | ||
"SALTSOL\n" | ||
"8.0/\n" |
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.
So shouldn't be
NTPVT = 1
in this test case?
Yes, you're right. My mistake. I was confused by the layout of the RWGSALT
table data.
{ | ||
"name": "DATA", | ||
"value_type": "DOUBLE", | ||
"size_type": "ALL", |
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.
Is that observation correct?
Yes, you're right. There may be an exception somewhere that I've overlooked, but using size_type = "ALL"
does appear to be the typical case.
jenkins build this please |
2 similar comments
jenkins build this please |
jenkins build this please |
Build check is clear. I'll merge into master. Thanks a lot. |
No description provided.