-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #285 from xcompact3d/feature-mhd
Add MHD capabilities and update some testing input files
- Loading branch information
Showing
44 changed files
with
1,432 additions
and
22,387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_test.i3d") | ||
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case}) | ||
install(FILES ${input_file} DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case}) | ||
if(ADIOS2_FOUND) | ||
install(FILES adios2_config.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case}) | ||
endif() | ||
# If testing active add test for 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_test.i3d") | ||
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case}) | ||
install(FILES ${input_file} DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case}) | ||
if(ADIOS2_FOUND) | ||
install(FILES adios2_config.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/examples/${case}) | ||
endif() | ||
# If testing active add test for 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}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0"?> | ||
<adios-config> | ||
<io name="solution-io"> | ||
<engine type="BP4"> | ||
</engine> | ||
<transport type="File"> | ||
<parameter key="Library" value="fstream"/> | ||
<parameter key="ProfileUnits" value="Milliseconds"/> | ||
</transport> | ||
</io> | ||
<io name="in-outflow-io"> | ||
<engine type="BP4"> | ||
</engine> | ||
<transport type="File"> | ||
<parameter key="Library" value="fstream"/> | ||
<parameter key="ProfileUnits" value="Milliseconds"/> | ||
</transport> | ||
</io> | ||
<io name="turb-io"> | ||
<engine type="BP4"> | ||
</engine> | ||
<transport type="File"> | ||
<parameter key="Library" value="fstream"/> | ||
<parameter key="ProfileUnits" value="Milliseconds"/> | ||
</transport> | ||
</io> | ||
<io name="restart-io"> | ||
<engine type="BP4"> | ||
</engine> | ||
<transport type="File"> | ||
<parameter key="Library" value="fstream"/> | ||
<parameter key="ProfileUnits" value="Milliseconds"/> | ||
</transport> | ||
</io> | ||
<io name="statistics-io"> | ||
<engine type="BP4"> | ||
</engine> | ||
<transport type="File"> | ||
<parameter key="Library" value="fstream"/> | ||
<parameter key="ProfileUnits" value="Milliseconds"/> | ||
</transport> | ||
</io> | ||
<io name="restart-forces-io"> | ||
<engine type="BP4"> | ||
</engine> | ||
<transport type="File"> | ||
<parameter key="Library" value="fstream"/> | ||
<parameter key="ProfileUnits" value="Milliseconds"/> | ||
</transport> | ||
</io> | ||
</adios-config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=0 ! Row partition | ||
p_col=0 ! 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' ! MHD type of equation (potential or induction) | ||
hartmann = 6.d0 ! Hartmann number (Ha) ratio of electromagnetic force to the viscous force (BLsqrt(sigma/nu)) | ||
|
||
/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 | ||
|
||
|
Oops, something went wrong.