Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mhd tune #6

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ add_subdirectory(src)

# Add tests
option(BUILD_TESTING "Build with test and use only TGV case" ON)
option(BUILD_TESTING_FULL "Build all tests" OFF)
option(BUILD_TESTING_FULL "Build all tests" ON)
if (${BUILD_TESTING})
include(CTest)
add_subdirectory(examples)
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (${BUILD_TESTING_FULL})
endif()
add_subdirectory(Gravity-current)
add_subdirectory(Mixing-layer)
add_subdirectory(OTV-Ozage-Tang-vortex-2D)
add_subdirectory(MHD)
add_subdirectory(TBL-Turbulent-Boundary-Layer)
add_subdirectory(Wind-Turbine/NREL-5MW_ALM)
endif (${BUILD_TESTING_FULL})
33 changes: 33 additions & 0 deletions examples/MHD/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# OTV-2D
set(case "OTV2D")
set(case_dir "${test_dir}/${case}")
file(MAKE_DIRECTORY ${case_dir})
set(input_file "input_otv.i2d")
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
install(FILES ${input_file} DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
if(ADIOS2_FOUND)
install(FILES adios2_config.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
endif()
# If testing active add test for OTV case
file(COPY ${input_file} DESTINATION ${case_dir})
if(ADIOS2_FOUND)
file(COPY adios2_config.xml DESTINATION ${case_dir})
endif()
add_test(NAME ${case} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} $<TARGET_FILE:xcompact3d> ${input_file} WORKING_DIRECTORY ${case_dir})

# MHDCHANNEL-2D
set(case "MHD-Channel-2D")
set(case_dir "${test_dir}/${case}")
file(MAKE_DIRECTORY ${case_dir})
set(input_file "input_mhdchan.i2d")
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
install(FILES ${input_file} DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
if(ADIOS2_FOUND)
install(FILES adios2_config.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case})
endif()
# If testing active add test for OTV case
file(COPY ${input_file} DESTINATION ${case_dir})
if(ADIOS2_FOUND)
file(COPY adios2_config.xml DESTINATION ${case_dir})
endif()
add_test(NAME ${case} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} $<TARGET_FILE:xcompact3d> ${input_file} WORKING_DIRECTORY ${case_dir})
151 changes: 151 additions & 0 deletions examples/MHD/input_mhdchan.i2d
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
! -*- mode: f90 -*-

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

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

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

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

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

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

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

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

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

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

mhd_active = .true.
/End

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

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

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

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

/End

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

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

/End

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

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

/End

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

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

Sc(1) = 1.0 ! Schmidt number

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

/End

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

mhd_equation = 'potential'
hartmann = 6.d0

/End

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

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

/End

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

SmagWallDamp = 0 ! Smagorinsky damping function for ABL if 1

/End

&CASE
/End


151 changes: 151 additions & 0 deletions examples/MHD/input_mhdchan.i3d
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
! -*- mode: f90 -*-

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

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

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

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

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

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

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

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

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

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

mhd_active = .true.
/End

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

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

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

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

/End

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

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

/End

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

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

/End

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

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

Sc(1) = 1.0 ! Schmidt number

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

/End

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

mhd_equation = 'potential'
hartmann = 6.d0

/End

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

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

/End

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

SmagWallDamp = 0 ! Smagorinsky damping function for ABL if 1

/End

&CASE
/End


Loading
Loading