scaling of the Alq values

This commit is contained in:
Tor Harald Sandve
2020-09-15 14:58:12 +02:00
parent a4d07b5c57
commit ca2dfc6136
2 changed files with 33 additions and 1 deletions

View File

@@ -205,6 +205,9 @@ private:
static void convertGFRToSI(const GFR_TYPE& type,
std::vector<double>& values,
const UnitSystem& unit_system);
static void convertAlqToSI(const ALQ_TYPE& type,
std::vector<double>& values,
const UnitSystem& unit_system);
};

View File

@@ -285,7 +285,7 @@ VFPProdTable::VFPProdTable( const DeckKeyword& table, const UnitSystem& deck_uni
//Get actual gas fraction values
m_alq_data = table.getRecord(5).getItem<VFPPROD::ALQ_VALUES>().getData< double >();
convertAlqToSI(m_alq_type, m_alq_data, deck_unit_system);
//Finally, read the actual table itself.
size_t nt = m_thp_data.size();
size_t nw = m_wfr_data.size();
@@ -525,6 +525,35 @@ void VFPProdTable::convertGFRToSI(const GFR_TYPE& type,
}
void VFPProdTable::convertAlqToSI(const ALQ_TYPE& type,
std::vector<double>& values,
const UnitSystem& unit_system) {
double scaling_factor = 1.0;
switch (type) {
case ALQ_IGLR:
scaling_factor = unit_system.parse("GasSurfaceVolume/LiquidSurfaceVolume * Time").getSIScaling();
break;
case ALQ_TGLR:
scaling_factor = unit_system.parse("GasSurfaceVolume/LiquidSurfaceVolume").getSIScaling();
break;
case ALQ_GRAT:
scaling_factor = unit_system.parse("GasSurfaceVolume/Time").getSIScaling();
break;
case ALQ_UNDEF:
break;
case ALQ_PUMP:
case ALQ_COMP:
case ALQ_INVALID:
case ALQ_BEAN:
std::logic_error("scaling of the given ALQ type, not implemented ");
break;
default:
throw std::logic_error("Invalid ALQ type");
}
scaleValues(values, scaling_factor);
}
bool VFPProdTable::operator==(const VFPProdTable& data) const {
return this->getTableNum() == data.getTableNum() &&
this->getDatumDepth () == data.getDatumDepth() &&