Skip to content

Commit

Permalink
AIAA Prep
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfonba committed Jun 14, 2024
1 parent bc5da77 commit a62025d
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 5 deletions.
81 changes: 81 additions & 0 deletions src/pre_process/include/2dHardcodedIC.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/pre_process/include/3dHardcodedIC.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 3 additions & 1 deletion src/pre_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 !<
Expand Down Expand Up @@ -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
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 @@ -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'
Expand Down
3 changes: 2 additions & 1 deletion toolchain/mfc/run/case_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion toolchain/modules
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a62025d

Please sign in to comment.