diff --git a/src/common/m_constants.fpp b/src/common/m_constants.fpp index f926824cb8..1a87f0a912 100644 --- a/src/common/m_constants.fpp +++ b/src/common/m_constants.fpp @@ -44,7 +44,7 @@ module m_constants ! Interface Compression real(wp), parameter :: dflt_ic_eps = 1e-4_wp !< Ensure compression is only applied to surface cells in THINC real(wp), parameter :: dflt_ic_beta = 1.6_wp !< Sharpness parameter's default value used in THINC - integer, parameter :: moncon_cutoff = 1e-8_wp !< Monotonicity constraint's limiter to prevent extremas in THINC + real(wp), parameter :: moncon_cutoff = 1e-8_wp !< Monotonicity constraint's limiter to prevent extremas in THINC ! Chemistry real(wp), parameter :: dflt_T_guess = 1200._wp ! Default guess for temperature (when a previous value is not available) diff --git a/src/pre_process/m_assign_variables.fpp b/src/pre_process/m_assign_variables.fpp index e41428bf90..65809485ba 100644 --- a/src/pre_process/m_assign_variables.fpp +++ b/src/pre_process/m_assign_variables.fpp @@ -233,7 +233,6 @@ contains if (qbmm) then do i = 1, nb R3bar = R3bar + weight(i)*0.5_wp*(q_prim_vf(bubxb + 1 + (i - 1)*nmom)%sf(j, k, l))**3._wp - R3bar = R3bar + weight(i)*0.5_wp*(q_prim_vf(bubxb + 1 + (i - 1)*nmom)%sf(j, k, l))**3._wp end do else do i = 1, nb diff --git a/src/pre_process/m_grid.f90 b/src/pre_process/m_grid.f90 index 92bf4aa052..6ea71bd592 100644 --- a/src/pre_process/m_grid.f90 +++ b/src/pre_process/m_grid.f90 @@ -131,7 +131,7 @@ impure subroutine s_generate_serial_grid end do y_cb = y_cb*length - y_cc(0:m) = (y_cb(0:n) + y_cb(-1:n - 1))/2._wp + y_cc(0:n) = (y_cb(0:n) + y_cb(-1:n - 1))/2._wp dy = minval(y_cb(0:n) - y_cb(-1:n - 1)) @@ -168,7 +168,7 @@ impure subroutine s_generate_serial_grid end do z_cb = z_cb*length - z_cc(0:m) = (z_cb(0:p) + z_cb(-1:p - 1))/2._wp + z_cc(0:p) = (z_cb(0:p) + z_cb(-1:p - 1))/2._wp dz = minval(z_cb(0:p) - z_cb(-1:p - 1)) diff --git a/src/pre_process/m_mpi_proxy.fpp b/src/pre_process/m_mpi_proxy.fpp index 30ef061689..d88981b019 100644 --- a/src/pre_process/m_mpi_proxy.fpp +++ b/src/pre_process/m_mpi_proxy.fpp @@ -76,10 +76,6 @@ contains call MPI_BCAST(patch_bc(i)%${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) #:endfor - #:for VAR in ['vel', 'angular_vel', 'angles'] - call MPI_BCAST(patch_ib(i)%${VAR}$, 3, mpi_p, 0, MPI_COMM_WORLD, ierr) - #:endfor - call MPI_BCAST(patch_bc(i)%radius, 1, mpi_p, 0, MPI_COMM_WORLD, ierr) #:for VAR in ['centroid', 'length'] @@ -121,6 +117,9 @@ contains call MPI_BCAST(patch_icpp(i)%Y, size(patch_icpp(i)%Y), mpi_p, 0, MPI_COMM_WORLD, ierr) end if ! Broadcast IB variables + #:for VAR in ['vel', 'angular_vel', 'angles'] + call MPI_BCAST(patch_ib(i)%${VAR}$, size(patch_ib(i)%${VAR}$), mpi_p, 0, MPI_COMM_WORLD, ierr) + #:endfor call MPI_BCAST(patch_ib(i)%geometry, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) call MPI_BCAST(patch_ib(i)%model_filepath, len(patch_ib(i)%model_filepath), MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr) call MPI_BCAST(patch_ib(i)%model_threshold, 1, mpi_p, 0, MPI_COMM_WORLD, ierr) diff --git a/src/pre_process/m_perturbation.fpp b/src/pre_process/m_perturbation.fpp index 18fb89cd34..91b1f339ed 100644 --- a/src/pre_process/m_perturbation.fpp +++ b/src/pre_process/m_perturbation.fpp @@ -83,8 +83,8 @@ contains perturb_alpha = q_prim_vf(E_idx + perturb_flow_fluid)%sf(i, j, k) call random_number(rand_real) rand_real = rand_real*perturb_flow_mag - q_prim_vf(mom_idx%beg)%sf(i, j, k) = (1._wp + rand_real)*q_prim_vf(mom_idx%beg)%sf(i, j, k) q_prim_vf(mom_idx%end)%sf(i, j, k) = rand_real*q_prim_vf(mom_idx%beg)%sf(i, j, k) + q_prim_vf(mom_idx%beg)%sf(i, j, k) = (1._wp + rand_real)*q_prim_vf(mom_idx%beg)%sf(i, j, k) if (bubbles_euler) then q_prim_vf(alf_idx)%sf(i, j, k) = (1._wp + rand_real)*q_prim_vf(alf_idx)%sf(i, j, k) end if diff --git a/src/pre_process/m_start_up.fpp b/src/pre_process/m_start_up.fpp index 3b45547c29..259a56a6d7 100644 --- a/src/pre_process/m_start_up.fpp +++ b/src/pre_process/m_start_up.fpp @@ -767,7 +767,8 @@ contains real(wp), intent(inout) :: start, finish - integer :: j, k + integer :: j, k, l + real(wp) :: r2 ! Setting up the grid and the initial condition. If the grid is read in from ! preexisting grid data files, it is checked for consistency. If the grid is @@ -787,10 +788,15 @@ contains ! hard-coded psi if (hyper_cleaning) then - do j = 0, m + do l = 0, p do k = 0, n - q_cons_vf(psi_idx)%sf(j, k, 0) = 1d-2*exp(-(x_cc(j)**2 + y_cc(k)**2)/(2.0*0.05**2)) - q_prim_vf(psi_idx)%sf(j, k, 0) = q_cons_vf(psi_idx)%sf(j, k, 0) + do j = 0, m + r2 = x_cc(j)**2 + if (n > 0) r2 = r2 + y_cc(k)**2 + if (p > 0) r2 = r2 + z_cc(l)**2 + q_cons_vf(psi_idx)%sf(j, k, l) = 1.0e-2_wp*exp(-r2/(2.0_wp*0.05_wp**2)) + q_prim_vf(psi_idx)%sf(j, k, l) = q_cons_vf(psi_idx)%sf(j, k, l) + end do end do end do end if diff --git a/toolchain/mfc/case_validator.py b/toolchain/mfc/case_validator.py index 2c29c75e7f..a34d4d242d 100644 --- a/toolchain/mfc/case_validator.py +++ b/toolchain/mfc/case_validator.py @@ -1029,6 +1029,7 @@ def check_mhd_simulation(self): relativity = self.get('relativity', 'F') == 'T' hyper_cleaning = self.get('hyper_cleaning', 'F') == 'T' n = self.get('n', 0) + p = self.get('p', 0) self.prohibit(mhd and riemann_solver is not None and riemann_solver not in [1, 4], "MHD simulations require riemann_solver = 1 (HLL) or riemann_solver = 4 (HLLD)") @@ -1040,6 +1041,8 @@ def check_mhd_simulation(self): "Hyperbolic cleaning requires mhd to be enabled") self.prohibit(hyper_cleaning and n is not None and n == 0, "Hyperbolic cleaning is not supported for 1D simulations") + self.prohibit(hyper_cleaning and n is not None and n > 0 and p is not None and p == 0, + "Hyperbolic cleaning is not supported for 2D simulations") def check_igr_simulation(self): # pylint: disable=too-many-locals