Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfonba committed Feb 16, 2025
1 parent a80c780 commit 25466d1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions examples/2D_shockbubble_igr/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
vel = 230.0

leng = 1.0
Ny = 100.0
Ny = 200.0
Nx = Ny * 3
dx = leng / Nx

Expand Down Expand Up @@ -58,7 +58,7 @@
"igr": "T",
"alf_igr": 10,
"elliptic_smoothing": "T",
"elliptic_smoothing_ic": 1,
"elliptic_smoothing_iters": 10,
"bc_x%beg": -3,
"bc_x%end": -3,
"bc_y%beg": -3,
Expand Down
9 changes: 4 additions & 5 deletions src/pre_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module m_global_parameters
integer :: m
integer :: n
integer :: p
integer :: buff_size
integer, parameter :: buff_size = 1 ! buff size for elliptic smoothing

integer(8) :: nGlobal !< Global number of cells in the domain

Expand Down Expand Up @@ -148,7 +148,7 @@ module m_global_parameters
logical :: igr !< Use information geometric regularization
integer :: alf_igr
logical :: elliptic_smoothing !< Enables Ellipitcal Smoothing in Patches
integer :: elliptic_smoothing_ic !< Iterations of Elliptic Smoothing done
integer :: elliptic_smoothing_iters !< Iterations of Elliptic Smoothing done


#ifdef MFC_MPI
Expand Down Expand Up @@ -278,8 +278,7 @@ contains

! Computational domain parameters
m = dflt_int; n = 0; p = 0
buff_size = 1


cyl_coord = .false.

x_domain%beg = dflt_real
Expand Down Expand Up @@ -500,7 +499,7 @@ contains
igr = .false.
alf_igr = 0
elliptic_smoothing = .false.
elliptic_smoothing_ic = 1
elliptic_smoothing_iters = 1

end subroutine s_assign_default_values_to_user_inputs

Expand Down
3 changes: 2 additions & 1 deletion src/pre_process/m_initial_condition.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ contains
allocate (q_prim_vf(1:sys_size))
allocate (q_cons_vf(1:sys_size))

print*, proc_rank, buff_size
do i = 1, sys_size
allocate (q_prim_vf(i)%sf(-buff_size:m+buff_size, -buff_size:n + buff_size, -buff_size:p + buff_size))
allocate (q_cons_vf(i)%sf(0:m, 0:n, 0:p))
Expand Down Expand Up @@ -338,7 +339,7 @@ contains
if (perturb_sph) call s_perturb_sphere(q_prim_vf)
if (mixlayer_perturb) call s_superposition_instability_wave(q_prim_vf)

if (igr .and. elliptic_smoothing) call s_elliptic_smoothing(q_prim_vf)
if (elliptic_smoothing) call s_elliptic_smoothing(q_prim_vf)

! Converting the primitive variables to the conservative ones
call s_convert_primitive_to_conservative_variables(q_prim_vf, q_cons_vf)
Expand Down
4 changes: 2 additions & 2 deletions src/pre_process/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ contains
& 'loops_x', 'loops_y', 'loops_z', 'model_eqns', 'num_fluids', &
& 'weno_order', 'precision', 'perturb_flow_fluid', &
& 'perturb_sph_fluid', 'num_patches', 'thermal', 'nb', 'dist_type',&
& 'R0_type', 'relax_model', 'num_ibs', 'n_start' ]
& 'R0_type', 'relax_model', 'num_ibs', 'n_start', 'elliptic_smoothing_iters' ]
call MPI_BCAST(${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
#:endfor
Expand All @@ -67,7 +67,7 @@ contains
& 'mixlayer_perturb', 'bubbles_euler', 'polytropic', 'polydisperse',&
& 'qbmm', 'file_per_process', 'adv_n', 'ib' , 'cfl_adap_dt', &
& 'cfl_const_dt', 'cfl_dt', 'surface_tension', &
& 'hyperelasticity', 'pre_stress' ]
& 'hyperelasticity', 'pre_stress', 'elliptic_smoothing' ]
call MPI_BCAST(${VAR}$, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
#:endfor
call MPI_BCAST(fluid_rho(1), num_fluids_max, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
Expand Down
17 changes: 8 additions & 9 deletions src/pre_process/m_perturbation.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ module m_perturbation
use m_eigen_solver ! Subroutines to solve eigenvalue problem for
! complex general matrix

use m_helper

use ieee_arithmetic

implicit none
Expand Down Expand Up @@ -615,7 +617,7 @@ contains
real(wp), dimension(0:m, 0:n, 0:p, 1:sys_size) :: q_prim_temp
integer :: i, j, k, l, q

do q = 1, elliptic_smoothing_ic
do q = 1, elliptic_smoothing_iters
if(bcxb >= -12) then
if(bcxb >= 0) then
call s_mpi_sendrecv_variables_buffers(q_prim_vf, 1, -1)
Expand All @@ -635,7 +637,7 @@ contains
do l = 0, p
do k = 0, n
do j = 1, buff_size
do i = 1, sys_size
do i = 1, sys_size
q_prim_vf(i)%sf(-j, k, l) = q_prim_vf(i)%sf(j - 1,k,l)
end do
end do
Expand Down Expand Up @@ -665,7 +667,6 @@ contains
do j = 1, buff_size
do i = 1, sys_size
q_prim_vf(i)%sf(m+j, k, l) = q_prim_vf(i)%sf(j-1,k,l)

end do
end do
end do
Expand All @@ -677,9 +678,8 @@ contains
do j = 1, buff_size
do i = 1, sys_size
q_prim_vf(i)%sf(m+j, k, l) = q_prim_vf(i)%sf(m - (j - 1),k,l)

end do
end do
end do
end do
end do
else
Expand All @@ -689,7 +689,6 @@ contains
do j = 1, buff_size
do i = 1, sys_size
q_prim_vf(i)%sf(m+j, k, l) = q_prim_vf(i)%sf(m,k,l)

end do
end do
end do
Expand Down Expand Up @@ -758,7 +757,7 @@ contains
do i = 1, sys_size
q_prim_vf(i)%sf(j,n+k,l) = q_prim_vf(i)%sf(j,n - (k-1),l)
end do
end do
end do
end do
end do
else
Expand Down Expand Up @@ -864,7 +863,7 @@ contains
do k = 0, n
do j = 0, m
do i = 1, sys_size
q_prim_temp(j,k,l,i) = (1_wp/4_wp) * &
q_prim_temp(j,k,l,i) = (1._wp/4._wp) * &
(q_prim_vf(i)%sf(j+1,k,l) + q_prim_vf(i)%sf(j-1,k,l) + &
q_prim_vf(i)%sf(j,k+1,l) + q_prim_vf(i)%sf(j,k-1,l))
end do
Expand All @@ -876,7 +875,7 @@ contains
do k = 0, n
do j = 0, m
do i = 1, sys_size
q_prim_temp(j,k,l,i) = (1_wp/6_wp) * &
q_prim_temp(j,k,l,i) = (1._wp/6._wp) * &
(q_prim_vf(i)%sf(j+1,k,l) + q_prim_vf(i)%sf(j-1,k,l) + &
q_prim_vf(i)%sf(j,k+1,l) + q_prim_vf(i)%sf(j,k-1,l) + &
q_prim_vf(i)%sf(j,k,l+1) + q_prim_vf(i)%sf(j,k,l-1))
Expand Down
2 changes: 1 addition & 1 deletion src/pre_process/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ contains
palpha_eps, ptgalpha_eps, ib, num_ibs, patch_ib, &
sigma, adv_n, cfl_adap_dt, cfl_const_dt, n_start, &
n_start_old, surface_tension, hyperelasticity, pre_stress, rkck_adap_dt, &
bc_x, bc_y, bc_z, igr, alf_igr, elliptic_smoothing, elliptic_smoothing_ic
bc_x, bc_y, bc_z, igr, alf_igr, elliptic_smoothing, elliptic_smoothing_iters

! Inquiring the status of the pre_process.inp file
file_loc = 'pre_process.inp'
Expand Down
2 changes: 1 addition & 1 deletion toolchain/mfc/run/case_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def analytic(self):
'igr':ParamType.LOG,
'alf_igr':ParamType.INT,
'elliptic_smoothing':ParamType.LOG,
'elliptic_smoothing_ic':ParamType.INT,
'elliptic_smoothing_iters':ParamType.INT,
})

for ib_id in range(1, 10+1):
Expand Down

0 comments on commit 25466d1

Please sign in to comment.