mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#912 Deviatoric Stress added
This commit is contained in:
parent
b61cd434cf
commit
faddabadba
@ -186,6 +186,7 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
|
||||
|
||||
fieldCompNames["SM"];
|
||||
fieldCompNames["SEM"];
|
||||
fieldCompNames["Q"];
|
||||
|
||||
fieldCompNames["SE"].push_back("S11");
|
||||
fieldCompNames["SE"].push_back("S22");
|
||||
@ -227,6 +228,7 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
|
||||
fieldCompNames = m_readerInterface->scalarIntegrationPointFieldAndComponentNames();
|
||||
fieldCompNames["SM"];
|
||||
fieldCompNames["SEM"];
|
||||
fieldCompNames["Q"];
|
||||
|
||||
fieldCompNames["SE"].push_back("S11");
|
||||
fieldCompNames["SE"].push_back("S22");
|
||||
@ -418,6 +420,48 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateMeanStressSMSEM(
|
||||
return dstDataFrames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDeviatoricStress(int partIndex, const RigFemResultAddress& resVarAddr)
|
||||
{
|
||||
CVF_ASSERT(resVarAddr.fieldName == "Q");
|
||||
|
||||
RigFemScalarResultFrames * sa11 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S11"));
|
||||
RigFemScalarResultFrames * sa22 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S22"));
|
||||
RigFemScalarResultFrames * sa33 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S33"));
|
||||
|
||||
RigFemScalarResultFrames * sm = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "SM", ""));
|
||||
|
||||
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);
|
||||
|
||||
const std::vector<float>& smData = sm->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)
|
||||
{
|
||||
float smVal = smData[vIdx];
|
||||
float sa11Corr = sa11Data[vIdx] - smVal;
|
||||
float sa22Corr = sa22Data[vIdx] - smVal;
|
||||
float sa33Corr = sa33Data[vIdx] - smVal;
|
||||
|
||||
dstFrameData[vIdx] = sqrt (1.5*(sa11Corr*sa11Corr + sa22Corr*sa22Corr + sa33Corr*sa33Corr));
|
||||
}
|
||||
}
|
||||
|
||||
return dstDataFrames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -428,6 +472,11 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
|
||||
return calculateTimeLapseResult(partIndex, resVarAddr);
|
||||
}
|
||||
|
||||
if(resVarAddr.fieldName == "Q" )
|
||||
{
|
||||
return calculateDeviatoricStress(partIndex, resVarAddr);
|
||||
}
|
||||
|
||||
if(resVarAddr.fieldName == "SM" || resVarAddr.fieldName == "SEM")
|
||||
{
|
||||
return calculateMeanStressSMSEM(partIndex, resVarAddr);
|
||||
|
@ -74,6 +74,7 @@ private:
|
||||
RigFemScalarResultFrames* calculateEnIpPorBarResult(int partIndex, const RigFemResultAddress &convertedResultAddr);
|
||||
RigFemScalarResultFrames* calculateTimeLapseResult(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* calculateMeanStressSMSEM(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* calculateDeviatoricStress(int partIndex, const RigFemResultAddress& resVarAddr);
|
||||
|
||||
cvf::Collection<RigFemPartResults> m_femPartResults;
|
||||
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;
|
||||
|
@ -445,7 +445,7 @@ void RimGeoMechView::updateLegends()
|
||||
}
|
||||
|
||||
if ( cellResult->resultFieldName() == "SE" || cellResult->resultFieldName() == "ST" || cellResult->resultFieldName() == "POR-Bar"
|
||||
|| cellResult->resultFieldName() == "SM" || cellResult->resultFieldName() == "SEM")
|
||||
|| cellResult->resultFieldName() == "SM" || cellResult->resultFieldName() == "SEM" || cellResult->resultFieldName() == "Q" )
|
||||
{
|
||||
legendTitle += " [Bar]";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user