mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#912 Temporar fix of the sign of SM, However it really should be based on ST I believe now.
This commit is contained in:
parent
c6a2196ac5
commit
91302b8ee1
@ -397,28 +397,17 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateTimeLapseResult(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateMeanStressSMSEM(int partIndex, const RigFemResultAddress& resVarAddr)
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateMeanStressSEM(int partIndex, const RigFemResultAddress& resVarAddr)
|
||||
{
|
||||
CVF_ASSERT(resVarAddr.fieldName == "SEM");
|
||||
|
||||
RigFemScalarResultFrames * sa11 = nullptr;
|
||||
RigFemScalarResultFrames * sa22 = nullptr;
|
||||
RigFemScalarResultFrames * sa33 = nullptr;
|
||||
|
||||
if (resVarAddr.fieldName == "SM")
|
||||
{
|
||||
sa11 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S11"));
|
||||
sa22 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S22"));
|
||||
sa33 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S33"));
|
||||
}
|
||||
else if (resVarAddr.fieldName == "SEM")
|
||||
{
|
||||
sa11 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "SE", "S11"));
|
||||
sa22 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "SE", "S22"));
|
||||
sa33 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "SE", "S33"));
|
||||
}
|
||||
else
|
||||
{
|
||||
CVF_ASSERT(false);
|
||||
}
|
||||
sa11 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "SE", "S11"));
|
||||
sa22 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "SE", "S22"));
|
||||
sa33 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "SE", "S33"));
|
||||
|
||||
RigFemScalarResultFrames * dstDataFrames = m_femPartResults[partIndex]->createScalarResult(resVarAddr);
|
||||
|
||||
@ -441,6 +430,41 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateMeanStressSMSEM(
|
||||
|
||||
return dstDataFrames;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateMeanStressSM(int partIndex, const RigFemResultAddress& resVarAddr)
|
||||
{
|
||||
CVF_ASSERT(resVarAddr.fieldName == "SM");
|
||||
RigFemScalarResultFrames * sa11 = nullptr;
|
||||
RigFemScalarResultFrames * sa22 = nullptr;
|
||||
RigFemScalarResultFrames * sa33 = nullptr;
|
||||
|
||||
sa11 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S11"));
|
||||
sa22 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S22"));
|
||||
sa33 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S33"));
|
||||
|
||||
RigFemScalarResultFrames * dstDataFrames = m_femPartResults[partIndex]->createScalarResult(resVarAddr);
|
||||
|
||||
int frameCount = sa11->frameCount();
|
||||
for(int fIdx = 0; fIdx < frameCount; ++fIdx)
|
||||
{
|
||||
const std::vector<float>& sa11Data = sa11->frameData(fIdx);
|
||||
const std::vector<float>& sa22Data = sa22->frameData(fIdx);
|
||||
const std::vector<float>& sa33Data = sa33->frameData(fIdx);
|
||||
|
||||
std::vector<float>& dstFrameData = dstDataFrames->frameData(fIdx);
|
||||
size_t valCount = sa11Data.size();
|
||||
dstFrameData.resize(valCount);
|
||||
|
||||
for(size_t vIdx = 0; vIdx < valCount; ++vIdx)
|
||||
{
|
||||
dstFrameData[vIdx] = -(sa11Data[vIdx] + sa22Data[vIdx] + sa33Data[vIdx])/3.0f;
|
||||
}
|
||||
}
|
||||
|
||||
return dstDataFrames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -543,9 +567,14 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
|
||||
return calculateDeviatoricStress(partIndex, resVarAddr);
|
||||
}
|
||||
|
||||
if(resVarAddr.fieldName == "SM" || resVarAddr.fieldName == "SEM")
|
||||
if(resVarAddr.fieldName == "SM")
|
||||
{
|
||||
return calculateMeanStressSMSEM(partIndex, resVarAddr);
|
||||
return calculateMeanStressSM(partIndex, resVarAddr);
|
||||
}
|
||||
|
||||
if(resVarAddr.fieldName == "SEM")
|
||||
{
|
||||
return calculateMeanStressSEM(partIndex, resVarAddr);
|
||||
}
|
||||
|
||||
if (resVarAddr.fieldName == "S-Bar")
|
||||
|
@ -73,7 +73,8 @@ private:
|
||||
RigFemScalarResultFrames* calculateBarConvertedResult(int partIndex, const RigFemResultAddress &convertedResultAddr, const std::string fieldNameToConvert);
|
||||
RigFemScalarResultFrames* calculateEnIpPorBarResult(int partIndex, const RigFemResultAddress &convertedResultAddr);
|
||||
RigFemScalarResultFrames* calculateTimeLapseResult(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* calculateMeanStressSMSEM(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* calculateMeanStressSEM(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* calculateMeanStressSM(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* calculateDeviatoricStress(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* calculateVolumetricStrain(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user