Skip to content

(WIP) Add initial implementation of Maxwell-Wiechert rheology with two Maxwell arms - #7228

Open
alarshi wants to merge 2 commits into
geodynamics:mainfrom
alarshi:test_simple_implementation
Open

(WIP) Add initial implementation of Maxwell-Wiechert rheology with two Maxwell arms#7228
alarshi wants to merge 2 commits into
geodynamics:mainfrom
alarshi:test_simple_implementation

Conversation

@alarshi

@alarshi alarshi commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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:

  • I have tested my new feature locally to ensure it is correct.
  • I have created a testcase for the new feature/benchmark in the tests/ directory.
  • I have added a changelog entry in the doc/modules/changes directory that will inform other users of my change.

alarshi added 2 commits July 30, 2026 08:54
Add changes to stress compositional fields.

Add stress fraction as compositional field.

Restructure the reaction outputs.
@bobmyhill bobmyhill changed the title (WIP) Add initial implementation with two maxwell arms. (WIP) Add initial implementation of Maxwell-Wiechert rheology with two Maxwell arms Jul 30, 2026

@bobmyhill bobmyhill left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
#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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
#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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
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. "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"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",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As above.

"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.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As above.

{

AssertThrow(this->get_parameters().enable_elasticity == true,
ExcMessage("Rheology model maxwell wierchert only works if 'Enable elasticity' is set to true"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants