Compositional viscosity prefactors interface#6849
Compositional viscosity prefactors interface#6849lhy11009 wants to merge 2 commits intogeodynamics:mainfrom
Conversation
|
@danieldouglas92 Please take a look at this PR. This update makes several adjustments to better align the new rheology implementation with the structure used in other material model modules: I modified the compute_viscosity function so that it now explicitly takes temperature, pressure, fluid_fraction, etc., as input arguments. This brings the interface in line with the approach used by the other rheology modules. I reordered where this function is called within calculate_isostrain_viscosities. With this change, it is now clearer that the previously computed diffusion and dislocation viscosities are treated as the base viscosity for this module. Water fugacity is currently first introduced as a variable in calculate_isostrain_viscosities. Following this adjust, we can now also allow users to pass in a constant water fugacity value directly in visco_plastic.cc. This is likely to be broadly useful, and I can implement that extension in a follow-up PR. @mibillen |
|
The commit catalog seems to be messed up a little for a reason I don't know (I just rebased on the main branch), but it seems to contain this previous commit already in the main branch. |
09f6232 to
f3dc38f
Compare
|
Yes, I rebased, and now the commit list is right. |
danieldouglas92
left a comment
There was a problem hiding this comment.
Thanks for cleaning up this code Haoyuan, I think that this looks great! Only one minor comment to remove todo line.
include/aspect/material_model/rheology/compositional_viscosity_prefactors.h
Outdated
Show resolved
Hide resolved
f3dc38f to
6cb5df4
Compare
|
Yes, removed |
gassmoeller
left a comment
There was a problem hiding this comment.
I like the code simplification you did in visco_plastic.cc, but I dont quite understand your change to the interface of compositional_viscosity_prefactors. We usually try to avoid interface changes. Can you summarize what you are trying to achieve? Maybe we can find a way that does not break compatibility with the old code.
There was a problem hiding this comment.
Not your fault, but can you change this to a proper doxygen comment:
/**
- The flow law ...
- ...
*/
| template <int dim> | ||
| bool | ||
| CompositionalViscosityPrefactors<dim>::needs_scaling() const | ||
| { | ||
| return (viscosity_prefactor_scheme != none); | ||
| } |
There was a problem hiding this comment.
I dont really like the existence of this function, because it exposes information from inside the plugin to the outside world. The same functionality could be put to the beginning of the compute_viscosity() function and then you just return the base_viscosity without multiplying anything. Is there another reason this information is needed outside of this plugin?
6cb5df4 to
ffb71e1
Compare
ffb71e1 to
c03f885
Compare
c03f885 to
b518d10
Compare
There was a problem hiding this comment.
I don't know what happens to this file, my CMakeLists.txt in this branch is the same as origin/main
|
This is better, but I still dont like the change to the |
|
Okay, I see your point. My main goals with this change are: (1) To make temperature and pressure explicit inputs to the interface. (2) To allow bound_fluid_fraction to be defined as a constant. I agree that point (2) can be handled without modifying the interface. However, for point (1), in all other rheology modules temperature and pressure are passed from the upper-level calculate_..._viscosity functions. That leads to two broader questions that I think are worth considering: a. Interface consistency with other rheology modules b. Flexibility of passing P and T from the top level Given these considerations, I see two reasonable paths forward:
|
Pull Request Checklist. Please read and check each box with an X. Delete any part not applicable. Ask on the forum if you need help with any step.
I change the interface of the CompositionalViscosityPrefactors to be more consistent with the calculate_isostrain_viscosities function.
Before your first pull request:
For all pull requests:
For new features/models or changes of existing features: