grid properties: implement a table-lookup initializer for the endpoint scaling keywords

This commit is contained in:
Andreas Lauser
2014-08-13 15:53:57 +02:00
parent f54de8eafb
commit c5f602a17c
2 changed files with 399 additions and 113 deletions

View File

@@ -389,142 +389,144 @@ namespace Opm {
// SupportedIntKeywordInfo( "FIP???" , 0 ),
SupportedIntKeywordInfo( "FIPNUM" , 1, "1" )};
const auto eptLookup = std::make_shared<GridPropertyEndpointTableLookupInitializer<>>(*deck, *this);
// Note that the variants of grid keywords for radial grids
// are not supported. (and hopefully never will be)
typedef GridProperties<double>::SupportedKeywordInfo SupportedDoubleKeywordInfo;
static std::vector<SupportedDoubleKeywordInfo> supportedDoubleKeywords = {
// keywords to specify the scaled connate gas
// saturations.
SupportedDoubleKeywordInfo( "SGL" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGL" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGLX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGLX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGLX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGLX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGLY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGLY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGLY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGLY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGLZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGLZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGLZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGLZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGL" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGL" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGLX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGLX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGLX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGLX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGLY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGLY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGLY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGLY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGLZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGLZ-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGLZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGLZ-" , eptLookup, "1" ),
// keywords to specify the connate water saturation.
SupportedDoubleKeywordInfo( "SWL" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWL" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWLX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWLX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWLX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWLX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWLY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWLY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWLY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWLY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWLZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWLZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWLZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWLZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWL" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWL" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWLX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWLX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWLX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWLX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWLY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWLY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWLY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWLY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWLZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWLZ-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWLZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWLZ-" , eptLookup, "1" ),
// keywords to specify the maximum gas saturation.
SupportedDoubleKeywordInfo( "SGU" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGU" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGUX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGUX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGUX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGUX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGUY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGUY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGUY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGUY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGUZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGUZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGUZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGUZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGU" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGU" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGUX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGUX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGUX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGUX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGUY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGUY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGUY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGUY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGUZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGUZ-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGUZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGUZ-" , eptLookup, "1" ),
// keywords to specify the maximum water saturation.
SupportedDoubleKeywordInfo( "SWU" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWU" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWUX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWUX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWUX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWUX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWUY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWUY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWUY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWUY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWUZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWUZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWUZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWUZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWU" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWU" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWUX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWUX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWUX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWUX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWUY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWUY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWUY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWUY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWUZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWUZ-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWUZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWUZ-" , eptLookup, "1" ),
// keywords to specify the scaled critical gas
// saturation.
SupportedDoubleKeywordInfo( "SGCR" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGCR" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGCRX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGCRX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGCRX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGCRX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGCRY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGCRY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGCRY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGCRY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGCRZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGCRZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGCRZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISGCRZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SGCR" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGCR" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGCRX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGCRX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGCRX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGCRX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGCRY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGCRY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGCRY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGCRY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGCRZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SGCRZ-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGCRZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISGCRZ-" , eptLookup, "1" ),
// keywords to specify the scaled critical oil-in-water
// saturation.
SupportedDoubleKeywordInfo( "SOWCR" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOWCR" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOWCRX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOWCRX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOWCRY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOWCRY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOWCRZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOWCRZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOWCR" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOWCR" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOWCRX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOWCRX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOWCRY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOWCRY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOWCRZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOWCRZ-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOWCRZ-" , eptLookup, "1" ),
// keywords to specify the scaled critical oil-in-gas
// saturation.
SupportedDoubleKeywordInfo( "SOGCR" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOGCR" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOGCRX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOGCRX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOGCRY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOGCRY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOGCRZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOGCRZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SOGCR" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOGCR" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOGCRX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOGCRX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOGCRY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOGCRY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOGCRZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SOGCRZ-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISOGCRZ-" , eptLookup, "1" ),
// keywords to specify the scaled critical water
// saturation.
SupportedDoubleKeywordInfo( "SWCR" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWCR" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWCRX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWCRX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWCRX" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWCRX-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWCRY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWCRY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWCRY" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWCRY-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWCRZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWCRZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWCRZ" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "ISWCRZ-" , 0.0, "1" ),
SupportedDoubleKeywordInfo( "SWCR" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWCR" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWCRX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWCRX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWCRX" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWCRX-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWCRY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWCRY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWCRY" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWCRY-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWCRZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "SWCRZ-" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWCRZ" , eptLookup, "1" ),
SupportedDoubleKeywordInfo( "ISWCRZ-" , eptLookup, "1" ),
// porosity
SupportedDoubleKeywordInfo( "PORO" , 0.0, "1" ),
@@ -788,7 +790,7 @@ namespace Opm {
void EclipseState::copyDoubleKeyword(const std::string& srcField , const std::string& targetField , std::shared_ptr<const Box> inputBox) {
std::shared_ptr<const GridProperty<double> > src = m_doubleGridProperties->getKeyword( srcField );
std::shared_ptr<GridProperty<double> > target = m_doubleGridProperties->getKeyword( targetField );
target->copyFrom( *src , inputBox );
}