[cig-commits] [commit] master: fixed a common bug in computing J2 of strain rate in viscoplastic and maxwell plugins. (a11170b)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Nov 10 20:05:15 PST 2014
Repository : https://github.com/geodynamics/snac
On branch : master
Link : https://github.com/geodynamics/snac/compare/5f736a5111081d5fc5045c4d20a446255243117d...a11170be305eccbb042734720b0c7ce8d9f7f498
>---------------------------------------------------------------
commit a11170be305eccbb042734720b0c7ce8d9f7f498
Author: Eunseo Choi <echoi2 at memphis.edu>
Date: Mon Nov 10 22:04:54 2014 -0600
fixed a common bug in computing J2 of strain rate in viscoplastic and maxwell plugins.
>---------------------------------------------------------------
a11170be305eccbb042734720b0c7ce8d9f7f498
Snac/plugins/maxwell/Constitutive.c | 2 +-
Snac/plugins/viscoplastic_BI/Constitutive.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Snac/plugins/maxwell/Constitutive.c b/Snac/plugins/maxwell/Constitutive.c
index f12c444..8235be8 100644
--- a/Snac/plugins/maxwell/Constitutive.c
+++ b/Snac/plugins/maxwell/Constitutive.c
@@ -121,7 +121,7 @@ void _SnacMaxwell_Constitutive( void* _context, Element_LocalIndex element_lI )
stressd1 = (*stress)[1][1] - (trace_stress) / 3.0f;
stressd2 = (*stress)[2][2] - (trace_stress) / 3.0f;
if( temperatureEP ) {
- srJ2 = sqrt(fabs(straind1*straind2+straind2*straind0+straind0*straind1 -(*strain[0][1])*(*strain[0][1])-(*strain[0][2])*(*strain[0][2])-(*strain[1][2])*(*strain[1][2])))/context->dt;
+ srJ2 = sqrt(fabs(straind1*straind2+straind2*straind0+straind0*straind1 -(*strain)[0][1]*(*strain)[0][1]-(*strain)[0][2]*(*strain)[0][2]-(*strain)[1][2]*(*strain)[1][2]))/context->dt;
if(srJ2 == 0.0f) srJ2 = rstrainrate; // temporary. should be vmax/length_scale
avgTemp=0.0;
diff --git a/Snac/plugins/viscoplastic_BI/Constitutive.c b/Snac/plugins/viscoplastic_BI/Constitutive.c
index 3ed29be..5c6d25a 100755
--- a/Snac/plugins/viscoplastic_BI/Constitutive.c
+++ b/Snac/plugins/viscoplastic_BI/Constitutive.c
@@ -173,7 +173,7 @@ void SnacViscoPlastic_Constitutive( void* _context, Element_LocalIndex element_l
/* compute viscosity and add thermal stress */
if( temperatureEP ) {
- srJ2 = sqrt(fabs(straind1*straind2+straind2*straind0+straind0*straind1 -(*strain[0][1])*(*strain[0][1])-(*strain[0][2])*(*strain[0][2])-(*strain[1][2])*(*strain[1][2])))/context->dt;
+ srJ2 = sqrt(fabs(straind1*straind2+straind2*straind0+straind0*straind1 -(*strain)[0][1]*(*strain)[0][1]-(*strain)[0][2]*(*strain)[0][2]-(*strain)[1][2]*(*strain)[1][2]))/context->dt;
if(srJ2 == 0.0f) srJ2 = rstrainrate; // temporary. should be vmax/length_scale
avgTemp=0.0;
@@ -374,7 +374,9 @@ void SnacViscoPlastic_Constitutive( void* _context, Element_LocalIndex element_l
/* linear healing: applied whether this tet has yielded or not.
Parameters are hardwired for now, but should be given through an input file. */
/* viscoplasticElement->plasticStrain[tetra_I] *= (1.0/(1.0+context->dt/1.0e+12)); */
- viscoplasticElement->plasticStrain[tetra_I] *= (1.0/(1.0+context->dt/(ind?1.0e+13:5.0e+11)));
+
+ /* To use different healing rate according to whether yielding has occurred or not: */
+ /* viscoplasticElement->plasticStrain[tetra_I] *= (1.0/(1.0+context->dt/(ind?1.0e+13:5.0e+11))); */
depls += viscoplasticElement->plasticStrain[tetra_I]*element->tetra[tetra_I].volume;
totalVolume += element->tetra[tetra_I].volume;
More information about the CIG-COMMITS
mailing list