Skip to content

Commit

Permalink
Adding BLT to notes
Browse files Browse the repository at this point in the history
Equations, mostly.
  • Loading branch information
lmoresi committed Aug 20, 2024
1 parent a9e5907 commit 7ee933b
Show file tree
Hide file tree
Showing 3 changed files with 342 additions and 191 deletions.
21 changes: 14 additions & 7 deletions Notebooks/Convection_Cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
cellSize=1/resolution,
degree=1,
qdegree=3,
regular=True,
regular=False,
)

meshbox.return_coords_to_bounds = None
# meshbox.return_coords_to_bounds = None
meshbox.dm.view()

x,y = meshbox.CoordinateSystem.X
Expand Down Expand Up @@ -93,12 +93,19 @@

stokes.tolerance = 0.001

penalty = max(1000000, 10*rayleigh_number.sym)

# Prevent flow crossing the boundaries

stokes.add_natural_bc(10*rayleigh_number * v_soln.sym[1] * y_vector, "Top")
stokes.add_natural_bc(10*rayleigh_number * v_soln.sym[1] * y_vector, "Bottom")
stokes.add_natural_bc(10*rayleigh_number * v_soln.sym[0] * x_vector, "Left")
stokes.add_natural_bc(10*rayleigh_number * v_soln.sym[0] * x_vector, "Right")
# stokes.add_natural_bc(penalty * v_soln.sym[1] * y_vector, "Top")
# stokes.add_natural_bc(penalty * v_soln.sym[1] * y_vector, "Bottom")
# stokes.add_natural_bc(penalty * v_soln.sym[0] * x_vector, "Left")
# stokes.add_natural_bc(penalty * v_soln.sym[0] * x_vector, "Right")

stokes.add_essential_bc((None, 0.0), "Top")
stokes.add_essential_bc((None, 0.0), "Bottom")
stokes.add_essential_bc((0.0, None), "Left")
stokes.add_essential_bc((0.0, None), "Right")

stokes.bodyforce = y_vector * rayleigh_number * t_soln.sym[0]

Expand Down Expand Up @@ -163,7 +170,7 @@
for step in range(0, max_steps):
stokes.solve(zero_init_guess=False)

delta_t = 2.0 * stokes.estimate_dt()
delta_t = 1.0 * stokes.estimate_dt()
adv_diff.solve(timestep=delta_t)

# stats then loop
Expand Down
Loading

0 comments on commit 7ee933b

Please sign in to comment.