-
Notifications
You must be signed in to change notification settings - Fork 90
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
Adding field to output total strain #3142
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3142 +/- ##
===========================================
- Coverage 55.71% 55.68% -0.03%
===========================================
Files 1031 1032 +1
Lines 87698 87739 +41
===========================================
- Hits 48863 48861 -2
- Misses 38835 38878 +43 ☔ View full report in Codecov by Sentry. |
@@ -642,6 +642,15 @@ quadraturePointKernel( localIndex const k, | |||
LvArray::tensorOps::fill< 6 >( stack.strainIncrement, 0.0 ); | |||
FE_TYPE::symmetricGradient( dNdX, stack.uhat_local, stack.strainIncrement ); | |||
|
|||
for( int is = 0; is < 6; ++is ) | |||
{ | |||
if( q == 0 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
WRITE_AND_READ, | ||
"Average strain in cell" ); | ||
|
||
DECLARE_FIELD( incrementalStrain, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need both of these fields? Isn't the strain enough?
|
||
solidMechanics::arrayView2dLayoutIncrStrain incStrain = subRegion.getField< solidMechanics::incrementalStrain >(); | ||
solidMechanics::arrayView2dLayoutStrain strain = subRegion.getField< solidMechanics::strain >(); | ||
for( localIndex k = 0; k < subRegion.size(); ++k ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a raja loop.
solidMechanics::arrayView2dLayoutIncrStrain incStrain = subRegion.getField< solidMechanics::incrementalStrain >(); | ||
incStrain.zero(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solidMechanics::arrayView2dLayoutIncrStrain incStrain = subRegion.getField< solidMechanics::incrementalStrain >(); | |
incStrain.zero(); | |
subRegion.getField< solidMechanics::incrementalStrain >().zero(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you are setting it to zero here I am not sure I see the point of that if (q == 0)
. I also think that this means that the field will always be zero when we plot it so I would only store the strain and not the incremental one.
@@ -133,6 +135,14 @@ quadraturePointKernel( localIndex const k, | |||
|
|||
FE_TYPE::symmetricGradient( dNdX, stack.uhat_local, strainInc ); | |||
|
|||
for( int is = 0; is < 6; ++is ) | |||
{ | |||
if( q == 0 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see previous comment.
for( int is = 0; is < 6; ++is ) | ||
{ | ||
if( q == 0 ) | ||
{ | ||
m_incStrain[k][is] = 0.0; | ||
} | ||
m_incStrain[k][is] += strainInc[is]*detJxW/m_elementVolume[k]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same code seems to be repeated a few times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree - Is there a place you would recommend placing a function which does the strain tracking? Its seems like a lot of the quadrature point kernel is kind of repeated in the various places it is used.
Thanks for the review @CusiniM . You picked up on the things I was hoping to ask about. In particular, the need for both incremental strain and total strain, and the zeroing I have to do - It seemed to me that the strainInc used in the quadraturePointKernel is an increment from the previous converged time step to the current state, so I don't think you can just sum all of the increments across newton iterations, if that makes sense. I think if you dont do the zeroing in the quadrature point kernel then the results directly depend on the number of newton iterations, or at least thats what I saw during testing. I think a separate variable for the increment is needed for a similar reason, but perhaps we can think of something more clever. |
Hmm, if instead of using |
I am also still not entirely convinced that it's not worth it to launch a simpler kernel just for this computation at the end of the timestep instead of trying to combine it with the assembly. I think we would only need to dispatch on the elem type since all we need is to know how to perform the interpolation and the integration and we don't care about the constitutive type (I think). |
@CusiniM Should be good to go now if youd like to take a look. |
This PR adds registers total strain as a field within solid mechanics solvers so that it can be output to vtk. An incremental strain is updated when strain increments are computed within the quadrature point kernel, and these are added to the total stran at the end of the time step. We may want to rethink this once the new packing/data interface is in place.
I believe rebaselining will be needed as there is new output, but none of the results should change.
I also propose we have the TotalEnergies folks propose which constitutive laws they use most frequently and from which they would like elastic/plastic strain output as well, and that can be incrementally added.
An example output from my staircase runs which shows x displacement and the corresponding XX strain: