write out the cell temperature field

I used "TEMP" as the name of the field of the UNRST files, but that is
just a guess. (I don't have access to any results of a thermal run of
the "It Defines The Truth (TM)" simulator.)
This commit is contained in:
Andreas Lauser
2015-03-26 17:33:00 +01:00
parent 1b540ff962
commit 59c8fb83d4
2 changed files with 16 additions and 2 deletions

View File

@@ -95,10 +95,10 @@ void restrictAndReorderToActiveCells(std::vector<double> &data,
}
// convert the units of an array
void convertFromSiTo(std::vector<double> &siValues, double toSiConversionFactor)
void convertFromSiTo(std::vector<double> &siValues, double toSiConversionFactor, double toSiOffset = 0)
{
for (size_t curIdx = 0; curIdx < siValues.size(); ++curIdx) {
siValues[curIdx] = unit::convert::to(siValues[curIdx], toSiConversionFactor);
siValues[curIdx] = unit::convert::to(siValues[curIdx] - toSiOffset, toSiConversionFactor);
}
}
@@ -1149,6 +1149,12 @@ void EclipseWriter::writeTimeStep(const SimulatorTimerInterface& timer,
sol.add(EclipseWriterDetails::Keyword<float>("PRESSURE", pressure));
// write the cell temperature
std::vector<double> temperature = reservoirState.temperature();
EclipseWriterDetails::convertFromSiTo(temperature, deckToSiTemperatureFactor_, deckToSiTemperatureOffset_);
EclipseWriterDetails::restrictAndReorderToActiveCells(temperature, gridToEclipseIdx_.size(), gridToEclipseIdx_.data());
sol.add(EclipseWriterDetails::Keyword<float>("TEMP", temperature));
std::vector<double> saturation_water;
std::vector<double> saturation_gas;
@@ -1266,6 +1272,12 @@ EclipseWriter::EclipseWriter(const parameter::ParameterGroup& params,
deckToSiPressure_ =
eclipseState->getDeckUnitSystem()->parse("Pressure")->getSIScaling();
// factor and offset from the temperature values given in the deck to Kelvin
deckToSiTemperatureFactor_ =
eclipseState->getDeckUnitSystem()->parse("Temperature")->getSIScaling();
deckToSiTemperatureOffset_ =
eclipseState->getDeckUnitSystem()->parse("Temperature")->getSIOffset();
init(params);
}

View File

@@ -112,6 +112,8 @@ private:
const int* compressedToCartesianCellIdx_;
std::vector< int > gridToEclipseIdx_;
double deckToSiPressure_;
double deckToSiTemperatureFactor_;
double deckToSiTemperatureOffset_;
bool enableOutput_;
int outputInterval_;
int writeStepIdx_;