-
Notifications
You must be signed in to change notification settings - Fork 0
/
FallingSphere_3D.jl
33 lines (24 loc) · 1.05 KB
/
FallingSphere_3D.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# First example of how to use LaMEM
# You can run this from the julia REPL with:
# julia> include("FallingSphere_3D.jl")
# Load packages:
using LaMEM, GeophysicalModelGenerator, Plots
model = Model(
# Define grid:
Grid(nel=(16,16,16), x=[-1,1], y=[-1,1], z=[-1,1]),
# Set timesteps
Time(nstep_max=20, dt_min=1e-3, dt=1, dt_max=10, time_end=100),
# USe a multigrid solver with 2 levels:
Solver(SolverType="multigrid", MGLevels=2),
# Output directory:
Output(out_dir="example_1")
)
# Specify material properties for matrix and sphere:
matrix = Phase(ID=0,Name="matrix",eta=1e20,rho=3000)
sphere = Phase(ID=1,Name="sphere",eta=1e23,rho=3200)
# Add them to the model setup:
add_phase!(model, sphere, matrix)
# Specify the initial model geometry
add_sphere!(model,cen=(0.0,0.0,0.0), radius=(0.5, )) # this is a function from the GeophysicalModelGenerator package
# Run the simulation on 1 processor:
run_lamem(model,1)