(WIP) Add initial implementation of Maxwell-Wiechert rheology with two Maxwell arms - #7228
(WIP) Add initial implementation of Maxwell-Wiechert rheology with two Maxwell arms#7228alarshi wants to merge 2 commits into
Conversation
Add changes to stress compositional fields. Add stress fraction as compositional field. Restructure the reaction outputs.
bobmyhill
left a comment
There was a problem hiding this comment.
Hi @alarshi ,
Thanks for making a start on this cool project!
This PR is currently quite difficult to review, because a lot is derived from the elasticity rheology. Could you start with a commit that duplicates elasticity.cc (and .h) into maxwell_wiechert.cc (and .h) and just change the class name and initialisation? Then the github review system will be easier to use and you'll be able to track which things you changed in each commit.
After that, you could add what you've done here on top of that commit (if you are happy that you can follow the changes you made so far), or make smaller commits, slowly adding up to the model that you want to have. For example:
- Commit 2: add the "stress fraction" fields (n - 1 fields for n Maxwell arms) and read them in to the rheology model. In the first commit you could have these fields do nothing and just be advected passively. You don't need to add a "Stress fractions" parameter in the rheology model - we will just need to strip these out again later.
- Commit 3: Add a test for the stress fraction outputs to make sure that they work as you intend.
- Commit 4: Add the stress fraction reaction terms. Again, they can just be placeholders in this commit - you'll have a later commit that adds their real values.
- Commit 5: ...
I also gave you access to the overleaf that we're using to build this rheology model; I think that when we've populated the table with all the equivalencies between elasticity and maxwell_wiechert it will be a lot easier for you to substitute in the changes required to make this rheology work.
| <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| #ifndef _aspect_material_model_rheology_maxwell_wierchert_h |
There was a problem hiding this comment.
| #ifndef _aspect_material_model_rheology_maxwell_wierchert_h | |
| #ifndef _aspect_material_model_rheology_maxwell_wiechert_h |
| */ | ||
|
|
||
| #ifndef _aspect_material_model_rheology_maxwell_wierchert_h | ||
| #define _aspect_material_model_rheology_maxwell_wierchert_h |
There was a problem hiding this comment.
| #define _aspect_material_model_rheology_maxwell_wierchert_h | |
| #define _aspect_material_model_rheology_maxwell_wiechert_h |
| }; | ||
|
|
||
| template <int dim> | ||
| class MaxwellWierchert : public ::aspect::SimulatorAccess<dim> |
There was a problem hiding this comment.
| class MaxwellWierchert : public ::aspect::SimulatorAccess<dim> | |
| class MaxwellWiechert : public ::aspect::SimulatorAccess<dim> |
| else if (input == "entropy") | ||
| return CompositionalFieldDescription::entropy; | ||
| else if (input == "stress fraction") | ||
| return CompositionalFieldDescription::entropy; |
There was a problem hiding this comment.
| return CompositionalFieldDescription::entropy; | |
| return CompositionalFieldDescription::stress_fraction; |
| { | ||
| prm.declare_entry ("Elastic shear moduli", "75.0e9", | ||
| Patterns::List(Patterns::Double(0.)), | ||
| "List of elastic shear moduli, $G$, for each of the maxwell arms. " |
There was a problem hiding this comment.
| "List of elastic shear moduli, $G$, for each of the maxwell arms. " | |
| "List of elastic shear moduli, $G$, for each of the Maxwell arms. " |
| "is equal to the elastic time step. The default value of this parameter is " | ||
| "'unspecified', which throws an exception during runtime. In order for " | ||
| "the model to run the user must select 'true' or 'false'."); | ||
| prm.declare_entry ("Fixed elastic time step", "1.e3", |
| "timestep; afterwards on if 'Used fixed elastic time step' is true. " | ||
| "Units: \\si{\\year} if the 'Use years instead of seconds' parameter is set; " | ||
| "\\si{\\second} otherwise."); | ||
| prm.declare_entry ("Stabilization time scale factor", "1.", |
| { | ||
|
|
||
| AssertThrow(this->get_parameters().enable_elasticity == true, | ||
| ExcMessage("Rheology model maxwell wierchert only works if 'Enable elasticity' is set to true")); |
There was a problem hiding this comment.
Spelling and capitalization here and elsewhere.
|
|
||
| const double dtc = calculate_timestep_ratio() * elastic_timestep(); | ||
|
|
||
| // Everything bellow and above this section is modified from the original rheology of Elasticiy |
There was a problem hiding this comment.
below and above? so, everything is modified?
|
|
||
| for (unsigned int a = 0; a < number_of_maxwell_arms; ++a) | ||
| { | ||
| const unsigned int f_index = this->introspection().compositional_index_for_name("stress_fraction_" + Utilities::int_to_string(a+1)); |
There was a problem hiding this comment.
So the fractions are fixed? I don't think that this will do what you want it to do. I suspect that this model is equivalent to a single arm.
This PR is largely based on elastic rheology but with modification to the rhs terms following solution to several parallel maxwell arms (Maxwell wiechert elastic implementation by @bobmyhill )
@bobmyhill : This is much more simplified than what you derived, but it would be helpful to have your thoughts on the computation (ln 681–721 in the .cc file), everything else is related to prms that are needed for the computation of this term.
Before your first pull request:
For all pull requests:
If yes, please describe your usage of AI models in the creation of this pull request
For new features/models or changes of existing features: