Skip to content

Commit

Permalink
Added stabilisation to hunt and cavity
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Oct 31, 2024
1 parent 9f8573e commit dff60fb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
23 changes: 14 additions & 9 deletions src/Applications/cavity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ function _cavity(;
distribute=nothing,
np=1,
nc=(4,4,4),
ν=1.0,
ρ=1.0,
σ=1.0,
ζ=0.0,
B=VectorValue(0.0, 0.0, 10.0),
f=VectorValue(0.0, 0.0, 0.0),
L=1.0,
u0=1.0,
B0=norm(B),
ν = 1.0,
ρ = 1.0,
σ = 1.0,
ζ = 0.0, # Augmented Lagrangian weight
μ = 0, # Stabilization weight
B = VectorValue(0.0, 0.0, 10.0),
f = VectorValue(0.0, 0.0, 0.0),
L = 1.0,
u0 = 1.0,
B0 = norm(B),
order = 2,
order_j = order,
formulation = :mhd,
Expand Down Expand Up @@ -140,6 +141,10 @@ function _cavity(;
)
end

if μ > 0
params[:bcs][:stabilization] = Dict(=>μ)
end

if !uses_petsc(params[:solver])
xh,fullparams,info = main(params;output=info)
else
Expand Down
8 changes: 4 additions & 4 deletions src/Applications/expansion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ function _expansion(;
verbose = true,
solver = :julia,
formulation = :mhd,
Z = 4.0, # Expansion Ratio, it has to be consistent with the mesh
b = 0.2, # Outlet channel aspect ratio, it has to be consistent with the mesh
Z = 4.0, # Expansion Ratio, it has to be consistent with the mesh
b = 0.2, # Outlet channel aspect ratio, it has to be consistent with the mesh
N = 1.0,
Ha = 1.0,
cw = 0.028,
τ = 100,
ζ = 0.0,
ζ = 0.0, # Augmented Lagrangian weight
μ = 0, # Stabilization weight
order = 2,
order_j = order,
μ = 0,
inlet = :parabolic,
initial_value = :zero,
solid_coupling = :none,
Expand Down
7 changes: 6 additions & 1 deletion src/Applications/hunt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ function _hunt(;
σ=1.0,
B=(0.0,10.0,0.0),
f=(0.0,0.0,1.0),
ζ=0.0,
ζ = 0.0, # Augmented Lagrangian weight
μ = 0, # Stabilization weight
L=1.0,
u0=1.0,
B0=norm(VectorValue(B)),
Expand Down Expand Up @@ -162,6 +163,10 @@ function _hunt(;
:j => Dict(:tags=>"insulating"),
)

if μ > 0
params[:bcs][:stabilization] = Dict(=>μ)
end

toc!(t,"pre_process")

# Solve it
Expand Down

0 comments on commit dff60fb

Please sign in to comment.