Skip to content

Commit

Permalink
Merge pull request #324 from xcompact3d/UpdateTests_Continue
Browse files Browse the repository at this point in the history
Update tests continue
  • Loading branch information
rfj82982 authored Nov 22, 2024
2 parents 8c4bbaf + 8605f9d commit 46486d7
Show file tree
Hide file tree
Showing 44 changed files with 2,499 additions and 101 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ 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 Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ add_subdirectory(Mixing-layer)
add_subdirectory(Periodic-hill)
add_subdirectory(TBL-Turbulent-Boundary-Layer)
add_subdirectory(TGV-Taylor-Green-vortex)
#add_subdirectory(Wind-Turbine)
add_subdirectory(Wind-Turbine)
40 changes: 8 additions & 32 deletions examples/Particle-Tracking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
# 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})
# Particle-tracking
set(case "Particle-tracking")
set(example_files "")
list(APPEND example_files "adios2_config.xml")
list(APPEND example_files "input_channel_particles.i3d")
list(APPEND example_files "input_tgv_particles.i3d")
AddExample("${examples_dir}" "${case}" "${example_files}")


# 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})
51 changes: 51 additions & 0 deletions examples/Particle-Tracking/adios2_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<adios-config>
<io name="solution-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="in-outflow-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="turb-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="restart-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="statistics-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="restart-forces-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
</adios-config>
33 changes: 17 additions & 16 deletions examples/Particle-Tracking/input_channel_particles.i3d
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@
itype = 3

! Domain decomposition
p_row=0 ! Row partition
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
nx=256 ! X-direction nodes
ny=129 ! Y-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)

! Domain
xlx = 6.0 ! Lx (Size of the box in x-direction)
xlx = 12.56637 ! 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)
zlz = 6.2831853 ! Lz (Size of the box in z-direction)

! Flow parameters
re = 4200.0 ! nu=1/re (Kinematic Viscosity)
re = 3457.5 ! 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
ilast = 50000 ! Last iteration

! Enable modelling tools
ilesmod=0 ! if 0 then DNS
Expand Down Expand Up @@ -82,8 +82,8 @@ cnu = 0.44 ! Ratio between hypervisvosity at k_m=2/3pi and k_c= pi
! 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
ioutput = 100 ! Frequency for visualization
ilist = 100 ! Frequency for the output to screen
nvisu = 1 ! Size for visualisation collection

/End
Expand All @@ -92,10 +92,10 @@ nvisu = 1 ! Size for visualisation collection
&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
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 = 10000000 ! Time steps after which statistics are collected

/End

Expand All @@ -107,7 +107,7 @@ initstat = 1000000 ! Time steps after which statistics are collected
&ScalarParam
!================

Sc(1) = 1.0 ! Schmidt number
Sc(1) = 1.0 ! Schmidt number

nclxS1 = 0
nclxSn = 0
Expand All @@ -134,10 +134,11 @@ hartmann = 4.d0
bc_particle = 'outflow','outflow','reflective','reflective','periodic','periodic'
initype_particle = 'uniform'
n_particles = 64
particle_inject_period = 0.1
particle_inject_period = 0.01

/End


!================
&LESModel
!================
Expand Down
8 changes: 4 additions & 4 deletions examples/Particle-Tracking/input_tgv_particles.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=32 ! X-direction nodes
ny=32 ! Y-direction nodes
nz=32 ! Z-direction nodes
nx=128 ! X-direction nodes
ny=128 ! Y-direction nodes
nz=128 ! Z-direction nodes
istret = 0 ! y mesh refinement (0:no, 1:center, 2:both sides, 3:bottom)
beta = 0.259065151 ! Refinement parameter (beta)

Expand Down Expand Up @@ -42,7 +42,7 @@ 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
ilast = 2000 ! Last iteration

! Enable modelling tools
ilesmod=0 ! if 0 then DNS
Expand Down
9 changes: 2 additions & 7 deletions examples/Wind-Turbine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Wind-Turbine
set(case "Wind-Turbine")
set(example_files "")
list(APPEND example_files "NREL-5MW_ALM")
list(APPEND example_files "precursor-succesor-ADM")
AddExample("${examples_dir}" "${case}" "${example_files}")


add_subdirectory(NREL-5MW_ALM)
add_subdirectory(two_turbines)
27 changes: 8 additions & 19 deletions examples/Wind-Turbine/NREL-5MW_ALM/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
# ABL Neutral
set(case "Wind-Turbine")
set(case_dir "${test_dir}/${case}")
file(MAKE_DIRECTORY ${case_dir})
set(input_file "input_test.i3d")
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
install(FILES ${input_file} DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
install(FILES input_test.turb 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 for TGV case
file(COPY ${input_file} DESTINATION ${case_dir})
file(COPY input_test.turb DESTINATION ${case_dir})
file(COPY NRELResources 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})
# Wind-Turbine: NREL
set(case "Wind-Turbine-NREL-5MW")
set(example_files "")
list(APPEND example_files "adios2_config.xml")
list(APPEND example_files "NREL-5MW.i3d")
list(APPEND example_files "NREL-5MW.turb")
AddExample("${examples_dir}" "${case}" "${example_files}")
add_subdirectory(NRELResources)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(dir "Wind-Turbine-NREL-5MW/NRELResources/Airfoils")
file(GLOB_RECURSE example_files "${CMAKE_CURRENT_SOURCE_DIR}/*.air")
AddExample("${examples_dir}" "${dir}" "${example_files}")
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(dir "Wind-Turbine-NREL-5MW/NRELResources")
file(GLOB_RECURSE example_files "${CMAKE_CURRENT_SOURCE_DIR}/*.al")
AddExample("${examples_dir}" "${dir}" "${example_files}")
add_subdirectory(Airfoils)
3 changes: 3 additions & 0 deletions examples/Wind-Turbine/two_turbines/Airfoils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(dir "Wind-Turbine-two-turbines/Airfoils")
file(GLOB_RECURSE example_files "${CMAKE_CURRENT_SOURCE_DIR}/*.air")
AddExample("${examples_dir}" "${dir}" "${example_files}")
11 changes: 11 additions & 0 deletions examples/Wind-Turbine/two_turbines/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Wind-Turbine: NREL
set(case "Wind-Turbine-two-turbines")
set(example_files "")
list(APPEND example_files "adios2_config.xml")
list(APPEND example_files "input.i3d")
list(APPEND example_files "BT2_1.turb")
list(APPEND example_files "BT2_2.turb")
list(APPEND example_files "Blade_N52.al")
list(APPEND example_files "Tower.al")
AddExample("${examples_dir}" "${case}" "${example_files}")
add_subdirectory(Airfoils)
51 changes: 51 additions & 0 deletions examples/Wind-Turbine/two_turbines/adios2_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<adios-config>
<io name="solution-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="in-outflow-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="turb-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="restart-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="statistics-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
<io name="restart-forces-io">
<engine type="BP4">
</engine>
<transport type="File">
<parameter key="Library" value="fstream"/>
<parameter key="ProfileUnits" value="Milliseconds"/>
</transport>
</io>
</adios-config>
6 changes: 3 additions & 3 deletions examples/cmake/X3D_ADD_EXAMPLE.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
macro(AddExample example_dir case list_files)
install(DIRECTORY DESTINATION ${example_dir}/${case})
macro(AddExample root_dir case list_files)
install(DIRECTORY DESTINATION ${root_dir}/${case})
set(local_list "")
list(APPEND local_list ${list_files})
foreach(ff IN LISTS local_list)
install(FILES ${ff} DESTINATION ${example_dir}/${case})
install(FILES ${ff} DESTINATION ${root_dir}/${case})
endforeach()
endmacro()

3 changes: 2 additions & 1 deletion tests/ABL-Atmospheric-Boundary-Layer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ABL
set(case "ABL-Atmospheric-Boundary-Layer")
set(input_file "input_neutral_test.i3d")
CreateMPITest(${test_dir} ${case} ${input_file})
set(additional_inputs "")
CreateMPITest(${test_dir} ${case} ${input_file} "${additional_inputs}")

3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ if (${BUILD_TESTING_FULL})
add_subdirectory(Gravity-current)
add_subdirectory(MHD)
add_subdirectory(Mixing-layer)
add_subdirectory(Particle-Tracking)
add_subdirectory(Periodic-hill)
add_subdirectory(TBL-Turbulent-Boundary-Layer)
#add_subdirectory(Wind-Turbine/NREL-5MW_ALM)
add_subdirectory(Wind-Turbine)
endif (${BUILD_TESTING_FULL})


3 changes: 2 additions & 1 deletion tests/Cavity/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Cavity
set(case "Cavity")
set(input_file "input_test.i3d")
CreateMPITest(${test_dir} ${case} ${input_file})
set(additional_inputs "")
CreateMPITest(${test_dir} ${case} ${input_file} "${additional_inputs}")

6 changes: 4 additions & 2 deletions tests/Channel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Channel
set(case "Channel-X")
set(input_file "input_test_x.i3d")
CreateMPITest(${test_dir} ${case} ${input_file})
set(additional_inputs "")
CreateMPITest(${test_dir} ${case} ${input_file} "${additional_inputs}")
set(case "Channel-Z")
set(input_file "input_test_z.i3d")
CreateMPITest(${test_dir} ${case} ${input_file})
set(additional_inputs "")
CreateMPITest(${test_dir} ${case} ${input_file} "${additional_inputs}")

6 changes: 4 additions & 2 deletions tests/Cylinder-wake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Cylinder
set(case "Cylinder-wake")
set(input_file "input_test.i3d")
CreateMPITest(${test_dir} ${case} ${input_file})
set(additional_inputs "")
CreateMPITest(${test_dir} ${case} ${input_file} "${additional_inputs}")
set(case "Cylinder-wake-moving")
set(input_file "input_test_moving.i3d")
CreateMPITest(${test_dir} ${case} ${input_file})
set(additional_inputs "")
CreateMPITest(${test_dir} ${case} ${input_file} "${additional_inputs}")

Loading

0 comments on commit 46486d7

Please sign in to comment.