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

Adding field to output total strain #3142

Merged
merged 24 commits into from
Jun 21, 2024
Merged

Conversation

ryar9534
Copy link
Contributor

@ryar9534 ryar9534 commented May 24, 2024

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:
Screen Shot 2024-05-26 at 3 47 09 PM
Screen Shot 2024-05-26 at 3 47 27 PM

@ryar9534 ryar9534 self-assigned this May 26, 2024
@ryar9534 ryar9534 added type: feature New feature or request flag: ready for review flag: requires rebaseline Requires rebaseline branch in integratedTests ci: run integrated tests Allows to run the integrated tests in GEOS CI labels May 26, 2024
@ryar9534 ryar9534 marked this pull request as ready for review May 27, 2024 02:39
Copy link

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 41 lines in your changes missing coverage. Please review.

Project coverage is 55.68%. Comparing base (3bf12d2) to head (b3e928f).
Report is 97 commits behind head on develop.

Files with missing lines Patch % Lines
...icsSolvers/solidMechanics/kernels/StrainHelper.hpp 0.00% 28 Missing ⚠️
...ers/solidMechanics/SolidMechanicsLagrangianFEM.cpp 0.00% 12 Missing ⚠️
...icsSolvers/solidMechanics/SolidMechanicsFields.hpp 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@ryar9534 ryar9534 added the ci: run CUDA builds Allows to triggers (costly) CUDA jobs label May 28, 2024
@@ -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 )
Copy link
Collaborator

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,
Copy link
Collaborator

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 )
Copy link
Collaborator

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.

Comment on lines 1341 to 1342
solidMechanics::arrayView2dLayoutIncrStrain incStrain = subRegion.getField< solidMechanics::incrementalStrain >();
incStrain.zero();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
solidMechanics::arrayView2dLayoutIncrStrain incStrain = subRegion.getField< solidMechanics::incrementalStrain >();
incStrain.zero();
subRegion.getField< solidMechanics::incrementalStrain >().zero();

Copy link
Collaborator

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 )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous comment.

Comment on lines 132 to 138
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];
Copy link
Collaborator

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.

Copy link
Contributor Author

@ryar9534 ryar9534 Jun 6, 2024

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.

@ryar9534
Copy link
Contributor Author

ryar9534 commented Jun 6, 2024

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.

@CusiniM
Copy link
Collaborator

CusiniM commented Jun 10, 2024

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 u_hat, we use u don't we get directly the total strain? At that point there is no need to store the incremental one.

@CusiniM
Copy link
Collaborator

CusiniM commented Jun 10, 2024

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 u_hat, we use u don't we get directly the total strain? At that point there is no need to store the incremental one.

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).

@ryar9534 ryar9534 removed ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI labels Jun 18, 2024
@ryar9534 ryar9534 added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI labels Jun 20, 2024
@ryar9534
Copy link
Contributor Author

@CusiniM Should be good to go now if youd like to take a look.

@CusiniM CusiniM merged commit d6b6e0b into develop Jun 21, 2024
24 of 26 checks passed
@CusiniM CusiniM deleted the feature/aronson/strainOutput branch June 21, 2024 03:36
Algiane pushed a commit that referenced this pull request Jun 21, 2024
@ryar9534 ryar9534 linked an issue Jul 4, 2024 that may be closed by this pull request
Algiane pushed a commit that referenced this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI flag: ready for review flag: requires rebaseline Requires rebaseline branch in integratedTests type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elastic/Plastic strain outputs in GEOS
3 participants