OPM / opm-common

Common components for OPM, in particular build system (cmake).
http://www.opm-project.org
GNU General Public License v3.0
31 stars 112 forks source link

maximum number of 8 characters for fault names not enforced #3057

Closed blattms closed 2 years ago

blattms commented 2 years ago

If a user specifies more than 8 character for a fault then flow uses all characters to construct the fault name while other simulators seems to disregard the characters after the 8th one. This leads to problem for models assuming the behavior of the other simulators and use just the first 8 characters when referring to the fault e.g. in MULTFLT. I have just seen "ABCE_04h_reduced_height" being used defining the fault name and later referring to it with "ABCE_04h"

To add to the confusion our error is "Key not found" without any additional information. :flushed:

So the question is: Should we

In both cases we need to fix all keywords that take the name of a fault.

Thoughts? @alfbr @OPMUSER.

Will start fixing the error message...

alfbr commented 2 years ago

My preference is to allow more than eight characters, but it seems that is not on the menu :-) from the two options I prefer the latter, chopping off the excessive characters, but allowing more than eight.

atgeirr commented 2 years ago

Is not this how almost any string is treated already, for example well names? Or do we accept and use arbitrary long names there?

Are there any strings, other than in the INCLUDE keyword and others that take paths, that we should NOT chop down to 8?

blattms commented 2 years ago

@alfbr Everything is on the menu. I just only listed the ones that would make it easier to either use the model or to fix it.

Our manual states clearly that fault names have a maximum of 8 characters. We just do not act on it in any way

bska commented 2 years ago

I have no idea how hard it would be to implement, but I think the most user-friendly option here would be to permit long names and first try an exact match, but fall back to initial 8-character prefix matching if that fails. This will of course have a runtime cost so it's not something that should be added without careful measurement. On the other hand, this approach would probably also address issues like #1856—nominally handled in #1857—which may or may not recur in other models.

atgeirr commented 2 years ago

What about just looking at the first 8 characters in the map comparison operator?

bska commented 2 years ago

What about just looking at the first 8 characters in the map comparison operator?

That will do the right thing in the common case but it will fail randomly if we happen to get a model for which the initial 8-character prefix of two distinct faults is the same—e.g.,FAULT-SOUTH-1 and FAULT-SOUTH-2.

atgeirr commented 2 years ago

That will do the right thing in the common case but it will fail randomly if we happen to get a model for which the initial 8-character prefix of two distinct faults is the same—e.g.,FAULT-SOUTH-1 and FAULT-SOUTH-2.

Should we not treat those two as the same fault? Just as "ABCE_04h_reduced_height" and "ABCE_04h"?

blattms commented 2 years ago

I think this is overengineering. The manual clearly states that that fault names are limited to a maximum of 8 characters. Please also be aware that OPM uses a lot of lookups...

atgeirr commented 2 years ago

I think this is overengineering.

Not sure which of the ideas you think is overengineering, and which you favour?

blattms commented 2 years ago

Full support for long names as @bska suggested is overengineering and also breaks compatibility.

OPMUSER commented 2 years ago

I think we should follow the behavior of the commercial simulator, issue a warning stating that the fault name is greater than the allowable eight characters and has been truncated. For example:

Warning: Unsupported keywords or keyword items:  

  FAULTS: invalid fault name - ABCE_04h_reduced_height
  In file: MOD01-TEMP.DATA, line 664  
  FAULTS(FLTNAME) greater than 8 characters, truncated to: ABCE_04h - will continue

Otherwise it just adds inconsistency between decks. Engineers know the eight character rule, but unfortunately our geoscience friends always seem to forget it .

We should definitely not consider supporting FAULTS(FLTNAME) greater than 8 characters.

blattms commented 2 years ago

What about just looking at the first 8 characters in the map comparison operator?

As this is an unordered_map internally we need to do this both for the predicate and the hash functions. Seems like a nice approach that we combine with a warning if needed.

blattms commented 2 years ago

While at it I would also get rid off the template parameter for the key type of OrderedMap as this would simply things. Currently only std::string is used anyway. Does anybody envision another type to be used? Seems unlikely, right?

bska commented 2 years ago

@blattms: Is this still a problem following #3065 and OPM/opm-simulators#3959?

blattms commented 2 years ago

thanks for the hint. Not an issue anymore, sorry for not closing earlier.