Prescribed condition from initial composition#6889
Prescribed condition from initial composition#6889lhy11009 wants to merge 1 commit intogeodynamics:mainfrom
Conversation
|
Currently, this works for the field methods, and I don't think it works for the particle method. In the test I included, I modified from the composition_passive.prm and prescribed the composition on the left half of the domain. So the left side would stay the same value while the right side is advecting. |
|
Ideally, I would want a method that works for the particle method. At least that's something I was thinking when creating the PR. However, I feel this is also useful with the field method. |
danieldouglas92
left a comment
There was a problem hiding this comment.
This is great @lhy11009 thanks for this! I only had a few minor comments about cleaning up the test file and the formatting of things, but other then that I think looks great.
There was a problem hiding this comment.
With the exception of the postprocessor, the mesh refinement, and of course the prescribed solutions bits, this is exactly the same file as composition_passive.prm. I would instead only keep these sections which you've changed and just put include $ASPECT_SOURCE_DIR/tests/composition_passive.prm at the top.
There was a problem hiding this comment.
I think that prm file resides in the cookbooks folder: $ASPECT_SOURCE_DIR/cookbooks/composition_passive/composition_passive.prm
I tried to include this the way you suggested, but for some reason, the test hangs forever.
There was a problem hiding this comment.
Oh sorry that's my mistake! I just assumed it was in the test directory. If you instead put include $ASPECT_SOURCE_DIR/cookbooks/composition_passive/composition_passive.prm does that work?
| const unsigned int first_comp = | ||
| this->introspection().component_indices.compositional_fields[0]; | ||
|
|
||
| const unsigned int last_comp = | ||
| this->introspection().component_indices.compositional_fields[this->introspection().n_compositional_fields-1]; | ||
|
|
||
| const auto &geometry_model = this->get_geometry_model(); | ||
|
|
||
| for (unsigned int q=0; q<positions.size(); ++q) | ||
| { | ||
| const unsigned int component = component_indices[q]; | ||
|
|
||
| if (component < first_comp || | ||
| component > last_comp) | ||
| continue; |
There was a problem hiding this comment.
I think it would be helpful to add some comments describing what is happening here just for future reference. At first I thought it was this was a strange way to go through the compositional fields instead of just looping over all of the compositional fields like how we do in the material model for example, but then I remembered that this is constraining the DoF's and that the components here include temperature and velocities etc.
There was a problem hiding this comment.
Yes, these are the comments I add:
// Determine the component range corresponding to compositional fields.
// These component indices are originally mapped from local DoFs and
// determine which DoFs in the system belong to compositional fields.
bf0ec1e to
23b9afd
Compare
|
Hi @danieldouglas92, Thanks for reviewing my changes. |
|
@lhy11009 the rest of your changes look great! Thanks for addressing them so quickly. If including the cookbook parameter file also causes the model to hang don't worry about it, but I would try adding the include statement to that cookbook file if you haven't already and see what happens. |


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.
Prescribe the composition field from the initial composition fields.
Before your first pull request:
For all pull requests:
For new features/models or changes of existing features: