#9102 Thermal Fracture: handle field units.

This commit is contained in:
Kristian Bendiksen
2022-08-03 14:07:20 +02:00
parent f102a8b249
commit a87e05035d
7 changed files with 70 additions and 16 deletions

View File

@@ -18,6 +18,7 @@
#include "RigThermalFractureResultUtil.h"
#include "RiaEclipseUnitTools.h"
#include "RiaLogging.h"
#include "RiaWeightedMeanCalculator.h"
@@ -256,6 +257,30 @@ cvf::cref<RigFractureGrid>
return nullptr;
}
// Check that the data is in the required unit system.
// Convert if not the case.
if ( requiredUnitSet != fractureDefinition->unitSystem() )
{
// Convert to the conductivity unit system used by the fracture template
// The conductivity value is used in the computations of transmissibility when exporting COMPDAT, and has unit
// md-m or md-ft This unit must match the unit used to represent coordinates of the grid used for export
for ( auto& yValues : conductivityValues )
{
for ( auto& xVal : yValues )
{
if ( requiredUnitSet == RiaDefines::EclipseUnitSystem::UNITS_FIELD )
{
xVal = RiaEclipseUnitTools::convertToFeet( xVal, conductivityUnitTextOnFile, false );
}
else if ( requiredUnitSet == RiaDefines::EclipseUnitSystem::UNITS_METRIC )
{
xVal = RiaEclipseUnitTools::convertToMeter( xVal, conductivityUnitTextOnFile, false );
}
}
}
}
// Create bounding box
cvf::BoundingBox boundingBox;
for ( auto p : points )