From a62025d47410671a3a39f5bee4145237af875b90 Mon Sep 17 00:00:00 2001 From: Ben Wilfong Date: Fri, 14 Jun 2024 11:48:35 -0400 Subject: [PATCH] AIAA Prep --- src/pre_process/include/2dHardcodedIC.fpp | 81 +++++++++++++++++++++++ src/pre_process/include/3dHardcodedIC.fpp | 2 +- src/pre_process/m_global_parameters.fpp | 4 +- src/pre_process/m_start_up.fpp | 2 +- toolchain/mfc/run/case_dicts.py | 3 +- toolchain/modules | 2 +- 6 files changed, 89 insertions(+), 5 deletions(-) diff --git a/src/pre_process/include/2dHardcodedIC.fpp b/src/pre_process/include/2dHardcodedIC.fpp index 7d6ee9602b..43778bd33e 100644 --- a/src/pre_process/include/2dHardcodedIC.fpp +++ b/src/pre_process/include/2dHardcodedIC.fpp @@ -7,6 +7,33 @@ eps = 1e-9 + + real(kind(0d0)), dimension(0:m_glb) :: ihCsv + + integer :: i1, ios + character(len=50) :: line + real(kind(0d0)) :: r1 + + eps = 1e-9 + + if (perlinNoise) then + + open(unit=10, file='perlin.txt', status='old', action='read') + + do i = 0,(m_glb+1) + + ! Read a line from the file into the 'line' variable + read(10, '(A)', iostat=ios) line + if (ios /= 0) exit ! Exit the loop if end of file or error + + ! Read two integers followed by a float from the line + read(line, *) i1, r1 + + ihCsv(i1) = r1 + end do + + end if + #:enddef #:def Hardcoded2D() @@ -100,6 +127,60 @@ q_prim_vf(E_idx)%sf(i, j, 0) = pInt + rhoL*9.81*(intH - y_cc(j)) end if + case (21) + + lam = 0.030 + acc = 9.81 + + ih = 5*lam + ihCsv(start_idx(1) + i + + alph = 5d-1*(1 + tanh((y_cc(j) - ih)/1d-3)) + + if (alph < 1e-6) alph = 1e-6 + if (alph > 1 - 1e-6) alph = 1 - 1e-6 + + if (sigma .ne. dflt_real) q_prim_vf(c_idx)%sf(i, j, k) = alph + q_prim_vf(advxb)%sf(i, j, 0) = 1 - alph + q_prim_vf(advxe)%sf(i, j, 0) = alph + q_prim_vf(contxb)%sf(i, j, 0) = (1 - alph)*950d0 + q_prim_vf(contxe)%sf(i, j, 9) = alph*1d0 + + if (y_cc(j) > ih) then + q_prim_vf(E_idx)%sf(i, j, 0) = 1d5 - 1d0*acc*(y_cc(j) - ih) + else + q_prim_vf(E_idx)%sf(i, j, 0) = 1d5 + 950d0*acc*(ih - y_cc(j)) + end if + + case (22) + + case (23) + + case (24) + + case (241) + + case (242) + + case (243) + + case (244) + + case (11) + + case (12) + + case (13) + + case (14) + + case (31) + + case (32) + + case (33) + + case (34) + case default if (proc_rank == 0) then call s_int_to_str(patch_id, iStr) diff --git a/src/pre_process/include/3dHardcodedIC.fpp b/src/pre_process/include/3dHardcodedIC.fpp index 1dd4f9bccc..e707c54929 100644 --- a/src/pre_process/include/3dHardcodedIC.fpp +++ b/src/pre_process/include/3dHardcodedIC.fpp @@ -82,7 +82,7 @@ case (301) ! 3D interface shake !0.0005*(sin(pi/3*x_cc(i)/lam) + sin(pi/5*z_cc(k)/lam) + & !sin(pi/11*x_cc(i)/lam + sin(pi/7*z_cc(k)/lam))) - ih = 5*lam + ihCsv(start_idx(1) + i, start_idx(3) + k) + ih = 3*lam + ihCsv(start_idx(1) + i, start_idx(3) + k) alph = 5d-1*(1 + tanh((y_cc(j) - ih)/1d-3)) diff --git a/src/pre_process/m_global_parameters.fpp b/src/pre_process/m_global_parameters.fpp index e2d647be00..daab33bf84 100644 --- a/src/pre_process/m_global_parameters.fpp +++ b/src/pre_process/m_global_parameters.fpp @@ -32,7 +32,7 @@ module m_global_parameters ! Computational Domain Parameters ========================================== integer :: proc_rank !< Rank of the local processor - + logical :: perlinNoise integer :: m integer :: n integer :: p !< @@ -386,6 +386,8 @@ contains dist_type = dflt_int R0_type = dflt_int + perlinNoise = false + R_n = dflt_real R_v = dflt_real phi_vn = dflt_real diff --git a/src/pre_process/m_start_up.fpp b/src/pre_process/m_start_up.fpp index ddf9eb772f..4474f6c078 100644 --- a/src/pre_process/m_start_up.fpp +++ b/src/pre_process/m_start_up.fpp @@ -136,7 +136,7 @@ contains sigR, sigV, dist_type, rhoRV, R0_type, & file_per_process, relax, relax_model, & palpha_eps, ptgalpha_eps, ib, num_ibs, patch_ib, & - sigma, adv_n, cfl_dt, t_start + sigma, adv_n, cfl_dt, t_start, perlinNoise ! Inquiring the status of the pre_process.inp file file_loc = 'pre_process.inp' diff --git a/toolchain/mfc/run/case_dicts.py b/toolchain/mfc/run/case_dicts.py index c299108490..6de8adefac 100644 --- a/toolchain/mfc/run/case_dicts.py +++ b/toolchain/mfc/run/case_dicts.py @@ -68,7 +68,8 @@ class ParamType(Enum): 'ib': ParamType.LOG, 'num_ibs': ParamType.INT, 'cfl_dt': ParamType.LOG, - 't_start': ParamType.INT + 't_start': ParamType.INT, + 'perlinNoise': ParamType.LOG }) for ib_id in range(1, 10+1): diff --git a/toolchain/modules b/toolchain/modules index e852818aa3..1edc58761d 100644 --- a/toolchain/modules +++ b/toolchain/modules @@ -43,7 +43,7 @@ e-gpu CC=nvc CXX=nvc++ FC=nvfortran p GT Phoenix p-all python/3.9.12-rkxvr6 -p-cpu gcc/12.1.0-qgxpzk mvapich2/2.3.7-733lcv +p-cpu gcc/12.1.0-qgxpzk openmpi p-gpu cmake/3.23.1-327dbl cuda/11.7.0-7sdye3 nvhpc/22.11 p-gpu MFC_CUDA_CC=70,80 CC=nvc CXX=nvc++ FC=nvfortran