├── .DS_Store ├── .github └── workflows │ ├── Build.yml │ └── test.yml ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── LOG.md ├── Makefile ├── README.md ├── chemMech ├── ES80_H2-8-16.xml ├── Jachimowski88_H2-9-19.xml ├── Lu09_nHeptane_71s-539r.xml ├── gri30.xml ├── modifiedSmooke-Doan18_CH4wOHs-19s-58.xml └── thermchem_gen.xsl ├── examples ├── CMakeLists.txt ├── Channel │ ├── CMakeLists.txt │ └── datin │ │ ├── controller │ │ └── input.chl ├── Channel_SI │ └── datin │ │ ├── controller │ │ └── input.chdim ├── MixingLayer │ ├── CMakeLists.txt │ └── datin │ │ ├── controller │ │ ├── grid.2d │ │ └── input.2d ├── Perfectly_Stirred_Reactor │ └── datin │ │ ├── ES80_H2-8-16.xml │ │ ├── controller │ │ ├── h2_12s.yaml │ │ └── input.psr ├── Rayleigh–Taylor-Instability │ ├── CMakeLists.txt │ └── datin │ │ ├── controller │ │ └── input.rti ├── SWLBI │ ├── CMakeLists.txt │ └── datin │ │ ├── controller │ │ ├── grid.2d │ │ ├── inlet.prof │ │ └── input.2d ├── Shuosher │ ├── CMakeLists.txt │ └── datin │ │ ├── controller │ │ └── input.shuosher ├── Steady_H2flame │ └── datin │ │ ├── Burke12.xml │ │ ├── Burke12.yaml │ │ ├── controller │ │ ├── input.hitflame │ │ └── userinput.txt ├── Taylor_Green_Vortex │ ├── CMakeLists.txt │ └── datin │ │ ├── controller │ │ ├── input.tgv │ │ └── input.tgv2d ├── Taylor_Green_Vortex_2D │ ├── CMakeLists.txt │ └── datin │ │ ├── controller │ │ └── input.tgv2d ├── Taylor_Green_Vortex_SI │ └── datin │ │ ├── controller │ │ └── input.dim ├── Taylor_Green_Vortex_with_Flame │ ├── CMakeLists.txt │ └── datin │ │ ├── ES80_H2-7-16.yaml │ │ ├── controller │ │ └── input.tgvflame ├── Vortex_Transport │ ├── CMakeLists.txt │ └── datin │ │ ├── controller │ │ └── input.2dvort ├── Wind_Tunnel_2D │ ├── CMakeLists.txt │ └── datin │ │ ├── circle.stl │ │ ├── controller │ │ └── input2d.windtunn ├── flame2d │ ├── datin │ │ ├── Burke12.xml │ │ ├── Burke12.yaml │ │ ├── controller │ │ ├── input.hitflame │ │ └── userinput.txt │ └── user_define_module │ │ └── userdefine_2dflame.F90 ├── hitflame │ └── datin │ │ ├── Burke12.xml │ │ ├── Burke12.yaml │ │ ├── controller │ │ ├── input.hitflame │ │ └── userinput.txt ├── onedflame │ ├── CMakeLists.txt │ └── datin │ │ ├── Burke12.xml │ │ ├── Burke12.yaml │ │ ├── controller │ │ ├── input.onedflame │ │ └── userinput.txt ├── supersonic_backstep │ └── datin │ │ ├── controller │ │ ├── grid.2d │ │ ├── inlet.prof │ │ └── input.2d ├── supersonic_backstep_dimension │ └── datin │ │ ├── controller │ │ ├── grid.2d │ │ ├── h2_12s.xml │ │ ├── inlet.prof │ │ └── input.2d └── test_accuracy │ └── datin │ ├── controller │ └── input.1dtest ├── miniapps ├── gradient_solver_3d │ └── gradient_solver_cpu.f90 └── tgv_solver_3d │ ├── tgvsolver_cpu.f90 │ └── tgvsolver_oacc.f90 ├── script ├── astr.case.creater ├── install_cantera.sh ├── install_hdf5.sh └── setup_a_case.sh ├── src ├── CMakeLists.txt ├── astr.F90 ├── bc.F90 ├── cmdefne.F90 ├── commarray.F90 ├── commcal.F90 ├── commfunc.F90 ├── commtype.F90 ├── commvar.F90 ├── comsolver.F90 ├── constdef.F90 ├── fdnn.F90 ├── filter.F90 ├── fludyna.F90 ├── geom.F90 ├── gridgeneration.F90 ├── hdf5io.F90 ├── ibmethod.F90 ├── initialisation.F90 ├── interp.F90 ├── mainloop.F90 ├── models.F90 ├── parallel.F90 ├── pp.F90 ├── readwrite.F90 ├── riemann.F90 ├── singleton.F90 ├── solver.F90 ├── statistic.F90 ├── stlaio.F90 ├── strings.F90 ├── tecio.F90 ├── test.F90 ├── thermchem.F90 ├── userdefine.F90 ├── utility.F90 └── vtkio.F90 └── user_define_module ├── examples ├── userdefine_2dflame.F90 ├── userdefine_3dflame.F90 ├── userdefine_channel.F90 ├── userdefine_forcedhit.F90 ├── userdefine_hitflame.F90 ├── userdefine_mixinglayer.F90 └── userdefine_onedflame.F90 ├── udf_pp.F90 └── userdefine.F90 /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/astr-code/astr/2ba00b70da962d5d86edbff0eb257c1410fa9230/.DS_Store -------------------------------------------------------------------------------- /.github/workflows/Build.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: Build 4 | 5 | # Controls when the action will run. Triggers the workflow on push or pull request 6 | # events but only for the master branch 7 | on: 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 14 | jobs: 15 | # This workflow contains a single job called "build" 16 | build: 17 | # The type of runner that the job will run on 18 | runs-on: ubuntu-latest 19 | 20 | # Steps represent a sequence of tasks that will be executed as part of the job 21 | steps: 22 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 23 | - uses: actions/checkout@v4 24 | 25 | - name: Build openmpi 26 | run: | 27 | wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.4.tar.gz 28 | tar -xf openmpi-4.1.4.tar.gz 29 | cd openmpi-4.1.4/ && mkdir installed 30 | ./configure --prefix=$(pwd)/installed 31 | make all install 32 | 33 | - name: Build HDF5 34 | run: | 35 | wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2 36 | tar -xf hdf5-1.12.0.tar.bz2 37 | cd hdf5-1.12.0/ && mkdir installed 38 | ./configure --prefix==$(pwd)/installed --enable-fortran --disable-shared --enable-parallel CC=mpicc FC=mpif90 39 | make all install 40 | 41 | - name: Build ASTR 42 | run: | 43 | export PATH=$(pwd)/hdf5-1.12.0/installed/bin/:$PATH 44 | export FC=h5pfc 45 | cmake -S . -B build 46 | cmake --build build -j 2 47 | cmake --install build 48 | ctest --test-dir build -L nondim -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | on: 3 | push: 4 | branches: 5 | - main 6 | 7 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 8 | jobs: 9 | # This workflow contains a single job called "build" 10 | build: 11 | # The type of runner that the job will run on 12 | runs-on: ubuntu-latest 13 | 14 | # Steps represent a sequence of tasks that will be executed as part of the job 15 | steps: 16 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 17 | - uses: actions/checkout@v4 18 | 19 | - name: Install openmpi 20 | run: | 21 | sudo apt-get install -y openmpi-bin libopenmpi-dev 22 | 23 | - name: Install HDF5 24 | run: | 25 | sudo apt-get install -y libhdf5-openmpi-dev 26 | 27 | - name: Build ASTR 28 | run: | 29 | cmake -S . -B build 30 | cmake --build build -j 2 31 | cmake --install build 32 | ctest --test-dir build -L nondim -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | *.plt 3 | *.dat 4 | *.h5 5 | *.log 6 | *.xdmf 7 | bin/ 8 | obj/ 9 | solid_in.stl 10 | tecsolid.plt 11 | astr.code-workspace 12 | parallel.info 13 | report.bak 14 | report.txt 15 | benchmark/ 16 | workspace* 17 | fort* 18 | 19 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | cmake_policy(SET CMP0048 NEW) 3 | 4 | project(ASTR LANGUAGES Fortran) 5 | 6 | set(AUTHOR "Jian Fang") 7 | set(AUTHOR_DETAILS "jian.fang@stfc.ac.uk") 8 | set(DESCRIPTION "Building ASTR using cmake") 9 | 10 | message(STATUS "building ${PROJECT_NAME}") 11 | 12 | include(GNUInstallDirs) 13 | set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) 14 | set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) 15 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 16 | set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/opt" CACHE PATH "..." FORCE) 17 | endif() 18 | 19 | # Add support for CMAKE_DEPENDENT_OPTION 20 | INCLUDE(CMakeDependentOption) 21 | INCLUDE(CMakeParseArguments) 22 | 23 | # Find the modules included with ASTR 24 | #SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) 25 | 26 | # make sure that the default is a RELEASE 27 | if (NOT CMAKE_BUILD_TYPE) 28 | set (CMAKE_BUILD_TYPE RELEASE CACHE STRING 29 | "Choose the type of build, options are: None Debug Release." 30 | FORCE) 31 | endif (NOT CMAKE_BUILD_TYPE) 32 | 33 | set(Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER_ID} ) 34 | message(STATUS "COMP ID ${Fortran_COMPILER_NAME}") 35 | message(STATUS "Fortran compiler name ${Fortran_COMPILER_NAME}") 36 | message(STATUS "Fortran compiler version ${CMAKE_Fortran_COMPILER_VERSION}") 37 | if (Fortran_COMPILER_NAME MATCHES "GNU") 38 | # gfortran 39 | message(STATUS "Setting gfortran flags") 40 | set(CMAKE_Fortran_FLAGS "-cpp -funroll-loops -floop-optimize -g -fcray-pointer -fbacktrace -ffree-line-length-none") 41 | if (CMAKE_Fortran_COMPILER_VERSION GREATER_EQUAL "10") 42 | message(STATUS "Set New Fortran basic flags") 43 | set(CMAKE_Fortran_FLAGS "-cpp -funroll-loops -floop-optimize -g -fcray-pointer -fbacktrace -ffree-line-length-none -fallow-argument-mismatch") 44 | endif (CMAKE_Fortran_COMPILER_VERSION GREATER_EQUAL "10") 45 | set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3") 46 | set(CMAKE_Fortran_FLAGS_DEBUG "-DDEBG -O0 -g") 47 | elseif (Fortran_COMPILER_NAME MATCHES "Intel") 48 | message(STATUS "Setting ifort flags") 49 | set(CMAKE_Fortran_FLAGS "-fpp -xHost -heaparrays -safe-cray-ptr -g -traceback") 50 | set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -ipo") 51 | set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -DDEBG") 52 | #set(CMAKE_Fortran_FLAGS "-cpp xSSE4.2 -axAVX,CORE-AVX-I,CORE-AVX2 -ipo -fp-model fast=2 -mcmodel=large -safe-cray-ptr") 53 | elseif (Fortran_COMPILER_NAME MATCHES "NAG") 54 | message(STATUS "Setting nagfor flags") 55 | set(CMAKE_Fortran_FLAGS "-fpp") 56 | set (CMAKE_Fortran_FLAGS_RELEASE "-O3") 57 | set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g") 58 | elseif (Fortran_COMPILER_NAME MATCHES "Cray") 59 | message(STATUS "Setting cray fortran flags") 60 | set(CMAKE_Fortran_FLAGS "-eF -g -N 1023") 61 | set (CMAKE_Fortran_FLAGS_RELEASE "-O3") 62 | set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g") 63 | elseif (Fortran_COMPILER_NAME MATCHES "PGI") 64 | message(STATUS "Setting PGI fortran flags") 65 | set(CMAKE_Fortran_FLAGS "-cpp -acc -Mfree -Kieee -Minfo=accel -g") 66 | set (CMAKE_Fortran_FLAGS_RELEASE "-O3") 67 | set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -DDEBG") 68 | elseif (Fortran_COMPILER_NAME MATCHES "Fujitsu") 69 | message(STATUS "Setting Fujitsu fortran flags") 70 | set (CMAKE_Fortran_FLAGS "-Cpp") 71 | set (CMAKE_Fortran_FLAGS_RELEASE "-O3") 72 | set (CMAKE_Fortran_FLAGS_DEBUG "-O0") 73 | else (Fortran_COMPILER_NAME MATCHES "GNU") 74 | message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER}) 75 | message ("Fortran compiler: " ${Fortran_COMPILER_NAME}) 76 | message ("No optimized Fortran compiler flags are known, we just try -O2...") 77 | set (CMAKE_Fortran_FLAGS_RELEASE "-O2") 78 | set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g") 79 | endif (Fortran_COMPILER_NAME MATCHES "GNU") 80 | 81 | if (CMAKE_BUILD_TYPE MATCHES "DEBUG") 82 | add_definitions("-DDEBG") 83 | endif (CMAKE_BUILD_TYPE MATCHES "DEBUG") 84 | 85 | 86 | find_package(MPI REQUIRED) 87 | # Stop if there is no MPI_Fortran_Compiler 88 | if (MPI_Fortran_COMPILER) 89 | message(STATUS "MPI_Fortran_COMPILER found: ${MPI_Fortran_COMPILER}") 90 | else (MPI_Fortran_COMPILER) 91 | message(SEND_ERROR "This application cannot compile without MPI") 92 | endif(MPI_Fortran_COMPILER) 93 | # Warning if Include are not found => can be fixed with more recent cmake version 94 | if (MPI_FOUND) 95 | message(STATUS "MPI FOUND: ${MPI_FOUND}") 96 | include_directories(SYSTEM ${MPI_INCLUDE_PATH}) 97 | message(STATUS "MPI INCL : ${MPI_INCLUDE_PATH}") 98 | else (MPI_FOUND) 99 | message(STATUS "NO MPI include have been found. The executable won't be targeted with MPI include") 100 | message(STATUS "Code will compile but performaces can be compromised") 101 | message(STATUS "Using a CMake vers > 3.10 should solve the problem") 102 | message(STATUS "Alternatively use ccmake to manually set the include if available") 103 | endif (MPI_FOUND) 104 | 105 | set(HDF5_PREFER_PARALLEL TRUE) 106 | find_package(HDF5 REQUIRED COMPONENTS Fortran HL) 107 | 108 | message(STATUS "HDF5_Fortran_COMPILER found: ${HDF5_Fortran_COMPILER_EXECUTABLE}") 109 | message(STATUS "HDF5_DIR: ${HDF5_DIR}") 110 | 111 | # Stop if there is no HDF5 112 | # if (HDF5_Fortran_COMPILER) 113 | # message(STATUS "HDF5_Fortran_COMPILER found: ${HDF5_Fortran_COMPILER}") 114 | # else (HDF5_Fortran_COMPILER) 115 | # message(SEND_ERROR "This application cannot compile without HDF5") 116 | # endif(HDF5_Fortran_COMPILER) 117 | 118 | # Warning if Include are not found => can be fixed with more recent cmake version 119 | if (HDF5_FOUND) 120 | message(STATUS "HDF5 FOUND: ${HDF5_FOUND}") 121 | include_directories(${HDF5_INCLUDE_DIRS}) 122 | message(STATUS "HDF5 INCL: ${HDF5_INCLUDE_DIRS}") 123 | link_libraries(${HDF5_LIBRARIES}) 124 | message(STATUS "HDF5_LIB: ${HDF5_LIBRARIES}") 125 | link_libraries(${HDF5_HL_LIBRARIES}) 126 | message(STATUS "HDF5_HL_LIB: ${HDF5_HL_LIBRARIES}") 127 | link_libraries(${HDF5_Fortran_LIBRARIES}) 128 | message(STATUS "HDF5_Fortran_LIBRARIES: ${HDF5_Fortran_LIBRARIES}") 129 | link_libraries(${HDF5_Fortran_HL_LIBRARIES}) 130 | message(STATUS "HDF5_Fortran_HL_LIBRARIES: ${HDF5_Fortran_HL_LIBRARIES}") 131 | add_definitions("-DHDF5") 132 | else (HDF5_FOUND) 133 | message(STATUS "NO HDF5 include have been found. The executable won't be targeted with HDF5 include") 134 | message(STATUS "Code will compile but performaces can be compromised") 135 | message(STATUS "Using a CMake vers > 3.10 should solve the problem") 136 | message(STATUS "Alternatively use ccmake to manually set the include if available") 137 | endif (HDF5_FOUND) 138 | 139 | # set chemistry library 140 | option(CHEMISTRY "Build ASTR with chemistry" OFF) 141 | if (CHEMISTRY) 142 | IF(EXISTS ${CANTERA_DIR}) 143 | MESSAGE(STATUS "CANTERA directory " ${CANTERA_DIR}) 144 | set(CTRDIR ${CANTERA_DIR}) 145 | include_directories(${CTRDIR}/include/cantera) 146 | link_directories(${CTRDIR}/lib) 147 | set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) 148 | add_definitions(-DCOMB) 149 | else() 150 | message(FATAL_ERROR " !! CANTERA path not found: " ${CANTERA_DIR}) 151 | endif(EXISTS ${CANTERA_DIR}) 152 | else(CHEMISTRY) 153 | message("chemistry is not activated") 154 | endif (CHEMISTRY) 155 | 156 | set(ASTR_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) 157 | message(STATUS "ASTR directory: ${ASTR_ROOT}") 158 | set(CMAKE_INSTALL_PREFIX ${ASTR_ROOT}) 159 | 160 | 161 | # Create the ASTR executable 162 | add_subdirectory(src) 163 | 164 | # Create an example dir with all input.i3d example files 165 | option(BUILD_TESTING "Build with tests" ON) 166 | set(test_dir "${PROJECT_BINARY_DIR}/Test") 167 | add_subdirectory(examples) 168 | message(STATUS "Before test main ${test_dir}") 169 | set(osub "--oversubscribe") 170 | 171 | if (${BUILD_TESTING}) 172 | include(CTest) 173 | message(STATUS "MPI INCL ALSO FOUND: ${MPI_INCLUDE_PATH}") 174 | message(STATUS "MPI EXEC: ${MPIEXEC_EXECUTABLE}") 175 | #dd_test(NAME TGV2D COMMAND ${MPIEXEC_EXECUTABLE} -n 4 ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.tgv2d WORKING_DIRECTORY ${test_dir}/TGV2D) 176 | #et_tests_properties(TGV2D PROPERTIES LABELS "nondim") 177 | add_test(NAME Shuosher COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.shuosher WORKING_DIRECTORY ${test_dir}/Shuosher) 178 | set_tests_properties(Shuosher PROPERTIES LABELS "nondim") 179 | add_test(NAME VT COMMAND ${MPIEXEC_EXECUTABLE} -n 8 ${osub} ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.2dvort WORKING_DIRECTORY ${test_dir}/VT) 180 | set_tests_properties(VT PROPERTIES LABELS "nondim") 181 | add_test(NAME mixinglayer COMMAND ${MPIEXEC_EXECUTABLE} -n 8 ${osub} ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.2d WORKING_DIRECTORY ${test_dir}/mixinglayer) 182 | set_tests_properties(mixinglayer PROPERTIES LABELS "nondim") 183 | add_test(NAME WT2D COMMAND ${MPIEXEC_EXECUTABLE} -n 8 ${osub} ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input2d.windtunn WORKING_DIRECTORY ${test_dir}/WT2D) 184 | set_tests_properties(WT2D PROPERTIES LABELS "nondim") 185 | add_test(NAME TGV COMMAND ${MPIEXEC_EXECUTABLE} -n 8 ${osub} ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.tgv WORKING_DIRECTORY ${test_dir}/TGV) 186 | set_tests_properties(TGV PROPERTIES LABELS "nondim") 187 | add_test(NAME RTI COMMAND ${MPIEXEC_EXECUTABLE} -n 8 ${osub} ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.rti WORKING_DIRECTORY ${test_dir}/RTI) 188 | set_tests_properties(RTI PROPERTIES LABELS "nondim") 189 | add_test(NAME Channel COMMAND ${MPIEXEC_EXECUTABLE} -n 8 ${osub} ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.chl WORKING_DIRECTORY ${test_dir}/Channel) 190 | set_tests_properties(Channel PROPERTIES LABELS "nondim") 191 | add_test(NAME SWLBI COMMAND ${MPIEXEC_EXECUTABLE} -n 8 ${osub} ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.2d WORKING_DIRECTORY ${test_dir}/SWLBI) 192 | set_tests_properties(SWLBI PROPERTIES LABELS "nondim") 193 | add_test(NAME onedflame COMMAND ${MPIEXEC_EXECUTABLE} ${osub} ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.onedflame WORKING_DIRECTORY ${test_dir}/onedflame) 194 | set_tests_properties(onedflame PROPERTIES LABELS "combustion") 195 | add_test(NAME TGVflame COMMAND ${MPIEXEC_EXECUTABLE} -n 8 ${osub} ${CMAKE_INSTALL_PREFIX}/bin/astr run ./datin/input.tgvflame WORKING_DIRECTORY ${test_dir}/TGVflame) 196 | set_tests_properties(TGVflame PROPERTIES LABELS "combustion") 197 | endif() 198 | -------------------------------------------------------------------------------- /LOG.md: -------------------------------------------------------------------------------- 1 | 2023-02-26: move from gitlab to github 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # This makefile is used to compile ASTR code. 2 | # The compiler: gfortran compiler 3 | # 4 | #FCFLAGS= -Wuse-without-only -g 5 | #FC=mpif90 6 | FC=h5pfc 7 | 8 | SRCDIR = ./astr/src ./astr/user_define_module 9 | OBJDIR = obj 10 | BINDIR = bin 11 | CTRDIR = cma 12 | 13 | FCFLAGS= -O3 -fbounds-check -fallow-argument-mismatch 14 | 15 | # OPTIONS1 = -fcheck=all 16 | OPTIONS2 = -J $(OBJDIR) 17 | OPTIONS3 = -DHDF5 18 | # OPTIONS4 = -DCOMB -I$(CTRDIR)/include/cantera 19 | # OMP = -fopenacc 20 | 21 | 22 | EXE=astr 23 | 24 | LIBS= -lz -lm # -L$(CTRDIR)/lib -lcantera_fortran -lcantera -lstdc++ -pthread 25 | #LIBS= -lz -lm 26 | 27 | TARGET = $(BINDIR)/$(EXE) 28 | 29 | VPATH = $(SRCDIR):$(OBJDIR) 30 | 31 | srs= strings.F90 fdnn.F90 singleton.F90 commtype.F90 stlaio.F90 constdef.F90 tecio.F90 \ 32 | vtkio.F90 interp.F90 commvar.F90 utility.F90 thermchem.F90 commarray.F90 fludyna.F90 \ 33 | parallel.F90 hdf5io.F90 cmdefne.F90 commfunc.F90 commcal.F90 models.F90 statistic.F90 \ 34 | userdefine.F90 filter.F90 bc.F90 readwrite.F90 geom.F90 ibmethod.F90 \ 35 | gridgeneration.F90 riemann.F90 comsolver.F90 solver.F90 udf_pp.F90 pp.F90 \ 36 | initialisation.F90 mainloop.F90 test.F90 astr.F90 37 | 38 | OBJS=$(srs:.F90=.o) 39 | 40 | %.o:%.F90 41 | @mkdir -p $(OBJDIR) 42 | $(FC) $(FCFLAGS) $(INCL) $(OPTIONS1) $(OPTIONS2) $(OPTIONS3) $(OPTIONS4) $(OMP) -c -o $(OBJDIR)/$@ $< 43 | 44 | default: $(OBJS) 45 | @mkdir -p $(BINDIR) 46 | $(FC) $(FCFLAGS) -o $(TARGET) $(OBJDIR)/*.o $(LIBS) $(INCL) $(OMP) 47 | 48 | clean: 49 | rm -fv $(OBJDIR)/*.o $(OBJDIR)/*.mod $(TARGET) $(OBJDIR)/*.mod 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASTR code 2 | Version 2.0 3 | 4 | ASTR code is a high-order finite-difference flow solver for compressible turbulence research. 5 | 6 | # Download, Installation and Compilation 7 | Required dependencies: Fortran 90, MPI, HDF5 8 | 9 | ## Download the astr code: 10 | 11 | git clone git@github.com:astr-code/astr.git 12 | 13 | ## Compilation and installation: 14 | ASTR 2.0 supports both gnu make and cmake. 15 | For the use of gnu make, do: 16 | make 17 | in the directory containing src folder, and the executable will be found as ./bin/astr 18 | 19 | The cmake gives a more complete and safe way of compiling and installing the code. 20 | By default ASTR solves equations under non-dimensional form, unless the chemstry is included. 21 | 22 | create a case folder, e.g. 23 | mkdir test_case 24 | sh path_to_the_source/script/astr.case.creater #create a new case 25 | 26 | cmake path_to_the_source 27 | cmake --build 28 | cmake --install 29 | ctest -L nondim 30 | 31 | The code will be installed in test_case and excutable can be found at test_case/bin/astr 32 | 33 | If you want to use the chemstry function, you need first to install cantera. After download and unpack the cantera, you can use the following script to install: 34 | python scons/scripts/scons.py build python_package=none FORTRAN= f90_interface=y prefix= boost_inc_dir= 35 | 36 | python scons/scripts/scons.py test 37 | 38 | python scons/scripts/scons.py install 39 | 40 | you may need to make and test ASTR with chemstry with following cmake commands: 41 | 42 | cmake -DCHEMISTRY=TRUE -DCANTERA_DIR=path_to_cantera path_to_the_source 43 | 44 | cmake --build 45 | 46 | cmake --install 47 | 48 | ctest -L combustion 49 | 50 | 51 | ## Run the solver: 52 | 53 | Once the excutable is built, a typical simulation can be run as, 54 | mpirun -np 8 ./astr run ./datin/input_file 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /chemMech/thermchem_gen.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | = = = = = = = = = = = = = = = = = = = = 8 | - - - - - SPECIES THERMO DATA - - - - - 9 | = = = = = = = = = = = = = = = = = = = = 10 | 11 | 12 | = = = = = = = = = = = = = = = = = = = = 13 | - - - - - REACTION STEP DATA - - - - - 14 | = = = = = = = = = = = = = = = = = = = = 15 | 16 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 83 | 84 | 85 | 86 | 87 | 88 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | *************************************** 99 | 100 | 101 | 110 | 111 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples) 2 | add_subdirectory(Taylor_Green_Vortex) 3 | add_subdirectory(Taylor_Green_Vortex_2D) 4 | add_subdirectory(Channel) 5 | add_subdirectory(Rayleigh–Taylor-Instability) 6 | add_subdirectory(Shuosher) 7 | add_subdirectory(Vortex_Transport) 8 | add_subdirectory(MixingLayer) 9 | add_subdirectory(SWLBI) 10 | add_subdirectory(Wind_Tunnel_2D) 11 | add_subdirectory(Taylor_Green_Vortex_with_Flame) 12 | add_subdirectory(onedflame) -------------------------------------------------------------------------------- /examples/Channel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Channel) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Channel) 3 | 4 | # If testing active add test for Channel case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/Channel") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/Channel/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 10, 10, 100, 50, 1, 50 10 | 11 | # deltat 12 | 7.5d-4 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Channel/datin/input.chl: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | channel 7 | 8 | # im,jm,km : The size of grid. 9 | 128,128,128 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,f,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt : Parameters 15 | t,t,t,f,f,f,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 3000.d0, 0.3d0 25 | 26 | # conschm,difschm,rkscheme : Numerical scheme 27 | 642c, 642c, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld : Parameters for upwind-biased scheme 30 | 3, f, 0.3d0, 0.01d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 41, 1.d0 42 | 41, 1.d0 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /examples/Channel_SI/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 10, 10, 100, 50, 1, 50 10 | 11 | # deltat 12 | 3.d-6 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Channel_SI/datin/input.chdim: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | channel 7 | 8 | # im,jm,km : The size of grid. 9 | 128,128,128 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,f,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt : Parameters 15 | f,t,t,f,f,f,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_tem,ref_vel,ref_len,ref_den : Reference variables 24 | 273.15d0, 100.d0, 3.981d-4, 1.293d0 25 | 26 | # conschm,difschm,rkscheme : Numerical scheme 27 | 642c, 642c, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld : Parameters for upwind-biased scheme 30 | 3, f, 0.3d0, 0.01d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 41, 273.15d0 42 | 41, 273.15d0 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /examples/MixingLayer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/MixingLayer) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/MixingLayer) 3 | 4 | # If testing active add test for mixing layer case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/mixinglayer") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() -------------------------------------------------------------------------------- /examples/MixingLayer/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTRR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 10, 10, 10, 400, 1, 500 10 | 11 | # deltat 12 | 3d-3 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/MixingLayer/datin/grid.2d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/astr-code/astr/2ba00b70da962d5d86edbff0eb257c1410fa9230/examples/MixingLayer/datin/grid.2d -------------------------------------------------------------------------------- /examples/MixingLayer/datin/input.2d: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | mixlayer 7 | 8 | # im,jm,km : The size of grid. 9 | 4050,300,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,f,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt : Parameters 15 | t,t,t,t,f,f,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 1500.d0, 0.3d0 25 | 26 | # conschm,difschm,rkscheme : Numerical scheme 27 | 642c, 642c, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.001d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 11, prof 40 | 22 41 | 52 42 | 52 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 20, 0, 0, 0, 0 51 | 52 | # gridfile : grid 53 | ./datin/grid.2d 54 | 55 | 56 | 57 | ######################################################################## 58 | # bctype # 59 | # 1 : periodic bc, nothing will be done. # 60 | # 41 : isothermal wall, wall temperature input. # 61 | ######################################################################## 62 | -------------------------------------------------------------------------------- /examples/Perfectly_Stirred_Reactor/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg 6 | f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 40000, 10000000, 1000000, 500000, 100, 5000000 10 | 11 | # deltat 12 | 5.d-8 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Perfectly_Stirred_Reactor/datin/h2_12s.yaml: -------------------------------------------------------------------------------- 1 | generator: ctml2yaml 2 | cantera-version: 2.5.1 3 | date: Thu, 28 Jul 2022 09:48:45 +0800 4 | input-files: [h2_12s.xml] 5 | 6 | phases: 7 | - name: gas 8 | elements: [H, O, C, N] 9 | species: [H2, H, O2, OH, O, H2O, HO2, H2O2, N2] 10 | thermo: ideal-gas 11 | transport: mixture-averaged 12 | kinetics: gas 13 | reactions: all 14 | state: {T: 300.0 K, P: 1.01325e+05 Pa} 15 | 16 | species: 17 | - name: H2 18 | composition: {H: 2.0} 19 | note: TPIS78 20 | thermo: 21 | model: NASA7 22 | temperature-ranges: [200.0, 1000.0, 3500.0] 23 | data: 24 | - [2.34433112, 7.98052075e-03, -1.9478151e-05, 2.01572094e-08, -7.37611761e-12, 25 | -917.935173, 0.683010238] 26 | - [3.3372792, -4.94024731e-05, 4.99456778e-07, -1.79566394e-10, 2.00255376e-14, 27 | -950.158922, -3.20502331] 28 | transport: 29 | model: gas 30 | geometry: linear 31 | well-depth: 38.0 32 | diameter: 2.92 33 | dipole: 0.0 34 | polarizability: 0.79 35 | rotational-relaxation: 280.0 36 | dispersion-coefficient: 0.0 37 | quadrupole-polarizability: 0.0 38 | - name: H 39 | composition: {H: 1.0} 40 | note: L7/88 41 | thermo: 42 | model: NASA7 43 | temperature-ranges: [200.0, 1000.0, 3500.0] 44 | data: 45 | - [2.5, 7.05332819e-13, -1.99591964e-15, 2.30081632e-18, -9.27732332e-22, 2.54736599e+04, 46 | -0.446682853] 47 | - [2.50000001, -2.30842973e-11, 1.61561948e-14, -4.73515235e-18, 4.98197357e-22, 48 | 2.54736599e+04, -0.446682914] 49 | transport: 50 | model: gas 51 | geometry: atom 52 | well-depth: 145.0 53 | diameter: 2.05 54 | dipole: 0.0 55 | polarizability: 0.0 56 | rotational-relaxation: 0.0 57 | dispersion-coefficient: 0.0 58 | quadrupole-polarizability: 0.0 59 | - name: O2 60 | composition: {O: 2.0} 61 | note: TPIS89 62 | thermo: 63 | model: NASA7 64 | temperature-ranges: [200.0, 1000.0, 3500.0] 65 | data: 66 | - [3.78245636, -2.99673416e-03, 9.84730201e-06, -9.68129509e-09, 3.24372837e-12, 67 | -1063.94356, 3.65767573] 68 | - [3.28253784, 1.48308754e-03, -7.57966669e-07, 2.09470555e-10, -2.16717794e-14, 69 | -1088.45772, 5.45323129] 70 | transport: 71 | model: gas 72 | geometry: linear 73 | well-depth: 107.4 74 | diameter: 3.458 75 | dipole: 0.0 76 | polarizability: 1.6 77 | rotational-relaxation: 3.8 78 | dispersion-coefficient: 0.0 79 | quadrupole-polarizability: 0.0 80 | - name: OH 81 | composition: {O: 1.0, H: 1.0} 82 | note: S9/01 83 | thermo: 84 | model: NASA7 85 | temperature-ranges: [200.0, 1000.0, 6000.0] 86 | data: 87 | - [4.12530561, -3.22544939e-03, 6.52764691e-06, -5.79853643e-09, 2.06237379e-12, 88 | 3381.53812, -0.69043296] 89 | - [2.86472886, 1.05650448e-03, -2.59082758e-07, 3.05218674e-11, -1.33195876e-15, 90 | 3718.85774, 5.70164073] 91 | transport: 92 | model: gas 93 | geometry: linear 94 | well-depth: 80.0 95 | diameter: 2.75 96 | dipole: 0.0 97 | polarizability: 0.0 98 | rotational-relaxation: 0.0 99 | dispersion-coefficient: 0.0 100 | quadrupole-polarizability: 0.0 101 | - name: O 102 | composition: {O: 1.0} 103 | note: L1/90 104 | thermo: 105 | model: NASA7 106 | temperature-ranges: [200.0, 1000.0, 3500.0] 107 | data: 108 | - [3.1682671, -3.27931884e-03, 6.64306396e-06, -6.12806624e-09, 2.11265971e-12, 109 | 2.91222592e+04, 2.05193346] 110 | - [2.56942078, -8.59741137e-05, 4.19484589e-08, -1.00177799e-11, 1.22833691e-15, 111 | 2.92175791e+04, 4.78433864] 112 | transport: 113 | model: gas 114 | geometry: atom 115 | well-depth: 80.0 116 | diameter: 2.75 117 | dipole: 0.0 118 | polarizability: 0.0 119 | rotational-relaxation: 0.0 120 | dispersion-coefficient: 0.0 121 | quadrupole-polarizability: 0.0 122 | - name: H2O 123 | composition: {O: 1.0, H: 2.0} 124 | note: L8/89 125 | thermo: 126 | model: NASA7 127 | temperature-ranges: [200.0, 1000.0, 3500.0] 128 | data: 129 | - [4.19864056, -2.0364341e-03, 6.52040211e-06, -5.48797062e-09, 1.77197817e-12, 130 | -3.02937267e+04, -0.849032208] 131 | - [3.03399249, 2.17691804e-03, -1.64072518e-07, -9.7041987e-11, 1.68200992e-14, 132 | -3.00042971e+04, 4.9667701] 133 | transport: 134 | model: gas 135 | geometry: nonlinear 136 | well-depth: 572.4 137 | diameter: 2.605 138 | dipole: 1.844 139 | polarizability: 0.0 140 | rotational-relaxation: 4.0 141 | dispersion-coefficient: 0.0 142 | quadrupole-polarizability: 0.0 143 | - name: HO2 144 | composition: {O: 2.0, H: 1.0} 145 | note: L5/89 146 | thermo: 147 | model: NASA7 148 | temperature-ranges: [200.0, 1000.0, 3500.0] 149 | data: 150 | - [4.30179801, -4.74912051e-03, 2.11582891e-05, -2.42763894e-08, 9.29225124e-12, 151 | 294.80804, 3.71666245] 152 | - [4.0172109, 2.23982013e-03, -6.3365815e-07, 1.1424637e-10, -1.07908535e-14, 153 | 111.856713, 3.78510215] 154 | transport: 155 | model: gas 156 | geometry: nonlinear 157 | well-depth: 107.4 158 | diameter: 3.458 159 | dipole: 0.0 160 | polarizability: 0.0 161 | rotational-relaxation: 1.0 162 | dispersion-coefficient: 0.0 163 | quadrupole-polarizability: 0.0 164 | - name: H2O2 165 | composition: {O: 2.0, H: 2.0} 166 | note: L7/88 167 | thermo: 168 | model: NASA7 169 | temperature-ranges: [200.0, 1000.0, 3500.0] 170 | data: 171 | - [4.27611269, -5.42822417e-04, 1.67335701e-05, -2.15770813e-08, 8.62454363e-12, 172 | -1.77025821e+04, 3.43505074] 173 | - [4.16500285, 4.90831694e-03, -1.90139225e-06, 3.71185986e-10, -2.87908305e-14, 174 | -1.78617877e+04, 2.91615662] 175 | transport: 176 | model: gas 177 | geometry: nonlinear 178 | well-depth: 107.4 179 | diameter: 3.458 180 | dipole: 0.0 181 | polarizability: 0.0 182 | rotational-relaxation: 3.8 183 | dispersion-coefficient: 0.0 184 | quadrupole-polarizability: 0.0 185 | - name: N2 186 | composition: {N: 2.0} 187 | note: '121286' 188 | thermo: 189 | model: NASA7 190 | temperature-ranges: [300.0, 1000.0, 5000.0] 191 | data: 192 | - [3.298677, 1.4082404e-03, -3.963222e-06, 5.641515e-09, -2.444854e-12, -1020.8999, 193 | 3.950372] 194 | - [2.92664, 1.4879768e-03, -5.68476e-07, 1.0097038e-10, -6.753351e-15, -922.7977, 195 | 5.980528] 196 | transport: 197 | model: gas 198 | geometry: linear 199 | well-depth: 97.53 200 | diameter: 3.621 201 | dipole: 0.0 202 | polarizability: 1.76 203 | rotational-relaxation: 4.0 204 | dispersion-coefficient: 0.0 205 | quadrupole-polarizability: 0.0 206 | 207 | reactions: 208 | - equation: H + O2 <=> OH + O 209 | rate-constant: {A: 3.52e+13, b: -0.7, Ea: 1.706979e+04 cal/mol} 210 | - equation: H2 + O <=> OH + H 211 | rate-constant: {A: 50.6, b: 2.67, Ea: 6290.63 cal/mol} 212 | - equation: H2 + OH <=> H2O + H 213 | rate-constant: {A: 1.17e+06, b: 1.3, Ea: 3635.28 cal/mol} 214 | - equation: H + O2 (+ M) => HO2 (+ M) 215 | type: falloff 216 | high-P-rate-constant: {A: 4.65e+09, b: 0.44, Ea: 0.0 cal/mol} 217 | low-P-rate-constant: {A: 5.75e+13, b: -1.4, Ea: 0.0 cal/mol} 218 | efficiencies: {O2: 1.0, H2: 2.5, H2O: 16.0} 219 | Troe: {A: 0.5, T3: 1.0e-30, T1: 1.0e+30} 220 | - equation: HO2 + H => 2 OH 221 | rate-constant: {A: 7.08e+10, b: 0.0, Ea: 295.0 cal/mol} 222 | - equation: HO2 + H <=> H2 + O2 223 | rate-constant: {A: 1.66e+10, b: 0.0, Ea: 823.0 cal/mol} 224 | - equation: HO2 + OH => H2O + O2 225 | rate-constant: {A: 2.89e+10, b: 0.0, Ea: -497.13 cal/mol} 226 | - equation: H + OH + M <=> H2O + M 227 | type: three-body 228 | rate-constant: {A: 4.0e+16, b: -2.0, Ea: 0.0 cal/mol} 229 | efficiencies: {H2: 2.5, H2O: 12.0} 230 | - equation: H + H + M <=> H2 + M 231 | type: three-body 232 | rate-constant: {A: 1.3e+12, b: -1.0, Ea: 0.0 cal/mol} 233 | efficiencies: {H2: 2.5, H2O: 12.0} 234 | - equation: 2 HO2 => H2O2 + O2 235 | rate-constant: {A: 3.02e+09, b: 0.0, Ea: 1386.23 cal/mol} 236 | - equation: H2O2 (+ M) => 2 OH (+ M) 237 | type: falloff 238 | high-P-rate-constant: {A: 2.62328e+19, b: -1.38836, Ea: 5.1323e+04 cal/mol} 239 | low-P-rate-constant: {A: 8.15342e+20, b: -1.91836, Ea: 4.9621e+04 cal/mol} 240 | efficiencies: {H2: 2.0, H2O: 6.0} 241 | Troe: {A: 0.735, T3: 94.0, T1: 1756.0, T2: 5182.0} 242 | - equation: HO2 + H2 => H2O2 + H 243 | rate-constant: {A: 1.62439e+08, b: 0.606961, Ea: 2.3933e+04 cal/mol} 244 | -------------------------------------------------------------------------------- /examples/Perfectly_Stirred_Reactor/datin/input.psr: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | 0dreactor 7 | 8 | # im,jm,km : The size of grid. 9 | 2,2,2 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | f,f,f,f,f,f,t,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 1600.d0, 0.1d0 25 | 26 | # conschm,difschm,rkscheme,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species (for nondim cases) 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 1 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | 54 | # chemfile 55 | datin/ES80_H2-8-16.xml 56 | 57 | 58 | ######################################################################## 59 | # bctype # 60 | # 1 : periodic bc, nothing will be done. # 61 | # 41 : isothermal wall, wall temperature input. # 62 | ######################################################################## 63 | -------------------------------------------------------------------------------- /examples/Rayleigh–Taylor-Instability/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Rayleigh–Taylor-Instability) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Rayleigh–Taylor-Instability) 3 | 4 | # If testing active add test for RTI case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/RTI") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/Rayleigh–Taylor-Instability/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 100, 100, 100, 50, 1, 50 10 | 11 | # deltat 12 | 1.95d-4 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Rayleigh–Taylor-Instability/datin/input.rti: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | rti 7 | 8 | # im,jm,km : The size of grid. 9 | 120,480,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,f,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt : Parameters 15 | t,f,f,f,f,f,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 1600.d0, 0.3d0 25 | 26 | # conschm,difschm,rkscheme : Numerical scheme 27 | 742e, 642c, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 3, t, 0.7d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 31 42 | 31 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # grid 53 | ./datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /examples/SWLBI/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/SWLBI) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/SWLBI) 3 | 4 | # If testing active add test for Shuosher case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/SWLBI") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/SWLBI/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTRR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 100, 100, 100, 400, 1, 500 10 | 11 | # deltat 12 | 2.5d-4 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/SWLBI/datin/grid.2d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/astr-code/astr/2ba00b70da962d5d86edbff0eb257c1410fa9230/examples/SWLBI/datin/grid.2d -------------------------------------------------------------------------------- /examples/SWLBI/datin/input.2d: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | swbli 7 | 8 | # im,jm,km : The size of grid. 9 | 1450,260,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,f,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt : Parameters 15 | t,t,f,t,f,f,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 148.9d0, 296000, 2.d0 25 | 26 | # conschm,difschm,rkscheme : Numerical scheme 27 | 732e, 642c, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.001d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 11, free 40 | 21 41 | 421, 0.8d0 42 | 51, 1.d5, 32.6d0 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 20, 0, 0, 0, 0 51 | 52 | # gridfile : grid 53 | ./datin/grid.2d 54 | 55 | 56 | 57 | ######################################################################## 58 | # bctype # 59 | # 1 : periodic bc, nothing will be done. # 60 | # 41 : isothermal wall, wall temperature input. # 61 | ######################################################################## 62 | -------------------------------------------------------------------------------- /examples/Shuosher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Shuosher) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Shuosher) 3 | 4 | # If testing active add test for Shuosher case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/Shuosher") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/Shuosher/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 1000, 1000, 1000, 50, 1, 50 10 | 11 | # deltat 12 | 1.8d-3 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ -------------------------------------------------------------------------------- /examples/Shuosher/datin/input.shuosher: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | shuosher 7 | 8 | # im,jm,km : The size of grid. 9 | 400,0,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | t,f,f,f,f,f,t,f 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 3000.d0, 3.d0 25 | 26 | # conschm,difschm,rkscheme,odetype : Numerical scheme 27 | 732e, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld : Parameters for upwind-biased scheme 30 | 3, t, 0.3d0, 0.01d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | ./datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /examples/Steady_H2flame/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | t, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 10000000, 200, 200, 50, 10, 50 10 | 11 | # deltat 12 | 1.d-8 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Steady_H2flame/datin/input.hitflame: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | hitflame 7 | 8 | # im,jm,km : The size of grid. 9 | 768,10,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | f,t,t,f,f,f,t,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 200.d0, 0.3d0 25 | 26 | # conschm,difschm,rkschemem,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 11 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 11,free 40 | 22 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | # chemfile 56 | datin/Burke12.yaml 57 | 58 | 59 | ######################################################################## 60 | # bctype # 61 | # 1 : periodic bc, nothing will be done. # 62 | # 41 : isothermal wall, wall temperature input. # 63 | ######################################################################## 64 | -------------------------------------------------------------------------------- /examples/Steady_H2flame/datin/userinput.txt: -------------------------------------------------------------------------------- 1 | 0.0003762791163253942 # flame thickness at 1atm 2 | # 7.87559d-5 flame thickness at 5 atm 3 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Taylor_Green_Vortex) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Taylor_Green_Vortex) 3 | 4 | # If testing active add test for TGV case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/TGV") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 10, 10, 100, 50, 1, 50 10 | 11 | # deltat 12 | 1.d-3 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex/datin/input.tgv: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | tgv 7 | 8 | # im,jm,km : The size of grid. 9 | 128,128,128 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | t,t,t,f,f,f,t,f 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 1600.d0, 0.1d0 25 | 26 | # conschm,difschm,rkscheme,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex/datin/input.tgv2d: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | tgv 7 | 8 | # im,jm,km : The size of grid. 9 | 128,128,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | t,t,t,f,f,f,t,f 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 1600.d0, 0.1d0 25 | 26 | # conschm,difschm,rkscheme,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex_2D/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Taylor_Green_Vortex) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Taylor_Green_Vortex) 3 | 4 | # If testing active add test for TGV case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/TGV2D") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex_2D/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 10, 10, 100, 50, 1, 50 10 | 11 | # deltat 12 | 1.d-3 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex_2D/datin/input.tgv2d: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | tgv 7 | 8 | # im,jm,km : The size of grid. 9 | 128,128,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | t,t,t,f,f,f,t,f 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 1600.d0, 0.1d0 25 | 26 | # conschm,difschm,rkscheme,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex_SI/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 10, 10, 10, 50, 1, 50 10 | 11 | # deltat 12 | 1.934d-8 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex_SI/datin/input.dim: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | tgv 7 | 8 | # im,jm,km : The size of grid. 9 | 128,128,128 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | f,t,t,f,f,f,t,f 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_tem,ref_vel,ref_len,ref_den : Reference variables 24 | 273.15d0, 33.1345d0, 6.40853d-4, 1.293d0 25 | 26 | # conschm,difschm,rkscheme,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex_with_Flame/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Taylor_Green_Vortex_with_Flame) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Taylor_Green_Vortex_with_Flame) 3 | 4 | # If testing active add test for TGV case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/TGVflame") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex_with_Flame/datin/ES80_H2-7-16.yaml: -------------------------------------------------------------------------------- 1 | generator: ctml2yaml 2 | cantera-version: 2.6.0 3 | date: Wed, 08 Jun 2022 13:32:25 +0800 4 | input-files: [ES80_H2-8-16.xml] 5 | 6 | phases: 7 | - name: gas 8 | elements: [O, H, N] 9 | species: [H, O, H2O, OH, O2, H2, N2] 10 | thermo: ideal-gas 11 | transport: mixture-averaged 12 | kinetics: gas 13 | reactions: all 14 | state: {T: 300.0 K, P: 1.01325e+05 Pa} 15 | 16 | species: 17 | - name: H 18 | composition: {H: 1.0} 19 | note: L7/88 20 | thermo: 21 | model: NASA7 22 | temperature-ranges: [200.0, 1000.0, 3500.0] 23 | data: 24 | - [2.5, 7.05332819e-13, -1.99591964e-15, 2.30081632e-18, -9.27732332e-22, 2.54736599e+04, 25 | -0.446682853] 26 | - [2.50000001, -2.30842973e-11, 1.61561948e-14, -4.73515235e-18, 4.98197357e-22, 27 | 2.54736599e+04, -0.446682914] 28 | transport: 29 | model: gas 30 | geometry: atom 31 | well-depth: 145.0 32 | diameter: 2.05 33 | dipole: 0.0 34 | polarizability: 0.0 35 | rotational-relaxation: 0.0 36 | dispersion-coefficient: 0.0 37 | quadrupole-polarizability: 0.0 38 | - name: O 39 | composition: {O: 1.0} 40 | note: L1/90 41 | thermo: 42 | model: NASA7 43 | temperature-ranges: [200.0, 1000.0, 3500.0] 44 | data: 45 | - [3.1682671, -3.27931884e-03, 6.64306396e-06, -6.12806624e-09, 2.11265971e-12, 46 | 2.91222592e+04, 2.05193346] 47 | - [2.56942078, -8.59741137e-05, 4.19484589e-08, -1.00177799e-11, 1.22833691e-15, 48 | 2.92175791e+04, 4.78433864] 49 | transport: 50 | model: gas 51 | geometry: atom 52 | well-depth: 80.0 53 | diameter: 2.75 54 | dipole: 0.0 55 | polarizability: 0.0 56 | rotational-relaxation: 0.0 57 | dispersion-coefficient: 0.0 58 | quadrupole-polarizability: 0.0 59 | - name: H2O 60 | composition: {H: 2.0, O: 1.0} 61 | note: L8/89 62 | thermo: 63 | model: NASA7 64 | temperature-ranges: [200.0, 1000.0, 3500.0] 65 | data: 66 | - [4.19864056, -2.0364341e-03, 6.52040211e-06, -5.48797062e-09, 1.77197817e-12, 67 | -3.02937267e+04, -0.849032208] 68 | - [3.03399249, 2.17691804e-03, -1.64072518e-07, -9.7041987e-11, 1.68200992e-14, 69 | -3.00042971e+04, 4.9667701] 70 | transport: 71 | model: gas 72 | geometry: nonlinear 73 | well-depth: 572.4 74 | diameter: 2.605 75 | dipole: 1.844 76 | polarizability: 0.0 77 | rotational-relaxation: 4.0 78 | dispersion-coefficient: 0.0 79 | quadrupole-polarizability: 0.0 80 | - name: OH 81 | composition: {H: 1.0, O: 1.0} 82 | note: S9/01 83 | thermo: 84 | model: NASA7 85 | temperature-ranges: [200.0, 1000.0, 6000.0] 86 | data: 87 | - [4.12530561, -3.22544939e-03, 6.52764691e-06, -5.79853643e-09, 2.06237379e-12, 88 | 3381.53812, -0.69043296] 89 | - [2.86472886, 1.05650448e-03, -2.59082758e-07, 3.05218674e-11, -1.33195876e-15, 90 | 3718.85774, 5.70164073] 91 | transport: 92 | model: gas 93 | geometry: linear 94 | well-depth: 80.0 95 | diameter: 2.75 96 | dipole: 0.0 97 | polarizability: 0.0 98 | rotational-relaxation: 0.0 99 | dispersion-coefficient: 0.0 100 | quadrupole-polarizability: 0.0 101 | - name: O2 102 | composition: {O: 2.0} 103 | note: TPIS89 104 | thermo: 105 | model: NASA7 106 | temperature-ranges: [200.0, 1000.0, 3500.0] 107 | data: 108 | - [3.78245636, -2.99673416e-03, 9.84730201e-06, -9.68129509e-09, 3.24372837e-12, 109 | -1063.94356, 3.65767573] 110 | - [3.28253784, 1.48308754e-03, -7.57966669e-07, 2.09470555e-10, -2.16717794e-14, 111 | -1088.45772, 5.45323129] 112 | transport: 113 | model: gas 114 | geometry: linear 115 | well-depth: 107.4 116 | diameter: 3.458 117 | dipole: 0.0 118 | polarizability: 1.6 119 | rotational-relaxation: 3.8 120 | dispersion-coefficient: 0.0 121 | quadrupole-polarizability: 0.0 122 | - name: H2 123 | composition: {H: 2.0} 124 | note: TPIS78 125 | thermo: 126 | model: NASA7 127 | temperature-ranges: [200.0, 1000.0, 3500.0] 128 | data: 129 | - [2.34433112, 7.98052075e-03, -1.9478151e-05, 2.01572094e-08, -7.37611761e-12, 130 | -917.935173, 0.683010238] 131 | - [3.3372792, -4.94024731e-05, 4.99456778e-07, -1.79566394e-10, 2.00255376e-14, 132 | -950.158922, -3.20502331] 133 | transport: 134 | model: gas 135 | geometry: linear 136 | well-depth: 38.0 137 | diameter: 2.92 138 | dipole: 0.0 139 | polarizability: 0.79 140 | rotational-relaxation: 280.0 141 | dispersion-coefficient: 0.0 142 | quadrupole-polarizability: 0.0 143 | - name: N2 144 | composition: {N: 2.0} 145 | note: '121286' 146 | thermo: 147 | model: NASA7 148 | temperature-ranges: [300.0, 1000.0, 5000.0] 149 | data: 150 | - [3.298677, 1.4082404e-03, -3.963222e-06, 5.641515e-09, -2.444854e-12, -1020.8999, 151 | 3.950372] 152 | - [2.92664, 1.4879768e-03, -5.68476e-07, 1.0097038e-10, -6.753351e-15, -922.7977, 153 | 5.980528] 154 | transport: 155 | model: gas 156 | geometry: linear 157 | well-depth: 97.53 158 | diameter: 3.621 159 | dipole: 0.0 160 | polarizability: 1.76 161 | rotational-relaxation: 4.0 162 | dispersion-coefficient: 0.0 163 | quadrupole-polarizability: 0.0 164 | 165 | reactions: 166 | - equation: H2 + M => 2 H + M 167 | type: three-body 168 | rate-constant: {A: 5.5e+15, b: -1.0, Ea: 1.033e+05 cal/mol} 169 | - equation: 2 H + M => H2 + M 170 | type: three-body 171 | rate-constant: {A: 1.8e+12, b: -1.0, Ea: 0.0 cal/mol} 172 | - equation: O2 + M => 2 O + M 173 | type: three-body 174 | rate-constant: {A: 7.2e+15, b: -1.0, Ea: 1.1791e+05 cal/mol} 175 | - equation: 2 O + M => O2 + M 176 | type: three-body 177 | rate-constant: {A: 4.0e+11, b: -1.0, Ea: 0.0 cal/mol} 178 | - equation: H2O + M => OH + H + M 179 | type: three-body 180 | rate-constant: {A: 5.2e+18, b: -1.5, Ea: 1.18e+05 cal/mol} 181 | - equation: OH + H + M => H2O + M 182 | type: three-body 183 | rate-constant: {A: 4.4e+14, b: -1.5, Ea: 0.0 cal/mol} 184 | - equation: OH + M => O + H + M 185 | type: three-body 186 | rate-constant: {A: 8.5e+15, b: -1.0, Ea: 1.01e+05 cal/mol} 187 | - equation: O + H + M => OH + M 188 | type: three-body 189 | rate-constant: {A: 7.1e+12, b: -1.0, Ea: 0.0 cal/mol} 190 | - equation: H2O + O => 2 OH 191 | rate-constant: {A: 5.8e+10, b: 0.0, Ea: 1.8e+04 cal/mol} 192 | - equation: 2 OH => H2O + O 193 | rate-constant: {A: 5.3e+09, b: 0.0, Ea: 1000.0 cal/mol} 194 | - equation: H2O + H => OH + H2 195 | rate-constant: {A: 8.4e+10, b: 0.0, Ea: 2.01e+04 cal/mol} 196 | - equation: OH + H2 => H2O + H 197 | rate-constant: {A: 2.0e+10, b: 0.0, Ea: 5166.0 cal/mol} 198 | - equation: O2 + H => OH + O 199 | rate-constant: {A: 2.2e+11, b: 0.0, Ea: 1.68e+04 cal/mol} 200 | - equation: OH + O => O2 + H 201 | rate-constant: {A: 1.5e+10, b: 0.0, Ea: 0.0 cal/mol} 202 | - equation: H2 + O => OH + H 203 | rate-constant: {A: 7.5e+10, b: 0.0, Ea: 1.11e+04 cal/mol} 204 | - equation: OH + H => H2 + O 205 | rate-constant: {A: 3.0e+10, b: 0.0, Ea: 8800.0 cal/mol} 206 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex_with_Flame/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 5, 10, 100, 50, 1, 50 10 | 11 | # deltat 12 | 2.d-8 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Taylor_Green_Vortex_with_Flame/datin/input.tgvflame: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | tgvflame 7 | 8 | # im,jm,km : The size of grid. 9 | 128,128,128 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | f,t,t,f,f,f,t,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 1600.d0, 0.1d0 25 | 26 | # conschm,difschm,rkscheme,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, f, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | # chemfile 56 | datin/ES80_H2-7-16.yaml 57 | 58 | 59 | 60 | ######################################################################## 61 | # bctype # 62 | # 1 : periodic bc, nothing will be done. # 63 | # 41 : isothermal wall, wall temperature input. # 64 | ######################################################################## 65 | -------------------------------------------------------------------------------- /examples/Vortex_Transport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Vortex_Transport) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Vortex_Transport) 3 | 4 | # If testing active add test for vortex trasport case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/VT") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/Vortex_Transport/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 100, 100, 100, 50, 1, 50 10 | 11 | # deltat 12 | 5.d-3 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Vortex_Transport/datin/input.2dvort: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | 2dvort 7 | 8 | # im,jm,km : The size of grid. 9 | 400,200,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt : Parameters 15 | t,f,t,f,f,f,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 3000.d0, 0.3d0 25 | 26 | # conschm,difschm,rkscheme : Numerical scheme 27 | 642c, 642c, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld : Parameters for upwind-biased scheme 30 | 3, f, 0.3d0, 0.01d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | 53 | ./datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /examples/Wind_Tunnel_2D/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Wind_Tunnel_2D) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/Wind_Tunnel_2D) 3 | 4 | # If testing active add test for Shuosher case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/WT2D") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/Wind_Tunnel_2D/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTRR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 100, 100, 100, 400, 1, 500 10 | 11 | # deltat 12 | 2.5d-4 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/Wind_Tunnel_2D/datin/input2d.windtunn: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | windtunn 7 | 8 | # im,jm,km : The size of grid. 9 | 256,128,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,f,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | t,t,f,f,f,t,t,f 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 200.d0, 0.1d0 25 | 26 | # conschm,difschm,rkscheme,odetype : Numerical scheme 27 | 742e, 642e, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.001d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 11, free 40 | 22 41 | 52 42 | 52 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # grid 53 | datin/grid.h5 54 | 55 | # solidfile 56 | stl,'datin/circle.stl' 57 | 58 | 59 | 60 | ######################################################################## 61 | # bctype # 62 | # 1 : periodic bc, nothing will be done. # 63 | # 41 : isothermal wall, wall temperature input. # 64 | ######################################################################## 65 | -------------------------------------------------------------------------------- /examples/flame2d/datin/Burke12.yaml: -------------------------------------------------------------------------------- 1 | generator: ctml2yaml 2 | cantera-version: 2.6.0 3 | date: Wed, 19 Jul 2023 22:56:09 +0800 4 | input-files: [Burke12.xml] 5 | 6 | phases: 7 | - name: gas 8 | elements: [H, O, N, Ar, He, C] 9 | species: [H, H2, O, OH, H2O, O2, HO2, H2O2, AR, HE, N2] 10 | thermo: ideal-gas 11 | transport: mixture-averaged 12 | kinetics: gas 13 | reactions: all 14 | state: {T: 300.0 K, P: 1.01325e+05 Pa} 15 | 16 | species: 17 | - name: H 18 | composition: {H: 1.0} 19 | note: L6/94 20 | thermo: 21 | model: NASA7 22 | temperature-ranges: [200.0, 1000.0, 6000.0] 23 | data: 24 | - [2.5, 0.0, 0.0, 0.0, 0.0, 2.547366e+04, -0.44668285] 25 | - [2.5, 0.0, 0.0, 0.0, 0.0, 2.547366e+04, -0.44668285] 26 | transport: 27 | model: gas 28 | geometry: atom 29 | well-depth: 145.0 30 | diameter: 2.05 31 | dipole: 0.0 32 | polarizability: 0.0 33 | rotational-relaxation: 0.0 34 | dispersion-coefficient: 0.0 35 | quadrupole-polarizability: 0.0 36 | - name: H2 37 | composition: {H: 2.0} 38 | note: REFELEMENTtpis78 39 | thermo: 40 | model: NASA7 41 | temperature-ranges: [200.0, 1000.0, 6000.0] 42 | data: 43 | - [2.34433112, 7.98052075e-03, -1.9478151e-05, 2.01572094e-08, -7.37611761e-12, 44 | -917.935173, 0.683010238] 45 | - [2.93286575, 8.26608026e-04, -1.46402364e-07, 1.54100414e-11, -6.888048e-16, 46 | -813.065581, -1.02432865] 47 | transport: 48 | model: gas 49 | geometry: linear 50 | well-depth: 38.0 51 | diameter: 2.92 52 | dipole: 0.0 53 | polarizability: 0.79 54 | rotational-relaxation: 280.0 55 | dispersion-coefficient: 0.0 56 | quadrupole-polarizability: 0.0 57 | - name: O 58 | composition: {O: 1.0} 59 | note: L1/90 60 | thermo: 61 | model: NASA7 62 | temperature-ranges: [200.0, 1000.0, 6000.0] 63 | data: 64 | - [3.1682671, -3.27931884e-03, 6.64306396e-06, -6.12806624e-09, 2.11265971e-12, 65 | 2.91222592e+04, 2.05193346] 66 | - [2.54363697, -2.73162486e-05, -4.1902952e-09, 4.95481845e-12, -4.79553694e-16, 67 | 2.9226012e+04, 4.92229457] 68 | transport: 69 | model: gas 70 | geometry: atom 71 | well-depth: 80.0 72 | diameter: 2.75 73 | dipole: 0.0 74 | polarizability: 0.0 75 | rotational-relaxation: 0.0 76 | dispersion-coefficient: 0.0 77 | quadrupole-polarizability: 0.0 78 | - name: OH 79 | composition: {H: 1.0, O: 1.0} 80 | note: HYDROXYLRADIIU3/03 81 | thermo: 82 | model: NASA7 83 | temperature-ranges: [200.0, 1000.0, 6000.0] 84 | data: 85 | - [3.99198424, -2.40106655e-03, 4.61664033e-06, -3.87916306e-09, 1.36319502e-12, 86 | 3368.89836, -0.103998477] 87 | - [2.83853033, 1.10741289e-03, -2.94000209e-07, 4.20698729e-11, -2.4228989e-15, 88 | 3697.80808, 5.84494652] 89 | transport: 90 | model: gas 91 | geometry: linear 92 | well-depth: 80.0 93 | diameter: 2.75 94 | dipole: 0.0 95 | polarizability: 0.0 96 | rotational-relaxation: 0.0 97 | dispersion-coefficient: 0.0 98 | quadrupole-polarizability: 0.0 99 | - name: H2O 100 | composition: {H: 2.0, O: 1.0} 101 | note: L5/89 102 | thermo: 103 | model: NASA7 104 | temperature-ranges: [200.0, 1000.0, 6000.0] 105 | data: 106 | - [4.1986352, -2.0364017e-03, 6.5203416e-06, -5.4879269e-09, 1.771968e-12, -3.0293726e+04, 107 | -0.84900901] 108 | - [2.6770389, 2.9731816e-03, -7.7376889e-07, 9.4433514e-11, -4.2689991e-15, -2.9885894e+04, 109 | 6.88255] 110 | transport: 111 | model: gas 112 | geometry: nonlinear 113 | well-depth: 572.4 114 | diameter: 2.605 115 | dipole: 1.844 116 | polarizability: 0.0 117 | rotational-relaxation: 4.0 118 | dispersion-coefficient: 0.0 119 | quadrupole-polarizability: 0.0 120 | - name: O2 121 | composition: {O: 2.0} 122 | note: REFELEMENTRUS89 123 | thermo: 124 | model: NASA7 125 | temperature-ranges: [200.0, 1000.0, 6000.0] 126 | data: 127 | - [3.78245636, -2.99673416e-03, 9.84730201e-06, -9.68129509e-09, 3.24372837e-12, 128 | -1063.94356, 3.65767573] 129 | - [3.66096065, 6.56365811e-04, -1.41149627e-07, 2.05797935e-11, -1.29913436e-15, 130 | -1215.97718, 3.41536279] 131 | transport: 132 | model: gas 133 | geometry: linear 134 | well-depth: 107.4 135 | diameter: 3.458 136 | dipole: 0.0 137 | polarizability: 1.6 138 | rotational-relaxation: 3.8 139 | dispersion-coefficient: 0.0 140 | quadrupole-polarizability: 0.0 141 | - name: HO2 142 | composition: {H: 1.0, O: 2.0} 143 | note: T1/09 144 | thermo: 145 | model: NASA7 146 | temperature-ranges: [200.0, 1000.0, 5000.0] 147 | data: 148 | - [4.30179807, -4.74912097e-03, 2.11582905e-05, -2.42763914e-08, 9.29225225e-12, 149 | 264.018485, 3.7166622] 150 | - [4.17228741, 1.88117627e-03, -3.46277286e-07, 1.94657549e-11, 1.76256905e-16, 151 | 31.0206839, 2.95767672] 152 | transport: 153 | model: gas 154 | geometry: nonlinear 155 | well-depth: 107.4 156 | diameter: 3.458 157 | dipole: 0.0 158 | polarizability: 0.0 159 | rotational-relaxation: 1.0 160 | dispersion-coefficient: 0.0 161 | quadrupole-polarizability: 0.0 162 | - name: H2O2 163 | composition: {H: 2.0, O: 2.0} 164 | note: T8/03 165 | thermo: 166 | model: NASA7 167 | temperature-ranges: [200.0, 1000.0, 6000.0] 168 | data: 169 | - [4.31515149, -8.47390622e-04, 1.76404323e-05, -2.26762944e-08, 9.08950158e-12, 170 | -1.77067437e+04, 3.27373319] 171 | - [4.57977305, 4.05326003e-03, -1.2984473e-06, 1.982114e-10, -1.13968792e-14, 172 | -1.80071775e+04, 0.664970694] 173 | transport: 174 | model: gas 175 | geometry: nonlinear 176 | well-depth: 107.4 177 | diameter: 3.458 178 | dipole: 0.0 179 | polarizability: 0.0 180 | rotational-relaxation: 3.8 181 | dispersion-coefficient: 0.0 182 | quadrupole-polarizability: 0.0 183 | - name: AR 184 | composition: {Ar: 1.0} 185 | note: REFELEMENTg5/97 186 | thermo: 187 | model: NASA7 188 | temperature-ranges: [200.0, 1000.0, 6000.0] 189 | data: 190 | - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.37967491] 191 | - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.37967491] 192 | transport: 193 | model: gas 194 | geometry: atom 195 | well-depth: 136.5 196 | diameter: 3.33 197 | dipole: 0.0 198 | polarizability: 0.0 199 | rotational-relaxation: 0.0 200 | dispersion-coefficient: 0.0 201 | quadrupole-polarizability: 0.0 202 | - name: HE 203 | composition: {He: 1.0} 204 | note: REFELEMENTg5/97 205 | thermo: 206 | model: NASA7 207 | temperature-ranges: [200.0, 1000.0, 6000.0] 208 | data: 209 | - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 0.928723974] 210 | - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 0.928723974] 211 | transport: 212 | model: gas 213 | geometry: atom 214 | well-depth: 10.2 215 | diameter: 2.576 216 | dipole: 0.0 217 | polarizability: 0.0 218 | rotational-relaxation: 0.0 219 | dispersion-coefficient: 0.0 220 | quadrupole-polarizability: 0.0 221 | - name: N2 222 | composition: {N: 2.0} 223 | note: REFELEMENTG8/02 224 | thermo: 225 | model: NASA7 226 | temperature-ranges: [200.0, 1000.0, 6000.0] 227 | data: 228 | - [3.53100528, -1.23660988e-04, -5.02999433e-07, 2.43530612e-09, -1.40881235e-12, 229 | -1046.97628, 2.96747038] 230 | - [2.95257637, 1.3969004e-03, -4.92631603e-07, 7.86010195e-11, -4.60755204e-15, 231 | -923.948688, 5.87188762] 232 | transport: 233 | model: gas 234 | geometry: linear 235 | well-depth: 97.53 236 | diameter: 3.621 237 | dipole: 0.0 238 | polarizability: 1.76 239 | rotational-relaxation: 4.0 240 | dispersion-coefficient: 0.0 241 | quadrupole-polarizability: 0.0 242 | 243 | reactions: 244 | - equation: H + O2 <=> O + OH 245 | rate-constant: {A: 1.04e+11, b: 0.0, Ea: 1.5286e+04 cal/mol} 246 | - equation: O + H2 <=> H + OH 247 | rate-constant: {A: 3.818e+09, b: 0.0, Ea: 7948.0 cal/mol} 248 | duplicate: true 249 | - equation: O + H2 <=> H + OH 250 | rate-constant: {A: 8.792e+11, b: 0.0, Ea: 1.917e+04 cal/mol} 251 | duplicate: true 252 | - equation: H2 + OH <=> H2O + H 253 | rate-constant: {A: 2.16e+05, b: 1.51, Ea: 3430.0 cal/mol} 254 | - equation: OH + OH <=> O + H2O 255 | rate-constant: {A: 33.4, b: 2.42, Ea: -1930.0 cal/mol} 256 | - equation: H2 + M <=> H + H + M 257 | type: three-body 258 | rate-constant: {A: 4.577e+16, b: -1.4, Ea: 1.0438e+05 cal/mol} 259 | efficiencies: {AR: 0.0, H2: 2.5, H2O: 12.0, HE: 0.0} 260 | - equation: H2 + AR <=> H + H + AR 261 | rate-constant: {A: 5.84e+15, b: -1.1, Ea: 1.0438e+05 cal/mol} 262 | - equation: H2 + HE <=> H + H + HE 263 | rate-constant: {A: 5.84e+15, b: -1.1, Ea: 1.0438e+05 cal/mol} 264 | - equation: O + O + M <=> O2 + M 265 | type: three-body 266 | rate-constant: {A: 6.165e+09, b: -0.5, Ea: 0.0 cal/mol} 267 | efficiencies: {AR: 0.0, H2: 2.5, H2O: 12.0, HE: 0.0} 268 | - equation: O + O + AR <=> O2 + AR 269 | rate-constant: {A: 1.886e+07, b: 0.0, Ea: -1788.0 cal/mol} 270 | - equation: O + O + HE <=> O2 + HE 271 | rate-constant: {A: 1.886e+07, b: 0.0, Ea: -1788.0 cal/mol} 272 | - equation: O + H + M <=> OH + M 273 | type: three-body 274 | rate-constant: {A: 4.714e+12, b: -1.0, Ea: 0.0 cal/mol} 275 | efficiencies: {AR: 0.75, H2: 2.5, H2O: 12.0, HE: 0.75} 276 | - equation: H2O + M <=> H + OH + M 277 | type: three-body 278 | rate-constant: {A: 6.064e+24, b: -3.322, Ea: 1.2079e+05 cal/mol} 279 | efficiencies: {H2: 3.0, H2O: 0.0, HE: 1.1, O2: 1.5} 280 | - equation: H2O + H2O <=> H + OH + H2O 281 | rate-constant: {A: 1.006e+23, b: -2.44, Ea: 1.2018e+05 cal/mol} 282 | - equation: H + O2 (+ M) <=> HO2 (+ M) 283 | type: falloff 284 | high-P-rate-constant: {A: 4.65084e+09, b: 0.44, Ea: 0.0 cal/mol} 285 | low-P-rate-constant: {A: 6.366e+14, b: -1.72, Ea: 524.8 cal/mol} 286 | efficiencies: {AR: 0.67, H2: 2.0, H2O: 14.0, HE: 0.8, O2: 0.78} 287 | Troe: {A: 0.5, T3: 1.0e-30, T1: 1.0e+30} 288 | - equation: HO2 + H <=> H2 + O2 289 | rate-constant: {A: 2750.0, b: 2.09, Ea: -1451.0 cal/mol} 290 | - equation: HO2 + H <=> OH + OH 291 | rate-constant: {A: 7.079e+10, b: 0.0, Ea: 295.0 cal/mol} 292 | - equation: HO2 + O <=> O2 + OH 293 | rate-constant: {A: 2.85e+07, b: 1.0, Ea: -723.93 cal/mol} 294 | - equation: HO2 + OH <=> H2O + O2 295 | rate-constant: {A: 2.89e+10, b: 0.0, Ea: -497.0 cal/mol} 296 | - equation: HO2 + HO2 <=> H2O2 + O2 297 | rate-constant: {A: 4.2e+11, b: 0.0, Ea: 1.1982e+04 cal/mol} 298 | duplicate: true 299 | - equation: HO2 + HO2 <=> H2O2 + O2 300 | rate-constant: {A: 1.3e+08, b: 0.0, Ea: -1629.3 cal/mol} 301 | duplicate: true 302 | - equation: H2O2 (+ M) <=> OH + OH (+ M) 303 | type: falloff 304 | high-P-rate-constant: {A: 2.0e+12, b: 0.9, Ea: 4.8749e+04 cal/mol} 305 | low-P-rate-constant: {A: 2.49e+21, b: -2.3, Ea: 4.8749e+04 cal/mol} 306 | efficiencies: {H2: 3.7, H2O: 7.5, H2O2: 7.7, HE: 0.65, O2: 1.2} 307 | Troe: {A: 0.43, T3: 1.0e-30, T1: 1.0e+30} 308 | - equation: H2O2 + H <=> H2O + OH 309 | rate-constant: {A: 2.41e+10, b: 0.0, Ea: 3970.0 cal/mol} 310 | - equation: H2O2 + H <=> HO2 + H2 311 | rate-constant: {A: 4.82e+10, b: 0.0, Ea: 7950.0 cal/mol} 312 | - equation: H2O2 + O <=> OH + HO2 313 | rate-constant: {A: 9550.0, b: 2.0, Ea: 3970.0 cal/mol} 314 | - equation: H2O2 + OH <=> HO2 + H2O 315 | rate-constant: {A: 1.74e+09, b: 0.0, Ea: 318.0 cal/mol} 316 | duplicate: true 317 | - equation: H2O2 + OH <=> HO2 + H2O 318 | rate-constant: {A: 7.59e+10, b: 0.0, Ea: 7270.0 cal/mol} 319 | duplicate: true 320 | -------------------------------------------------------------------------------- /examples/flame2d/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | t, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 375000, 2500, 2500, 50, 50, 50 10 | 11 | # deltat 12 | 2.d-9 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | 36 | -------------------------------------------------------------------------------- /examples/flame2d/datin/input.hitflame: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | hitflame 7 | 8 | # im,jm,km : The size of grid. 9 | 800,800,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,f,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | f,t,t,t,f,f,t,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 200.d0, 0.3d0 25 | 26 | # conschm,difschm,rkschemem,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 60 40 | 22 41 | 60 42 | 22 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 32, 0, 32, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | # chemfile 56 | datin/Burke12.yaml 57 | 58 | 59 | ######################################################################## 60 | # bctype # 61 | # 1 : periodic bc, nothing will be done. # 62 | # 41 : isothermal wall, wall temperature input. # 63 | ######################################################################## 64 | -------------------------------------------------------------------------------- /examples/flame2d/datin/userinput.txt: -------------------------------------------------------------------------------- 1 | 3.01d-5 -------------------------------------------------------------------------------- /examples/hitflame/datin/Burke12.yaml: -------------------------------------------------------------------------------- 1 | generator: ctml2yaml 2 | cantera-version: 2.6.0 3 | date: Wed, 19 Jul 2023 22:56:09 +0800 4 | input-files: [Burke12.xml] 5 | 6 | phases: 7 | - name: gas 8 | elements: [H, O, N, Ar, He, C] 9 | species: [H, H2, O, OH, H2O, O2, HO2, H2O2, AR, HE, N2] 10 | thermo: ideal-gas 11 | transport: mixture-averaged 12 | kinetics: gas 13 | reactions: all 14 | state: {T: 300.0 K, P: 1.01325e+05 Pa} 15 | 16 | species: 17 | - name: H 18 | composition: {H: 1.0} 19 | note: L6/94 20 | thermo: 21 | model: NASA7 22 | temperature-ranges: [200.0, 1000.0, 6000.0] 23 | data: 24 | - [2.5, 0.0, 0.0, 0.0, 0.0, 2.547366e+04, -0.44668285] 25 | - [2.5, 0.0, 0.0, 0.0, 0.0, 2.547366e+04, -0.44668285] 26 | transport: 27 | model: gas 28 | geometry: atom 29 | well-depth: 145.0 30 | diameter: 2.05 31 | dipole: 0.0 32 | polarizability: 0.0 33 | rotational-relaxation: 0.0 34 | dispersion-coefficient: 0.0 35 | quadrupole-polarizability: 0.0 36 | - name: H2 37 | composition: {H: 2.0} 38 | note: REFELEMENTtpis78 39 | thermo: 40 | model: NASA7 41 | temperature-ranges: [200.0, 1000.0, 6000.0] 42 | data: 43 | - [2.34433112, 7.98052075e-03, -1.9478151e-05, 2.01572094e-08, -7.37611761e-12, 44 | -917.935173, 0.683010238] 45 | - [2.93286575, 8.26608026e-04, -1.46402364e-07, 1.54100414e-11, -6.888048e-16, 46 | -813.065581, -1.02432865] 47 | transport: 48 | model: gas 49 | geometry: linear 50 | well-depth: 38.0 51 | diameter: 2.92 52 | dipole: 0.0 53 | polarizability: 0.79 54 | rotational-relaxation: 280.0 55 | dispersion-coefficient: 0.0 56 | quadrupole-polarizability: 0.0 57 | - name: O 58 | composition: {O: 1.0} 59 | note: L1/90 60 | thermo: 61 | model: NASA7 62 | temperature-ranges: [200.0, 1000.0, 6000.0] 63 | data: 64 | - [3.1682671, -3.27931884e-03, 6.64306396e-06, -6.12806624e-09, 2.11265971e-12, 65 | 2.91222592e+04, 2.05193346] 66 | - [2.54363697, -2.73162486e-05, -4.1902952e-09, 4.95481845e-12, -4.79553694e-16, 67 | 2.9226012e+04, 4.92229457] 68 | transport: 69 | model: gas 70 | geometry: atom 71 | well-depth: 80.0 72 | diameter: 2.75 73 | dipole: 0.0 74 | polarizability: 0.0 75 | rotational-relaxation: 0.0 76 | dispersion-coefficient: 0.0 77 | quadrupole-polarizability: 0.0 78 | - name: OH 79 | composition: {H: 1.0, O: 1.0} 80 | note: HYDROXYLRADIIU3/03 81 | thermo: 82 | model: NASA7 83 | temperature-ranges: [200.0, 1000.0, 6000.0] 84 | data: 85 | - [3.99198424, -2.40106655e-03, 4.61664033e-06, -3.87916306e-09, 1.36319502e-12, 86 | 3368.89836, -0.103998477] 87 | - [2.83853033, 1.10741289e-03, -2.94000209e-07, 4.20698729e-11, -2.4228989e-15, 88 | 3697.80808, 5.84494652] 89 | transport: 90 | model: gas 91 | geometry: linear 92 | well-depth: 80.0 93 | diameter: 2.75 94 | dipole: 0.0 95 | polarizability: 0.0 96 | rotational-relaxation: 0.0 97 | dispersion-coefficient: 0.0 98 | quadrupole-polarizability: 0.0 99 | - name: H2O 100 | composition: {H: 2.0, O: 1.0} 101 | note: L5/89 102 | thermo: 103 | model: NASA7 104 | temperature-ranges: [200.0, 1000.0, 6000.0] 105 | data: 106 | - [4.1986352, -2.0364017e-03, 6.5203416e-06, -5.4879269e-09, 1.771968e-12, -3.0293726e+04, 107 | -0.84900901] 108 | - [2.6770389, 2.9731816e-03, -7.7376889e-07, 9.4433514e-11, -4.2689991e-15, -2.9885894e+04, 109 | 6.88255] 110 | transport: 111 | model: gas 112 | geometry: nonlinear 113 | well-depth: 572.4 114 | diameter: 2.605 115 | dipole: 1.844 116 | polarizability: 0.0 117 | rotational-relaxation: 4.0 118 | dispersion-coefficient: 0.0 119 | quadrupole-polarizability: 0.0 120 | - name: O2 121 | composition: {O: 2.0} 122 | note: REFELEMENTRUS89 123 | thermo: 124 | model: NASA7 125 | temperature-ranges: [200.0, 1000.0, 6000.0] 126 | data: 127 | - [3.78245636, -2.99673416e-03, 9.84730201e-06, -9.68129509e-09, 3.24372837e-12, 128 | -1063.94356, 3.65767573] 129 | - [3.66096065, 6.56365811e-04, -1.41149627e-07, 2.05797935e-11, -1.29913436e-15, 130 | -1215.97718, 3.41536279] 131 | transport: 132 | model: gas 133 | geometry: linear 134 | well-depth: 107.4 135 | diameter: 3.458 136 | dipole: 0.0 137 | polarizability: 1.6 138 | rotational-relaxation: 3.8 139 | dispersion-coefficient: 0.0 140 | quadrupole-polarizability: 0.0 141 | - name: HO2 142 | composition: {H: 1.0, O: 2.0} 143 | note: T1/09 144 | thermo: 145 | model: NASA7 146 | temperature-ranges: [200.0, 1000.0, 5000.0] 147 | data: 148 | - [4.30179807, -4.74912097e-03, 2.11582905e-05, -2.42763914e-08, 9.29225225e-12, 149 | 264.018485, 3.7166622] 150 | - [4.17228741, 1.88117627e-03, -3.46277286e-07, 1.94657549e-11, 1.76256905e-16, 151 | 31.0206839, 2.95767672] 152 | transport: 153 | model: gas 154 | geometry: nonlinear 155 | well-depth: 107.4 156 | diameter: 3.458 157 | dipole: 0.0 158 | polarizability: 0.0 159 | rotational-relaxation: 1.0 160 | dispersion-coefficient: 0.0 161 | quadrupole-polarizability: 0.0 162 | - name: H2O2 163 | composition: {H: 2.0, O: 2.0} 164 | note: T8/03 165 | thermo: 166 | model: NASA7 167 | temperature-ranges: [200.0, 1000.0, 6000.0] 168 | data: 169 | - [4.31515149, -8.47390622e-04, 1.76404323e-05, -2.26762944e-08, 9.08950158e-12, 170 | -1.77067437e+04, 3.27373319] 171 | - [4.57977305, 4.05326003e-03, -1.2984473e-06, 1.982114e-10, -1.13968792e-14, 172 | -1.80071775e+04, 0.664970694] 173 | transport: 174 | model: gas 175 | geometry: nonlinear 176 | well-depth: 107.4 177 | diameter: 3.458 178 | dipole: 0.0 179 | polarizability: 0.0 180 | rotational-relaxation: 3.8 181 | dispersion-coefficient: 0.0 182 | quadrupole-polarizability: 0.0 183 | - name: AR 184 | composition: {Ar: 1.0} 185 | note: REFELEMENTg5/97 186 | thermo: 187 | model: NASA7 188 | temperature-ranges: [200.0, 1000.0, 6000.0] 189 | data: 190 | - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.37967491] 191 | - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 4.37967491] 192 | transport: 193 | model: gas 194 | geometry: atom 195 | well-depth: 136.5 196 | diameter: 3.33 197 | dipole: 0.0 198 | polarizability: 0.0 199 | rotational-relaxation: 0.0 200 | dispersion-coefficient: 0.0 201 | quadrupole-polarizability: 0.0 202 | - name: HE 203 | composition: {He: 1.0} 204 | note: REFELEMENTg5/97 205 | thermo: 206 | model: NASA7 207 | temperature-ranges: [200.0, 1000.0, 6000.0] 208 | data: 209 | - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 0.928723974] 210 | - [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, 0.928723974] 211 | transport: 212 | model: gas 213 | geometry: atom 214 | well-depth: 10.2 215 | diameter: 2.576 216 | dipole: 0.0 217 | polarizability: 0.0 218 | rotational-relaxation: 0.0 219 | dispersion-coefficient: 0.0 220 | quadrupole-polarizability: 0.0 221 | - name: N2 222 | composition: {N: 2.0} 223 | note: REFELEMENTG8/02 224 | thermo: 225 | model: NASA7 226 | temperature-ranges: [200.0, 1000.0, 6000.0] 227 | data: 228 | - [3.53100528, -1.23660988e-04, -5.02999433e-07, 2.43530612e-09, -1.40881235e-12, 229 | -1046.97628, 2.96747038] 230 | - [2.95257637, 1.3969004e-03, -4.92631603e-07, 7.86010195e-11, -4.60755204e-15, 231 | -923.948688, 5.87188762] 232 | transport: 233 | model: gas 234 | geometry: linear 235 | well-depth: 97.53 236 | diameter: 3.621 237 | dipole: 0.0 238 | polarizability: 1.76 239 | rotational-relaxation: 4.0 240 | dispersion-coefficient: 0.0 241 | quadrupole-polarizability: 0.0 242 | 243 | reactions: 244 | - equation: H + O2 <=> O + OH 245 | rate-constant: {A: 1.04e+11, b: 0.0, Ea: 1.5286e+04 cal/mol} 246 | - equation: O + H2 <=> H + OH 247 | rate-constant: {A: 3.818e+09, b: 0.0, Ea: 7948.0 cal/mol} 248 | duplicate: true 249 | - equation: O + H2 <=> H + OH 250 | rate-constant: {A: 8.792e+11, b: 0.0, Ea: 1.917e+04 cal/mol} 251 | duplicate: true 252 | - equation: H2 + OH <=> H2O + H 253 | rate-constant: {A: 2.16e+05, b: 1.51, Ea: 3430.0 cal/mol} 254 | - equation: OH + OH <=> O + H2O 255 | rate-constant: {A: 33.4, b: 2.42, Ea: -1930.0 cal/mol} 256 | - equation: H2 + M <=> H + H + M 257 | type: three-body 258 | rate-constant: {A: 4.577e+16, b: -1.4, Ea: 1.0438e+05 cal/mol} 259 | efficiencies: {AR: 0.0, H2: 2.5, H2O: 12.0, HE: 0.0} 260 | - equation: H2 + AR <=> H + H + AR 261 | rate-constant: {A: 5.84e+15, b: -1.1, Ea: 1.0438e+05 cal/mol} 262 | - equation: H2 + HE <=> H + H + HE 263 | rate-constant: {A: 5.84e+15, b: -1.1, Ea: 1.0438e+05 cal/mol} 264 | - equation: O + O + M <=> O2 + M 265 | type: three-body 266 | rate-constant: {A: 6.165e+09, b: -0.5, Ea: 0.0 cal/mol} 267 | efficiencies: {AR: 0.0, H2: 2.5, H2O: 12.0, HE: 0.0} 268 | - equation: O + O + AR <=> O2 + AR 269 | rate-constant: {A: 1.886e+07, b: 0.0, Ea: -1788.0 cal/mol} 270 | - equation: O + O + HE <=> O2 + HE 271 | rate-constant: {A: 1.886e+07, b: 0.0, Ea: -1788.0 cal/mol} 272 | - equation: O + H + M <=> OH + M 273 | type: three-body 274 | rate-constant: {A: 4.714e+12, b: -1.0, Ea: 0.0 cal/mol} 275 | efficiencies: {AR: 0.75, H2: 2.5, H2O: 12.0, HE: 0.75} 276 | - equation: H2O + M <=> H + OH + M 277 | type: three-body 278 | rate-constant: {A: 6.064e+24, b: -3.322, Ea: 1.2079e+05 cal/mol} 279 | efficiencies: {H2: 3.0, H2O: 0.0, HE: 1.1, O2: 1.5} 280 | - equation: H2O + H2O <=> H + OH + H2O 281 | rate-constant: {A: 1.006e+23, b: -2.44, Ea: 1.2018e+05 cal/mol} 282 | - equation: H + O2 (+ M) <=> HO2 (+ M) 283 | type: falloff 284 | high-P-rate-constant: {A: 4.65084e+09, b: 0.44, Ea: 0.0 cal/mol} 285 | low-P-rate-constant: {A: 6.366e+14, b: -1.72, Ea: 524.8 cal/mol} 286 | efficiencies: {AR: 0.67, H2: 2.0, H2O: 14.0, HE: 0.8, O2: 0.78} 287 | Troe: {A: 0.5, T3: 1.0e-30, T1: 1.0e+30} 288 | - equation: HO2 + H <=> H2 + O2 289 | rate-constant: {A: 2750.0, b: 2.09, Ea: -1451.0 cal/mol} 290 | - equation: HO2 + H <=> OH + OH 291 | rate-constant: {A: 7.079e+10, b: 0.0, Ea: 295.0 cal/mol} 292 | - equation: HO2 + O <=> O2 + OH 293 | rate-constant: {A: 2.85e+07, b: 1.0, Ea: -723.93 cal/mol} 294 | - equation: HO2 + OH <=> H2O + O2 295 | rate-constant: {A: 2.89e+10, b: 0.0, Ea: -497.0 cal/mol} 296 | - equation: HO2 + HO2 <=> H2O2 + O2 297 | rate-constant: {A: 4.2e+11, b: 0.0, Ea: 1.1982e+04 cal/mol} 298 | duplicate: true 299 | - equation: HO2 + HO2 <=> H2O2 + O2 300 | rate-constant: {A: 1.3e+08, b: 0.0, Ea: -1629.3 cal/mol} 301 | duplicate: true 302 | - equation: H2O2 (+ M) <=> OH + OH (+ M) 303 | type: falloff 304 | high-P-rate-constant: {A: 2.0e+12, b: 0.9, Ea: 4.8749e+04 cal/mol} 305 | low-P-rate-constant: {A: 2.49e+21, b: -2.3, Ea: 4.8749e+04 cal/mol} 306 | efficiencies: {H2: 3.7, H2O: 7.5, H2O2: 7.7, HE: 0.65, O2: 1.2} 307 | Troe: {A: 0.43, T3: 1.0e-30, T1: 1.0e+30} 308 | - equation: H2O2 + H <=> H2O + OH 309 | rate-constant: {A: 2.41e+10, b: 0.0, Ea: 3970.0 cal/mol} 310 | - equation: H2O2 + H <=> HO2 + H2 311 | rate-constant: {A: 4.82e+10, b: 0.0, Ea: 7950.0 cal/mol} 312 | - equation: H2O2 + O <=> OH + HO2 313 | rate-constant: {A: 9550.0, b: 2.0, Ea: 3970.0 cal/mol} 314 | - equation: H2O2 + OH <=> HO2 + H2O 315 | rate-constant: {A: 1.74e+09, b: 0.0, Ea: 318.0 cal/mol} 316 | duplicate: true 317 | - equation: H2O2 + OH <=> HO2 + H2O 318 | rate-constant: {A: 7.59e+10, b: 0.0, Ea: 7270.0 cal/mol} 319 | duplicate: true 320 | -------------------------------------------------------------------------------- /examples/hitflame/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | t, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 100000, 1000, 500, 50, 1, 50 10 | 11 | # deltat 12 | 2.d-9 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/hitflame/datin/input.hitflame: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | hitflame 7 | 8 | # im,jm,km : The size of grid. 9 | 768,64,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | f,t,t,f,f,f,t,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 200.d0, 0.3d0 25 | 26 | # conschm,difschm,rkschemem,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 11,free 40 | 21 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 1 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | grid.h5 54 | 55 | # chemfile 56 | datin/Burke12.yaml 57 | 58 | 59 | ######################################################################## 60 | # bctype # 61 | # 1 : periodic bc, nothing will be done. # 62 | # 41 : isothermal wall, wall temperature input. # 63 | ######################################################################## 64 | -------------------------------------------------------------------------------- /examples/hitflame/datin/userinput.txt: -------------------------------------------------------------------------------- 1 | 7.87559d-5 2 | -------------------------------------------------------------------------------- /examples/onedflame/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/onedflame) 2 | install(DIRECTORY datin DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/onedflame) 3 | 4 | # If testing active add test for Shuosher case 5 | if (${BUILD_TESTING}) 6 | set(case_dir "${test_dir}/onedflame") 7 | file(MAKE_DIRECTORY ${case_dir}) 8 | file(COPY datin DESTINATION ${case_dir}) 9 | endif() 10 | -------------------------------------------------------------------------------- /examples/onedflame/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | t, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 1000, 1000, 1000, 50, 1, 50 10 | 11 | # deltat 12 | 2.d-9 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/onedflame/datin/input.onedflame: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | onedflame 7 | 8 | # im,jm,km : The size of grid. 9 | 768,0,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | f,t,t,f,f,f,t,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 200.d0, 0.3d0 25 | 26 | # conschm,difschm,rkschemem,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 11,free 40 | 21 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 0 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | grid.h5 54 | 55 | # chemfile 56 | datin/Burke12.yaml 57 | 58 | 59 | ######################################################################## 60 | # bctype # 61 | # 1 : periodic bc, nothing will be done. # 62 | # 41 : isothermal wall, wall temperature input. # 63 | ######################################################################## 64 | -------------------------------------------------------------------------------- /examples/onedflame/datin/userinput.txt: -------------------------------------------------------------------------------- 1 | 7.87559d-5 2 | -------------------------------------------------------------------------------- /examples/supersonic_backstep/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTRR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | f, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 100, 50, 20, 200, 5, 500 10 | 11 | # deltat 12 | 2.d-3 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/supersonic_backstep/datin/grid.2d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/astr-code/astr/2ba00b70da962d5d86edbff0eb257c1410fa9230/examples/supersonic_backstep/datin/grid.2d -------------------------------------------------------------------------------- /examples/supersonic_backstep/datin/input.2d: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | bl 7 | 8 | # im,jm,km : The size of grid. 9 | 1450,320,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,f,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou : Parameters 15 | t,t,f,t,f,t,t 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 224.14d0, 3994.54d0, 1.5d0 25 | 26 | # conschm,difschm,rkscheme : Numerical scheme 27 | 742e, 642e, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.1d0, 2.5d-4 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 11, prof 40 | 21 41 | 42 42 | 42 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 1 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # grid 53 | datin/grid.2d 54 | 55 | # solidfile 56 | udf, backfacestep 57 | stl/double_delta_wing.stl 58 | 59 | 60 | 61 | ######################################################################## 62 | # bctype # 63 | # 1 : periodic bc, nothing will be done. # 64 | # 41 : isothermal wall, wall temperature input. # 65 | ######################################################################## 66 | -------------------------------------------------------------------------------- /examples/supersonic_backstep_dimension/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTRR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | t, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 10000, 100, 100, 200, 5, 500 10 | 11 | # deltat 12 | 2.d-10 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/supersonic_backstep_dimension/datin/grid.2d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/astr-code/astr/2ba00b70da962d5d86edbff0eb257c1410fa9230/examples/supersonic_backstep_dimension/datin/grid.2d -------------------------------------------------------------------------------- /examples/supersonic_backstep_dimension/datin/input.2d: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | bl 7 | 8 | # im,jm,km : The size of grid. 9 | 1450,320,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | f,f,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | f,t,f,t,f,t,t,f 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 224.14d0, 3994.54d0, 1.5d0 25 | 26 | # conschm,difschm,rkscheme,odetype : Numerical scheme 27 | 642e, 642e, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.1d0, 2.5d-4 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 11, prof 40 | 21 41 | 42 42 | 42 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 1 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.2d 54 | 55 | # solidfile 56 | udf, backfacestep 57 | stl/double_delta_wing.stl 58 | # chemfile 59 | datin/h2_12s.xml 60 | 61 | 62 | 63 | ######################################################################## 64 | # bctype # 65 | # 1 : periodic bc, nothing will be done. # 66 | # 41 : isothermal wall, wall temperature input. # 67 | ######################################################################## 68 | -------------------------------------------------------------------------------- /examples/test_accuracy/datin/controller: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # control file for ASTR code # 3 | ############################################################ 4 | 5 | # lwsequ,lwslic,lavg,lcracon 6 | t, f, f, f 7 | 8 | # maxstep,feqchkpt,feqwsequ,feqslice,feqlist,feqavg 9 | 5000, 200, 200, 50, 1, 50 10 | 11 | # deltat 12 | 7.5d-4 13 | 14 | # The controller file will be read during a simulation, 15 | # everytime after dumping checkpoint. 16 | 17 | #+---------------+-----------------------------------------+ 18 | #| lwsequ | to output flowfield sequence | 19 | #| lwslic | to output flowfield at given i/j/k cut | 20 | #| | , slice.dat will be required to define | 21 | #| | i/j/k position | 22 | #| lavg | to calculate statistics and also output | 23 | #| | meanflow, 2order and 3order files. | 24 | #+---------------+-----------------------------------------+ 25 | #| maxstep | the max step to run. | 26 | #| feqchkpt | frequency of writing checkpoint | 27 | #| feqwsequ | frequency of writing flowfield sequence | 28 | #| feqslice | frequency of writing slices | 29 | #| feqlist | frequency of listing log | 30 | #| feqavg | frequency of averaging flowfield | 31 | #| feqchkpt | frequency of outputting checkpoint | 32 | #+---------------+-----------------------------------------+ 33 | #| deltat | the time step | 34 | #+---------------+-----------------------------------------+ 35 | -------------------------------------------------------------------------------- /examples/test_accuracy/datin/input.1dtest: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # input file of ASTR code # 3 | ######################################################################## 4 | 5 | # flowtype : The type of flow problem 6 | tgv 7 | 8 | # im,jm,km : The size of grid. 9 | 32,0,0 10 | 11 | # lihomo,ljhomo,lkhomo : The homogeneous directions 12 | t,t,t 13 | 14 | # nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters 15 | t,t,t,f,f,f,f,f 16 | 17 | # lrestar : start mode 18 | f 19 | 20 | # alfa_filter, kcutoff : Filter parameters 21 | 0.49d0, 48 22 | 23 | # ref_t,reynolds,mach : Reference variables 24 | 273.15d0, 200.d0, 0.3d0 25 | 26 | # conschm,difschm,rkschemem,odetype : Numerical scheme 27 | 642c, 642c, rk3, rk3 28 | 29 | # recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme 30 | 5, t, 0.3d0, 0.05d0 31 | 32 | # num_species : number of species 33 | 0 34 | 35 | # turbmode,iomode : turbulence model 36 | none,h 37 | 38 | # bctype : Boundary condition definition 39 | 1 40 | 1 41 | 1 42 | 1 43 | 1 44 | 1 45 | 46 | # ninit : Initial method 47 | 1 48 | 49 | # spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range 50 | 0, 0, 0, 0, 0, 0 51 | 52 | # gridfile 53 | datin/grid.h5 54 | 55 | 56 | ######################################################################## 57 | # bctype # 58 | # 1 : periodic bc, nothing will be done. # 59 | # 41 : isothermal wall, wall temperature input. # 60 | ######################################################################## 61 | -------------------------------------------------------------------------------- /miniapps/gradient_solver_3d/gradient_solver_cpu.f90: -------------------------------------------------------------------------------- 1 | program main 2 | ! 3 | integer :: im=256,jm=256,km=256,hm=3 4 | real(8),parameter :: pi=4.d0*atan(1.0_8) 5 | ! 6 | real(8),allocatable,dimension(:,:,:,:) :: x,df,df_ref 7 | real(8),allocatable,dimension(:,:,:) :: f 8 | ! 9 | integer :: i,j,k 10 | real(8) :: dx,dy,dz,error(3) 11 | real(8) :: time_beg,time_end 12 | ! 13 | allocate(x(0:im,0:jm,0:km,1:3),f(-hm:im+hm,-hm:jm+hm,-hm:km+hm),df(0:im,0:jm,0:km,1:3),df_ref(0:im,0:jm,0:km,1:3)) 14 | ! 15 | call cpu_time(time_beg) 16 | ! initial value 17 | do k=0,km 18 | do j=0,jm 19 | do i=0,im 20 | ! 21 | x(i,j,k,1) =2.d0*pi/dble(im)*dble(i) 22 | x(i,j,k,2) =2.d0*pi/dble(jm)*dble(j) 23 | x(i,j,k,3) =2.d0*pi/dble(km)*dble(k) 24 | ! 25 | f(i,j,k) = sin(x(i,j,k,1))*cos(x(i,j,k,2))*cos(x(i,j,k,3)) 26 | ! 27 | df_ref(i,j,k,1) = cos(x(i,j,k,1))*cos(x(i,j,k,2))*cos(x(i,j,k,3)) 28 | df_ref(i,j,k,2) = -sin(x(i,j,k,1))*sin(x(i,j,k,2))*cos(x(i,j,k,3)) 29 | df_ref(i,j,k,3) = -sin(x(i,j,k,1))*cos(x(i,j,k,2))*sin(x(i,j,k,3)) 30 | enddo 31 | enddo 32 | enddo 33 | call cpu_time(time_end) 34 | print*,' ** CPU time for initialisation :',time_end-time_beg 35 | ! 36 | dx=x(1,1,1,1)-x(0,0,0,1) 37 | dy=x(1,1,1,2)-x(0,0,0,2) 38 | dz=x(1,1,1,3)-x(0,0,0,3) 39 | ! 40 | call cpu_time(time_beg) 41 | ! boundary condition 42 | do k=0,km 43 | do j=0,jm 44 | f(-hm:-1,j,k) = f(im-hm:im-1,j,k) 45 | f(im+1:im+hm,j,k) = f(1:hm,j,k) 46 | enddo 47 | enddo 48 | do k=0,km 49 | do i=0,im 50 | f(i,-hm:-1,k) = f(i,jm-hm:jm-1,k) 51 | f(i,jm+1:jm+hm,k) = f(i,1:hm,k) 52 | enddo 53 | enddo 54 | do j=0,jm 55 | do i=0,im 56 | f(i,j,-hm:-1) = f(i,j,km-hm:km-1) 57 | f(i,j,km+1:km+hm) = f(i,j,1:hm) 58 | enddo 59 | enddo 60 | call cpu_time(time_end) 61 | print*,' ** CPU time for boundary condition :',time_end-time_beg 62 | ! 63 | call cpu_time(time_beg) 64 | ! gradient calculation with 6th-order scheme 65 | ! 66 | do k=0,km 67 | do j=0,jm 68 | do i=0,im 69 | df(i,j,k,1) =0.75d0 *(f(i+1,j,k)-f(i-1,j,k))- & 70 | 0.15d0 *(f(i+2,j,k)-f(i-2,j,k))+ & 71 | 1.66666666666667d-2*(f(i+3,j,k)-f(i-3,j,k)) 72 | df(i,j,k,2) =0.75d0 *(f(i,j+1,k)-f(i,j-1,k))- & 73 | 0.15d0 *(f(i,j+2,k)-f(i,j-2,k))+ & 74 | 1.66666666666667d-2*(f(i,j+3,k)-f(i,j-3,k)) 75 | df(i,j,k,3) =0.75d0 *(f(i,j,k+1)-f(i,j,k-1))- & 76 | 0.15d0 *(f(i,j,k+2)-f(i,j,k-2))+ & 77 | 1.66666666666667d-2*(f(i,j,k+3)-f(i,j,k-3)) 78 | enddo 79 | enddo 80 | enddo 81 | df(:,:,:,1)=df(:,:,:,1)/dx 82 | df(:,:,:,2)=df(:,:,:,2)/dy 83 | df(:,:,:,3)=df(:,:,:,3)/dz 84 | ! 85 | call cpu_time(time_end) 86 | print*,' ** CPU time for gradient calculation :',time_end-time_beg 87 | ! 88 | call cpu_time(time_beg) 89 | ! validation 90 | error=0.d0 91 | do k=1,km 92 | do j=1,jm 93 | do i=1,im 94 | ! 95 | error(1) = error(1) + (df(i,j,k,1)-df_ref(i,j,k,1))**2 96 | error(2) = error(2) + (df(i,j,k,2)-df_ref(i,j,k,2))**2 97 | error(3) = error(3) + (df(i,j,k,3)-df_ref(i,j,k,3))**2 98 | ! 99 | ! if(i==1 .and. j==1) print*,'x-y-z:df3',i,j,k,x(i,j,k,:),df(i,j,k,3) 100 | ! if(i==1 .and. k==1) print*,'x-y-z:df2',x(i,j,k,:),df(i,j,k,2) 101 | ! 102 | enddo 103 | enddo 104 | enddo 105 | error=error/dble(im*jm*km) 106 | ! 107 | print*,' ** errors:',error 108 | ! 109 | call cpu_time(time_end) 110 | print*,' ** CPU time for validation :',time_end-time_beg 111 | ! 112 | print*,' ** job done.' 113 | ! 114 | end program 115 | ! -------------------------------------------------------------------------------- /script/astr.case.creater: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo ' this is to create a new ASTR case' 4 | 5 | mkdir -p ./user_define_module 6 | 7 | echo ' ASTR PATH:'$apath 8 | 9 | cp -v $apath/user_define_module/userdefine.F90 ./user_define_module/ 10 | 11 | cp -rv $apath/examples/Taylor_Green_Vortex_2D/datin ./ 12 | -------------------------------------------------------------------------------- /script/install_cantera.sh: -------------------------------------------------------------------------------- 1 | download cantera-2.5.1.tgz 2 | tar -xvf cantera-2.5.1.tgz 3 | cd cantera-2.5.1 4 | module load python3 5 | python3 scons/scripts/scons.py build python_package=none FORTRAN=mpif90 f90_interface=y prefix=/home/abr01399/opt/cantera-2.5.1/ boost_inc_dir=/usr/include/boost/ 6 | python scons/scripts/scons.py install 7 | -------------------------------------------------------------------------------- /script/install_hdf5.sh: -------------------------------------------------------------------------------- 1 | wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2 2 | tar -xvf hdf5-1.12.0.tar.bz2 3 | cd hdf5-1.12.0 4 | ./configure --prefix=$HD5_INSTALL_DIR --enable-fortran --disable-shared --enable-parallel CC=mpicc FC=mpif90 5 | make 6 | make install 7 | 8 | echo 'export HDF5_INSTALL_PATH=$HD5_INSTALL_DIR' >> .bashrc 9 | echo 'export PATH=$PATH:$HD5_INSTALL_DIR/bin/' >> .bashrc -------------------------------------------------------------------------------- /script/setup_a_case.sh: -------------------------------------------------------------------------------- 1 | # this is a bash script to setup a ASTR case 2 | 3 | ASTR_DIR="$(dirname "$(readlink -f "$0")")" 4 | 5 | echo "ASTR directory: $ASTR_DIR" 6 | 7 | cp -v $ASTR_DIR/Makefile ./ 8 | cp -vr $ASTR_DIR//examples/Taylor_Green_Vortex/datin ./ 9 | 10 | mkdir "./user_define_module" 11 | cp -v $ASTR_DIR/user_define_module/userdefine.F90 ./user_define_module/ -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | message(STATUS "CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}") 2 | message(STATUS "PROJECT_BINARY_DIR: ${PROJECT_BINARY_DIR}") 3 | 4 | add_executable(astr 5 | astr.F90 6 | bc.F90 7 | CMakeLists.txt 8 | cmdefne.F90 9 | commarray.F90 10 | comsolver.F90 11 | commcal.F90 12 | commfunc.F90 13 | commtype.F90 14 | commvar.F90 15 | constdef.F90 16 | fdnn.F90 17 | filter.F90 18 | fludyna.F90 19 | geom.F90 20 | gridgeneration.F90 21 | hdf5io.F90 22 | ibmethod.F90 23 | initialisation.F90 24 | interp.F90 25 | mainloop.F90 26 | models.F90 27 | parallel.F90 28 | pp.F90 29 | readwrite.F90 30 | riemann.F90 31 | singleton.F90 32 | solver.F90 33 | statistic.F90 34 | stlaio.F90 35 | strings.F90 36 | tecio.F90 37 | test.F90 38 | thermchem.F90 39 | userdefine.F90 40 | utility.F90 41 | vtkio.F90) 42 | 43 | target_link_libraries(astr) 44 | if (MPI_FOUND) 45 | target_link_libraries(astr PRIVATE MPI::MPI_Fortran) 46 | endif (MPI_FOUND) 47 | if (CHEMISTRY) 48 | message(STATUS "CANTERA library: ${CTRDIR}/lib") 49 | target_link_libraries(astr PRIVATE -L${CTRDIR}/lib -lcantera_fortran -lcantera -lstdc++ -pthread) 50 | endif (CHEMISTRY) 51 | 52 | install(TARGETS astr 53 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 54 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 55 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 56 | ) 57 | -------------------------------------------------------------------------------- /src/astr.F90: -------------------------------------------------------------------------------- 1 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2 | ! This Program is a DNS solver for compressible flow 3 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4 | ! re-mastered at 2021-02-06, by Fang Jian 5 | ! fangjian19@gmail.com 6 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 7 | program astr 8 | ! 9 | use parallel 10 | use readwrite 11 | use commarray 12 | use solver 13 | use initialisation 14 | use mainloop 15 | use gridgeneration 16 | use cmdefne 17 | use pp 18 | use geom 19 | use ibmethod 20 | use test 21 | use comsolver 22 | ! 23 | implicit none 24 | ! 25 | character(len=16) :: cmd 26 | ! 27 | call mpiinitial 28 | ! 29 | call statement 30 | ! 31 | call getcmd(cmd) 32 | ! 33 | call listcmd 34 | ! 35 | if(trim(cmd)=='pp') then 36 | ! 37 | ! do the pre/post-process 38 | ! 39 | call ppentrance 40 | ! 41 | elseif(trim(cmd)=='run') then 42 | ! 43 | ! computational loop 44 | ! 45 | call readinput 46 | ! 47 | call mpisizedis 48 | ! 49 | call parapp 50 | ! 51 | call parallelini 52 | ! 53 | call refcal 54 | ! 55 | call fileini 56 | ! 57 | call infodisp 58 | ! 59 | call allocommarray 60 | ! 61 | call ibprocess 62 | ! 63 | call gridgen 64 | ! 65 | call geomcal 66 | ! 67 | call spongelayerini 68 | ! 69 | call solvrinit 70 | ! 71 | call flowinit 72 | ! 73 | call codetest 74 | ! 75 | call steploop 76 | ! 77 | call mpistop 78 | ! 79 | else 80 | if(mpirank==0) print*,' ** all jobs done. **' 81 | stop 82 | endif 83 | ! 84 | end program astr 85 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 86 | ! End of the program main 87 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 88 | -------------------------------------------------------------------------------- /src/cmdefne.F90: -------------------------------------------------------------------------------- 1 | !+---------------------------------------------------------------------+ 2 | !| This module contains subroutine of getting command via interactive | 3 | !+---------------------------------------------------------------------+ 4 | !| ============== | 5 | !| CHANGE RECORD | 6 | !| ------------- | 7 | !| 28-05-2021 | Created by J. Fang @ Warrington | 8 | !+---------------------------------------------------------------------+ 9 | module cmdefne 10 | ! 11 | implicit none 12 | ! 13 | contains 14 | ! 15 | !+-------------------------------------------------------------------+ 16 | !| This subroutine is used to input command from keyboard. | 17 | !+-------------------------------------------------------------------+ 18 | !| CHANGE RECORD | 19 | !| ------------- | 20 | !| 11-02-2021 | Created by J. Fang @ Warrington | 21 | !| 28-05-2021 | Moved to the module command by J. Fang @ Warrington | 22 | !+-------------------------------------------------------------------+ 23 | subroutine readkeyboad(keyin) 24 | ! 25 | character(len=*),intent(out),optional :: keyin 26 | ! 27 | ! local data 28 | integer :: ierr,cli_len,nlen,arg_count 29 | integer,save :: nkey=0 30 | ! 31 | nkey=nkey+1 32 | call get_command_argument(nkey,keyin,cli_len,ierr) 33 | ! 34 | end subroutine readkeyboad 35 | !+-------------------------------------------------------------------+ 36 | !| The end of the subroutine readkeyboad. | 37 | !+-------------------------------------------------------------------+ 38 | ! 39 | !+-------------------------------------------------------------------+ 40 | !| This subroutine is used to get command from the main program. | 41 | !+-------------------------------------------------------------------+ 42 | !| CHANGE RECORD | 43 | !| ------------- | 44 | !| 28-05-2021 | Created by J. Fang @ Warrington | 45 | !+-------------------------------------------------------------------+ 46 | subroutine getcmd(cmd,casename) 47 | ! 48 | use parallel, only: mpistop,mpirank,bcast 49 | ! 50 | character(len=*),intent(out) :: cmd 51 | character(len=*),intent(out),optional :: casename 52 | ! 53 | cmd='run' 54 | ! default value 55 | ! 56 | if(mpirank==0) then 57 | ! 58 | call readkeyboad(cmd) 59 | ! 60 | if(cmd=='list' .or. cmd=='help') then 61 | call listcmd 62 | endif 63 | ! 64 | print*,' ** input command: ',cmd 65 | ! 66 | endif 67 | ! 68 | call bcast(cmd) 69 | ! 70 | end subroutine getcmd 71 | !+-------------------------------------------------------------------+ 72 | !| The end of the subroutine getcmd. | 73 | !+-------------------------------------------------------------------+ 74 | ! 75 | !+-------------------------------------------------------------------+ 76 | !| This subroutine is to list all command that is predefined. | 77 | !+-------------------------------------------------------------------+ 78 | !| CHANGE RECORD | 79 | !| ------------- | 80 | !| 28-05-2021 | Created by J. Fang @ Warrington | 81 | !+-------------------------------------------------------------------+ 82 | subroutine listcmd 83 | ! 84 | use parallel, only: mpirank 85 | ! 86 | if(mpirank==0) then 87 | ! 88 | write(*,*)' +------------------------------------------------------------+' 89 | write(*,*)' | command line |' 90 | write(*,*)' +----------------+-------------------------------------------+' 91 | write(*,*)' | command | |' 92 | write(*,*)' +----------------+-------------------------------------------+' 93 | write(*,*)' | list / help | to list all functionalities |' 94 | write(*,*)' +----------------+-------------------------------------------+' 95 | write(*,*)' | run | to run a computation |' 96 | write(*,*)' | | inputfile |' 97 | write(*,*)' +----------------+-------------------------------------------+' 98 | write(*,*)' | pp | pre/post-process |' 99 | write(*,*)' | | init casename generate a example case |' 100 | write(*,*)' +----------------+-------------------------------------------+' 101 | ! 102 | endif 103 | ! 104 | end subroutine listcmd 105 | !+-------------------------------------------------------------------+ 106 | !| The end of the subroutine listcmd. | 107 | !+-------------------------------------------------------------------+ 108 | ! 109 | end module cmdefne 110 | !+---------------------------------------------------------------------+ 111 | !| The end of the module cmdefne | 112 | !+---------------------------------------------------------------------+ -------------------------------------------------------------------------------- /src/commarray.F90: -------------------------------------------------------------------------------- 1 | !+---------------------------------------------------------------------+ 2 | !| This module is to define common array. | 3 | !+---------------------------------------------------------------------+ 4 | !| CHANGE RECORD | 5 | !| ------------- | 6 | !| 06-02-2021 | Created by J. Fang | 7 | !+---------------------------------------------------------------------+ 8 | module commarray 9 | ! 10 | use commtype, only : nodcel 11 | ! 12 | implicit none 13 | ! 14 | real(8),allocatable,dimension(:,:,:,:) :: x,q,qrhs,vel,spc,dtmp, & 15 | dgrid,vor 16 | real(8),allocatable,dimension(:,:,:) :: jacob,rho,prs,tmp 17 | real(8),allocatable,dimension(:,:,:,:,:) :: dxi,dvel,dspc 18 | real(8),allocatable,dimension(:,:,:) :: bnorm_i0,bnorm_im,bnorm_j0, & 19 | bnorm_jm,bnorm_k0,bnorm_km 20 | real(8),allocatable,dimension(:,:,:) :: dis2wall 21 | integer,allocatable,dimension(:,:,:) :: nodestat 22 | logical,allocatable,dimension(:,:,:) :: lsolid,lshock,crinod 23 | type(nodcel),allocatable,dimension(:,:,:) :: cell 24 | ! 25 | real(8),allocatable,dimension(:,:,:) :: sponge_damp_coef_i0,sponge_damp_coef_im, & 26 | sponge_damp_coef_j0,sponge_damp_coef_jm, & 27 | sponge_damp_coef_k0,sponge_damp_coef_km, & 28 | sponge_damp_coef 29 | ! 30 | real(8),allocatable,dimension(:,:,:) :: tke,omg,miut,res12,ssf 31 | real(8),allocatable,dimension(:,:,:,:) :: dtke,domg 32 | ! 33 | !+---------------------+---------------------------------------------+ 34 | !| x | coordinates. | 35 | !| jacob | geometrical Jacobian. | 36 | !| dxi | geometrical transform matrix | 37 | !| q | indepedent conservation variables. | 38 | !| qrhs | R.H.S of equations. | 39 | !| rho | density. | 40 | !| prs | pressure. | 41 | !| tmp | temperature. | 42 | !| vel | velocity. | 43 | !| spc | species. | 44 | !| lenspg_* | length of sponge layer | 45 | !| xspg_* | starting x,y,z of sponge layer | 46 | !| nodestat | node status: fluid or solid | 47 | !| bnorm_* | the vector of boundary normal direction, | 48 | !| | towards the inside of the domain | 49 | !+---------------------+---------------------------------------------+ 50 | real(8),allocatable :: acctest_ref(:) 51 | ! 52 | contains 53 | ! 54 | !+-------------------------------------------------------------------+ 55 | !| This subroutine is used to allocate common array. | 56 | !+-------------------------------------------------------------------+ 57 | !| CHANGE RECORD | 58 | !| ------------- | 59 | !| 07-02-2021 | Created by J. Fang STFC Daresbury Laboratory | 60 | !+-------------------------------------------------------------------+ 61 | subroutine allocommarray 62 | ! 63 | use commvar, only : im,jm,km,hm,numq,num_species,ndims,turbmode 64 | ! 65 | ! local data 66 | integer :: lallo 67 | ! 68 | allocate( x(-hm:im+hm,-hm:jm+hm,-hm:km+hm,1:3),stat=lallo) 69 | if(lallo.ne.0) stop ' !! error at allocating x' 70 | ! 71 | allocate( nodestat(-hm:im+hm,-hm:jm+hm,-hm:km+hm),stat=lallo) 72 | if(lallo.ne.0) stop ' !! error at allocating nodestat' 73 | ! 74 | allocate( q(-hm:im+hm,-hm:jm+hm,-hm:km+hm,1:numq),stat=lallo) 75 | if(lallo.ne.0) stop ' !! error at allocating q' 76 | ! 77 | allocate( rho(-hm:im+hm,-hm:jm+hm,-hm:km+hm),stat=lallo) 78 | if(lallo.ne.0) stop ' !! error at allocating rho' 79 | ! 80 | allocate( prs(-hm:im+hm,-hm:jm+hm,-hm:km+hm),stat=lallo) 81 | if(lallo.ne.0) stop ' !! error at allocating prs' 82 | ! 83 | allocate( tmp(-hm:im+hm,-hm:jm+hm,-hm:km+hm),stat=lallo) 84 | if(lallo.ne.0) stop ' !! error at allocating tmp' 85 | ! 86 | allocate( vel(-hm:im+hm,-hm:jm+hm,-hm:km+hm,1:3),stat=lallo) 87 | if(lallo.ne.0) stop ' !! error at allocating vel' 88 | ! 89 | allocate( spc(-hm:im+hm,-hm:jm+hm,-hm:km+hm,1:num_species),stat=lallo) 90 | if(lallo.ne.0) stop ' !! error at allocating spc' 91 | ! 92 | allocate(qrhs(0:im,0:jm,0:km,1:numq),stat=lallo) 93 | if(lallo.ne.0) stop ' !! error at allocating qrhs' 94 | ! 95 | allocate(dvel(0:im,0:jm,0:km,1:3,1:3),stat=lallo) 96 | if(lallo.ne.0) stop ' !! error at allocating dvel' 97 | ! 98 | allocate(dspc(0:im,0:jm,0:km,1:num_species,1:3),stat=lallo) 99 | if(lallo.ne.0) stop ' !! error at allocating dvel' 100 | ! 101 | allocate(dtmp(0:im,0:jm,0:km,1:3),stat=lallo) 102 | if(lallo.ne.0) stop ' !! error at allocating dvel' 103 | ! 104 | allocate(vor(0:im,0:jm,0:km,1:3),stat=lallo) 105 | if(lallo.ne.0) stop ' !! error at allocating vor' 106 | ! 107 | allocate(lsolid(-hm:im+hm,-hm:jm+hm,-hm:km+hm),stat=lallo) 108 | if(lallo.ne.0) stop ' !! error at allocating lsolid' 109 | ! 110 | allocate(crinod(0:im,0:jm,0:km),stat=lallo) 111 | if(lallo.ne.0) stop ' !! error at allocating crinod' 112 | ! 113 | end subroutine allocommarray 114 | !+-------------------------------------------------------------------+ 115 | !| The end of the subroutine allocommarray. | 116 | !+-------------------------------------------------------------------+ 117 | ! 118 | end module commarray 119 | !+---------------------------------------------------------------------+ 120 | !| The end of the module commarray. | 121 | !+---------------------------------------------------------------------+ -------------------------------------------------------------------------------- /src/commtype.F90: -------------------------------------------------------------------------------- 1 | !+---------------------------------------------------------------------+ 2 | !| The module declares new types. | 3 | !+---------------------------------------------------------------------+ 4 | !| ============== | 5 | !| CHANGE RECORD | 6 | !| ------------- | 7 | !| 02-Jul-2021 | Created by J. Fang STFC | 8 | !+---------------------------------------------------------------------+ 9 | module commtype 10 | ! 11 | implicit none 12 | ! 13 | type :: triangle 14 | real(8) :: a(3),b(3),c(3),normdir(3),area,cen(3) 15 | !+-------------------+---------------------------------------------+ 16 | !| a,b,c | coordinates of the 3 vertex of the triangle.| 17 | !| normdir | normal direction of the face. | 18 | !| area | area of of the triangle. | 19 | !+-------------------+---------------------------------------------+ 20 | end type triangle 21 | ! 22 | type :: lsegment 23 | real(8) :: a(2),b(2),normdir(2),length,cen(2) 24 | !+-------------------+---------------------------------------------+ 25 | !| a,b,c | coordinates of the 3 vertex of the triangle.| 26 | !| normdir | normal direction of the face. | 27 | !| area | area of of the triangle. | 28 | !+-------------------+---------------------------------------------+ 29 | end type lsegment 30 | ! 31 | type :: solid 32 | ! 33 | character(len=32) :: name 34 | real(8) :: xmin(3),xmax(3),xref(3),xcen(3) 35 | integer :: num_face,num_edge 36 | type(triangle),allocatable :: face(:) 37 | type(lsegment),allocatable :: edge(:) 38 | ! 39 | contains 40 | ! 41 | procedure :: alloface 42 | procedure :: alloedge 43 | ! 44 | end type solid 45 | ! 46 | type :: sboun 47 | ! 48 | character(len=1) :: nodetype 49 | ! 50 | real(8) :: x(3),normdir(3),ximag(3) 51 | real(8) :: dis_imga_inmg,dis2image,dis2ghost 52 | real(8),allocatable :: qimag(:),q(:) 53 | integer :: igh(3),inmg(3) 54 | integer :: icell(3),icell_bnode(8),icell_ijk(8,3) 55 | integer,allocatable :: isup(:,:) 56 | real(8),allocatable :: weig(:) 57 | real(8),allocatable :: coef_dirichlet(:),coef_neumann(:),invmatrx(:,:) 58 | ! 59 | logical :: localin,cellin 60 | integer :: icell_rank,ighst_rank 61 | integer,allocatable :: ighst_rank_all(:) 62 | ! 63 | character(len=1) :: locality 64 | ! 65 | !+-------------------+---------------------------------------------+ 66 | !| igh | i,j,k of the ghost point | 67 | !| inmg | i,j,k that closest to the image point | 68 | !| isup | i,j,k that supports the image point | 69 | !| weig | wright from supporting node to image node | 70 | !| | based on the distance. | 71 | !| normdir | normal direction of the face. | 72 | !| ximag | coordinate of the boundary nodes. | 73 | !| localin | is the boundary node local in. | 74 | !+-------------------+---------------------------------------------+ 75 | contains 76 | ! 77 | end type sboun 78 | ! 79 | type :: nodcel 80 | real(8),allocatable :: x(:,:) 81 | real(8) :: xmax(3),xmin(3) 82 | real(8) :: vol 83 | character(len=1) :: celltype 84 | end type nodcel 85 | !! 86 | !+---------------------+---------------------------------------------+ 87 | !| solidbody | a type of describing immersed solid body | 88 | !| triangle | a type of describing a triangle | 89 | !| sboun | a boundary at the solid. | 90 | !| cell | a cell formed with nodes. | 91 | !+---------------------+---------------------------------------------+ 92 | ! 93 | type :: varray 94 | ! 95 | integer,allocatable :: vint(:) 96 | ! 97 | end type varray 98 | ! 99 | contains 100 | ! 101 | !+-------------------------------------------------------------------+ 102 | !| This subroutine initialise faces of a solid. | 103 | !+-------------------------------------------------------------------+ 104 | !| CHANGE RECORD | 105 | !| ------------- | 106 | !| 02-Jul-2021 | Created by J. Fang STFC | 107 | !+-------------------------------------------------------------------+ 108 | subroutine alloface(asolid) 109 | ! 110 | class(solid),target :: asolid 111 | ! 112 | allocate(asolid%face(asolid%num_face)) 113 | ! 114 | end subroutine alloface 115 | !+-------------------------------------------------------------------+ 116 | !| The end of the subroutine alloface | 117 | !+-------------------------------------------------------------------+ 118 | ! 119 | !+-------------------------------------------------------------------+ 120 | !| This subroutine initialise edges of a solid. | 121 | !+-------------------------------------------------------------------+ 122 | !| CHANGE RECORD | 123 | !| ------------- | 124 | !| 07-Jul-2021 | Created by J. Fang STFC | 125 | !+-------------------------------------------------------------------+ 126 | subroutine alloedge(asolid) 127 | ! 128 | class(solid),target :: asolid 129 | ! 130 | allocate(asolid%edge(asolid%num_edge)) 131 | ! 132 | end subroutine alloedge 133 | !+-------------------------------------------------------------------+ 134 | !| The end of the subroutine alloedge | 135 | !+-------------------------------------------------------------------+ 136 | ! 137 | end module commtype 138 | !+---------------------------------------------------------------------+ 139 | !| The end of the module commtype. | 140 | !+---------------------------------------------------------------------+ 141 | -------------------------------------------------------------------------------- /src/constdef.F90: -------------------------------------------------------------------------------- 1 | !+---------------------------------------------------------------------+ 2 | !| This module is to define constants. | 3 | !+---------------------------------------------------------------------+ 4 | !| CHANGE RECORD | 5 | !| ------------- | 6 | !| 06-02-2021 | Created by J. Fang | 7 | !+---------------------------------------------------------------------+ 8 | module constdef 9 | ! 10 | implicit none 11 | ! 12 | real(8),parameter :: pi=4.d0*atan(1.0_8), & 13 | num1d35 =1.d0/35.d0, num1d3 =1.d0/3.d0, & 14 | num2d3 =2.d0/3.d0, num1d24 =1.d0/24.d0, & 15 | num4d3 =4.d0/3.d0, num1d6 =1.d0/6.d0, & 16 | num1d12 =1.d0/12.d0, num7d12 =7.d0/12.d0, & 17 | num7d9 =7.d0/9.d0, num1d36 =1.d0/36.d0, & 18 | num1d60 =1.d0/60.d0, num65d3 =65.d0/3.d0, & 19 | num20d3 =20.d0/3.d0, num1d11 =1.d0/11.d0, & 20 | num25d12=25.d0/12.d0, num11d6 =11.d0/6.d0, & 21 | num1d840=1.d0/840.d0, num13d60=13.d0/60.d0, & 22 | num1d30 =1.d0/30.d0, num47d60=47.d0/60.d0, & 23 | num5d6 =5.d0/6.d0, num1d18 =1.d0/18.d0, & 24 | num19d18=19.d0/18.d0, num5d9 =5.d0/9.d0, & 25 | num9d36 =9.d0/36.d0 26 | !+-------------------------------------------------------------------+ 27 | !| constants. | 28 | !+-------------------------------------------------------------------+ 29 | ! 30 | end module constdef 31 | !+---------------------------------------------------------------------+ 32 | !| The end of the module constdef. | 33 | !+---------------------------------------------------------------------+ -------------------------------------------------------------------------------- /src/fdnn.F90: -------------------------------------------------------------------------------- 1 | 2 | module fdnn 3 | integer, dimension(5) :: n_layer=(/9, 1600, 800, 400, 9/) 4 | integer::sample_num=1, epoch=5040, fileunit=20200 5 | integer, allocatable :: dnnidx(:,:,:) 6 | double precision:: delta_t=1e-6 7 | ! 标准化的均值与标准差 8 | double precision, allocatable :: Xmu(:,:), Xstd(:,:), & 9 | Ymu(:,:), Ystd(:,:) 10 | ! 输入输出与weight,bias 11 | double precision, allocatable :: w(:,:), b(:,:), & 12 | matrix(:, :), input(:, :), & 13 | output(:, :), inputholder(:, :) 14 | 15 | type:: dnn_layer_type 16 | double precision, allocatable :: w(:,:),b(:,:),x(:,:) 17 | end type 18 | type:: dnn_network_type 19 | type(dnn_layer_type), allocatable :: layer(:) 20 | end type 21 | type(dnn_network_type) :: dnn_h2 22 | 23 | contains 24 | 25 | subroutine readtxt(matrix,filename,fileunit,row,col) 26 | double precision,allocatable::matrix(:,:) 27 | character(len = 40) :: filename 28 | integer::row,col,i, fileunit 29 | filename = trim(filename) 30 | do i=1,row 31 | ! print*,'位置:',filename 32 | open(unit=fileunit,file=filename) 33 | read(fileunit,*) matrix(i,:) 34 | enddo 35 | close(fileunit) 36 | end subroutine readtxt 37 | 38 | subroutine readtxts() 39 | character(len = 40) :: filename 40 | ! 读入x、y均值和标准差 41 | write(filename, "(A12,I4,A8)") 'Models/model', epoch, '/Xmu.txt' 42 | call readtxt(Xmu,filename,fileunit,size(Xmu,1),size(Xmu,2)) 43 | write(filename, "(A12,I4,A9)") 'Models/model', epoch, '/Xstd.txt' 44 | call readtxt(Xstd,filename,fileunit,size(Xstd,1),size(Xstd,2)) 45 | write(filename, "(A12,I4,A8)") 'Models/model', epoch, '/Ymu.txt' 46 | call readtxt(Ymu,filename,fileunit,size(Ymu,1),size(Ymu,2)) 47 | write(filename, "(A12,I4,A9)") 'Models/model', epoch, '/Ystd.txt' 48 | call readtxt(Ystd,filename,fileunit,size(Ystd,1),size(Ystd,2)) 49 | ! 读入神经网络权重 50 | do j = 1, size(n_layer) - 1 51 | allocate(w(n_layer(j+1),n_layer(j))) 52 | write(filename, "(A12,I4,A4,I1,A11)") 'Models/model', & 53 | epoch, '/fc.',2*(j-1),'.weight.txt' 54 | call readtxt(w,filename,fileunit,size(w,1),size(w,2)) 55 | allocate(b(n_layer(j+1), 1)) 56 | write(filename, "(A12,I4,A4,I1,A9)") 'Models/model', & 57 | epoch, '/fc.',2*(j-1),'.bias.txt' 58 | call readtxt(b,filename,fileunit,size(b,1),size(b,2)) 59 | dnn_h2%layer(j)%w = w 60 | dnn_h2%layer(j)%b = b 61 | DEALLOCATE(w, b) 62 | enddo 63 | end subroutine readtxts 64 | 65 | subroutine initialization() 66 | ! allocate(input(n_layer(1),sample_num)) 67 | ! allocate(output(n_layer(size(n_layer)),sample_num)) 68 | allocate(Xmu(n_layer(1),1)) 69 | allocate(Xstd(n_layer(1),1)) 70 | allocate(Ymu(n_layer(size(n_layer)),1)) 71 | allocate(Ystd(n_layer(size(n_layer)),1)) 72 | allocate(dnn_h2%layer(size(n_layer))) 73 | do j = 1, size(n_layer) - 1 74 | allocate(dnn_h2%layer(j)%w(n_layer(j+1), n_layer(j))) 75 | allocate(dnn_h2%layer(j)%b(n_layer(j+1), 1)) 76 | ! allocate(dnn_h2%layer(j)%x(n_layer(j), sample_num)) 77 | enddo 78 | ! allocate(dnn_h2%layer(size(n_layer))% & 79 | ! x(n_layer(size(n_layer)), sample_num)) 80 | call readtxts() 81 | end subroutine initialization 82 | 83 | subroutine initialize_locell(im,jm,km) 84 | integer, intent(in) :: im,jm,km 85 | ! 86 | allocate(inputholder(n_layer(1),(im+1)*(jm+1)*(km+1))) 87 | allocate(dnnidx(0:im,0:jm,0:km)) 88 | do j=1,size(n_layer) 89 | if(.not.(allocated(dnn_h2%layer(j)%x))) & 90 | allocate(dnn_h2%layer(j)%x(n_layer(j),ncell)) 91 | enddo 92 | end subroutine initialize_locell 93 | 94 | ! subroutine finalize_locell 95 | ! deallocate(input,output) 96 | ! do j=1,size(n_layer) 97 | ! deallocate(dnn_h2%layer(j)%x) 98 | ! enddo 99 | ! end subroutine finalize_locell 100 | 101 | subroutine finalize() 102 | deallocate(xmu, xstd, ymu, ystd) 103 | DEALLOCATE(inputholder, dnnidx) 104 | do j = 1, size(n_layer) - 1 105 | deallocate(dnn_h2%layer(j)%w, dnn_h2%layer(j)%b) 106 | enddo 107 | do j = 1, size(n_layer) 108 | deallocate(dnn_h2%layer(j)%x) 109 | enddo 110 | deallocate(dnn_h2%layer) 111 | end subroutine finalize 112 | 113 | 114 | function netOneStep(input,epoch,n_layer,sample_num) 115 | integer,intent(in)::n_layer(5), sample_num, epoch 116 | double precision, allocatable:: input(:,:) 117 | double precision, allocatable:: input_normed(:,:),input_bct(:,:) 118 | double precision, allocatable:: output_normed(:,:) 119 | double precision, allocatable:: netOneStep(:,:) 120 | 121 | input_bct=input 122 | input_bct(3:,:) = BCT(input_bct(3:,:)) 123 | 124 | input_normed=(input_bct-spread(Xmu(:,1),2,size(input,2))) & 125 | / spread(Xstd(:,1),2,size(input,2)) !标准化 126 | output_normed=netForward(input_normed,epoch,n_layer,sample_num) 127 | netOneStep = output_normed & 128 | * spread(Ystd(:,1),2,size(output_normed,2)) & 129 | + spread(Ymu(:,1),2,size(output_normed,2)) 130 | netOneStep = netOneStep*delta_t + input_bct !这里有问题 131 | netOneStep(3:,:)=IBCT(netOneStep(3:,:)) 132 | end function netOneStep 133 | 134 | 135 | function netForward(input,epoch,n_layer,sample_num) 136 | integer,intent(in)::n_layer(5),sample_num,epoch 137 | double precision, allocatable:: input(:,:),netForward(:,:) 138 | double precision, allocatable:: w(:,:), b(:,:), tmp(:, :) 139 | !network forward oneStep 140 | ! DNN矩阵运算部分 141 | dnn_h2%layer(1)%x = input 142 | do j=1,size(n_layer)-1 143 | dnn_h2%layer(j+1)%x = & 144 | matmul(dnn_h2%layer(j)%w, dnn_h2%layer(j)%x) + & 145 | spread(dnn_h2%layer(j)%b(:,1),2, sample_num) 146 | if (j.lt.size(n_layer)-1) then 147 | dnn_h2%layer(j+1)%x = GELU(dnn_h2%layer(j+1)%x) 148 | end if 149 | end do 150 | netForward=dnn_h2%layer(size(n_layer))%x 151 | end function netForward 152 | 153 | 154 | ! subroutine saveOutput(result,sample_num) 155 | ! double precision, allocatable::result(:,:) 156 | ! integer::sample_num, fileunit=20200 157 | ! open(unit=fileunit, file='output.txt' ,position='append') 158 | ! do k=1,sample_num 159 | ! write(fileunit,'(9e24.16)') result(:,k) 160 | ! end do 161 | ! close(fileunit) 162 | ! end subroutine saveOutput 163 | 164 | 165 | pure function GELU(x) result(res) 166 | ! Gaussian activation function. 167 | double precision, intent(in) :: x(:,:) 168 | double precision :: res(size(x,1),size(x,2)) 169 | double precision,parameter::Pi=3.141592653600000 170 | res = 0.5*x*(1+tanh(sqrt(2/Pi)*(x+0.044715*x**3))) 171 | end function GELU 172 | 173 | 174 | pure function BCT(x) result(res) 175 | ! Box-Cox Transformation 176 | double precision, intent(in) :: x(:,:) 177 | double precision :: res(size(x,1),size(x,2)) 178 | double precision,parameter::lambda=0.1 179 | res = (x**lambda-1)/lambda 180 | end function BCT 181 | 182 | 183 | pure function IBCT(x) result(res) 184 | ! Inverse Box-Cox Transformation 185 | double precision, intent(in) :: x(:,:) 186 | double precision :: res(size(x,1),size(x,2)) 187 | double precision,parameter::lambda=0.1 188 | res = (lambda*x+1)**(1/lambda) 189 | end function IBCT 190 | end module fdnn 191 | -------------------------------------------------------------------------------- /src/interp.F90: -------------------------------------------------------------------------------- 1 | !+---------------------------------------------------------------------+ 2 | !| This module contains subroutines to do interpolation. | 3 | !| ============== | 4 | !| CHANGE RECORD | 5 | !| ------------- | 6 | !| 22-Jul-2022 | Created by J. Fang @ Warrington | 7 | !+---------------------------------------------------------------------+ 8 | module interp 9 | ! 10 | implicit none 11 | ! 12 | interface interlinear 13 | module procedure linear1d_s 14 | module procedure linear1d_a1 15 | module procedure linear1d_a2 16 | module procedure linear1d_arrayin 17 | end interface interlinear 18 | ! 19 | contains 20 | ! 21 | !+-------------------------------------------------------------------+ 22 | !| This function is a linear interpolation function. | 23 | !+-------------------------------------------------------------------+ 24 | function linear1d_s(xx1,xx2,yy1,yy2,xx) result(yy) 25 | ! 26 | real(8),intent(in) :: xx1,xx2,yy1,yy2,xx 27 | real(8) :: yy 28 | ! 29 | real(8) :: var1 30 | ! 31 | var1=(yy2-yy1)/(xx2-xx1) 32 | yy=var1*(xx-xx1)+yy1 33 | ! 34 | return 35 | ! 36 | end function linear1d_s 37 | ! 38 | function linear1d_a1(xx1,xx2,yy1,yy2,xx) result(yy) 39 | ! 40 | real(8),intent(in) :: xx1,xx2,xx 41 | real(8),intent(in) :: yy1(:),yy2(:) 42 | real(8) :: yy(1:size(yy1)) 43 | ! 44 | real(8) :: var1 45 | ! 46 | var1=(xx-xx1)/(xx2-xx1) 47 | yy=(yy2-yy1)*var1+yy1 48 | ! 49 | return 50 | ! 51 | end function linear1d_a1 52 | ! 53 | function linear1d_a2(xx1,xx2,yy1,yy2,xx) result(yy) 54 | ! 55 | real(8),intent(in) :: xx1,xx2,xx 56 | real(8),intent(in) :: yy1(:,:),yy2(:,:) 57 | real(8) :: yy(1:size(yy1,1),1:size(yy1,2)) 58 | ! 59 | real(8) :: var1 60 | ! 61 | var1=(xx-xx1)/(xx2-xx1) 62 | yy=(yy2-yy1)*var1+yy1 63 | ! 64 | return 65 | ! 66 | end function linear1d_a2 67 | ! 68 | function linear1d_arrayin(x1,y1,xx) result(yy) 69 | ! 70 | real(8),intent(in) :: x1(:),y1(:),xx 71 | real(8) :: yy 72 | ! 73 | integer :: dim,i 74 | ! 75 | dim=size(x1) 76 | ! 77 | if(xx=x1(dim)) then 81 | ! yy=linear1d_s(x1(dim-1),x1(dim),y1(dim-1),y1(dim),xx) 82 | yy=2.d0*y1(dim)-y1(dim-1) 83 | else 84 | do i=2,dim 85 | if(xx>=x1(i-1) .and. xx=1.d0) then 88 | fplus(i,1)=jacob(i)* q(i,1)*uu 89 | fplus(i,2)=jacob(i)*( q(i,2)*uu+dxi(i,1)*prs(i) ) 90 | fplus(i,3)=jacob(i)*( q(i,3)*uu+dxi(i,2)*prs(i) ) 91 | fplus(i,4)=jacob(i)*( q(i,4)*uu+dxi(i,3)*prs(i) ) 92 | fplus(i,5)=jacob(i)*( q(i,5)+prs(i) )*uu 93 | ! 94 | fmius(i,1)=0.d0 95 | fmius(i,2)=0.d0 96 | fmius(i,3)=0.d0 97 | fmius(i,4)=0.d0 98 | fmius(i,5)=0.d0 99 | ! 100 | if(numq>5) then 101 | fplus(i,6:numq)=jacob(i)*q(i,6:numq)*uu 102 | fmius(i,6:numq)=0.d0 103 | endif 104 | ! 105 | elseif(lmach<=-1.d0) then 106 | fplus(i,1)=0.d0 107 | fplus(i,2)=0.d0 108 | fplus(i,3)=0.d0 109 | fplus(i,4)=0.d0 110 | fplus(i,5)=0.d0 111 | ! 112 | fmius(i,1)=jacob(i)* q(i,1)*uu 113 | fmius(i,2)=jacob(i)*( q(i,2)*uu+dxi(i,1)*prs(i) ) 114 | fmius(i,3)=jacob(i)*( q(i,3)*uu+dxi(i,2)*prs(i) ) 115 | fmius(i,4)=jacob(i)*( q(i,4)*uu+dxi(i,3)*prs(i) ) 116 | fmius(i,5)=jacob(i)*( q(i,5)+prs(i) )*uu 117 | ! 118 | if(numq>5) then 119 | fplus(i,6:numq)=0.d0 120 | fmius(i,6:numq)=jacob(i)*q(i,6:numq)*uu 121 | endif 122 | ! 123 | else 124 | ! 125 | fhi=0.5d0*(gamma-1.d0)*(vel(i,1)**2+vel(i,2)**2+vel(i,3)**2) 126 | ! 127 | var1=lmdap(1) 128 | var2=lmdap(4)-lmdap(5) 129 | var3=2.d0*lmdap(1)-lmdap(4)-lmdap(5) 130 | var4=var1-var3*gm2 131 | ! 132 | jro=jacob(i)*rho(i) 133 | ! 134 | fplus(i,1)=jro*var4 135 | fplus(i,2)=jro*(var4*vel(i,1)+var2*css*gpd(1)*gm2) 136 | fplus(i,3)=jro*(var4*vel(i,2)+var2*css*gpd(2)*gm2) 137 | fplus(i,4)=jro*(var4*vel(i,3)+var2*css*gpd(3)*gm2) 138 | fplus(i,5)=jacob(i)*(var1*q(i,5)+rho(i)*(var2*uu*var0*css*gm2-var3*(fhi+css**2)*gm2/(gamma-1.d0))) 139 | ! 140 | if(numq>5) then 141 | fplus(i,6:numq)=jacob(i)*q(i,6:numq)*var4 142 | endif 143 | ! 144 | var1=lmdam(1) 145 | var2=lmdam(4)-lmdam(5) 146 | var3=2.d0*lmdam(1)-lmdam(4)-lmdam(5) 147 | var4=var1-var3*gm2 148 | ! 149 | fmius(i,1)=jro*var4 150 | fmius(i,2)=jro*(var4*vel(i,1)+var2*css*gpd(1)*gm2) 151 | fmius(i,3)=jro*(var4*vel(i,2)+var2*css*gpd(2)*gm2) 152 | fmius(i,4)=jro*(var4*vel(i,3)+var2*css*gpd(3)*gm2) 153 | fmius(i,5)=jacob(i)*(var1*q(i,5)+rho(i)*(var2*uu*var0*css*gm2-var3*(fhi+css**2)*gm2/(gamma-1.d0))) 154 | ! 155 | if(numq>5) then 156 | fmius(i,6:numq)=jacob(i)*q(i,6:numq)*var4 157 | endif 158 | ! 159 | ! 160 | end if 161 | enddo 162 | ! 163 | return 164 | ! 165 | end subroutine flux_steger_warming 166 | !+-------------------------------------------------------------------+ 167 | !| The end of the subroutine flux_steger_warming. | 168 | !+-------------------------------------------------------------------+ 169 | !! 170 | ! 171 | end module riemann -------------------------------------------------------------------------------- /user_define_module/udf_pp.F90: -------------------------------------------------------------------------------- 1 | module udf_postprocess 2 | ! 3 | implicit none 4 | ! 5 | contains 6 | ! 7 | subroutine flame2d_pp(inputfile) 8 | ! 9 | use cmdefne 10 | use hdf5io 11 | use tecio 12 | use WriteVTK 13 | use commvar, only: num_species 14 | ! 15 | #ifdef COMB 16 | use cantera 17 | use thermchem,only: chemrep,chemread,thermdyn,heatrate 18 | ! 19 | type(phase_t) :: mixture 20 | ! 21 | #endif 22 | ! 23 | character(len=*),intent(in) :: inputfile 24 | ! 25 | ! local data 26 | integer :: nfirst,nlast,n,im,jm,km,jsp,i,j 27 | logical :: lihomo,ljhomo,lkhomo 28 | real(8) :: ref_tem,reynolds,mach,qdotmax 29 | character(len=32) :: gridfile,chemfile 30 | ! 31 | real(8),allocatable,dimension(:,:) :: x_2d,y_2d,z_2d,ro_2d,u_2d, & 32 | v_2d,w_2d,p_2d,t_2d 33 | real(8),allocatable,dimension(:,:,:) :: spec 34 | real(8),allocatable,dimension(:,:) :: vtmp,qdot 35 | ! 36 | character(len=4) :: stepname 37 | character(len=5) :: cnmuber1,cnmuber2 38 | character(len=3) :: spname 39 | character(len=10),allocatable :: spcsym(:) 40 | character(len=10) :: phase_id 41 | character(len=128) :: filename,tecname 42 | ! 43 | call readkeyboad(cnmuber1) 44 | call readkeyboad(cnmuber2) 45 | ! 46 | read(cnmuber1,*)nfirst 47 | read(cnmuber2,*)nlast 48 | ! 49 | print*,' ==========================readinput==========================' 50 | ! 51 | open(11,file=inputfile,form='formatted',status='old') 52 | read(11,'(///////)') 53 | read(11,*)im,jm,km 54 | read(11,"(/)") 55 | read(11,*)lihomo,ljhomo,lkhomo 56 | read(11,'(//////////)') 57 | read(11,*)ref_tem,reynolds,mach 58 | read(11,'(///////)') 59 | read(11,*)num_species 60 | read(11,'(//////////////////)') 61 | read(11,'(A)')gridfile 62 | #ifdef COMB 63 | read(11,"(/)") 64 | read(11,'(A)')chemfile 65 | #endif 66 | close(11) 67 | print*,' >> ',inputfile 68 | ! 69 | print*,' ** grid file: ',trim(gridfile) 70 | ! 71 | allocate(x_2d(0:im,0:jm),y_2d(0:im,0:jm)) 72 | call H5ReadSubset(x_2d,im,jm,km,'x',gridfile,kslice=0) 73 | call H5ReadSubset(y_2d,im,jm,km,'y',gridfile,kslice=0) 74 | ! 75 | #ifdef COMB 76 | call chemread(trim(chemfile)) 77 | call thermdyn 78 | print*,' ** num_species: ',num_species 79 | ! 80 | phase_id='gas' 81 | !---CANTERA--- 82 | mixture=importPhase(trim(chemfile),trim(phase_id)) 83 | ! 84 | allocate(spcsym(num_species)) 85 | ! 86 | write(*,'(2X,A12)')'------------' 87 | write(*,'(2X,A12)')' chemistry' 88 | write(*,'(2X,A12)')'----+-------' 89 | do jsp=1,num_species 90 | 91 | call getSpeciesName(mixture,jsp,spcsym(jsp)) 92 | 93 | write(*,'(2X,I3,A3,A5)')jsp,' | ',spcsym(jsp) 94 | enddo 95 | write(*,'(2X,A12)')'----+-------' 96 | ! 97 | ! 98 | #endif 99 | ! 100 | allocate(ro_2d(0:im,0:jm),u_2d(0:im,0:jm), v_2d(0:im,0:jm), & 101 | w_2d(0:im,0:jm),p_2d(0:im,0:jm), t_2d(0:im,0:jm) ) 102 | ! 103 | if(num_species>0) then 104 | 105 | allocate(spec(0:im,0:jm,1:num_species) ) 106 | allocate(vtmp(0:im,0:jm),qdot(0:im,0:jm) ) 107 | endif 108 | ! 109 | do n=nfirst,nlast 110 | ! 111 | write(stepname,'(i4.4)')n 112 | filename='outdat/flowfield'//stepname//'.h5' 113 | ! 114 | ! 115 | call h5_read2dfrom3d(ro_2d,im,jm,km,'ro',trim(filename),kslice=0) 116 | call h5_read2dfrom3d( u_2d,im,jm,km,'u1',trim(filename),kslice=0) 117 | call h5_read2dfrom3d( v_2d,im,jm,km,'u2',trim(filename),kslice=0) 118 | call h5_read2dfrom3d( p_2d,im,jm,km, 'p',trim(filename),kslice=0) 119 | call h5_read2dfrom3d( t_2d,im,jm,km, 't',trim(filename),kslice=0) 120 | ! 121 | tecname='Results/tecflow'//stepname//'.plt' 122 | ! 123 | do jsp=1,num_species 124 | write(spname,'(i3.3)') jsp 125 | call h5_read2dfrom3d(vtmp,im,jm,km, 'sp'//spname,trim(filename),kslice=0) 126 | spec(:,:,jsp)=vtmp 127 | enddo 128 | ! 129 | #ifdef COMB 130 | qdotmax=0.d0 131 | do j=0,jm 132 | do i=0,im 133 | qdot(i,j)=heatrate(ro_2d(i,j),t_2d(i,j),spec(i,j,:)) 134 | ! 135 | if(qdot(i,j)>qdotmax)qdotmax=qdot(i,j) 136 | enddo 137 | enddo 138 | ! 139 | print*,' ** qdotmax=',qdotmax 140 | #endif 141 | ! 142 | call tecbin(trim(tecname),x_2d,'x',y_2d,'y',ro_2d,'ro', & 143 | u_2d,'u', & 144 | v_2d,'v', & 145 | p_2d,'p', & 146 | t_2d,'t', & 147 | spec(:,:,1),spcsym(1), & 148 | spec(:,:,2),spcsym(2), & 149 | spec(:,:,5),spcsym(5), & 150 | qdot,'HRR') 151 | enddo 152 | 153 | ! ! call writeprvbin(outputfile,x_2d,'x',y_2d,'y',ro_2d,'ro',u_2d,'u', & 154 | ! ! v_2d,'v',p_2d,'p',t_2d,'t',im,jm) 155 | ! call tecbin(outputfile,x_2d,'x',y_2d,'y',ro_2d,'ro',u_2d,'u', & 156 | ! v_2d,'v',p_2d,'p',t_2d,'t') 157 | ! elseif(viewmode=='3d') then 158 | ! allocate(x(0:im,0:jm,0:km),y(0:im,0:jm,0:km),z(0:im,0:jm,0:km)) 159 | ! elseif(viewmode=='1d') then 160 | ! ! 161 | ! allocate(x_1d(0:im),ro_1d(0:im),u_1d(0:im),p_1d(0:im),t_1d(0:im)) 162 | ! ! 163 | ! call H5ReadSubset( x_1d,im,jm,km, 'x',gridfile,jslice=jm/2-1,kslice=-1) 164 | ! ! 165 | ! call H5ReadSubset(ro_1d,im,jm,km,'ro',flowfile,jslice=jm/2-1,kslice=-1) 166 | ! call H5ReadSubset( u_1d,im,jm,km,'u1',flowfile,jslice=jm/2-1,kslice=-1) 167 | ! call H5ReadSubset( p_1d,im,jm,km, 'p',flowfile,jslice=jm/2-1,kslice=-1) 168 | ! call H5ReadSubset( t_1d,im,jm,km, 't',flowfile,jslice=jm/2-1,kslice=-1) 169 | ! ! 170 | ! allocate(spc_1d(0:im,1:num_species)) 171 | ! allocate(var1d(0:im)) 172 | ! do jsp=1,num_species 173 | ! write(spname,'(i3.3)')jsp 174 | ! call H5ReadSubset(var1d,im,jm,km,'sp'//spname,flowfile,jslice=jm/2-1,kslice=-1) 175 | ! spc_1d(:,jsp)=var1d 176 | ! enddo 177 | ! ! 178 | ! open(18,file=outputfile) 179 | ! write(18,"(8(1X,A15))")'x','ro','u','p','t','Y1','Y2','Y3' 180 | ! write(18,"(8(1X,E15.7E3))")(x_1d(i),ro_1d(i),u_1d(i),p_1d(i), & 181 | ! t_1d(i),spc_1d(i,1),spc_1d(i,2),spc_1d(i,3),i=0,im) 182 | ! close(18) 183 | ! print*,' << ',outputfile 184 | ! ! 185 | ! call h5srite(var=ro_1d,varname='ro',filename='flowini1d.h5',explicit=.true.,newfile=.true.) 186 | ! call h5srite(var= u_1d,varname='u1',filename='flowini1d.h5',explicit=.true.,newfile=.false.) 187 | ! call h5srite(var=t_1d, varname= 't',filename='flowini1d.h5',explicit=.true.,newfile=.false.) 188 | ! call h5srite(var=p_1d, varname= 'p',filename='flowini1d.h5',explicit=.true.,newfile=.false.) 189 | ! ! 190 | ! do jsp=1,num_species 191 | ! write(spname,'(i3.3)')jsp 192 | ! call h5srite(var=spc_1d(:,jsp),varname='sp'//spname,filename='flowini1d.h5',explicit=.true.,newfile=.false.) 193 | ! enddo 194 | ! else 195 | ! print*,viewmode 196 | ! stop ' !! mode is not defined @ fieldview' 197 | ! endif 198 | ! 199 | end subroutine flame2d_pp 200 | ! 201 | end module udf_postprocess --------------------------------------------------------------------------------