From 6809268d12555f22b86d694d3e2adaa9509dd6c1 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 5 Feb 2025 11:35:41 +0100 Subject: [PATCH] move assignment of linStress into MechContainer --- opm/simulators/flow/MechContainer.cpp | 13 +++++++++++++ opm/simulators/flow/MechContainer.hpp | 3 +++ opm/simulators/flow/OutputBlackoilModule.hpp | 11 +++-------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/opm/simulators/flow/MechContainer.cpp b/opm/simulators/flow/MechContainer.cpp index 32bc8f800..15e56a01e 100644 --- a/opm/simulators/flow/MechContainer.cpp +++ b/opm/simulators/flow/MechContainer.cpp @@ -117,6 +117,19 @@ assignDisplacement(const unsigned globalDofIdx, this->disp_[2][globalDofIdx] = disp[2]; } +template +void MechContainer:: +assignLinStress(const unsigned globalDofIdx, + const Dune::FieldVector& linStress) +{ + this->linstressXX_[globalDofIdx] = linStress[0]; + this->linstressYY_[globalDofIdx] = linStress[1]; + this->linstressZZ_[globalDofIdx] = linStress[2]; + this->linstressYZ_[globalDofIdx] = linStress[3]; + this->linstressXZ_[globalDofIdx] = linStress[4]; + this->linstressXY_[globalDofIdx] = linStress[5]; +} + template void MechContainer:: assignPotentialForces(const unsigned globalDofIdx, diff --git a/opm/simulators/flow/MechContainer.hpp b/opm/simulators/flow/MechContainer.hpp index ae4057fe4..c885b33de 100644 --- a/opm/simulators/flow/MechContainer.hpp +++ b/opm/simulators/flow/MechContainer.hpp @@ -60,6 +60,9 @@ public: const Scalar pressForce, const Scalar tempForce); + void assignLinStress(const unsigned globalDofIdx, + const Dune::FieldVector& linStress); + void assignStrain(const unsigned globalDofIdx, const Dune::FieldVector& strain); diff --git a/opm/simulators/flow/OutputBlackoilModule.hpp b/opm/simulators/flow/OutputBlackoilModule.hpp index 0c4270bbe..d658fe05b 100644 --- a/opm/simulators/flow/OutputBlackoilModule.hpp +++ b/opm/simulators/flow/OutputBlackoilModule.hpp @@ -215,6 +215,9 @@ public: this->mech_.assignDisplacement(globalDofIdx, model.disp(globalDofIdx, /*include_fracture*/true)); + this->mech_.assignLinStress(globalDofIdx, + model.linstress(globalDofIdx)); + this->mech_.assignPotentialForces(globalDofIdx, model.mechPotentialForce(globalDofIdx), model.mechPotentialPressForce(globalDofIdx), @@ -227,14 +230,6 @@ public: this->mech_.assignStress(globalDofIdx, model.stress(globalDofIdx, /*include_fracture*/true));; - const auto linstress = model.linstress(globalDofIdx); - this->mech_.linstressXX_[globalDofIdx] = linstress[Voigt::XX]; - this->mech_.linstressYY_[globalDofIdx] = linstress[Voigt::YY]; - this->mech_.linstressZZ_[globalDofIdx] = linstress[Voigt::ZZ]; - this->mech_.linstressXY_[globalDofIdx] = linstress[Voigt::XY]; - this->mech_.linstressXZ_[globalDofIdx] = linstress[Voigt::XZ]; - this->mech_.linstressYZ_[globalDofIdx] = linstress[Voigt::YZ]; - // is the tresagii stress which make rock fracture const auto fracstress = model.fractureStress(globalDofIdx); this->mech_.fracstressXX_[globalDofIdx] = fracstress[Voigt::XX];