Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/lint-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
run: |
! grep -iR -e '\.\.\.' -e '\-\-\-' -e '===' ./src/*

- name: Looking for false integers
run: |
! grep -onRP '(?<![0-9.eE\-])\b[0-9]*_wp\b' src/

- name: Looking for junk comments in examples
run: |
! grep -R '# ===' ./benchmarks **/*.py
Expand Down
28 changes: 14 additions & 14 deletions src/common/m_constants.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ module m_constants

character, parameter :: dflt_char = ' ' !< Default string value

real(wp), parameter :: dflt_real = -1e6_wp !< Default real value
real(wp), parameter :: sgm_eps = 1e-16_wp !< Segmentation tolerance
real(wp), parameter :: small_alf = 1e-11_wp !< Small alf tolerance
real(wp), parameter :: dflt_real = -1.e6_wp !< Default real value
real(wp), parameter :: sgm_eps = 1.e-16_wp !< Segmentation tolerance
real(wp), parameter :: small_alf = 1.e-11_wp !< Small alf tolerance
real(wp), parameter :: pi = 3.141592653589793_wp !< Pi
real(wp), parameter :: verysmall = 1.e-12_wp !< Very small number

Expand All @@ -26,7 +26,7 @@ module m_constants
integer, parameter :: pathlen_max = 400
integer, parameter :: nnode = 4 !< Number of QBMM nodes
integer, parameter :: gp_layers = 3 !< Number of ghost point layers for IBM
real(wp), parameter :: capillary_cutoff = 1e-6 !< color function gradient magnitude at which to apply the surface tension fluxes
real(wp), parameter :: capillary_cutoff = 1.e-6 !< color function gradient magnitude at which to apply the surface tension fluxes
real(wp), parameter :: acoustic_spatial_support_width = 2.5_wp !< Spatial support width of acoustic source, used in s_source_spatial
real(wp), parameter :: dflt_vcfl_dt = 100._wp !< value of vcfl_dt when viscosity is off for computing adaptive timestep size
real(wp), parameter :: broadband_spectral_level_constant = 20._wp !< The constant to scale the spectral level at the lower frequency bound
Expand All @@ -41,25 +41,25 @@ module m_constants
integer, parameter :: Ifactor_bary_3D = 20 !< Multiple factor of the ratio (triangle area to cell face area) for interpolation on triangle facets for 3D models
integer, parameter :: num_ray = 20 !< Default number of rays traced per cell
real(wp), parameter :: ray_tracing_threshold = 0.9_wp !< Threshold above which the cell is marked as the model patch
real(wp), parameter :: threshold_vector_zero = 1e-10 !< Threshold to treat the component of a vector to be zero
real(wp), parameter :: threshold_edge_zero = 1e-10 !< Threshold to treat two edges to be overlapped
real(wp), parameter :: threshold_bary = 1e-1 !< Threshold to interpolate a barycentric facet
real(wp), parameter :: initial_distance_buffer = 1e12_wp !< Initialized levelset distance for the shortest path pair algorithm
real(wp), parameter :: threshold_vector_zero = 1.e-10_wp !< Threshold to treat the component of a vector to be zero
real(wp), parameter :: threshold_edge_zero = 1.e-10_wp !< Threshold to treat two edges to be overlapped
real(wp), parameter :: threshold_bary = 1.e-1_wp !< Threshold to interpolate a barycentric facet
real(wp), parameter :: initial_distance_buffer = 1.e12_wp !< Initialized levelset distance for the shortest path pair algorithm

! Lagrange bubbles constants
integer, parameter :: mapCells = 3 !< Number of cells around the bubble where the smoothening function will have effect
real(wp), parameter :: R_uni = 8314._wp ! Universal gas constant - J/kmol/K

! Strang Splitting constants
real(wp), parameter :: dflt_adap_dt_tol = 1e-4_wp !< Default tolerance for adaptive step size
real(wp), parameter :: dflt_adap_dt_tol = 1.e-4_wp !< Default tolerance for adaptive step size
integer, parameter :: adap_dt_max_iters = 100 !< Maximum number of iterations
! Constants of the algorithm described by Heirer, E. Hairer S.P.Nørsett G. Wanner, Solving Ordinary Differential Equations I, Chapter II.4
! to choose the initial time step size for the adaptive time stepping routine
real(wp), parameter :: threshold_first_guess = 1e-5_wp
real(wp), parameter :: threshold_second_guess = 1e-15_wp
real(wp), parameter :: scale_first_guess = 1e-3_wp
real(wp), parameter :: scale_guess = 1e-2_wp
real(wp), parameter :: small_guess = 1e-6_wp
real(wp), parameter :: threshold_first_guess = 1.e-5_wp
real(wp), parameter :: threshold_second_guess = 1.e-15_wp
real(wp), parameter :: scale_first_guess = 1.e-3_wp
real(wp), parameter :: scale_guess = 1.e-2_wp
real(wp), parameter :: small_guess = 1.e-6_wp

! Relativity
integer, parameter :: relativity_cons_to_prim_max_iter = 100
Expand Down
4 changes: 2 additions & 2 deletions src/common/m_helper_basic.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module m_helper_basic
!> This procedure checks if two floating point numbers of wp are within tolerance.
!! @param a First number.
!! @param b Second number.
!! @param tol_input Relative error (default = 1e-10_wp).
!! @param tol_input Relative error (default = 1.e-10_wp).
!! @return Result of the comparison.
logical pure elemental function f_approx_equal(a, b, tol_input) result(res)
!$acc routine seq
Expand All @@ -32,7 +32,7 @@ logical pure elemental function f_approx_equal(a, b, tol_input) result(res)
if (present(tol_input)) then
tol = tol_input
else
tol = 1e-10_wp
tol = 1.e-10_wp
end if

if (a == b) then
Expand Down
6 changes: 3 additions & 3 deletions src/common/m_phase_change.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ contains

! Newton Solver for the pT-equilibrium
ns = 0
! change this relative error metric. 1e4_wp is just arbitrary
do while ((abs(pS - pO) > palpha_eps) .and. (abs((pS - pO)/pO) > palpha_eps/1e4_wp) .or. (ns == 0))
! change this relative error metric. 1.e4_wp is just arbitrary
do while ((abs(pS - pO) > palpha_eps) .and. (abs((pS - pO)/pO) > palpha_eps/1.e4_wp) .or. (ns == 0))

! increasing counter
ns = ns + 1
Expand Down Expand Up @@ -438,7 +438,7 @@ contains
R2D(1) = 0.0_wp; R2D(2) = 0.0_wp
DeltamP(1) = 0.0_wp; DeltamP(2) = 0.0_wp
do while (((sqrt(R2D(1)**2 + R2D(2)**2) > ptgalpha_eps) &
.and. ((sqrt(R2D(1)**2 + R2D(2)**2)/rhoe) > (ptgalpha_eps/1e6_wp))) &
.and. ((sqrt(R2D(1)**2 + R2D(2)**2)/rhoe) > (ptgalpha_eps/1.e6_wp))) &
.or. (ns == 0))

! Updating counter for the iterative procedure
Expand Down
14 changes: 7 additions & 7 deletions src/common/m_variables_conversion.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
alpha_K(i) = min(max(0._wp, alpha_K(i)), 1._wp)
end do

alpha_K = alpha_K/max(sum(alpha_K), 1e-16_wp)
alpha_K = alpha_K/max(sum(alpha_K), 1.e-16_wp)

Check warning on line 283 in src/common/m_variables_conversion.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_variables_conversion.fpp#L283

Added line #L283 was not covered by tests

end if

Expand Down Expand Up @@ -405,7 +405,7 @@
alpha_K(i) = min(max(0._wp, alpha_K(i)), 1._wp)
end do

alpha_K = alpha_K/max(sum(alpha_K), 1e-16_wp)
alpha_K = alpha_K/max(sum(alpha_K), 1.e-16_wp)

end if

Expand Down Expand Up @@ -960,7 +960,7 @@

dW = -f/df_dW
W = W + dW
if (abs(dW) < 1e-12*W) exit
if (abs(dW) < 1.e-12_wp*W) exit
end do

! Recalculate pressure using converged W
Expand Down Expand Up @@ -1014,7 +1014,7 @@
if (model_eqns /= 4) then
qK_prim_vf(i)%sf(j, k, l) = qK_cons_vf(i)%sf(j, k, l) &
/rho_K
dyn_pres_K = dyn_pres_K + 5e-1_wp*qK_cons_vf(i)%sf(j, k, l) &
dyn_pres_K = dyn_pres_K + 5.e-1_wp*qK_cons_vf(i)%sf(j, k, l) &
*qK_prim_vf(i)%sf(j, k, l)
else
qK_prim_vf(i)%sf(j, k, l) = qK_cons_vf(i)%sf(j, k, l) &
Expand Down Expand Up @@ -1520,11 +1520,11 @@
R_gas = gas_constant/mix_mol_weight
T_K = pres_K/rho_K/R_gas
call get_mixture_energy_mass(T_K, Y_K, E_K)
E_K = rho_K*E_K + 5e-1_wp*rho_K*vel_K_sum
E_K = rho_K*E_K + 5.e-1_wp*rho_K*vel_K_sum

Check warning on line 1523 in src/common/m_variables_conversion.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_variables_conversion.fpp#L1523

Added line #L1523 was not covered by tests
else
! Computing the energy from the pressure
E_K = gamma_K*pres_K + pi_inf_K &
+ 5e-1_wp*rho_K*vel_K_sum + qv_K
+ 5.e-1_wp*rho_K*vel_K_sum + qv_K
end if

! mass flux, this should be \alpha_i \rho_i u_i
Expand Down Expand Up @@ -1659,7 +1659,7 @@
(rho*(1._wp - adv(num_fluids)))
end if
else
c = ((H - 5e-1*vel_sum)/gamma)
c = ((H - 5.e-1*vel_sum)/gamma)
end if

if (mixture_err .and. c < 0._wp) then
Expand Down
2 changes: 1 addition & 1 deletion src/post_process/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@
rho = rho + adv(l)*q_prim_vf(l)%sf(i, j, k)
end do

H = ((gamma + 1_wp)*pres + pi_inf)/rho
H = ((gamma + 1._wp)*pres + pi_inf)/rho

Check warning on line 1332 in src/post_process/m_data_output.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_data_output.fpp#L1332

Added line #L1332 was not covered by tests

call s_compute_speed_of_sound(pres, rho, &
gamma, pi_inf, &
Expand Down
14 changes: 7 additions & 7 deletions src/post_process/m_derived_variables.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
end if

if (mixture_err .and. q_sf(i, j, k) < 0._wp) then
q_sf(i, j, k) = 1e-16_wp
q_sf(i, j, k) = 1.e-16_wp

Check warning on line 215 in src/post_process/m_derived_variables.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_derived_variables.fpp#L215

Added line #L215 was not covered by tests
else
q_sf(i, j, k) = sqrt(q_sf(i, j, k))
end if
Expand Down Expand Up @@ -285,8 +285,8 @@
end if
end if

if (abs(top) < 1e-8_wp) top = 0._wp
if (abs(bottom) < 1e-8_wp) bottom = 0._wp
if (abs(top) < 1.e-8_wp) top = 0._wp
if (abs(bottom) < 1.e-8_wp) bottom = 0._wp

if (f_approx_equal(top, bottom)) then
slope = 1._wp
Expand All @@ -295,20 +295,20 @@
! (bottom == 0._wp .AND. top /= 0._wp)) THEN
! slope = 0._wp
else
slope = (top*bottom)/(bottom**2._wp + 1e-16_wp)
slope = (top*bottom)/(bottom**2._wp + 1.e-16_wp)

Check warning on line 298 in src/post_process/m_derived_variables.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_derived_variables.fpp#L298

Added line #L298 was not covered by tests
end if

! Flux limiter function
if (flux_lim == 1) then ! MINMOD (MM)
q_sf(j, k, l) = max(0._wp, min(1._wp, slope))
elseif (flux_lim == 2) then ! MUSCL (MC)
q_sf(j, k, l) = max(0._wp, min(2._wp*slope, 5e-1_wp*(1._wp + slope), 2._wp))
q_sf(j, k, l) = max(0._wp, min(2._wp*slope, 5.e-1_wp*(1._wp + slope), 2._wp))

Check warning on line 305 in src/post_process/m_derived_variables.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_derived_variables.fpp#L305

Added line #L305 was not covered by tests
elseif (flux_lim == 3) then ! OSPRE (OP)
q_sf(j, k, l) = (15e-1_wp*(slope**2._wp + slope))/(slope**2._wp + slope + 1._wp)
q_sf(j, k, l) = (15.e-1_wp*(slope**2._wp + slope))/(slope**2._wp + slope + 1._wp)

Check warning on line 307 in src/post_process/m_derived_variables.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_derived_variables.fpp#L307

Added line #L307 was not covered by tests
elseif (flux_lim == 4) then ! SUPERBEE (SB)
q_sf(j, k, l) = max(0._wp, min(1._wp, 2._wp*slope), min(slope, 2._wp))
elseif (flux_lim == 5) then ! SWEBY (SW) (beta = 1.5)
q_sf(j, k, l) = max(0._wp, min(15e-1_wp*slope, 1._wp), min(slope, 15e-1_wp))
q_sf(j, k, l) = max(0._wp, min(15.e-1_wp*slope, 1._wp), min(slope, 15.e-1_wp))

Check warning on line 311 in src/post_process/m_derived_variables.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_derived_variables.fpp#L311

Added line #L311 was not covered by tests
elseif (flux_lim == 6) then ! VAN ALBADA (VA)
q_sf(j, k, l) = (slope**2._wp + slope)/(slope**2._wp + 1._wp)
elseif (flux_lim == 7) then ! VAN LEER (VL)
Expand Down
4 changes: 2 additions & 2 deletions src/pre_process/include/2dHardcodedIC.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
real(wp) :: rhoH, rhoL, pRef, pInt, h, lam, wl, amp, intH, intL, alph
real(wp) :: factor

eps = 1e-9_wp
eps = 1.e-9_wp

#:enddef

Expand Down Expand Up @@ -35,7 +35,7 @@
if (r < rmax) then
q_prim_vf(momxb)%sf(i, j, 0) = -(y_cc(j) - 0.5_wp)*umax/rmax
q_prim_vf(momxe)%sf(i, j, 0) = (x_cc(i) - 0.5_wp)*umax/rmax
q_prim_vf(E_idx)%sf(i, j, 0) = p0 + umax**2*((r/rmax)**2/2._wp)
q_prim_vf(E_idx)%sf(i, j, 0) = p0 + umax**2*((r/rmax)**2._wp/2._wp)
else if (r < 2*rmax) then
q_prim_vf(momxb)%sf(i, j, 0) = -((y_cc(j) - 0.5_wp)/r)*umax*(2._wp - r/rmax)
q_prim_vf(momxe)%sf(i, j, 0) = ((x_cc(i) - 0.5_wp)/r)*umax*(2._wp - r/rmax)
Expand Down
4 changes: 2 additions & 2 deletions src/pre_process/include/3dHardcodedIC.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

real(wp) :: eps

eps = 1e-9_wp
eps = 1.e-9_wp
#:enddef

#:def Hardcoded3D()
Expand All @@ -23,7 +23,7 @@

intH = amp*(sin(2._wp*pi*x_cc(i)/lam - pi/2._wp) + sin(2._wp*pi*z_cc(k)/lam - pi/2._wp)) + h

alph = 5e-1_wp*(1._wp + tanh((y_cc(j) - intH)/2.5e-3_wp))
alph = 5.e-1_wp*(1._wp + tanh((y_cc(j) - intH)/2.5e-3_wp))

if (alph < eps) alph = eps
if (alph > 1._wp - eps) alph = 1._wp - eps
Expand Down
10 changes: 5 additions & 5 deletions src/pre_process/m_assign_variables.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
end if

! Updating the patch identities bookkeeping variable
if (1._wp - eta < 1e-16_wp) patch_id_fp(j, k, l) = patch_id
if (1._wp - eta < 1.e-16_wp) patch_id_fp(j, k, l) = patch_id

end subroutine s_assign_patch_mixture_primitive_variables

Expand All @@ -199,8 +199,8 @@
real(wp) :: pres_mag, loc, n_tait, B_tait, p0
real(wp) :: R3bar, n0, ratio, nH, vfH, velH, rhoH, deno

p0 = 101325
pres_mag = 1e-1_wp
p0 = 101325._wp
pres_mag = 1.e-1_wp
loc = x_cc(177)
n_tait = fluid_pp(1)%gamma
B_tait = fluid_pp(1)%pi_inf
Expand All @@ -214,7 +214,7 @@

if (qbmm) then
do i = 1, nb
q_prim_vf(bubxb + 1 + (i - 1)*nmom)%sf(j, k, l) = q_prim_vf(bubxb + 1 + (i - 1)*nmom)%sf(j, k, l)*((p0 - fluid_pp(1)%pv)/(q_prim_vf(E_idx)%sf(j, k, l)*p0 - fluid_pp(1)%pv))**(1/3._wp)
q_prim_vf(bubxb + 1 + (i - 1)*nmom)%sf(j, k, l) = q_prim_vf(bubxb + 1 + (i - 1)*nmom)%sf(j, k, l)*((p0 - fluid_pp(1)%pv)/(q_prim_vf(E_idx)%sf(j, k, l)*p0 - fluid_pp(1)%pv))**(1._wp/3._wp)

Check warning on line 217 in src/pre_process/m_assign_variables.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_assign_variables.fpp#L217

Added line #L217 was not covered by tests
end do
end if

Expand Down Expand Up @@ -687,7 +687,7 @@
end if

! Updating the patch identities bookkeeping variable
if (1._wp - eta < 1e-16_wp) patch_id_fp(j, k, l) = patch_id
if (1._wp - eta < 1.e-16_wp) patch_id_fp(j, k, l) = patch_id

end subroutine s_assign_patch_species_primitive_variables

Expand Down
8 changes: 4 additions & 4 deletions src/pre_process/m_grid.f90
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
dx = (x_domain%end - x_domain%beg)/real(m + 1, wp)

do i = 0, m
x_cc(i) = x_domain%beg + 5e-1_wp*dx*real(2*i + 1, wp)
x_cc(i) = x_domain%beg + 5.e-1_wp*dx*real(2*i + 1, wp)
x_cb(i - 1) = x_domain%beg + dx*real(i, wp)
end do

Expand Down Expand Up @@ -101,7 +101,7 @@

dy = (y_domain%end - y_domain%beg)/real(2*n + 1, wp)

y_cc(0) = y_domain%beg + 5e-1_wp*dy
y_cc(0) = y_domain%beg + 5.e-1_wp*dy

Check warning on line 104 in src/pre_process/m_grid.f90

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_grid.f90#L104

Added line #L104 was not covered by tests
y_cb(-1) = y_domain%beg

do i = 1, n
Expand All @@ -114,7 +114,7 @@
dy = (y_domain%end - y_domain%beg)/real(n + 1, wp)

do i = 0, n
y_cc(i) = y_domain%beg + 5e-1_wp*dy*real(2*i + 1, wp)
y_cc(i) = y_domain%beg + 5.e-1_wp*dy*real(2*i + 1, wp)

Check warning on line 117 in src/pre_process/m_grid.f90

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_grid.f90#L117

Added line #L117 was not covered by tests
y_cb(i - 1) = y_domain%beg + dy*real(i, wp)
end do

Expand Down Expand Up @@ -153,7 +153,7 @@
dz = (z_domain%end - z_domain%beg)/real(p + 1, wp)

do i = 0, p
z_cc(i) = z_domain%beg + 5e-1_wp*dz*real(2*i + 1, wp)
z_cc(i) = z_domain%beg + 5.e-1_wp*dz*real(2*i + 1, wp)

Check warning on line 156 in src/pre_process/m_grid.f90

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_grid.f90#L156

Added line #L156 was not covered by tests
z_cb(i - 1) = z_domain%beg + dz*real(i, wp)
end do

Expand Down
4 changes: 2 additions & 2 deletions src/pre_process/m_model.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,8 @@ contains
t_vec3 :: dist_buffer !< Distance between the cell center and the vertices
integer :: i, j, tri_idx !< Iterator

dist_min = 1e12_wp
dist_min_normal = 1e12_wp
dist_min = 1.e12_wp
dist_min_normal = 1.e12_wp
distance = 0._wp

tri_idx = 0
Expand Down
Loading
Loading