Skip to content
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 cookbook for coupling global models to regional models #6229

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danieldouglas92
Copy link
Contributor

Motivated by a comment by @gassmoeller today during the ASPECT user meeting about how the python scripts in the contrib folder need to have some application in a cookbook.

This adds a cookbook which demonstrates the workflow that was intended for the python script added in PR #6019. That script takes the output of a global convection model and extracts the velocities along the boundaries of a 3D regional chunk model so that they can be used in an ASPECT model to capture far-field effects outside of the bounds of the regional model. In this cookbook I compare the velocities in a regional chunk when you do and do not account for the far-field effects of a global model, give an example of what the input file looks like, and also the workflow for running the python script.

@danieldouglas92 danieldouglas92 force-pushed the regional_global_coupling_cookbook branch 2 times, most recently from 63210db to ee77f9c Compare February 11, 2025 21:27
@danieldouglas92 danieldouglas92 force-pushed the regional_global_coupling_cookbook branch from ee77f9c to 50a4eaf Compare February 11, 2025 21:35
@danieldouglas92 danieldouglas92 force-pushed the regional_global_coupling_cookbook branch from 50a4eaf to 4902e05 Compare February 12, 2025 19:02
Copy link
Contributor

@jdannberg jdannberg left a comment

Choose a reason for hiding this comment

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

Thank you for contributing this!
I've made a few suggestions for what to change, but it's great to have this explanation and have this workflow documented. I am sure there'll be a time when I want to look up how this works.


*This section was contributed by Daniel Douglas.*

In this cookbook we showcase how to use the python script `extract_local_velocity.py` (located in the [/aspect/contrib/python/] directory) to prescribe velocity boundary conditions on a regional spherical chunk using the velocity solution from a global convection model. For the `extract_local_velocity.py` script to work, pvpython must be installed. The idea is that when simulating a 3D spherical chunk the choice of boundary conditions has a non-negligible effect on the regional solution. One can negate the boundary effects by increasing the domain of the regional model, but the far-field effects from global tectonics are still generally ignored by the regional model. By prescribing the velocity solution from a global convection model, the boundary conditions import some of the context of far-field global tectonics that would otherwise be missing from the regional model. We will compare the difference in the resulting solution from an instantaneous Stokes solution in a regional chunk when applying velocity boundary conditions from a global convection model, or applying free slip boundary conditions. In both cases, we will use the S20RTS model as the initial temperature distribution, and the simple material model. We choose the spherical chunk domain spanning from -55$^\circ$ < latitude < -20$\circ$, 152$\circ$ < longitude < 210$\circ$, and 4770 km < radius < 6370 km.
Copy link
Contributor

Choose a reason for hiding this comment

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

The link to [/aspect/contrib/python/] does not work.
I think you need to provide the actual location of the file in parenthesis after the rectangular brackets:
[contrib/python/](https://www.github.com/geodynamics/aspect/blob/main/contrib/python/)
or something like that.


*This section was contributed by Daniel Douglas.*

In this cookbook we showcase how to use the python script `extract_local_velocity.py` (located in the [/aspect/contrib/python/] directory) to prescribe velocity boundary conditions on a regional spherical chunk using the velocity solution from a global convection model. For the `extract_local_velocity.py` script to work, pvpython must be installed. The idea is that when simulating a 3D spherical chunk the choice of boundary conditions has a non-negligible effect on the regional solution. One can negate the boundary effects by increasing the domain of the regional model, but the far-field effects from global tectonics are still generally ignored by the regional model. By prescribing the velocity solution from a global convection model, the boundary conditions import some of the context of far-field global tectonics that would otherwise be missing from the regional model. We will compare the difference in the resulting solution from an instantaneous Stokes solution in a regional chunk when applying velocity boundary conditions from a global convection model, or applying free slip boundary conditions. In both cases, we will use the S20RTS model as the initial temperature distribution, and the simple material model. We choose the spherical chunk domain spanning from -55$^\circ$ < latitude < -20$\circ$, 152$\circ$ < longitude < 210$\circ$, and 4770 km < radius < 6370 km.
Copy link
Contributor

Choose a reason for hiding this comment

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

increasing the domain --> increasing the domain size


*This section was contributed by Daniel Douglas.*

In this cookbook we showcase how to use the python script `extract_local_velocity.py` (located in the [/aspect/contrib/python/] directory) to prescribe velocity boundary conditions on a regional spherical chunk using the velocity solution from a global convection model. For the `extract_local_velocity.py` script to work, pvpython must be installed. The idea is that when simulating a 3D spherical chunk the choice of boundary conditions has a non-negligible effect on the regional solution. One can negate the boundary effects by increasing the domain of the regional model, but the far-field effects from global tectonics are still generally ignored by the regional model. By prescribing the velocity solution from a global convection model, the boundary conditions import some of the context of far-field global tectonics that would otherwise be missing from the regional model. We will compare the difference in the resulting solution from an instantaneous Stokes solution in a regional chunk when applying velocity boundary conditions from a global convection model, or applying free slip boundary conditions. In both cases, we will use the S20RTS model as the initial temperature distribution, and the simple material model. We choose the spherical chunk domain spanning from -55$^\circ$ < latitude < -20$\circ$, 152$\circ$ < longitude < 210$\circ$, and 4770 km < radius < 6370 km.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would also change "negate the boundary effects" to something like "reduce the boundary effects" or "diminish the boundary effects" since the boundary conditions will always have an influence.


*This section was contributed by Daniel Douglas.*

In this cookbook we showcase how to use the python script `extract_local_velocity.py` (located in the [/aspect/contrib/python/] directory) to prescribe velocity boundary conditions on a regional spherical chunk using the velocity solution from a global convection model. For the `extract_local_velocity.py` script to work, pvpython must be installed. The idea is that when simulating a 3D spherical chunk the choice of boundary conditions has a non-negligible effect on the regional solution. One can negate the boundary effects by increasing the domain of the regional model, but the far-field effects from global tectonics are still generally ignored by the regional model. By prescribing the velocity solution from a global convection model, the boundary conditions import some of the context of far-field global tectonics that would otherwise be missing from the regional model. We will compare the difference in the resulting solution from an instantaneous Stokes solution in a regional chunk when applying velocity boundary conditions from a global convection model, or applying free slip boundary conditions. In both cases, we will use the S20RTS model as the initial temperature distribution, and the simple material model. We choose the spherical chunk domain spanning from -55$^\circ$ < latitude < -20$\circ$, 152$\circ$ < longitude < 210$\circ$, and 4770 km < radius < 6370 km.
Copy link
Contributor

Choose a reason for hiding this comment

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

$^\circ$ does not render a nice degree symbol. I think &deg; is better.


*This section was contributed by Daniel Douglas.*

In this cookbook we showcase how to use the python script `extract_local_velocity.py` (located in the [/aspect/contrib/python/] directory) to prescribe velocity boundary conditions on a regional spherical chunk using the velocity solution from a global convection model. For the `extract_local_velocity.py` script to work, pvpython must be installed. The idea is that when simulating a 3D spherical chunk the choice of boundary conditions has a non-negligible effect on the regional solution. One can negate the boundary effects by increasing the domain of the regional model, but the far-field effects from global tectonics are still generally ignored by the regional model. By prescribing the velocity solution from a global convection model, the boundary conditions import some of the context of far-field global tectonics that would otherwise be missing from the regional model. We will compare the difference in the resulting solution from an instantaneous Stokes solution in a regional chunk when applying velocity boundary conditions from a global convection model, or applying free slip boundary conditions. In both cases, we will use the S20RTS model as the initial temperature distribution, and the simple material model. We choose the spherical chunk domain spanning from -55$^\circ$ < latitude < -20$\circ$, 152$\circ$ < longitude < 210$\circ$, and 4770 km < radius < 6370 km.
Copy link
Contributor

Choose a reason for hiding this comment

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

We will compare the difference in the resulting solution from an instantaneous Stokes solution in a regional chunk when applying velocity boundary conditions from a global convection model, or applying free slip boundary conditions.

That sentence reads a bit confusing, i.e., at first it's not clear what is being compared. I would change it to something like
"We will compare two regional instantaneous models in a chunk geometry, one applying velocity boundary conditions from a global convection model, the other applying free slip boundary conditions.

Comment on lines +7 to +9
# boundary conditions. With the exception of the velocity boundary conditions and the
# geometry model, the .prm file for this cookbook is identical to the `initial-condition-S20RTS`
# cookbook .prm file.
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, you should include the other file and only list your changes here. You can then remove this text.

Suggested change
# boundary conditions. With the exception of the velocity boundary conditions and the
# geometry model, the .prm file for this cookbook is identical to the `initial-condition-S20RTS`
# cookbook .prm file.
include $ASPECT_SOURCE_DIR/cookbooks/initial-condition-S20RTS/S20RTS.prm

# the instantaneous solution.
set End time = 0
set Use years in output instead of seconds = true
set Output directory = output-chunk-global-S20RTS
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this is changed from the original as well.


subsection Chunk
set Chunk inner radius = 4770e3
set Chunk outer radius = 6370e3
Copy link
Contributor

Choose a reason for hiding this comment

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

Your script says 6360e3, this says 6370e3. Should these be consistent?

Comment on lines +1 to +9
# A model which takes utilizes the python script `extract_local_velocity.py`
# to take the output of the global convection cookbook `initial-condition-S20RTS`
# and apply the velocity as boundary conditions in a regional 3D spherical chunk.
# This will outline the workflow for running the `extract_local_velocity.py` script,
# and show how the solution to the regional spherical chunk model varies between the case
# where the boundaries are free-slip, or when the boundaries are prescribed velocity
# boundary conditions. With the exception of the velocity boundary conditions and the
# geometry model, the .prm file for this cookbook is identical to the `initial-condition-S20RTS`
# cookbook .prm file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this input file does not use the output of the script, I would change the description to say what it actually does. And same as with the other file, include either the S20RTS or the global_regional_coupling file and then only list the lines that are different here.

@@ -105,6 +105,7 @@ cookbooks/continental_extension/doc/continental_extension.md
cookbooks/inner_core_convection/doc/inner_core_convection.md
cookbooks/lower_crustal_flow/doc/lower_crustal_flow.md
cookbooks/global_melt/doc/global_melt.md
cookbooks/global_regional_coupling/doc/global_regional_coupling.md
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move it after the cookbooks/initial-condition-S20RTS/doc/initial-condition-S20RTS.md model? These are not in alphabetic order, they're more in thematic order. And the gplates cookbook is another one about boundary conditions, so I think that would be a good spot.

@jdannberg
Copy link
Contributor

/rebuild

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

Successfully merging this pull request may close these issues.

2 participants