Skip to content

Commit

Permalink
Merge pull request #303 from xcompact3d/UpdateTests
Browse files Browse the repository at this point in the history
Split the tests from the examples and update of the related .md files
  • Loading branch information
rfj82982 authored Nov 21, 2024
2 parents 6108535 + b05adc2 commit 8c4bbaf
Show file tree
Hide file tree
Showing 60 changed files with 952 additions and 812 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/generate_reference_test_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@ jobs:
export PATH=$(pwd)/openmpi-4.1.4/installed/bin/:$PATH
echo "mpif90 version: $(mpif90 --version | head -1)" >> metadata.txt
echo "mpirun version: $(mpirun --version | head -1)" >> metadata.txt
mv metadata.txt test/data/Taylor-Green-Vortex/
mv metadata.txt tests/TGV-Taylor-Green-Vortex/
- name: Build Incompact3d and run TGV reference test case
run: |
export PATH=$(pwd)/openmpi-4.1.4/installed/bin/:$PATH
make
cp test/data/Taylor-Green-Vortex/reference_input.i3d input.i3d
mpirun -np 2 xcompact3d
export FC=mpif90
cmake -S . -B build
cmake --build build -j 2
cmake --install build
ctest --test-dir build
- name: Store new reference output
run: |
cp -v time_evol.dat test/data/Taylor-Green-Vortex/reference_time_evol.dat
cp -v build/RunTests/RunTests/TGV-Taylor-Green-vortex/time_evol.dat tests/TGV-Taylor-Green-Vortex/reference_time_evol.dat
- name: Create new Pull Request updating the reference output
uses: peter-evans/create-pull-request@v4
with:
title: Update reference output TGV data
commit-message: Update reference TGV data and metadata
add-paths: |
test/data/Taylor-Green-Vortex/reference_time_evol.dat
test/data/Taylor-Green-Vortex/metadata.txt
tests/TGV-Taylor-Green-Vortex/reference_time_evol.dat
tests/TGV-Taylor-Green-Vortex/metadata.txt
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ lint.txt
*.log
docs/_build/
build*
Test*
.cproject
.project
.settings
Expand Down
49 changes: 9 additions & 40 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $ cmake --build $path_to_build_directory -j <nproc>
```
appending `-v` will display additional information about the build, such as compiler flags.

After building the library can be tested. Please see the section [Testing](#testing-and-examples)
After building the library can be tested using `CTest`
for the available options.
Finally the code can be installed using
```
Expand All @@ -74,48 +74,17 @@ $ cmake --build $path_to_build_directory -DCMAKE_INSTALL_PREFIX=$path_to_my_opt
```
or via the `ccmake` interface.

### Testing
The testing suite for the **xcompact3d** solver is composed by 14 tests as follows

1. Atmospheric Boundary layer (ABL) in neutral conditions (new set-up)
1. Atmospheric Boundary layer (ABL) in neutral conditions (old set-up)
1. Atmospheric Boundary layer (ABL) in convective conditions (old set-up)
1. Atmospheric Boundary layer (ABL) in stable conditions (old set-up)
1. Differentially heated cavity
1. Turbulent Channel Flow with X as streamwise direction
1. Turbulent Channel Flow with Z as streamwise direction
1. Flow around a circular cylinder
1. Flow around a moving circular cylinder
1. Lock exchange
1. Mixing Layer
1. Turbulent Boundary Layer (TBL)
1. Wind Turbine
1. Taylor Green Vortex (TGV)

By default only the Taylor Green Vortex case is activated, while the full
testing suite needs to be enable by using the `BUILD_TESTING_FULL` flag as
```
$ cmake --build $path_to_build_directory -DBUILD_TESTING_FULL=ON
```
or by using `ccmake`.
## Examples and Testing
Several input *.i3d* files are available under the [examples](examples) folder.
The input files contain the full set-up, from flow development to statistic collection,
for several canonical test cases.

The tests are performed using `CTest` as
```
$ ctest --test-dir $path_to_build_directory
```
### Testing
The testing suite for the **xcompact3d** solver is composed by 13 tests.
More details are given in [here](tests/README.md)

Every test is performed in a dedicated working directory that is located under the following path
```
$ /path/to/build/RunTests
```
All standard outputs from all test runs are collated under the file
```
$ /path/to/build/Testing/Temporary/LastTest.log
```
together with additional files detailing additional informations such as
the elapse time for the different tests and the eventual failed cases.

### Build with an already present 2DECOMP&FFT
## Build with an already present 2DECOMP&FFT
If different options from the default
(i.e. Generic FFT backend and double precision) are necessary,
2DECOMP&FFT needs to be pre-installed as described [here](https://github.com/2decomp-fft/2decomp-fft/blob/dev/INSTALL.md).
Expand Down
23 changes: 7 additions & 16 deletions examples/ABL-Atmospheric-Boundary-Layer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
# ABL Neutral
set(case "ABL-Neutral")
set(case_dir "${test_dir}/${case}")
file(MAKE_DIRECTORY ${case_dir})
set(input_file "input_neutral_test.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 for TGV case
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})
# ABL
set(case "ABL-Atmospheric-Boundary-Layer")
set(example_files "")
list(APPEND example_files "adios2_config.xml")
list(APPEND example_files "input_neutral.i3d")
AddExample("${examples_dir}" "${case}" "${example_files}")


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=33 ! Y-direction nodes
nz=32 ! Z-direction nodes
nx=64 ! X-direction nodes
ny=65 ! Y-direction nodes
nz=64 ! Z-direction nodes
istret = 0 ! y mesh refinement (0:no, 1:center, 2:both sides, 3:bottom)
beta = 0.7 ! Refinement parameter (beta)

Expand All @@ -26,7 +26,7 @@ zlz = 3140. ! Lz (Size of the box in z-direction)
! Boundary conditions
nclx1 = 0
nclxn = 0
ncly1 = 1
ncly1 = 2
nclyn = 1
nclz1 = 0
nclzn = 0
Expand All @@ -36,21 +36,21 @@ iin = 1 ! Inflow conditions (1: classic, 2: turbinit)
re = 66667. ! nu=1/re (Kinematic Viscosity)
u1 = 10. ! u1 (max velocity) (for inflow condition)
u2 = 10. ! u2 (min velocity) (for inflow condition)
init_noise = 0.05 ! Turbulence intensity (1=100%) !! Initial condition
init_noise = 0.5 ! Turbulence intensity (1=100%) !! Initial condition
inflow_noise = 0.1 ! Turbulence intensity (1=100%) !! Inflow condition

! Time stepping
dt = 2 ! Time step
dt = 0.8 ! Time step
ifirst = 1 ! First iteration
ilast = 100 ! Last iteration
ilast = 100000 ! Last iteration

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

ifilter = 2
ifilter = 1
C_filter = 0.49

/End
Expand Down Expand Up @@ -79,10 +79,10 @@ 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 = 5000 ! Frequency for writing backup file
ioutput = 100 ! Frequency for visualization
icheckpoint = 10000 ! Frequency for writing backup file
ioutput = 500 ! Frequency for visualization
nvisu = 1 ! Size for visualisation collection
ilist = 25 ! Frequency for writing on screen
ilist = 50 ! Frequency for writing on screen

/End

Expand Down Expand Up @@ -126,7 +126,7 @@ smagcst = 0.14 ! Smagorinsky constant
SmagWallDamp = 1 ! 1: Mason and Thomson Damping function, otherwise OFF
nSmag = 3 ! Smag damping coeff (for use with M+T damping)
walecst = 0.5 ! WALES Model Coefficient
iconserv = 0 ! Formulation SGS divergence (0: non conservative, 1: conservative)
iconserv = 1 ! Formulation SGS divergence (0: non conservative, 1: conservative)

/End

Expand All @@ -138,7 +138,9 @@ z_zero=0.1 ! Roughness length
k_roughness=0.4 ! von Karman constant (usually taken to be equal to 0.4)
ustar=0.45 ! friction velocity
dBL=1000 ! Boundary layer height
iPressureGradient=0 ! 0: Geostrophic Vel 1: PG forcing
iPressureGradient=1 ! 0: Geostrophic Vel 1: PG forcing
imassconserve=0 ! Enforce mass conservation
dsampling=3.0 ! Sampling velocity for the wall model at delta=dsampling*dy
UG=0,0,0
ibuoyancy=0 ! Buoyancy effects
idamping=0 ! Damping zone
Expand All @@ -147,7 +149,6 @@ itherm=0 ! 0: Surface flux 1: Surface temperature
icoriolis=0 ! Coriolis forces
coriolisfreq=1e-04
iheight=0 ! Compute BL height
imassconserve=1 ! Enforce mass conservation
T_wall=300. ! Initial wall temperature
T_top=310.814 ! Temperature at domain top
/End
Expand Down
50 changes: 0 additions & 50 deletions examples/ABL-Atmospheric-Boundary-Layer/legacy/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 8c4bbaf

Please sign in to comment.