Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: plastic strain output #3384

Open
wants to merge 59 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d5de7f3
Update SolidMechanicsLagrangianFEM.cpp
ryar9534 Oct 3, 2024
662836f
Update StrainHelper.hpp
ryar9534 Oct 3, 2024
df505c2
Update SolidMechanicsFields.hpp
ryar9534 Oct 3, 2024
3b0bd7b
Update SolidMechanicsLagrangianFEM.cpp
ryar9534 Oct 3, 2024
78e4db4
Update StrainHelper.hpp
ryar9534 Oct 3, 2024
a23f26f
Update StrainHelper.hpp
ryar9534 Oct 3, 2024
c2325c3
Update StrainHelper.hpp
ryar9534 Oct 3, 2024
27a4801
Update StrainHelper.hpp
ryar9534 Oct 3, 2024
18a94b2
Update StrainHelper.hpp
ryar9534 Oct 3, 2024
c7e03b9
Update SolidMechanicsLagrangianFEM.cpp
ryar9534 Oct 3, 2024
2f4e691
Update SolidMechanicsLagrangianFEM.cpp
ryar9534 Oct 3, 2024
3cf18ca
Update StrainHelper.hpp
ryar9534 Oct 3, 2024
4284d71
Update SolidMechanicsLagrangianFEM.cpp
ryar9534 Oct 3, 2024
cd42322
Update SolidMechanicsLagrangianFEM.cpp
ryar9534 Oct 3, 2024
6700051
Update SolidMechanicsLagrangianFEM.cpp
ryar9534 Oct 3, 2024
5c8f164
Update SolidMechanicsLagrangianFEM.cpp
ryar9534 Oct 3, 2024
7a51c30
Update StrainHelper.hpp
ryar9534 Oct 3, 2024
ca89c99
Update StrainHelper.hpp
ryar9534 Oct 3, 2024
0e72772
Merge branch 'develop' into feature/aronson/plasticStrainOutput
ryar9534 Oct 3, 2024
4f21e46
Merge branch 'develop' into feature/aronson/plasticStrainOutput
ryar9534 Oct 7, 2024
cf6fe98
initial implementation, behavior is almost right but need to debug in…
ryar9534 Oct 11, 2024
8fda259
remove extraneous file
ryar9534 Oct 11, 2024
f5f1fa7
initial proposal for handling prescribed displacements and sign diffe…
ryar9534 Oct 15, 2024
d192712
Merge branch 'develop' into feature/aronson/plasticStrainOutput
ryar9534 Nov 5, 2024
1de0c2c
Merge branch 'develop' into feature/aronson/plasticStrainOutput
ryar9534 Nov 27, 2024
48db73d
simple method for handling BCs, may want to put in a disclaimer
ryar9534 Dec 4, 2024
583e7de
Update SolidMechanicsStateReset.cpp
ryar9534 Dec 5, 2024
e9bd953
Update StrainHelper.hpp
ryar9534 Dec 5, 2024
9abd3da
Merge branch 'develop' into feature/aronson/plasticStrainOutput
ryar9534 Dec 5, 2024
25ddb6a
Update SolidMechanicsStateReset.cpp
ryar9534 Dec 5, 2024
ccc1b0d
uncrustify
ryar9534 Dec 5, 2024
913a1a0
Merge branch 'develop' into feature/aronson/plasticStrainOutput
ryar9534 Dec 9, 2024
179e4fd
Apply suggestions from code review
ryar9534 Dec 11, 2024
834bba6
Apply suggestions from code review
ryar9534 Dec 11, 2024
3b9372e
Update ElasticIsotropicPressureDependent.hpp
ryar9534 Dec 11, 2024
136fe65
Update ElasticIsotropicPressureDependent.hpp
ryar9534 Dec 11, 2024
dbf7497
Merge branch 'develop' into feature/aronson/plasticStrainOutput
ryar9534 Dec 11, 2024
246dbc8
Update ElasticIsotropicPressureDependent.hpp
ryar9534 Dec 11, 2024
bb4dfc8
uncrustify
ryar9534 Dec 11, 2024
ee9d389
Merge branch 'develop' into feature/aronson/plasticStrainOutput
ryar9534 Dec 11, 2024
4e6c411
Update .integrated_tests.yaml
ryar9534 Dec 11, 2024
ce59c54
Update BASELINE_NOTES.md
ryar9534 Dec 11, 2024
beae829
add elastic strain functions to ElasticOrthotropic
ryar9534 Dec 13, 2024
a5164dc
Update ElasticOrthotropic.hpp
ryar9534 Dec 13, 2024
d403991
Add elastic strain functions to ElasticTransverseIsotropic
ryar9534 Dec 13, 2024
b04133d
Update .integrated_tests.yaml
ryar9534 Dec 16, 2024
d8a1680
uncrustify
ryar9534 Dec 16, 2024
bb8efc1
Merge branch 'develop' into feature/aronson/plasticStrainOutput
ryar9534 Dec 16, 2024
01cce1e
Update .integrated_tests.yaml
ryar9534 Dec 16, 2024
cfe31b2
Merge branch 'develop' into feature/aronson/plasticStrainOutput
rrsettgast Dec 16, 2024
caef37b
Update .integrated_tests.yaml
ryar9534 Dec 16, 2024
69ade8d
restructure elasticIsotropic
ryar9534 Dec 16, 2024
576e7bb
restructure elasticOrthotropic
ryar9534 Dec 16, 2024
54f91fc
restructure elasticTransverseIsotropic
ryar9534 Dec 16, 2024
93b5268
uncrustify
ryar9534 Dec 16, 2024
592b991
Update StrainHelper.hpp to output tensor strain not engineering
ryar9534 Dec 19, 2024
381d6ba
Merge branch 'develop' into feature/aronson/plasticStrainOutput
paveltomin Dec 19, 2024
2c13f68
Update .integrated_tests.yaml
ryar9534 Dec 20, 2024
74c7226
Merge branch 'develop' into feature/aronson/plasticStrainOutput
paveltomin Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ DECLARE_FIELD( strain,
WRITE_AND_READ,
"Average strain in cell" );

DECLARE_FIELD( plasticStrain,
"plasticStrain",
array2dLayoutStrain,
0,
LEVEL_0,
WRITE_AND_READ,
"Average plastic strain in cell" );

DECLARE_FIELD( incrementalBubbleDisplacement,
"incrementalBubbleDisplacement",
array2d< real64 >,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ void SolidMechanicsLagrangianFEM::registerDataOnMesh( Group & meshBodies )
{
setConstitutiveNamesCallSuper( subRegion );

subRegion.registerField< solidMechanics::strain >( getName() ).reference().resizeDimension< 1 >( 6 );
rrsettgast marked this conversation as resolved.
Show resolved Hide resolved
subRegion.registerField< solidMechanics::strain >( getName() ).setDimLabels( 1, voightLabels ).reference().resizeDimension< 1 >( 6 );

} );

NodeManager & nodes = meshLevel.getNodeManager();
Expand Down Expand Up @@ -947,18 +949,29 @@ void SolidMechanicsLagrangianFEM::implicitStepComplete( real64 const & GEOS_UNUS
constitutiveRelation.saveConvergedState();

solidMechanics::arrayView2dLayoutStrain strain = subRegion.getField< solidMechanics::strain >();
solidMechanics::arrayView2dLayoutStrain plasticStrain = subRegion.getField< solidMechanics::plasticStrain >();

constitutive::ConstitutivePassThru< SolidBase >::execute(constitutiveRelation, [&] (auto & solidModel)
{

using SOLID_TYPE = TYPEOFREF( solidModel );

finiteElement::FiniteElementBase & subRegionFE = subRegion.template getReference< finiteElement::FiniteElementBase >( this->getDiscretizationName());
finiteElement::FiniteElementDispatchHandler< BASE_FE_TYPES >::dispatch3D( subRegionFE, [&] ( auto const finiteElement )
{
using FE_TYPE = decltype( finiteElement );
AverageStrainOverQuadraturePointsKernelFactory::createAndLaunch< CellElementSubRegion, FE_TYPE, parallelDevicePolicy<> >( nodeManager,
AverageStrainOverQuadraturePointsKernelFactory::createAndLaunch< FE_TYPE, SOLID_TYPE, parallelDevicePolicy<> >( nodeManager,
mesh.getEdgeManager(),
mesh.getFaceManager(),
subRegion,
finiteElement,
solidModel,
disp,
strain );
strain,
plasticStrain );
} );


} );


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "common/DataTypes.hpp"
#include "common/GEOS_RAJA_Interface.hpp"
#include "finiteElement/FiniteElementDispatch.hpp"
#include "constitutive/ConstitutivePassThru.hpp"
#include "mesh/CellElementSubRegion.hpp"
#include "mesh/utilities/AverageOverQuadraturePointsKernel.hpp"
#include "physicsSolvers/solidMechanics/SolidMechanicsFields.hpp"
Expand All @@ -33,17 +34,18 @@ namespace geos
* @class AverageStrainOverQuadraturePoints
* @tparam SUBREGION_TYPE the subRegion type
* @tparam FE_TYPE the finite element type
* @tparam SOLID_TYPE the solid mechanics constitutuve type
*/
template< typename SUBREGION_TYPE,
typename FE_TYPE >
template< typename FE_TYPE,
typename SOLID_TYPE >
class AverageStrainOverQuadraturePoints :
public AverageOverQuadraturePointsBase< SUBREGION_TYPE,
public AverageOverQuadraturePointsBase< CellElementSubRegion,
FE_TYPE >
{
public:

/// Alias for the base class;
using Base = AverageOverQuadraturePointsBase< SUBREGION_TYPE,
using Base = AverageOverQuadraturePointsBase< CellElementSubRegion,
FE_TYPE >;

using Base::m_elementVolume;
Expand All @@ -63,17 +65,21 @@ class AverageStrainOverQuadraturePoints :
AverageStrainOverQuadraturePoints( NodeManager & nodeManager,
EdgeManager const & edgeManager,
FaceManager const & faceManager,
SUBREGION_TYPE const & elementSubRegion,
CellElementSubRegion const & elementSubRegion,
FE_TYPE const & finiteElementSpace,
SOLID_TYPE const & solidModel,
fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement const displacement,
fields::solidMechanics::arrayView2dLayoutStrain const avgStrain ):
fields::solidMechanics::arrayView2dLayoutStrain const avgStrain,
fields::solidMechanics::arrayView2dLayoutStrain const avgPlasticStrain):
Base( nodeManager,
edgeManager,
faceManager,
elementSubRegion,
finiteElementSpace ),
m_solidUpdate(solidModel.createKernelUpdates()),
m_displacement( displacement ),
m_avgStrain( avgStrain )
m_avgStrain( avgStrain ),
m_avgPlasticStrain( avgPlasticStrain )
{}

/**
Expand Down Expand Up @@ -105,6 +111,7 @@ class AverageStrainOverQuadraturePoints :
for( int icomp = 0; icomp < 6; ++icomp )
{
m_avgStrain[k][icomp] = 0.0;
m_avgPlasticStrain[k][icomp] = 0.0;
}
}

Expand All @@ -126,9 +133,13 @@ class AverageStrainOverQuadraturePoints :
real64 strain[6] = {0.0};
FE_TYPE::symmetricGradient( dNdX, stack.uLocal, strain );

real64 elasticStrain[6] = {0.0};
m_solidUpdate.getElasticStrain(k, q, elasticStrain);

for( int icomp = 0; icomp < 6; ++icomp )
{
m_avgStrain[k][icomp] += detJxW*strain[icomp]/m_elementVolume[k];
m_avgPlasticStrain[k][icomp] += detJxW*(strain[icomp] - elasticStrain[icomp])/m_elementVolume[k];
}
}

Expand Down Expand Up @@ -160,12 +171,18 @@ class AverageStrainOverQuadraturePoints :

protected:

/// The material
typename SOLID_TYPE::KernelWrapper const m_solidUpdate;

/// The displacement solution
fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement const m_displacement;

/// The average strain
fields::solidMechanics::arrayView2dLayoutStrain const m_avgStrain;

/// The average plastic strain
fields::solidMechanics::arrayView2dLayoutStrain const m_avgPlasticStrain;

};


Expand All @@ -182,6 +199,7 @@ class AverageStrainOverQuadraturePointsKernelFactory
* @brief Create a new kernel and launch
* @tparam SUBREGION_TYPE the subRegion type
* @tparam FE_TYPE the finite element type
* @tparam SOLID_TYPE the constitutive type
* @tparam POLICY the kernel policy
* @param nodeManager the node manager
* @param edgeManager the edge manager
Expand All @@ -191,23 +209,25 @@ class AverageStrainOverQuadraturePointsKernelFactory
* @param property the property at quadrature points
* @param averageProperty the property averaged over quadrature points
*/
template< typename SUBREGION_TYPE,
typename FE_TYPE,
template< typename FE_TYPE,
typename SOLID_TYPE,
typename POLICY >
static void
createAndLaunch( NodeManager & nodeManager,
EdgeManager const & edgeManager,
FaceManager const & faceManager,
SUBREGION_TYPE const & elementSubRegion,
CellElementSubRegion const & elementSubRegion,
FE_TYPE const & finiteElementSpace,
SOLID_TYPE const & solidModel,
fields::solidMechanics::arrayViewConst2dLayoutTotalDisplacement const displacement,
fields::solidMechanics::arrayView2dLayoutStrain const avgStrain )
fields::solidMechanics::arrayView2dLayoutStrain const avgStrain,
fields::solidMechanics::arrayView2dLayoutStrain const avgPlasticStrain)
{
AverageStrainOverQuadraturePoints< SUBREGION_TYPE, FE_TYPE >
AverageStrainOverQuadraturePoints< FE_TYPE, SOLID_TYPE >
kernel( nodeManager, edgeManager, faceManager, elementSubRegion, finiteElementSpace,
displacement, avgStrain );
solidModel, displacement, avgStrain, avgPlasticStrain );

AverageStrainOverQuadraturePoints< SUBREGION_TYPE, FE_TYPE >::template
AverageStrainOverQuadraturePoints< FE_TYPE, SOLID_TYPE >::template
kernelLaunch< POLICY >( elementSubRegion.size(), kernel );
}
};
Expand Down
Loading