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 DisplacementBoundaryConditions #188

Merged
merged 22 commits into from
Jul 8, 2024
Merged

Add DisplacementBoundaryConditions #188

merged 22 commits into from
Jul 8, 2024

Conversation

aelligp
Copy link
Collaborator

@aelligp aelligp commented Jul 5, 2024

This PR renames the boundary conditions to:

  • VelocityBoundaryConditions
  • DisplacementBoundaryConditions.

This allows to set displacement BCs by e.g.:

    bcs = DisplacementBoundaryConditions(;
    no_slip      = (left=false, right=false, top=false, bot=false),
    free_slip    = (left=true, right=true, top=true, bot=true),
    free_surface = false
)
    stokes.U.Ux .= PTArray(backend)([ x*εbg*lx*dt for x in xvi[1], _ in 1:ny+2])
    stokes.U.Uy .= PTArray(backend)([-y*εbg*ly*dt for _ in 1:nx+2, y in xvi[2]])
    flow_bcs!(stokes, flow_bcs) # apply boundary conditions
    displacement2velocity!(stokes, dt)
    update_halo!(@velocity(stokes)...)

Within the stokes solver, the BC's are converted from displacement to velocity by displacement2velocity!(stokes,dt) and after solving the PT iterations back to displacement by velocity2displacement!(stokes, dt). This minimizes the amount of different solvers.
Here the ShearBand2D benchmark for both velocity and displacement BC's with a resolution of 512x512 and the same input parameters.
Velocity BC's (note that the bottom left is Vx):
28_velocity
and displacement
28_displacement

Copy link
Collaborator

@albert-de-montserrat albert-de-montserrat left a comment

Choose a reason for hiding this comment

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

Thanks a lot! looks already quite good

src/JustRelax.jl Outdated Show resolved Hide resolved
src/types/displacement.jl Outdated Show resolved Hide resolved
@aelligp aelligp merged commit 5827453 into main Jul 8, 2024
11 of 12 checks passed
@aelligp aelligp deleted the pa-BC branch July 8, 2024 11:37
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