PV weight FPR

This commit is contained in:
Tor Harald Sandve 2017-05-09 14:17:55 +02:00
parent 7a0a230282
commit 01c56deb3f
7 changed files with 30 additions and 12 deletions

View File

@ -70,6 +70,7 @@ class Summary {
const ecl_sum_tstep_type* prev_tstep = nullptr; const ecl_sum_tstep_type* prev_tstep = nullptr;
double prev_time_elapsed = 0; double prev_time_elapsed = 0;
double initial_oip = 0.0; double initial_oip = 0.0;
const std::vector<double> porv;
}; };
} }

View File

@ -155,6 +155,7 @@ struct fn_args {
const out::RegionCache& regionCache; const out::RegionCache& regionCache;
const EclipseGrid& grid; const EclipseGrid& grid;
double initial_oip; double initial_oip;
const std::vector<double>& pv;
}; };
/* Since there are several enums in opm scattered about more-or-less /* Since there are several enums in opm scattered about more-or-less
@ -370,10 +371,16 @@ quantity fpr( const fn_args& args ) {
return { 0.0, measure::pressure }; return { 0.0, measure::pressure };
const auto& p = args.state.data( "PRESSURE" ); const auto& p = args.state.data( "PRESSURE" );
const auto& total = std::accumulate( p.begin(), p.end(), 0.0 ); const auto& pv = args.pv;
const auto size = std::max( p.size(), size_t( 1 ) ); const auto& sw = args.state.data( "SWAT" );
double fpr = 0.0;
return { total / size, measure::pressure }; double sum_hcpv = 0.0;
for (size_t cell_index = 0; cell_index < sw.size(); ++cell_index) {
double hcpv = pv[cell_index]*(1.0 - sw[cell_index]);
fpr += hcpv * p[cell_index];
sum_hcpv += hcpv;
}
return { fpr / sum_hcpv, measure::pressure };
} }
quantity rpr(const fn_args& args) { quantity rpr(const fn_args& args) {
@ -804,7 +811,8 @@ Summary::Summary( const EclipseState& st,
st.getInputGrid().getNZ() st.getInputGrid().getNZ()
) )
), ),
handlers( new keyword_handlers() ) handlers( new keyword_handlers() ),
porv( st.get3DProperties().getDoubleGridProperty("PORV").compressedCopy(grid_arg))
{ {
/* register all keywords handlers and pair with the newly-registered ert /* register all keywords handlers and pair with the newly-registered ert
* entry. * entry.
@ -831,7 +839,8 @@ Summary::Summary( const EclipseState& st,
{}, // Solution::State {}, // Solution::State
{}, // Region <-> cell mappings. {}, // Region <-> cell mappings.
this->grid, this->grid,
this->initial_oip }; this->initial_oip,
{} };
const auto val = handle( no_args ); const auto val = handle( no_args );
const auto* unit = st.getUnits().name( val.unit ); const auto* unit = st.getUnits().name( val.unit );
@ -867,7 +876,8 @@ void Summary::add_timestep( int report_step,
state, state,
this->regionCache, this->regionCache,
this->grid, this->grid,
this->initial_oip } ); this->initial_oip,
this->porv});
const auto unit_applied_val = es.getUnits().from_si( val.unit, val.value ); const auto unit_applied_val = es.getUnits().from_si( val.unit, val.value );
const auto res = smspec_node_is_total( f.first ) && prev_tstep const auto res = smspec_node_is_total( f.first ) && prev_tstep

View File

@ -19,6 +19,8 @@ DZV
TOPS TOPS
100*0.25 / 100*0.25 /
PORO
1000*0.2 /
SOLUTION SOLUTION
RESTART RESTART

View File

@ -33,6 +33,8 @@ TOPS
ACTNUM ACTNUM
901*1 0 98*1 / 901*1 0 98*1 /
PORO
1000*0.2 /
REGIONS REGIONS

View File

@ -39,7 +39,8 @@ DZ
TOPS TOPS
100*1 / 100*1 /
PORO
1000*0.2 /
PROPS =============================================================== PROPS ===============================================================
PVTO PVTO

View File

@ -30,9 +30,8 @@ DZV
DEPTHZ DEPTHZ
121*1000 / 121*1000 /
PORO
1000*0.2 /
SCHEDULE SCHEDULE

View File

@ -14,6 +14,9 @@ DZV
TOPS TOPS
100*0.25 / 100*0.25 /
PORO
1000*0.2 /
START -- 0 START -- 0
1 NOV 1979 / 1 NOV 1979 /
SCHEDULE SCHEDULE