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
add drucker prager rheology module #3257
add drucker prager rheology module #3257
Conversation
Hi @naliboff , thanks for this! I like the new structure. Concerning your discussions points:
Looking through it, I thought it might also be nice to have the DruckerPrager rheology store the updated cohesions and friction angles, instead of recomputing them to fill the AdditionalOutputs using the StrainDependent rheology, but maybe that's too much. |
@anne-glerum - Thanks for looking this over! I agree that I like the idea of outputting the modified cohesion and friction angles through the DruckerPrager rheology. Eventually, we could change the visco plastic AdditionalOutputs variable from |
86fd259
to
3cec9aa
Compare
The test Looking at Suggestions for what might be going on? I'll continue digging. from GDB:
|
@@ -224,6 +224,7 @@ namespace aspect | |||
"Units: $W/m/K$."); | |||
prm.enter_subsection ("Viscosity"); | |||
{ | |||
|
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.
@naliboff, I don't know if this causes the problem, but you want to remove the Angle of internal friction/Cohesion below (and same in parse parameters). These things are now read in the Rheology::DruckerPrager::declare_parameters(prm) function, right?
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.
@jdannberg - Thanks for taking a look! I should have added a comment on Friday after figuring out the solution.
I actually intentionally left Angle of internal friction
and Cohesion
in drucker_prager
as using the equivalent parameters in Rheology::DruckerPrager
would have required adding a decent amount of new code and adjusting tests. This is due to the parameters in Rheology::DruckerPrager
being lists, rather than single values.
@gassmoeller and I talked briefly on Friday about this and the issue is due to not having simulator access in the drucker_prager_derivatives
test, which we need to get the number of compositional fields when parsing parameters. I checked with @MFraters and the correct path forward is to adjust the test (or make new tests) following the visco_plastic_derivatives_
tests, which have simulator access. This does indeed work and I'll submit the new tests in a separate PR.
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.
Okay, but now that we have the new tests shouldnt this be removed? Or did I misunderstand our conversation? We do not want to have two parameters with nearly the same name, but different meanings in this material model.
3cec9aa
to
53d7487
Compare
@MFraters - oddly, the 2D drucker_prager_derivatives test is failing, while the 3D one passes. The changes occur at two points, one for pressure and for strain-rate: The changes in strain-rate are very small, but the pressure less so. Is this something to look carefully into or is this kind of behavior consistent with what you saw previously? If the change is due to a bug, it would have to be in the |
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.
Not quite through yet, but a first set of comments. I am not quite happy with the current flow of information beween the DruckerPrager module and the material models. I suggested a different layout, but lets talk about it if that does not work for some reason. It would be nice to simplify all of this though, so I support the aim of this PR!
New: There is a new model in the MaterialModel::Rheology namespace for plastic | ||
material behavior based on the Drucker Prager yield criterion. The functionality | ||
is largely based on existing functions in MaterialUtilities and is currently used | ||
in the visco plastic material. *Note, will updated once PR is approved and further |
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.
Dont forget to update this. What do you want to add?
in the visco plastic material. *Note, will updated once PR is approved and further | ||
changes are made. | ||
<br> | ||
(John Naliboff, 2019-10-10) |
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 is not our usual date format
/* | ||
* Objects for computing plastic stresses, viscosities, and additional outputs | ||
*/ | ||
Rheology::DruckerPrager<dim> drucker_prager_plasticity; |
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.
Shouldnt the other parameters below (angle_of_internal_friction, cohesion) now be removed, because they are inside drucker_prager_plasticity?
/* | ||
* Objects for computing plastic stresses, viscosities, and additional outputs | ||
*/ | ||
Rheology::DruckerPrager<dim> drucker_prager_plasticity; |
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 here, remove other parameters that are no longer needed.
* Compute the plastic yield stress based on the Drucker Prager yield criterion. | ||
*/ | ||
double | ||
compute_yield_stress (const double cohesion, |
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.
Shouldnt this function not get any inputs? The parameters are stored inside this class already.
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.
Ah, I saw below why you are doing this. Still I think this is not a good solution. You pass back the parameters of this class, then modify them outside (using the strain weakening module) and then hand them over again to this function. This breaks the concept of encapsulation though, either these parameters are mostly used inside this class (then they shouldnt be modified outside of it), or they should not be members of this class. I would suggest the following interface instead:
double
compute_yield_stress (const double pressure,
const unsigned int composition_index,
const double weakening_cohesion = 0.0,
const double weakening_angle_of_friction = 0.0) const;
This way you do not need to pass the parameters out and in again, you just hand over all the information that is needed inside this function. You can modify the default value for the weakening parameters from 0.0 to 1.0 if that fits better with the formula.
Did I understand this correctly?
|
||
|
||
/** | ||
* Return the value of the maximum yield stress for each composition used in |
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 do not see how this function can do for each composition
. It gets no input, and always returns one double. It would either need to get an input (which composition?) or need to return a vector (for all compositions).
@@ -224,6 +224,7 @@ namespace aspect | |||
"Units: $W/m/K$."); | |||
prm.enter_subsection ("Viscosity"); | |||
{ | |||
|
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.
Okay, but now that we have the new tests shouldnt this be removed? Or did I misunderstand our conversation? We do not want to have two parameters with nearly the same name, but different meanings in this material model.
// increment by one for background: | ||
const unsigned int n_fields = this->n_compositional_fields() + 1; | ||
|
||
angles_internal_friction = Utilities::possibly_extend_from_1_to_N (Utilities::string_to_double(Utilities::split_string_list(prm.get("Angles of internal friction"))), |
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.
All the functions in this class should use this parameter, not the ones handed over as parameters. Or did I misunderstand how this works?
* rheology model. | ||
*/ | ||
std::vector<double> | ||
get_cohesions () const; |
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 the above comment works, we might not need this function anymore.
* composition used in the rheology model. | ||
*/ | ||
std::vector<double> | ||
get_angles_internal_friction () const; |
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 for this one
@gassmoeller - thanks for the review! A quick recap from our discussion:
|
@gassmoeller - It turns out there is an issue with the new proposed interface. In the dynamic_friction material model we calculate the steady-state friction coefficient, which is used to compute the Drucker Prager yield stress. Other material models in the future may want to calculate various permutations of the friction and cohesion angle as well (e.g., beyond simple strain weakening). With this in mind, I don't think the new proposed interface is a good long-term solution and the best format is to keep with previous practice and have the material model pass the cohesion and internal friction value to the DruckerPrager rheology module. In order to deal with the encapsulation issue, perhaps the most straightforward path is to move the |
cc2367d
to
4461b76
Compare
4461b76
to
bd9feb4
Compare
👍 - thanks for the change @gassmoeller, this is a good solution. I made the associated changed to @MFraters - any thoughts on why the drucker_prager_derivatives_2d test is failing, but the 3D case is not? |
39ce754
to
88fcf56
Compare
The test was failing because the max_yield_stress for that test was changed. Previously the default was infity (no max yield stress), but the default for the input parameter is 1e12. I reverted that in another commit. I also removed the use of the DruckerPragerParameters in the drucker_prager material model and the dynamic_friction material model, because they both have a different structure for their input parameters. We can later think about how to unify them. |
When the tester agrees this is ready from my side. |
@gassmoeller - yikes, I'm surprised the change in maximum yield stress value affected only 1 out of 4 of the drucker prager tests. Thanks for pushing the other changes and agree that it is best to deal with unification of the interface and parameter declarations later on. |
This PR adds a new model in the
Rheology
namespace for Drucker Prager plasticity, which will replace the similar functionality inMaterialUtilities
.This is currently work in progress and I wanted to let @anne-glerum take a look before proceeding further.
Remaining tasks and topics for discussion:
drucker_prager
andviscoelastic_plastic
material models.For new features/models or changes of existing features: