Skip to content

Commit

Permalink
Update of the expansion driver and sender
Browse files Browse the repository at this point in the history
  • Loading branch information
FRUrgorri committed Jun 11, 2024
1 parent b12fa83 commit e8e8efa
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 249 deletions.
52 changes: 24 additions & 28 deletions analysis/xula/sendExpansion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,22 @@ echo NPROCS=$SLURM_NPROCS > $PASS_FILE
echo JOB_NAME=\"$SLURM_JOB_NAME\" >> $PASS_FILE

#Definition of the problem input paramenters
echo Ha=1000.0 >> $PASS_FILE #Hartmann number defined on the outlet channel
echo Re=50.0 >> $PASS_FILE #Reynolds number defined on the outlet channesl
echo r=4.0 >> $PASS_FILE #Expansion ratio
echo Ha=1000.0 >> $PASS_FILE #Hartmann number defined on the outlet channel
echo Re=50.0 >> $PASS_FILE #Reynolds number defined on the outlet channesl
echo r=4.0 >> $PASS_FILE #Expansion ratio
echo betta = 0.2 >> $PASS_FILE #Outlet channel aspect ratio
echo L_in=1.0 >> $PASS_FILE #Inlet channel normalized lenght
echo L_out=2.0 >> $PASS_FILE #Outlet channel normalized lenght

: <<'COMMENT'
#Definition of the mesh parameters
echo N_Ha=28 >> $PASS_FILE #Number of cells in the inlet channel along the B-direction
echo n_Ha=4 >> $PASS_FILE #Number of cells in the Hartmann BL
echo N_side=20 >> $PASS_FILE #Number of cells in along the direction perpendicular to B
echo n_side=5 >> $PASS_FILE #Number of cells in side BL
echo n_inlet=30 >> $PASS_FILE #Number of axial cells in the inlet channel
echo n_outlet=60 >> $PASS_FILE #Number of outlet cells in the outlet channel
echo R_exp=1.0 >> $PASS_FILE #Ratio of the geometric clustering towards the expansion point (x=0)
COMMENT

echo N_Ha = 22 >> $PASS_FILE #Number of cells in the inlet channel along the B-direction
echo N_s = 18 >> $PASS_FILE #Number of cells in along the direction perpendicular to B
echo L_in=1.0 >> $PASS_FILE #Inlet channel normalized lenght
echo L_out=2.0 >> $PASS_FILE #Outlet channel normalized lenght

echo N_Ha = 26 >> $PASS_FILE #Number of cells in the inlet channel along the B-direction
echo N_s = 20 >> $PASS_FILE #Number of cells in the inlet channel along the direction perpendicular to B
echo dx = 0.004 >> $PASS_FILE #Distante of the first node in the sudden expansion
echo N_1 = 50 >> $PASS_FILE #Number of cells in the outlet channel along the flow direction
echo N_2 = 80 >> $PASS_FILE #Number of cells in the inlet channel along the flow direction
echo N_1 = 30 >> $PASS_FILE #Number of cells in the outlet channel along the flow direction
echo N_2 = 30 >> $PASS_FILE #Number of cells in the inlet channel along the flow direction

#Mesh computation using gmsh

#source $GRIDAPMHD/meshes/expansion/MeshGenerator.sh
source $GRIDAPMHD/meshes/expansion/MeshGenerator-alt.sh
source $GRIDAPMHD/meshes/expansion/MeshGenerator.sh

#Parallel run using GridapMHD

Expand All @@ -77,6 +64,17 @@ pushfirst!(DEPOT_PATH, d)
include("input_params.jl")
using GridapMHD: expansion
#Monolithic MUMPS
solver = Dict(
:solver => :petsc,
:matrix_type => SparseMatrixCSR{0,PetscScalar,PetscInt},
:vector_type => Vector{PetscScalar},
:solver_postpro => ((cache,info) -> snes_postpro(cache,info)),
:petsc_options => "-snes_monitor -ksp_error_if_not_converged true -ksp_converged_reason -ksp_type preonly -pc_type lu -pc_factor_mat_solver_type mumps -mat_mumps_icntl_28 1 -mat_mumps_icntl_29 2 -mat_mumps_icntl_4 3 -mat_mumps_cntl_1 0.001",
:niter => 100,
:rtol => 1e-5,
)
expansion(;
mesh="compile",
Ha = 10.0,
Expand All @@ -88,8 +86,7 @@ expansion(;
inlet=:shercliff,
vtk=false,
title="warmup_gmsh_petsc",
solver=:petsc,
petsc_options="-snes_monitor -ksp_error_if_not_converged true -ksp_converged_reason -ksp_type preonly -pc_type lu -pc_factor_mat_solver_type mumps -mat_mumps_icntl_28 1 -mat_mumps_icntl_29 2 -mat_mumps_icntl_4 3 -mat_mumps_cntl_1 0.001"
solver=solver,
)
expansion(;
Expand All @@ -106,8 +103,7 @@ expansion(;
debug=false,
vtk=true,
title=JOB_NAME,
solver=:petsc,
petsc_options="-snes_monitor -ksp_error_if_not_converged true -ksp_converged_reason -ksp_type preonly -pc_type lu -pc_factor_mat_solver_type mumps -mat_mumps_icntl_7 0 -mat_mumps_icntl_28 1 -mat_mumps_icntl_29 2 -mat_mumps_icntl_4 3 -mat_mumps_cntl_1 0.001"
solver=solver,
)'


Expand Down
17 changes: 6 additions & 11 deletions src/Applications/expansion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,20 @@ function _expansion(;
distribute=nothing,
rank_partition=nothing,
title = "Expansion",
mesh = "720", #Either a string (for pure gmsh) or, a dictionary for p4est?
mesh = "720", #Either a string or a dictionary
vtk = true,
path = datadir(),
debug = false,
verbose = true,
solver = :julia,
petsc_options = nothing, #Added to have access to non-default petsc options
formulation = :cfd,
formulation = :mhd,
Z = 4.0, #Expansion Ratio, it has to be consistent with the mesh
β = 0.2, #Outlet channel aspect ratio, , it has to be consistent with the mesh
β = 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, #What is this?
ζ = 0.0,
order = 2,
inlet = :parabolic
)
Expand All @@ -69,10 +68,6 @@ function _expansion(;
:solver=> isa(solver,Symbol) ? default_solver_params(Val(solver)) : solver
)

if isa(petsc_options,Nothing)
params[:solver][:petsc_options] = petsc_options
end

if isa(distribute,Nothing)
@assert isa(rank_partition,Nothing)
rank_partition = (1,)
Expand Down Expand Up @@ -151,7 +146,7 @@ function _expansion(;
:thin_wall => [Dict(
=>τ,
:cw=>cw,
:domain => ["wall"], #No necessary to specify that "wall" is a gridap boundary
:domain => ["wall"]
)]
)
end
Expand Down Expand Up @@ -180,7 +175,7 @@ function _expansion(;

if vtk
writevtk(Ω,joinpath(path,title),
order=2,
order=order,
cellfields=[
"uh"=>uh,"ph"=>ph,"jh"=>jh,"phi"=>φh,"div_uh"=>div_uh,"div_jh"=>div_jh,"kp"=>Grad_p])
toc!(t,"vtk")
Expand Down
210 changes: 0 additions & 210 deletions src/expansion.jl

This file was deleted.

0 comments on commit e8e8efa

Please sign in to comment.