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

Geometric primitives #41

Merged
merged 3 commits into from
Feb 19, 2024
Merged

Geometric primitives #41

merged 3 commits into from
Feb 19, 2024

Conversation

boriskaus
Copy link
Member

You can create a LaMEM setup in various ways, for example by saving marker files, or by utilising geometric primitives that are specified in the LaMEM input files.
Previously we only exposed the spherical object (geom_Sphere).
With this PR, we add the other remaining objects as well:

  • geom_Sphere
  • geom_Ellipsoid
  • geom_Box
  • geom_Layer
  • geom_Cylinder
  • geom_RidgeSeg
  • geom_Hex

Simple example of how to use this:

julia> model  = Model(Grid(nel=(16,16)), Time(nstep_max=2, dt=1, dt_max=10))
LaMEM Model setup
|
|-- Scaling             :  GeoParams.Units.GeoUnits{GeoParams.Units.GEO}
|-- Grid                :  nel=(16, 1, 16); (-10.0, 10.0), (-5.0, 5.0), (-10.0, 0.0) 
|-- Time                :  nstep_max=2; nstep_out=1; time_end=1.0; dt=1.0
|-- Boundary conditions :  noslip=[0, 0, 0, 0, 0, 0]
|-- Solution parameters :  eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0
|-- Solver options      :  direct solver; mumps; penalty term=10000.0
|-- Model setup options :  Type=files; 
|-- Output options      :  filename=output; pvd=1; avd=0; surf=0
|-- Materials           :  0 phases;

# Specify material properties
julia> matrix = Phase(ID=0,Name="matrix",eta=1e20,rho=3000);
julia> sphere = Phase(ID=1,Name="sphere",eta=1e23,rho=3200);
julia> add_phase!(model, sphere, matrix);

# add sphere
julia> geom_sphere = geom_Sphere(center=[0.0,0.0,-1.0], Temperature="constant", cstTemp=100)
Sphere(ph=1, radius=1.5, center=[0.0, 0.0, -1.0], Temperature=constant,  cstTemp = 100.0
julia> add_geom!(model, geom_sphere)
julia> model
LaMEM Model setup
|
|-- Scaling             :  GeoParams.Units.GeoUnits{GeoParams.Units.GEO}
|-- Grid                :  nel=(16, 1, 16); (-10.0, 10.0), (-5.0, 5.0), (-10.0, 0.0) 
|-- Time                :  nstep_max=2; nstep_out=1; time_end=1.0; dt=1.0
|-- Boundary conditions :  noslip=[0, 0, 0, 0, 0, 0]
|-- Solution parameters :  eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0
|-- Solver options      :  direct solver; mumps; penalty term=10000.0
|-- Model setup options :  Type=geom; 1 geometric primitive objects
|-- Output options      :  filename=output; pvd=1; avd=0; surf=0
|-- Materials           :  2 phases; 
julia> run_lamem(model)

@boriskaus boriskaus merged commit 801cca2 into main Feb 19, 2024
20 checks passed
@boriskaus boriskaus deleted the bk-geometric-primitives branch February 19, 2024 15:15
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.

1 participant