Skip to content

Commit

Permalink
Added simplexify to cavity driver
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Nov 15, 2024
1 parent 065f6a7 commit cbb49cf
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/Applications/cavity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ function _cavity(;
verbose=true,
vtk=true,
convection=:newton,
closed_cavity=true
closed_cavity=true,
simplexify = false,
fluid_disc = ifelse(!simplexify,:Qk_dPkm1,:SV)
)
@assert formulation [:cfd,:mhd]
@assert initial_value [:zero,:solve]
Expand Down Expand Up @@ -91,7 +93,7 @@ function _cavity(;
params[:solver] = solver

# Model
model = cavity_mesh(parts,params,nc,np,L,ranks_per_level)
model = cavity_mesh(parts,params,nc,np,L,ranks_per_level,simplexify)

# Reduced quantities
Re = u0 * L / ν
Expand Down Expand Up @@ -131,7 +133,8 @@ function _cavity(;
params[:fespaces] = Dict{Symbol,Any}(
:order_u => order,
:order_j => order_j,
:rt_scaling => rt_scaling ? 1.0/get_mesh_size(model) : nothing
:rt_scaling => rt_scaling ? 1.0/get_mesh_size(model) : nothing,
:fluid_disc => fluid_disc,
)

params[:x0] = initial_value
Expand Down Expand Up @@ -215,15 +218,15 @@ function add_cavity_tags!(labels)
add_tag_from_tags!(labels, "insulating", "boundary")
end

function cavity_mesh(parts,params,nc::Int,np,L,ranks_per_level)
return cavity_mesh(parts,params,(nc,nc,nc),np,L,ranks_per_level)
function cavity_mesh(parts,params,nc::Int,np,L,ranks_per_level,simplexify)
return cavity_mesh(parts,params,(nc,nc,nc),np,L,ranks_per_level,simplexify)
end

function cavity_mesh(parts,params,nc::Tuple,np::Int,L,ranks_per_level)
return cavity_mesh(parts,params,nc,(np,1,1),L,ranks_per_level)
function cavity_mesh(parts,params,nc::Tuple,np::Int,L,ranks_per_level,simplexify)
return cavity_mesh(parts,params,nc,(np,1,1),L,ranks_per_level,simplexify)
end

function cavity_mesh(parts,params,nc::Tuple,np::Tuple,L,ranks_per_level)
function cavity_mesh(parts,params,nc::Tuple,np::Tuple,L,ranks_per_level,simplexify)
domain = (0.0,L,0.0,L,0.0,L)
if isnothing(ranks_per_level) # Single grid
model = CartesianDiscreteModel(parts,np,domain,nc)
Expand All @@ -242,5 +245,8 @@ function cavity_mesh(parts,params,nc::Tuple,np::Tuple,L,ranks_per_level)
model = get_model(mh,1)
params[:model] = model
end
if simplexify
model = Gridap.simplexify(model)
end
return model
end

0 comments on commit cbb49cf

Please sign in to comment.