Skip to content

Commit

Permalink
fix post_process, add 1D smoothing, and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfonba committed Mar 8, 2025
1 parent 637c765 commit ccc0ebd
Show file tree
Hide file tree
Showing 9 changed files with 653 additions and 11 deletions.
39 changes: 38 additions & 1 deletion src/post_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ module m_global_parameters
type(bounds_info) :: x_output, y_output, z_output !< Portion of domain to output for post-processing
type(int_bounds_info) :: x_output_idx, y_output_idx, z_output_idx !< Indices of domain to output for post-processing

!> @name Size of the ghost zone layer in the x-, y- and z-coordinate directions.
!! The definition of the ghost zone layers is only necessary when using the
!! Silo database file format in multidimensions. These zones provide VisIt
!! with the subdomain connectivity information that it requires in order to
!! produce smooth plots.
!> @{
type(int_bounds_info) :: offset_x, offset_y, offset_z
!> @}

!> @name The list of all possible flow variables that may be written to a database
!! file. It includes partial densities, density, momentum, velocity, energy,
!! pressure, volume fraction(s), specific heat ratio function, specific heat
Expand Down Expand Up @@ -729,7 +738,35 @@ contains
if (ib) allocate (MPI_IO_IB_DATA%var%sf(0:m, 0:n, 0:p))
#endif

buff_size = 0
! Size of the ghost zone layer is non-zero only when post-processing
! the raw simulation data of a parallel multidimensional computation
! in the Silo-HDF5 format. If this is the case, one must also verify
! whether the raw simulation data is 2D or 3D. In the 2D case, size
! of the z-coordinate direction ghost zone layer must be zeroed out.
if (num_procs == 1 .or. format /= 1 .or. n == 0) then

offset_x%beg = 0
offset_x%end = 0
offset_y%beg = 0
offset_y%end = 0
offset_z%beg = 0
offset_z%end = 0

elseif (p == 0) then

offset_z%beg = 0
offset_z%end = 0

end if

! Determining the finite-difference number and the buffer size. Note
! that the size of the buffer is unrelated to the order of the WENO
! scheme. Rather, it is directly dependent on maximum size of ghost
! zone layers and possibly the order of the finite difference scheme
! used for the computation of vorticity and/or numerical Schlieren
! function.
buff_size = max(offset_x%beg, offset_x%end, offset_y%beg, &
offset_y%end, offset_z%beg, offset_z%end)

if (any(omega_wrt) .or. schlieren_wrt .or. qm_wrt) then
fd_number = max(1, fd_order/2)
Expand Down
27 changes: 17 additions & 10 deletions src/pre_process/m_perturbation.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,16 +629,23 @@ contains
call s_populate_variables_buffers(q_prim_vf)

! Perform smoothing and store in temp array
if (p == 0) then
do l = 0, p
do k = 0, n
do j = 0, m
do i = 1, sys_size
q_prim_temp(j, k, l, i) = (1._wp/8._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) + &
4._wp*q_prim_vf(i)%sf(j, k, l))
end do

if (n == 0) then
do j = 0, m
do i = 1, sys_size
q_prim_temp(j, 0, 0, i) = (1._wp/4._wp)* &
(q_prim_vf(i)%sf(j + 1, 0, 0) + q_prim_vf(i)%sf(j - 1, 0, 0) + &
2._wp*q_prim_vf(i)%sf(j, 0, 0))
end do
end do
else if (p == 0) then
do k = 0, n
do j = 0, m
do i = 1, sys_size
q_prim_temp(j, k, 0, i) = (1._wp/8._wp)* &
(q_prim_vf(i)%sf(j + 1, k, 0) + q_prim_vf(i)%sf(j - 1, k, 0) + &
q_prim_vf(i)%sf(j, k + 1, 0) + q_prim_vf(i)%sf(j, k - 1, 0) + &
4._wp*q_prim_vf(i)%sf(j, k, 0))
end do
end do
end do
Expand Down
183 changes: 183 additions & 0 deletions tests/342686E8/golden-metadata.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions tests/342686E8/golden.txt

Large diffs are not rendered by default.

Loading

0 comments on commit ccc0ebd

Please sign in to comment.