Skip to content

Commit

Permalink
Merge branch 'master' into UpdateTests
Browse files Browse the repository at this point in the history
  • Loading branch information
rfj82982 committed Nov 12, 2024
2 parents 3e83fb6 + 14ebbad commit aa8dad3
Show file tree
Hide file tree
Showing 24 changed files with 3,355 additions and 181 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ add_subdirectory(src)

# Add tests
option(BUILD_TESTING "Build with test and use only TGV case" ON)
option(BUILD_TESTING_PARTICLE "Build with test and use only two cases with particle tracking" OFF)
option(BUILD_TESTING_FULL "Build all tests" OFF)
if (${BUILD_TESTING})
include(CTest)
Expand All @@ -68,5 +69,3 @@ endif (${BUILD_TESTING})
# Add a prettify target
#add_custom_target(format sh ${CMAKE_SOURCE_DIR}/scripts/format.sh
# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})


8 changes: 4 additions & 4 deletions examples/MHD/input_mhdchan.i3d
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ p_row=0 ! Row partition
p_col=0 ! Column partition

! Mesh
nx=128 ! X-direction nodes
nx=256 ! X-direction nodes
ny=129 ! Y-direction nodes
nz=128 ! Z-direction nodes
nz=192 ! Z-direction nodes
istret = 2 ! y mesh refinement (0:no, 1:center, 2:both sides, 3:bottom)
beta = 0.259065151 ! Refinement parameter (beta)

Expand All @@ -30,7 +30,7 @@ cpg = F ! if cpg=T, then re is friction Reynolds number
! Time stepping
dt = 0.005 ! Time step
ifirst = 1 ! First iteration
ilast = 20 ! Last iteration
ilast = 800000 ! Last iteration

! Enable modelling tools
ilesmod=0 ! if 0 then DNS
Expand Down Expand Up @@ -94,7 +94,7 @@ nvisu = 1 ! Size for visualisation collection
wrotation = 0.d0 ! rotation speed to trigger turbulence
spinup_time = 0 ! number of time steps with a rotation to trigger turbulence
nstat = 1 ! Size arrays for statistic collection
initstat = 400000 ! Time steps after which statistics are collected
initstat = 600000 ! Time steps after which statistics are collected

/End

Expand Down
2 changes: 1 addition & 1 deletion examples/MHD/input_otv.i3d
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ inflow_noise = 0.0 ! Turbulence intensity (1=100%) !! Inflow condition
! Time stepping
dt = 0.0001 ! Time step
ifirst = 1 ! First iteration
ilast = 20 ! Last iteration
ilast = 20000 ! Last iteration

! Enable modelling tools
ilesmod=0 ! if 0 then DNS
Expand Down
33 changes: 33 additions & 0 deletions examples/Particle-Tracking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# TGV flow with passive particle trackers
set(case "TGV-Particles")
set(case_dir "${test_dir}/${case}")
file(MAKE_DIRECTORY ${case_dir})
set(input_file "input_tgv_particles.i3d")
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
install(FILES ${input_file} DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
if(ADIOS2_FOUND)
install(FILES adios2_config.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
endif()
# If testing active add test
file(COPY ${input_file} DESTINATION ${case_dir})
if(ADIOS2_FOUND)
file(COPY adios2_config.xml DESTINATION ${case_dir})
endif()
add_test(NAME ${case} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} $<TARGET_FILE:xcompact3d> ${input_file} WORKING_DIRECTORY ${case_dir})

# Channel flow with constantly injected passive particle trackers
set(case "Channel-Particles")
set(case_dir "${test_dir}/${case}")
file(MAKE_DIRECTORY ${case_dir})
set(input_file "input_channel_particles.i3d")
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
install(FILES ${input_file} DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
if(ADIOS2_FOUND)
install(FILES adios2_config.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
endif()
# If testing active add test
file(COPY ${input_file} DESTINATION ${case_dir})
if(ADIOS2_FOUND)
file(COPY adios2_config.xml DESTINATION ${case_dir})
endif()
add_test(NAME ${case} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} $<TARGET_FILE:xcompact3d> ${input_file} WORKING_DIRECTORY ${case_dir})
163 changes: 163 additions & 0 deletions examples/Particle-Tracking/input_channel_particles.i3d
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
! -*- mode: f90 -*-

!===================
&BasicParam
!===================

! Flow type (1=Lock-exchange, 2=TGV, 3=Channel, 4=Periodic hill, 5=Cylinder, 6=dbg-schemes)
itype = 3

! Domain decomposition
p_row=0 ! Row partition
p_col=0 ! Column partition

! Mesh
nx=32 ! X-direction nodes
ny=65 ! Y-direction nodes
nz=32 ! Z-direction nodes
istret = 2 ! y mesh refinement (0:no, 1:center, 2:both sides, 3:bottom)
beta = 0.259065151 ! Refinement parameter (beta)

! Domain
xlx = 6.0 ! Lx (Size of the box in x-direction)
yly = 2.0 ! Ly (Size of the box in y-direction)
zlz = 3.0 ! Lz (Size of the box in z-direction)

! Flow parameters
re = 4200.0 ! nu=1/re (Kinematic Viscosity)
cpg = F ! if cpg=T, then re is friction Reynolds number

! Time stepping
dt = 0.005 ! Time step
ifirst = 1 ! First iteration
ilast = 200 ! Last iteration

! Enable modelling tools
ilesmod=0 ! if 0 then DNS
numscalar = 0 ! How many scalars? (Set to zero to disable scalars)
iibm=0 ! Flag for immersed boundary method

! Boundary and initial conditions
iin = 4 ! Inflow conditions (1: classic, 2: turbinit, 4: SEM)
u1 = 1. ! u1 (max velocity) (for inflow condition)
u2 = 1. ! u2 (min velocity) (for inflow condition)
init_noise = 0.03 ! Turbulence intensity (1=100%) !! Initial condition
inflow_noise = 0.0 ! Turbulence intensity (1=100%) !! Inflow condition
idir_stream = 1 ! Index of the streamwise direction (1=X, 3=Z, 2 not available)

nclx1 = 0
nclxn = 0
ncly1 = 2
nclyn = 2
nclz1 = 0
nclzn = 0

mhd_active = .false.
particle_active =.true.
/End

!====================
&NumOptions
!====================

! Spatial derivatives
ifirstder = 4 ! (1->2nd central, 2->4th central, 3->4th compact, 4-> 6th compact)
isecondder = 5 ! (1->2nd central, 2->4th central, 3->4th compact, 4-> 6th compact, 5->hyperviscous 6th)
ipinter = 3 ! interpolation scheme (1: classic, 2: optimized, 3: optimized agressive)

! Time scheme
iimplicit = 0
itimescheme = 5 ! Time integration scheme (1->Euler,2->AB2, 3->AB3, 4->AB4,5->RK3,6->RK4, 7-->CN2+AB3)

! Dissipation control
nu0nu = 4.0 ! Ratio between hyperviscosity/viscosity at nu
cnu = 0.44 ! Ratio between hypervisvosity at k_m=2/3pi and k_c= pi

/End

!=================
&InOutParam
!=================

! Basic I/O
irestart = 0 ! Read initial flow field
icheckpoint = 10000 ! Frequency for writing backup file
ioutput = 20 ! Frequency for visualization
ilist = 10 ! Frequency for the output to screen
nvisu = 1 ! Size for visualisation collection

/End

!=================
&Statistics
!=================

wrotation = 0.d0 ! rotation speed to trigger turbulence
spinup_time = 0 ! number of time steps with a rotation to trigger turbulence
nstat = 1 ! Size arrays for statistic collection
initstat = 1000000 ! Time steps after which statistics are collected

/End

!########################
! OPTIONAL PARAMETERS
!#######################

!================
&ScalarParam
!================

Sc(1) = 1.0 ! Schmidt number

nclxS1 = 0
nclxSn = 0
nclyS1 = 2
nclySn = 2
nclzS1 = 0
nclzSn = 0

/End

!====================
&MHDParam
!====================

mhd_equation = .false.
hartmann = 4.d0

/End

!====================
&ParTrack
!====================

bc_particle = 'outflow','outflow','reflective','reflective','periodic','periodic'
initype_particle = 'uniform'
n_particles = 64
particle_inject_period = 0.1

/End

!================
&LESModel
!================

iles = 0 ! LES Model (1: Phys Smag, 2: Phys WALE, 3: Phys dyn. Smag, 4: iSVV, 5: dyn SEV)
smagcst = 0.14 ! Smagorinsky constant
walecst = 0.5 ! WALES Model Coefficient
iwall = 0 ! Enable wall modeling

/End

!================
&WallModel
!================

SmagWallDamp = 0 ! Smagorinsky damping function for ABL if 1

/End

&CASE
/End


134 changes: 134 additions & 0 deletions examples/Particle-Tracking/input_tgv_particles.i3d
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
! -*- mode: f90 -*-

!===================
&BasicParam
!===================

! Flow type (1=Lock-exchange, 2=TGV, 3=Channel, 4=Periodic hill, 5=Cylinder, 6=dbg-schemes)
itype = 2

! Domain decomposition
p_row=0 ! Row partition
p_col=0 ! Column partition

! Mesh
nx=32 ! X-direction nodes
ny=32 ! Y-direction nodes
nz=32 ! Z-direction nodes
istret = 0 ! y mesh refinement (0:no, 1:center, 2:both sides, 3:bottom)
beta = 0.259065151 ! Refinement parameter (beta)

! Domain
xlx = 6.28318530717958 ! Lx (Size of the box in x-direction)
yly = 6.28318530717958 ! Ly (Size of the boy in y-direction)
zlz = 6.28318530717958 ! Lz (Size of the boz in z-direction)

! Boundary conditions
nclx1 = 0
nclxn = 0
ncly1 = 0
nclyn = 0
nclz1 = 0
nclzn = 0

! Flow parameters
iin = 1 ! Inflow conditions (1: classic, 2: turbinit)
re = 1600. ! nu=1/re (Kinematic Viscosity)
u1 = 8. ! u1 (max velocity) (for inflow condition)
u2 = 8. ! u2 (min velocity) (for inflow condition)
init_noise = 0.0 ! Turbulence intensity (1=100%) !! Initial condition
inflow_noise = 0.0 ! Turbulence intensity (1=100%) !! Inflow condition

! Time stepping
dt = 0.001 ! Time step
ifirst= 1 ! First iteration
ilast = 200 ! Last iteration

! Enable modelling tools
ilesmod=0 ! if 0 then DNS
iscalar=0 ! If iscalar=0 (no scalar), if iscalar=1 (scalar)
iibm=0 ! Flag for immersed boundary method

! Enable io
ivisu=1 ! Store snapshots
ipost=1 ! Do online postprocessing

ifilter=0
C_filter=0.49

particle_active=.true.
/End

!====================
&NumOptions
!====================

! Spatial derivatives
ifirstder = 4 ! (1->2nd central, 2->4th central, 3->4th compact, 4-> 6th compact)
isecondder = 5 ! (1->2nd central, 2->4th central, 3->4th compact, 4-> 6th compact, 5->hyperviscous 6th)

! Time scheme
itimescheme = 5 ! Time integration scheme (1->Euler,2->AB2, 3->AB3, 4->AB4,5->RK3,6->RK4)

/End

!=================
&InOutParam
!=================

! Basic I/O
irestart = 0 ! Read initial flow field ?
icheckpoint = 1000 ! Frequency for writing backup file
ioutput = 100 ! Frequency for visualization
ilist = 5 ! Frequency for the output
nvisu = 1 ! Size for visualisation collection

/End

!=================
&Statistics
!=================

nstat = 1 ! Size arrays for statistic collection

/End

!====================
&MHDParam
!====================

mhd_active = .false.
mhd_equation=.true.
Stuart = 100.d0
Rem = 100.d0

/End

!====================
&ParTrack
!====================

bc_particle = 'periodic','periodic','periodic','periodic','periodic','periodic'
initype_particle = 'uniform'
n_particles = 512
particle_inject_period = 0.0

/End

!#######################
! OPTIONAL PARAMETERS
!#######################

!=================
&LESModel
!=================
jles=0
smagcst=0.1
walecst=0.5
iwall=0
/End

!=================
&CASE
!=================
/End
Loading

0 comments on commit aa8dad3

Please sign in to comment.