├── .gitignore ├── .gitmodules ├── NekTests.py ├── RANSChannel ├── RANSchan.box ├── RANSchan.ma2 ├── RANSchan.par ├── RANSchan.re2 ├── RANSchan.usr ├── README.md └── SIZE ├── README.md ├── __init__.py ├── benard ├── README.md ├── README.pdf ├── SIZE ├── ray_9.map ├── ray_9.rea └── ray_9.usr ├── blasius ├── README.md ├── SIZE ├── blasius.map ├── blasius.rea ├── blasius.sep └── blasius.usr ├── bp5 ├── README.md ├── SIZE ├── bp5.ma2 ├── bp5.par ├── bp5.re2 ├── bp5.usr └── genbox.in ├── cone ├── README.md ├── cone016 │ ├── SIZE │ ├── base.map │ ├── base.rea │ ├── cone.usr │ └── cone016.box ├── cone064 │ ├── SIZE │ ├── base.map │ ├── base.rea │ ├── cone.usr │ └── cone064.box └── cone256 │ ├── SIZE │ ├── base.map │ ├── base.rea │ ├── cone.usr │ └── cone256.box ├── conj_ht ├── README.md ├── SIZE ├── conj_ht.box ├── conj_ht.map ├── conj_ht.rea └── conj_ht.usr ├── conj_ht_frz ├── README.md ├── SIZE ├── conj_ht_frz.ma2 ├── conj_ht_frz.par ├── conj_ht_frz.re2 └── conj_ht_frz.usr ├── e3q ├── SIZE ├── e3q.box ├── e3q.ma2 ├── e3q.par ├── e3q.re2 └── e3q.usr ├── eddy_neknek ├── README.md ├── SIZE ├── eddy_uv.usr ├── inside.map ├── inside.rea ├── outside.map └── outside.rea ├── eddy_psi_omega ├── README.md ├── SIZE ├── psi_omega.box ├── psi_omega.map ├── psi_omega.rea └── psi_omega.usr ├── eddy_rich ├── README.md ├── SIZE ├── eddy_rich.map ├── eddy_rich.rea └── eddy_rich.usr ├── eddy_uv ├── README.md ├── SIZE ├── eddy_uv.map ├── eddy_uv.rea └── eddy_uv.usr ├── expansion ├── README.md ├── SIZE ├── cyl2d.map ├── cyl2d.rea ├── expansion.map ├── expansion.rea ├── expansion.usr ├── mkmesh ├── nekmerge2 ├── quad2d └── ring.box ├── ext_cyl ├── README.md ├── SIZE ├── ext_cyl.his ├── ext_cyl.map ├── ext_cyl.rea ├── ext_cyl.usr ├── fpcyl.box ├── import.map ├── import.rea └── mkmesh ├── fs_2 ├── README.md ├── README.pdf ├── SIZE ├── box.2d ├── st1.map ├── st1.rea ├── st1.usr ├── st2.map ├── st2.rea ├── st2.usr ├── std_wv.box ├── std_wv.map ├── std_wv.rea └── std_wv.usr ├── hemi ├── README.md ├── SIZE ├── circ.dat ├── hemi.map ├── hemi.rea ├── hemi.usr └── plotit.m ├── kovasznay ├── README.md ├── SIZE ├── kov.map ├── kov.rea └── kov.usr ├── lib ├── __init__.py ├── legacy │ ├── Analysis.py │ ├── BB_RunTest │ ├── ExTest │ ├── ExTestmpi │ ├── README.md │ └── RunTests ├── nekBinBuild.py ├── nekBinRun.py ├── nekFileConfig.py └── nekTestCase.py ├── lin_channel2D ├── README.md ├── SIZE ├── lin_chan.usr ├── lin_chan_adj.ma2 ├── lin_chan_adj.par ├── lin_chan_adj.re2 ├── lin_chan_dir.ma2 ├── lin_chan_dir.par ├── lin_chan_dir.re2 ├── prtlin_chan_adj0.restart └── prtlin_chan_dir0.restart ├── lin_dfh_cav ├── README.md ├── SIZE ├── baseflow.restart ├── egvcavity_adj.restart ├── egvcavity_dir.restart ├── lin_dfh_cav.usr ├── lin_dfh_cav_adj.ma2 ├── lin_dfh_cav_adj.par ├── lin_dfh_cav_adj.re2 ├── lin_dfh_cav_dir.ma2 ├── lin_dfh_cav_dir.par └── lin_dfh_cav_dir.re2 ├── lowMach_test ├── README.md ├── SIZE ├── lowMach_test.ma2 ├── lowMach_test.par ├── lowMach_test.re2 └── lowMach_test.usr ├── mhd ├── README.md ├── SIZE ├── gpf.box ├── gpf.fld01i ├── gpf.fld02i ├── gpf.map ├── gpf.rea ├── gpf.usr ├── gpf_re.map └── gpf_re.rea ├── moffatt ├── README.md ├── SIZE ├── moff2.m ├── moff_circ.map ├── moff_circ.rea ├── moff_circ.usr ├── moffatt.map ├── moffatt.rea ├── moffatt.usr └── run_all ├── mv_cyl ├── README.md ├── SIZE ├── mv_cyl.ma2 ├── mv_cyl.par ├── mv_cyl.re2 ├── mv_cyl.usr └── plot_err ├── mv_wall ├── README.md ├── SIZE ├── mv_wall.map ├── mv_wall.rea └── mv_wall.usr ├── ocyl ├── README.md ├── SIZE ├── ocyl.map ├── ocyl.rea ├── ocyl.usr ├── ocyl2.map ├── ocyl2.rea └── ocyl2.usr ├── os7000 ├── README.md ├── SIZE ├── re7000.dat ├── re7500.dat ├── u3_t020_n13.map ├── u3_t020_n13.rea └── u3_t020_n13.usr ├── peris ├── README.md ├── SIZE ├── peris.map ├── peris.rea └── peris.usr ├── phill ├── README.md ├── SIZE ├── phill.box ├── phill.par └── phill.usr ├── pipe ├── README.md ├── SIZE ├── cyclic.map ├── cyclic.rea ├── cyclic.usr ├── helix.map ├── helix.rea ├── helix.usr ├── n2to3.in ├── stenosis.map ├── stenosis.rea ├── stenosis.usr ├── w2dcyl020a.map └── w2dcyl020a.rea ├── rayleigh ├── README.md ├── SIZE ├── ray0.map ├── ray0.rea ├── ray0.usr ├── ray1.box ├── ray1.map ├── ray1.rea ├── ray2.box ├── ray2.map └── ray2.rea ├── robin ├── README.md ├── README.pdf ├── SIZE ├── robin.map ├── robin.rea └── robin.usr ├── shear4 ├── README.md ├── SIZE ├── shear4.map ├── shear4.rea ├── shear4.usr ├── thin.map ├── thin.rea └── thin.usr ├── smoother ├── README.md ├── README.pdf ├── SIZE ├── lpt.ma2 ├── lpt.par ├── lpt.re2 └── lpt.usr ├── solid ├── README.md ├── SIZE ├── solid.map ├── solid.rea └── solid.usr ├── strat ├── README.md ├── README.pdf ├── SIZE ├── re10f1000p0001.map ├── re10f1000p0001.rea ├── re10f1000p0001.usr ├── re10f1000p1000.map ├── re10f1000p1000.rea └── re10f1000p1000.usr ├── taylor ├── README.md ├── SIZE ├── taylor.box ├── taylor.map ├── taylor.rea └── taylor.usr ├── tgv ├── README.md ├── SIZE ├── ms0.box ├── ms1.box ├── ms2.box ├── ref │ └── data ├── tgv.ma2 ├── tgv.par ├── tgv.re2 └── tgv.usr ├── turbChannel ├── README.md ├── SIZE ├── ref │ ├── LM_Channel_0550_mean_prof.dat │ └── LM_Channel_0550_vel_fluc_prof.dat ├── turbChannel.amg.dat ├── turbChannel.amg_AfP.dat ├── turbChannel.amg_Aff.dat ├── turbChannel.amg_W.dat ├── turbChannel.box ├── turbChannel.ma2 ├── turbChannel.par ├── turbChannel.re2 └── turbChannel.usr ├── turbJet ├── README.md └── turbJet │ ├── SIZE │ ├── mesh │ └── jet.exo │ ├── turbJet.ma2 │ ├── turbJet.par │ ├── turbJet.re2 │ └── turbJet.usr ├── turbPipe ├── README.md ├── SIZE ├── turbPipe.ma2 ├── turbPipe.par ├── turbPipe.re2 └── turbPipe.usr ├── vortex ├── README.md ├── README.pdf ├── SIZE ├── r1492_n08.fld27 ├── r1854a.map ├── r1854a.rea └── r1854a.usr └── vortex2 ├── README.md ├── SIZE ├── v2d.box ├── v2d.map ├── v2d.rea └── v2d.usr /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .tar 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/.gitmodules -------------------------------------------------------------------------------- /RANSChannel/RANSchan.box: -------------------------------------------------------------------------------- 1 | -2 spatial dimension 2 | 4 number of fields (U T TKE Omg) 3 | #======================================================================= 4 | # 5 | # Example of .box file for channel flow 6 | # 7 | # If nelx (y or z) < 0, then genbox automatically generates the 8 | # grid spacing in the x (y or z) direction 9 | # with a geometric ratio given by "ratio". 10 | # ( ratio=1 implies uniform spacing ) 11 | # 12 | # Note that the character bcs _must_ have 3 spaces. 13 | # 14 | #======================================================================= 15 | # 16 | Box 17 | -3 -10 nelx,nely,nelz for Box 18 | 0 1.0 1.0 x0,x1,gain 19 | 0.0 1.0 0.57 20 | P ,P ,SYM,W 21 | P ,P ,I ,f 22 | P ,P ,I ,t 23 | P ,P ,I ,t 24 | -------------------------------------------------------------------------------- /RANSChannel/RANSchan.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/RANSChannel/RANSchan.ma2 -------------------------------------------------------------------------------- /RANSChannel/RANSchan.par: -------------------------------------------------------------------------------- 1 | #Nek5000 parameter file 2 | [GENERAL] 3 | numSteps = 10000 4 | dt = 2.5e-2 5 | writeInterval = 2000 6 | extrapolation = OIFS 7 | targetCFL = 3.5 8 | 9 | [PROBLEMTYPE] 10 | equation = incompNS 11 | variableProperties = yes 12 | stressFormulation = yes 13 | 14 | [VELOCITY] 15 | density = 1.0 16 | viscosity = -1e5 17 | residualTol = 1e-6 18 | 19 | [PRESSURE] 20 | residualTol = 1e-4 21 | 22 | [SCALAR01] # tke 23 | density = 1.0 24 | diffusivity = 1.0 25 | residualTol = 1e-6 26 | 27 | [SCALAR02] # omega 28 | density = 1.0 29 | diffusivity = 1.0 30 | residualTol = 1e-6 31 | 32 | [SCALAR03] # eddy viscosity 33 | solver = none 34 | writeToFieldFile = yes 35 | -------------------------------------------------------------------------------- /RANSChannel/RANSchan.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/RANSChannel/RANSchan.re2 -------------------------------------------------------------------------------- /RANSChannel/README.md: -------------------------------------------------------------------------------- 1 | # RANS model for 2D channel flow 2 | 3 | This example demonstrates the use of the standard k-tau turbulence model. 4 | -------------------------------------------------------------------------------- /RANSChannel/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-0) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=30) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=4) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1001) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20) ! max dim of projection space 32 | parameter (lgmres=30) ! max dim Krylov space 33 | parameter (lorder=3) ! max order in time 34 | parameter (lx1m=lx1) ! GLL points mesh solver 35 | parameter (lfdm=0) ! unused 36 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 37 | 38 | parameter (lbelt=1) ! lelt for mhd 39 | parameter (lpelt=1) ! lelt for linear stability 40 | parameter (lcvelt=1) ! lelt for cvode 41 | 42 | ! INTERNALS 43 | include 'SIZE.inc' 44 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /benard/README.md: -------------------------------------------------------------------------------- 1 | # Rayleigh-Benard convection. 2 | 3 | Parameters are set in routine rayleigh_const for convenience. 4 | 5 | With this nondimensionalization, set rho==1 (parameter p1 in .rea 6 | file) and visocity (p2) to be the desired Prandtl number. 7 | 8 | Rayleigh number is set as Ra = Rc*(1+eps), Rc=p76, eps=p75. 9 | Use p122 (steady state tolerance) sstol>0 to fit Ra_critical from 10 | two additional Ra solutions prescribed by eps2 & eps3 (p121-122) 11 | 12 | The buoyancy is ffy = Ra Pr T, where T is determined by 13 | boundary and initial conditions. 14 | 15 | Critical Rayleigh number is around 1707.762 for the 16 | wavenumber 3.117 [1]. 17 | 18 | NOTES: 19 | 20 | A time trace of volume-avearged kinetic energy Ek vs t is output to 21 | the logfile. See userchk and runtimeavg. 22 | 23 | Be careful about selecting an even number of elements in x 24 | as it appears that the RB system likes to lock onto the grid spacing 25 | and give a number of rolls that matches the number of elements, if the 26 | elements have order-unity aspect ratio, as in the present case. 27 | Thus, in the case, the 9 element mesh is likely to be more faithful 28 | to the linear stability theory, at least for modest polynomial orders 29 | of lx1=8. 30 | 31 | It appears that one cannot realize Courant conditions of CFL ~ 0.5 32 | with these cases because of the explicit Boussinesq treatment. 33 | The given value dt=.02 is stable with lx1=8. 34 | 35 | Use 'grep Ra logfile' to get critical Ra or 'grep _ra logfile' to 36 | get steady state amplitudes for each of 3 eps* cases in adition to 37 | the last line w/ p75 38 | 39 | [1] Chandrasekhar 1961 "Hydrodynamic and Hydromagnetic Stability", Table III on p. 43 -------------------------------------------------------------------------------- /benard/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/benard/README.pdf -------------------------------------------------------------------------------- /benard/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=12) ! GLL points per element along each direction 14 | parameter (lxd=16) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /benard/ray_9.map: -------------------------------------------------------------------------------- 1 | 9 18 3 8 36 18 0 2 | 5 10 14 9 13 3 | 7 14 2 13 1 4 | 7 2 12 1 11 5 | 6 12 18 11 17 6 | 3 18 6 17 5 7 | 2 6 8 5 7 8 | 1 8 4 7 3 9 | 0 4 16 3 15 10 | 4 16 10 15 9 11 | -------------------------------------------------------------------------------- /blasius/README.md: -------------------------------------------------------------------------------- 1 | # Blasius boundary layer test case in 2D. 2 | 3 | It tests the "ON " boundary condition (Outflow, Normal only), given by: 4 | 5 | u_parallel - specified in userbc (ux, uy, or uz) 6 | d (u_n)/ dn = 0 7 | 8 | Note that the ON bc works only if the surface in question is normal 9 | to either the X, Y, or Z axis. 10 | 11 | In this test case the outflow condition is given by "O ", which 12 | implies p + dU/dn = 0. 13 | 14 | This configuration is set up for ymax=10, xmax ~= 480. 15 | 16 | At the end of the timestepping, most of the error is near the 17 | outflow boundary, as would be expected. 18 | 19 | The first field that is dumped is the exact solution, which is 20 | also the initial condition. Thus, you can check the error by 21 | plotting the difference between the first time slice and any 22 | later slice. -------------------------------------------------------------------------------- /blasius/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=1000) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /bp5/README.md: -------------------------------------------------------------------------------- 1 | # BP5 2 | This CEED benchmark solves a standard Poisson equation. 3 | For more informations, see here: https://ceed.exascaleproject.org/bps 4 | 5 | ## How to run this example 6 | 7 | ### Step 1 - Generate mesh 8 | * edit genbox.in and change number of elements in x,y,z 9 | * run genbox and rename box.re2 into bp5.re2 10 | * run genmap 11 | 12 | ### Step 2 - Build 13 | * edit bp5.par and adjust parameters polynomialOder and/or minNumProcesses 14 | * run mkSIZE 15 | * run makenek (make sure to compile with vector instructions like AVX) 16 | 17 | ### Step 3 - Run 18 | ``` 19 | nekbmpi bp5 32 20 | ``` 21 | -------------------------------------------------------------------------------- /bp5/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=1) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=1000) ! max number of global elements 18 | parameter (lpmin=32) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=1,lgmres=20) ! max dim of projection & Krylov space 32 | parameter (lorder=1) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /bp5/bp5.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/bp5/bp5.ma2 -------------------------------------------------------------------------------- /bp5/bp5.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | polynomialOrder = 7 6 | PnPnFormulation = yes 7 | minNumProcesses = 32 8 | 9 | numSteps = 0 10 | dealiasing = no 11 | timestepper = bdf1 12 | 13 | userParam01 = -1e-8 # tolerance (use negative value for fixed iter) 14 | userParam02 = 500 # max iterations 15 | userParam03 = 100 # number of repetitions 16 | 17 | [VELOCITY] 18 | viscosity = 1 19 | -------------------------------------------------------------------------------- /bp5/bp5.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/bp5/bp5.re2 -------------------------------------------------------------------------------- /bp5/genbox.in: -------------------------------------------------------------------------------- 1 | base.rea 2 | -3 spatial dimension ( < 0 --> generate .rea/.re2 pair) 3 | 1 number of fields 4 | #======================================================================= 5 | # 6 | # If nelx (y or z) < 0, then genbox automatically generates the 7 | # grid spacing in the x (y or z) direction 8 | # with a geometric ratio given by "ratio". 9 | # ( ratio=1 implies uniform spacing ) 10 | # 11 | # Note that the character bcs _must_ have 3 spaces. 12 | # 13 | #======================================================================= 14 | # 15 | Box 16 | -10 -10 -10 nelx,nely,nelz for Box 17 | 0 1 1. x0,x1,gain (rescaled in usrdat) 18 | 0 1 1. y0,y1,gain (rescaled in usrdat) 19 | 0 1 1. z0,z1,gain 20 | v ,v ,v ,v ,v ,v bc's (3 chars each!) 21 | -------------------------------------------------------------------------------- /cone/README.md: -------------------------------------------------------------------------------- 1 | # Convecting cone problem 2 | 3 | These cases provide examples of the convecting cone problem illustrated 4 | in Gottlieb & Orszg (1972) and Deville, Fischer, & Mund (2002). 5 | 6 | Typically, to run them you would change SIZE such that the product 7 | lx1*E1 = 32, where the total number of elements in the given case 8 | is E=E1*E1. For cone016 we have E=16 and E1=4, etc. Thus, set lx1 9 | as follows: 10 | 11 | cone256 lx1=2 12 | cone064 lx1=4 13 | cone016 lx1=8 14 | 15 | In this setup, each case (cone016, cone064, cone256) has its own 16 | directory with its SIZE, .usr, and .box file. To run any one of 17 | these examples, cd to the desired case and run genbox, to produce 18 | the .rea file, followed by genmap, to create the .map file). 19 | 20 | Note, for this problem, which is a pure convection problem, all of 21 | the cost is in evaluation of the convection operator. Thus, it 22 | does not make sense to use the characteristics scheme, which 23 | allows for a larger timestep at the expense of an increased 24 | number of evaluations of the convection operator. (Generally, 25 | the characteristics scheme is useful when the pressure solution 26 | costs are high.) Hence, in this example, we have IFCHAR = F. 27 | 28 | -------------------------------------------------------------------------------- /cone/cone016/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=9) ! GLL points per element along each direction 14 | parameter (lxd=14) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=100) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /cone/cone016/base.map: -------------------------------------------------------------------------------- 1 | 16 16 4 16 64 16 0 2 | 15 4 16 15 14 3 | 14 13 4 12 15 4 | 13 11 3 13 4 5 | 11 3 10 4 16 6 | 9 9 8 3 10 7 | 4 2 5 7 11 8 | 12 7 11 6 13 9 | 10 10 7 16 6 10 | 6 6 13 1 12 11 | 8 5 9 11 3 12 | 2 15 14 9 8 13 | 3 12 15 5 9 14 | 0 16 6 14 1 15 | 7 1 12 2 5 16 | 1 14 1 8 2 17 | 5 8 2 10 7 18 | -------------------------------------------------------------------------------- /cone/cone016/cone016.box: -------------------------------------------------------------------------------- 1 | base.rea 2 | 2 spatial dimension 3 | -1 number of fields 4 | #======================================================== 5 | # 6 | # Build an E1 x E1 box for the convecting cone problem 7 | # 8 | #======================================================== 9 | # 10 | Box 11 | -4 -4 nelx,nely,nelz for Box) 12 | -0.0 1.0 1.0 x0 x1 ratio 13 | -0.0 1.0 1.0 y0 y1 ratio 14 | P ,P ,P ,P , bc's (3 characters each, including blanks!) 15 | -------------------------------------------------------------------------------- /cone/cone064/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=5) ! GLL points per element along each direction 14 | parameter (lxd=8) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=100) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /cone/cone064/base.map: -------------------------------------------------------------------------------- 1 | 16 16 4 16 64 16 0 2 | 15 4 16 15 14 3 | 14 13 4 12 15 4 | 13 11 3 13 4 5 | 11 3 10 4 16 6 | 9 9 8 3 10 7 | 4 2 5 7 11 8 | 12 7 11 6 13 9 | 10 10 7 16 6 10 | 6 6 13 1 12 11 | 8 5 9 11 3 12 | 2 15 14 9 8 13 | 3 12 15 5 9 14 | 0 16 6 14 1 15 | 7 1 12 2 5 16 | 1 14 1 8 2 17 | 5 8 2 10 7 18 | -------------------------------------------------------------------------------- /cone/cone064/cone064.box: -------------------------------------------------------------------------------- 1 | base.rea 2 | 2 spatial dimension 3 | -1 number of fields 4 | #======================================================== 5 | # 6 | # Build an E1 x E1 box for the convecting cone problem 7 | # 8 | #======================================================== 9 | # 10 | Box 11 | -8 -8 nelx,nely,nelz for Box) 12 | -0.0 1.0 1.0 x0 x1 ratio 13 | -0.0 1.0 1.0 y0 y1 ratio 14 | P ,P ,P ,P , bc's (3 characters each, including blanks!) 15 | -------------------------------------------------------------------------------- /cone/cone256/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=3) ! GLL points per element along each direction 14 | parameter (lxd=5) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=300) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /cone/cone256/base.map: -------------------------------------------------------------------------------- 1 | 16 16 4 16 64 16 0 2 | 15 4 16 15 14 3 | 14 13 4 12 15 4 | 13 11 3 13 4 5 | 11 3 10 4 16 6 | 9 9 8 3 10 7 | 4 2 5 7 11 8 | 12 7 11 6 13 9 | 10 10 7 16 6 10 | 6 6 13 1 12 11 | 8 5 9 11 3 12 | 2 15 14 9 8 13 | 3 12 15 5 9 14 | 0 16 6 14 1 15 | 7 1 12 2 5 16 | 1 14 1 8 2 17 | 5 8 2 10 7 18 | -------------------------------------------------------------------------------- /cone/cone256/cone256.box: -------------------------------------------------------------------------------- 1 | base.rea 2 | 2 spatial dimension 3 | -1 number of fields 4 | #======================================================== 5 | # 6 | # Build an E1 x E1 box for the convecting cone problem 7 | # 8 | #======================================================== 9 | # 10 | Box 11 | -16 -16 nelx,nely,nelz for Box) 12 | -0.0 1.0 1.0 x0 x1 ratio 13 | -0.0 1.0 1.0 y0 y1 ratio 14 | P ,P ,P ,P , bc's (3 characters each, including blanks!) 15 | -------------------------------------------------------------------------------- /conj_ht/README.md: -------------------------------------------------------------------------------- 1 | # 2D example of conjugate heat transfer. 2 | 3 | The domain consists of two plates of finite thickness (h=0.5) 4 | with plane Poiseiulle flow moving between the plates from left 5 | to right (x=0 to 8). 6 | 7 | The gap height is 1.0 (y=0 to 1). 8 | 9 | The flow inlet temperature is T=0 and the plates are heated 10 | with volumetric heat source, qvol = 1. 11 | 12 | Insulated boundary conditions are applied on the solid 13 | surfaces that are not interior to the computational domain, 14 | so heat leaves only through advection at the flow outlet. -------------------------------------------------------------------------------- /conj_ht/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=4) ! GLL points per element along each direction 14 | parameter (lxd=7) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=100) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /conj_ht/conj_ht.box: -------------------------------------------------------------------------------- 1 | cht0.rea 2 | 2 (spatial dimension) 3 | 2 (number of fields) 4 | # 5 | # This is a comment 6 | # 7 | Box fluid 8 | -8 4 (nelx,nely,nelz for Box 1) 9 | 0.0 8.0 1.0 10 | 0.0 0.1 0.5 0.9 1.0 11 | v ,O ,W ,W velocity bc's: Xleft Xright Ybottom Ytop) 12 | t ,O ,E ,E temperature BCs 13 | Box lower wall 14 | -8 2 15 | 0.0 8.0 1.0 16 | -0.5 -0.1 0.0 17 | , , , no velocity bc's 18 | I ,I ,I ,E temperature BCs 19 | Box upper wall 20 | -8 2 21 | 0.0 8.0 1.0 22 | 1.0 1.1 1.5 23 | , , , no velocity bc's 24 | I ,I ,E ,I temperature BCs 25 | -------------------------------------------------------------------------------- /conj_ht_frz/README.md: -------------------------------------------------------------------------------- 1 | This case is identical to the CHT case. But it runs with a "frozen" 2 | velocity (no velocity solve) and the heat load is unsteady. 3 | 4 | The heat load is sinusoidal and the parameters can be controlled 5 | through the par file. 6 | 7 | In addition temperature is solved with Helmholtz (stored in temp) 8 | and CVODE (stored in scalar 01). Grep output for 'terr' to get 9 | deviation. 10 | -------------------------------------------------------------------------------- /conj_ht_frz/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=4) ! GLL points per element along each direction 14 | parameter (lxd=7) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=100) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=2) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=lelt) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /conj_ht_frz/conj_ht_frz.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/conj_ht_frz/conj_ht_frz.ma2 -------------------------------------------------------------------------------- /conj_ht_frz/conj_ht_frz.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | numSteps = 10000 6 | dt = 5e-03 7 | writeInterval = 1000 8 | 9 | userparam01=0.25 # Frequency of Heat pulsation 10 | userparam02=0.50 # Amplitude of Heat pulsation 11 | 12 | [PROBLEMTYPE] 13 | equation = incompNS 14 | variableProperties = yes 15 | 16 | [PRESSURE] 17 | residualTol = 1e-06 18 | residualProj = no 19 | 20 | [VELOCITY] 21 | residualTol = 1e-08 22 | density = 1 23 | viscosity = 0.5 24 | 25 | [TEMPERATURE] # temperature with Hmholtz 26 | conjugateHeatTransfer = yes 27 | rhoCp = 1.0 28 | conductivity = 0.5 29 | residualTol = 1e-08 30 | 31 | [SCALAR01] # temperature with CVODE 32 | conjugateHeatTransfer = yes 33 | solver = cvode 34 | absoluteTol = 1e-08 35 | 36 | [CVODE] 37 | relativeTol = 1e-06 38 | dtmax = 0 # set to dt to allow for a 1:1 comparison between Helmholtz and CVODE. 39 | -------------------------------------------------------------------------------- /conj_ht_frz/conj_ht_frz.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/conj_ht_frz/conj_ht_frz.re2 -------------------------------------------------------------------------------- /e3q/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-0) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=256) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20) ! max dim of projection space 32 | parameter (lgmres=30) ! max dim Krylov space 33 | parameter (lorder=3) ! max order in time 34 | parameter (lx1m=1) ! GLL points mesh solver 35 | parameter (lfdm=0) ! unused 36 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 37 | 38 | parameter (lbelt=1) ! lelt for mhd 39 | parameter (lpelt=1) ! lelt for linear stability 40 | parameter (lcvelt=1) ! lelt for cvode 41 | 42 | ! INTERNALS 43 | include 'SIZE.inc' 44 | -------------------------------------------------------------------------------- /e3q/e3q.box: -------------------------------------------------------------------------------- 1 | one3d.rea 2 | -3 spatial dimension 3 | 1 number of fields 4 | #======================================================== 5 | # 6 | # This gives a 9 x 1 box, periodic in x, 7 | # here used for Rayleigh Benard convection. 8 | # 9 | # Note that number of fields < 0 implies that box.rea 10 | # will be ascii. 11 | # 12 | #======================================================== 13 | # 14 | Box 15 | -8 -8 -4 nelx,nely,nelz for Box) 16 | 0 1 1 x0 x1 ratio !! Rescaled in usrdat2(). 17 | 0 1 1 y0 y1 ratio 18 | 0 1 1 z0 z1 ratio 19 | P ,P ,P ,P ,P ,P BCs (3 characters each!) 20 | -------------------------------------------------------------------------------- /e3q/e3q.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/e3q/e3q.ma2 -------------------------------------------------------------------------------- /e3q/e3q.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | stopAt = endTime 6 | endTime = 1.0 7 | dt = 1e-04 8 | timeStepper = bdf2 9 | 10 | writeControl = runTime 11 | writeInterval = 0 12 | 13 | [PROBLEMTYPE] 14 | equation = incompNS 15 | 16 | [PRESSURE] 17 | residualTol = 1e-08 18 | residualProj = yes 19 | 20 | [VELOCITY] 21 | residualTol = 1e-12 22 | density = 1 23 | viscosity = 0.005 24 | -------------------------------------------------------------------------------- /e3q/e3q.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/e3q/e3q.re2 -------------------------------------------------------------------------------- /eddy_neknek/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=1000) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=2) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /eddy_psi_omega/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=16) ! GLL points per element along each direction 14 | parameter (lxd=24) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=300) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /eddy_psi_omega/psi_omega.box: -------------------------------------------------------------------------------- 1 | base.rea 2 | 2 spatial dimension 3 | 1 number of fields 4 | # 5 | # comments Lee Ho Thesis, p. 76, p.128 6 | # 7 | # 8 | #======================================================== 9 | # 10 | Box 11 | -16 -16 nelx,nely,nelz for Box 12 | 0 1. 1. x0 x1 ratio 13 | 0 1. 1. y0 y1 ratio 14 | P ,P ,P ,P , bc's ! NOTE sigma given in usrdat2 15 | -------------------------------------------------------------------------------- /eddy_rich/README.md: -------------------------------------------------------------------------------- 1 | # Eddy solutions with moving boundary conditions. 2 | 3 | This case monitors the error for an exact 2D solution 4 | to the Navier-Stokes equations based on the paper of Walsh [1], 5 | with an additional translational velocity (u0,v0) and a moving 6 | domain. 7 | 8 | The initial computational domain is [0,2pi]^2 with doubly-periodic 9 | boundary conditions. 10 | 11 | Walsh's solution consists of an array of vortices determined 12 | as a linear combinations of eigenfunctions of having form: 13 | 14 | cos(pi m x)cos(pi n y), cos(pi m x)sin(pi n y) 15 | sin(pi m x)cos(pi n y), sin(pi m x)sin(pi n y) 16 | 17 | and 18 | 19 | cos(pi k x)cos(pi l y), cos(pi k x)sin(pi l y) 20 | sin(pi k x)cos(pi l y), sin(pi k x)sin(pi l y) 21 | 22 | While there are constraints on admissible (m,n),(k,l) 23 | pairings, Walsh shows that there is a large class of 24 | possible pairings that give rise to very complex vortex 25 | patterns. 26 | 27 | Walsh's solution applies either to unsteady Stokes or 28 | unsteady Navier-Stokes. The solution is a non-translating 29 | decaying array of vortices that decays at the rate 30 | 31 | exp ( -4 pi^2 (m^2+n^2) visc time ), 32 | 33 | with (m^2+n^2) = (k^2+l^2). A nearly stationary state may 34 | be obtained by taking the viscosity to be extremely small, 35 | so the effective decay is negligible. This limit, however, 36 | leads to an unstable state, thus diminsishing the value of 37 | Walsh's solution as a high-Reynolds number test case. 38 | 39 | It is possible to extend Walsh's solution to a stable convectively- 40 | dominated case by simulating an array of vortices that translate 41 | at arbitrary speed by adding a constant to the initial velocity field. 42 | This approach provides a good test for convection-diffusion dynamics. 43 | In the current file set the translational velocity is specified as: 44 | 45 | U0 =[u0,v0] := [param(96),param(97)] ( in the .rea file ) 46 | 47 | The approach can also be extended to incompressible MHD with non-unit 48 | magnetic Prandtl number Pm. 49 | 50 | [1] Owen Walsh, "Eddy Solutions of the Navier-Stokes Equations," 51 | in The Navier-Stokes Equations II - Theory and Numerical Methods, 52 | Proceedings, Oberwolfach 1991, J.G. Heywood, K. Masuda, 53 | R. Rautmann, S.A. Solonnikov, Eds., Springer-Verlag, pp. 306--309 (1992). 54 | -------------------------------------------------------------------------------- /eddy_rich/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /eddy_uv/README.md: -------------------------------------------------------------------------------- 1 | # Eddy solutions in doubly-periodic domain with an additional translational velocity. 2 | 3 | This case monitors the error for an exact 2D solution 4 | to the Navier-Stokes equations based on the paper of Walsh [1], 5 | with an additional translational velocity (u0,v0). 6 | 7 | The computational domain is [0,2pi]^2 with doubly-periodic 8 | boundary conditions. 9 | 10 | Walsh's solution consists of an array of vortices determined 11 | as a linear combinations of eigenfunctions of having form: 12 | 13 | cos(pi m x)cos(pi n y), cos(pi m x)sin(pi n y) 14 | sin(pi m x)cos(pi n y), sin(pi m x)sin(pi n y) 15 | 16 | and 17 | 18 | cos(pi k x)cos(pi l y), cos(pi k x)sin(pi l y) 19 | sin(pi k x)cos(pi l y), sin(pi k x)sin(pi l y) 20 | 21 | While there are constraints on admissible (m,n),(k,l) 22 | pairings, Walsh shows that there is a large class of 23 | possible pairings that give rise to very complex vortex 24 | patterns. 25 | 26 | Walsh's solution applies either to unsteady Stokes or 27 | unsteady Navier-Stokes. The solution is a non-translating 28 | decaying array of vortices that decays at the rate 29 | 30 | exp ( -4 pi^2 (m^2+n^2) visc time ), 31 | 32 | with (m^2+n^2) = (k^2+l^2). A nearly stationary state may 33 | be obtained by taking the viscosity to be extremely small, 34 | so the effective decay is negligible. This limit, however, 35 | leads to an unstable state, thus diminsishing the value of 36 | Walsh's solution as a high-Reynolds number test case. 37 | c 38 | It is possible to extend Walsh's solution to a stable convectively- 39 | dominated case by simulating an array of vortices that translate 40 | at arbitrary speed by adding a constant to the initial velocity field. 41 | This approach provides a good test for convection-diffusion dynamics. 42 | In the current file set the translational velocity is specified as: 43 | 44 | U0 =[u0,v0] := [param(96),param(97)] ( in the .rea file ) 45 | 46 | The approach can also be extended to incompressible MHD with non-unit 47 | magnetic Prandtl number Pm. 48 | 49 | [1] Owen Walsh, "Eddy Solutions of the Navier-Stokes Equations," 50 | in The Navier-Stokes Equations II - Theory and Numerical Methods, 51 | Proceedings, Oberwolfach 1991, J.G. Heywood, K. Masuda, 52 | R. Rautmann, S.A. Solonnikov, Eds., Springer-Verlag, pp. 306--309 53 | (1992). 54 | 55 | -------------------------------------------------------------------------------- /eddy_uv/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /expansion/README.md: -------------------------------------------------------------------------------- 1 | # 3D expanding pipe. 2 | 3 | To build a 3D pipe with sudden expansion, do the following: 4 | 5 | * Make certain you have built the nek tools via: 6 | 7 | `maketools all` 8 | 9 | * After making the tools (specifically, genmap, genbox, pretex), return to this working directory and type 10 | 11 | `mkmesh` 12 | 13 | * Then type 14 | 15 | `makenek expansion` 16 | `nek expansion` # run on one core 17 | 18 | or 19 | 20 | `nekmpi expansion 4` # run on 4 cores 21 | 22 | or 23 | 24 | `nekbmpi expansion 4` # run on 4 cores in background mode 25 | 26 | Of course, you will need nek, nekmpi, nekbmpi in your path. 27 | 28 | You can change the SIZE file and recompile in the usual way. 29 | If you increase lx1,etc., you probably should reduce lelt and 30 | use more processors. 31 | 32 | With increased resolution you probably also need to reduce dt, 33 | which can be done by editing the base cyl2d.rea file prior to 34 | mesh construction or by editing the resultant "expansion.rea" file. 35 | 36 | 37 | The mesh construction procedure is described in the mkmesh script 38 | in this directory. 39 | 40 | By studying this script you should be able to see how to do basic 41 | mesh refinement. Many more options open up if you actually use the 42 | graphical preprocessor, prenek, to edit the base file cyl2d.rea. 43 | -------------------------------------------------------------------------------- /expansion/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=5) ! GLL points per element along each direction 14 | parameter (lxd=8) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=2900) ! max number of global elements 18 | parameter (lpmin=2) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /expansion/cyl2d.map: -------------------------------------------------------------------------------- 1 | 20 25 4 16 80 25 0 2 | 15 25 24 15 4 3 | 13 23 22 18 14 4 | 12 18 14 17 15 5 | 14 22 25 14 15 6 | 15 17 15 16 4 7 | 11 17 16 13 3 8 | 9 23 18 21 12 9 | 8 21 12 20 13 10 | 10 18 17 12 13 11 | 11 20 13 19 3 12 | 7 20 19 8 2 13 | 5 23 21 11 7 14 | 4 11 7 10 8 15 | 6 21 20 7 8 16 | 7 10 8 9 2 17 | 3 10 9 6 1 18 | 1 23 11 22 5 19 | 0 22 5 25 6 20 | 2 11 10 5 6 21 | 3 25 6 24 1 22 | -------------------------------------------------------------------------------- /expansion/mkmesh: -------------------------------------------------------------------------------- 1 | # 2 | # Example script to build 3D pipe expansion. 3 | # 4 | # You will need the nek tools prenek/pretex and n2to3 built and 5 | # in your path (usually, in $HOME/bin). 6 | # 7 | # 8 | 9 | # Procedure: 10 | # 11 | # .Start with cyl2d.rea file (taken from vortex 12 | # directory w2dcyl010a.rea) 13 | # 14 | # .Use "ring.box" to build a ring with inner diamter 1 15 | # that will surround cyl2d. 16 | # 17 | # .Make a larger cylinder by merging cyl2d with ring 18 | # using "nekmerge2" script 19 | # 20 | # .Apply one round of quad refinement to cyl2d and large2d 21 | # with "quad2" script 22 | # 23 | # .Extrude both cyl2dr and large2dr to 3D counter parts 24 | # using n2to3 25 | # 26 | # .Merge cyl3dr and large3dr with nekmerge2 script 27 | 28 | 29 | 30 | genbox << EOF 31 | ring.box 32 | EOF 33 | mvv box ring 34 | 35 | 36 | nekmerge2 cyl2d ring large2d # make larger 2d cross section 37 | 38 | 39 | quad2d cyl2d cyl2dr 40 | quad2d large2d large2dr 41 | 42 | 43 | n2to3 << EOF 44 | cyl2dr 45 | cyl3dr 46 | 0 ascii output 47 | 10 input number of levels: (1, 2, 3,... etc.?): 48 | -5 input z min: 49 | 0. input z max: 50 | 0.9 input gain (0=custom,1=uniform,other=geometric spacing): 51 | n This is for CEM: yes or no: 52 | v Enter Z (5) boundary condition (P,v,O): 53 | O Enter Z (5) boundary condition (P,v,O): 54 | EOF 55 | 56 | 57 | n2to3 << EOF 58 | large2dr 59 | large3dr 60 | 0 ascii output 61 | 10 input number of levels: (1, 2, 3,... etc.?): 62 | 0 input z min: 63 | 5. input z max: 64 | 1.2 input gain (0=custom,1=uniform,other=geometric spacing): 65 | n This is for CEM: yes or no: 66 | W Enter Z (5) boundary condition (P,v,O): 67 | O Enter Z (5) boundary condition (P,v,O): 68 | EOF 69 | 70 | 71 | nekmerge2 cyl3dr large3dr expansion # make larger 2d cross section 72 | 73 | genmap << EOF 74 | expansion 75 | .1 76 | EOF 77 | 78 | rm tmp* *dra fort.* *.jou # CLEANUP 79 | 80 | 81 | -------------------------------------------------------------------------------- /expansion/nekmerge2: -------------------------------------------------------------------------------- 1 | ln $1.rea tmp_mg1.rea; 2 | ln $2.rea tmp_mg2.rea; 3 | pretex << EOF 4 | tmp_mg3 5 | 1 READ PREVIOUS PARAMETERS 6 | tmp_mg1 7 | 1 BUILD FROM FILE 8 | tmp_mg1 9 | 10 IMPORT MESH 10 | tmp_mg2 11 | n 12 | 1 END ELEMENTS 13 | 1 ACCEPT MATL,QVOL 14 | 1 ACCEPT B.C.'s 15 | 1 ACCEPT B.C.'s 16 | 1 EXIT 17 | EOF 18 | mv tmp_mg3.rea $3.rea 19 | rm -f *.dra tmp* 20 | -------------------------------------------------------------------------------- /expansion/quad2d: -------------------------------------------------------------------------------- 1 | pretex << EOF 2 | $2 3 | 1 READ PREVIOUS PARAMETERS 4 | $1 5 | 1 BUILD FROM FILE 6 | $1 7 | 3 GLOBAL REFINE 8 | 8 OCT/Multi-SPLIT 9 | q quad or multi-split? (q/m) 10 | y Are you sure you want to split (y/n)? 11 | 1 END GLOBAL REFINE 12 | 1 END ELEMENTS 13 | 1 ACCEPT MATL,QVOL 14 | 1 ACCEPT B.C.'s 15 | 1 ACCEPT B.C.'s 16 | 1 EXIT 17 | EOF 18 | -------------------------------------------------------------------------------- /expansion/ring.box: -------------------------------------------------------------------------------- 1 | cyl2d.rea 2 | 2 spatial dimension 3 | 1 number of fields: velocity + temperature 4 | #======================================================================== 5 | # 6 | # This will make a circle with inner radius 1.0 and out radius 2.0 7 | # 8 | # The circle is broken into two rings: 9 | # 10 | # Inner one has ascending element radii with scale factor 1.25 11 | # 12 | # Outer one has descending element radii with scale factor 1/1.25 13 | # 14 | # Each circle consists of 8 azimuthal segments in order to match with 15 | # base file 2dcyl.rea when the geometries are merged. 16 | # 17 | # One has the option of refining both meshes at any point as long as 18 | # they are consistently refined prior to merging. 19 | # 20 | #======================================================================== 21 | # 22 | Circle 23 | 0. 0. xctr,yctr 24 | -2 -8 nelr,nel_theta,nelz for annular mesh 25 | 1.0 1.5 1.50 r0, rn, ratio 26 | 0.0 360. 1.0 @0 @1 ratio 27 | v , , , , Velocity BCs (here, only at r0 and rn) 28 | Circle 29 | 0. 0. xctr,yctr 30 | -2 -8 nelr,nel_theta,nelz for annular mesh 31 | 1.5 2.0 0.666667 r0, rn, ratio 32 | 0.0 360. 1.0 @0 @1 ratio 33 | ,W , , , Velocity BCs (here, only at r0 and rn) 34 | -------------------------------------------------------------------------------- /ext_cyl/README.md: -------------------------------------------------------------------------------- 1 | # Flow past a cylinder in 2D. 2 | 3 | A unit-diameter cylinder is centered at (0,0) in a box on [-15,35] x [-15,15]. 4 | 5 | With unit inflow velocity at x=-15, the Reynolds number is given by 6 | 7 | Re = 1/viscosity 8 | 9 | For the current case, we have Re=100, which can be specified in the 10 | .rea file either by setting parameter 2, p2=.01 (the viscosity) or 11 | p2=-100. If Nek5000 sees a negative value for parameter 2 it sets 12 | viscosity to the reciprocal, viscosity = 1/|p2|. 13 | 14 | ## MESH: 15 | 16 | The mesh was built by combining a file box.rea generated with genbox, 17 | using the input file fpcyl.box, with a second file, import.rea, which 18 | contains the cylinder definition. This file was generated with prenek. 19 | 20 | If you wish to change the farfield resolution, you can edit fpcyl.box, 21 | rerun genbox, and then merge box.rea with import.rea. 22 | 23 | This case has a relatively fine spectral element mesh and should give 24 | reasonable results for lx1=6 (polynomial order N=5). 25 | 26 | The `mkmesh` script shows how to build the box and combine it with 27 | the existing circle mesh. Just type 28 | 29 | `mkmesh` 30 | 31 | to execute the script. 32 | 33 | ## OUTPUTS: 34 | 35 | * A simple ad-hoc Strouhal number estimator has been added to the .usr file 36 | * The drag and lift coefficients are also computed by calls in userchk. 37 | * Torque can be added by modifying the iftout flag in the torq_calc call. 38 | * The history of the field values at the probes located at points defined in ext_cyl.his is calculated by call to hpts in userchk. These values are appended to ext_cyl.his file. 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ext_cyl/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=6) ! GLL points per element along each direction 14 | parameter (lxd=9) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=1500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /ext_cyl/ext_cyl.his: -------------------------------------------------------------------------------- 1 | 5 2 | -0.7 0.05 3 | -0.05 0.6 4 | 1.0 0.05 5 | 10.1 0.05 6 | 10.1 1.0 7 | -------------------------------------------------------------------------------- /ext_cyl/fpcyl.box: -------------------------------------------------------------------------------- 1 | import.rea 2 | #============================================================== 3 | # 4 | # Generate a 56 x 26 array of elements on [-15:35] x [-15:15] 5 | # 6 | # Make certain that there is an 8x8 array of elements, of size 7 | # .3 x .3, centered at origin to accommodate cylinder mesh. 8 | # 9 | # Leave the top and bottom bcs BLANK. 10 | # 11 | # These bcs will be generated by pretex after the cylinder 12 | # mesh is inserted. 13 | # 14 | #============================================================== 15 | 2 spatial dimension 16 | 1 number of fields 17 | # 18 | Box 19 | 56 26 nelx,nely,nelz for Box) 20 | -15 -13 -11 -9 -7 -5 -3.5 -2.5 -1.7 -1.2 -.9 -.6 -.3 0 .3 .6 .9 1.2 1.6 2 21 | 2.5 3 3.6 4.2 4.8 5.4 6 6.8 7.6 8.2 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 x0...x_56 23 | -15 -13 -11 -9 -7 -5 -3 -2.3 -1.7 -1.2 -.9 -.6 -.3 0 .3 .6 .9 1.2 1.7 2.3 24 | 3 5 7 9 11 13 15 y0...y_26 25 | v ,O , , , bc's 26 | -------------------------------------------------------------------------------- /ext_cyl/mkmesh: -------------------------------------------------------------------------------- 1 | genbox << EOF 2 | fpcyl.box 3 | EOF 4 | # 5 | pretex << EOF 6 | new 7 | 1 READ PREVIOUS PARAMETERS 8 | box 9 | 1 BUILD FROM FILE 10 | box 11 | 10 IMPORT MESH 12 | import 13 | y Would you like to displace existing elements in box? 14 | 1 END ELEMENTS 15 | 1 ACCEPT MATL,QVOL 16 | 1 SET BCs 17 | 11 SET ENTIRE LEVEL 18 | 1 PERIODIC-AUTO 19 | n Is this a lattice for hex-close-packed spheres?: 20 | 1 END LEVEL 21 | 1 ACCEPT B.C.'s 22 | 1 EXIT 23 | EOF 24 | genmap << EOF 25 | new 26 | .1 27 | EOF 28 | -------------------------------------------------------------------------------- /fs_2/README.md: -------------------------------------------------------------------------------- 1 | # Free-Surface Channel Flow. 2 | 3 | Free-surface ALE formulation in Nek5000. For mor information see pdf file. 4 | 5 | 6 | -------------------------------------------------------------------------------- /fs_2/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/fs_2/README.pdf -------------------------------------------------------------------------------- /fs_2/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=6) ! GLL points per element along each direction 14 | parameter (lxd=9) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=100) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /fs_2/box.2d: -------------------------------------------------------------------------------- 1 | st2.rea 2 | 2 spatial dimension 3 | 1 number of fields 4 | #======================================================== 5 | # 6 | # comments: 7 | # 8 | # 9 | #======================================================== 10 | # 11 | Box 12 | -6 6 nelx,nely,nelz for Box 13 | -3.0 3.0 1.0 x0 x1 ratio 14 | -1. -.9 -.75 -.5 -.25 -.1 0. y0 y1 ... yn 15 | P ,P ,W ,MS , bc's 16 | -------------------------------------------------------------------------------- /fs_2/st1.map: -------------------------------------------------------------------------------- 1 | 36 42 5 32 144 42 0 2 | 31 36 27 35 26 3 | 29 27 25 26 30 4 | 28 25 34 30 33 5 | 23 34 21 33 20 6 | 21 21 19 20 24 7 | 20 19 36 24 35 8 | 31 35 26 32 29 9 | 30 26 30 29 28 10 | 27 30 33 28 31 11 | 23 33 20 31 23 12 | 22 20 24 23 22 13 | 19 24 35 22 32 14 | 25 32 29 42 41 15 | 24 29 28 41 40 16 | 26 28 31 40 39 17 | 17 31 23 39 38 18 | 16 23 22 38 37 19 | 18 22 32 37 42 20 | 15 42 41 18 9 21 | 13 41 40 9 12 22 | 12 40 39 12 17 23 | 7 39 38 17 3 24 | 5 38 37 3 6 25 | 4 37 42 6 18 26 | 15 18 9 16 11 27 | 14 9 12 11 10 28 | 11 12 17 10 15 29 | 7 17 3 15 5 30 | 6 3 6 5 4 31 | 3 6 18 4 16 32 | 9 16 11 14 7 33 | 8 11 10 7 8 34 | 10 10 15 8 13 35 | 1 15 5 13 1 36 | 0 5 4 1 2 37 | 2 4 16 2 14 38 | -------------------------------------------------------------------------------- /fs_2/st2.map: -------------------------------------------------------------------------------- 1 | 36 42 5 32 144 42 0 2 | 31 36 27 35 26 3 | 29 27 25 26 30 4 | 28 25 34 30 33 5 | 23 34 21 33 20 6 | 21 21 19 20 24 7 | 20 19 36 24 35 8 | 31 35 26 32 29 9 | 30 26 30 29 28 10 | 27 30 33 28 31 11 | 23 33 20 31 23 12 | 22 20 24 23 22 13 | 19 24 35 22 32 14 | 25 32 29 42 41 15 | 24 29 28 41 40 16 | 26 28 31 40 39 17 | 17 31 23 39 38 18 | 16 23 22 38 37 19 | 18 22 32 37 42 20 | 15 42 41 18 9 21 | 13 41 40 9 12 22 | 12 40 39 12 17 23 | 7 39 38 17 3 24 | 5 38 37 3 6 25 | 4 37 42 6 18 26 | 15 18 9 16 11 27 | 14 9 12 11 10 28 | 11 12 17 10 15 29 | 7 17 3 15 5 30 | 6 3 6 5 4 31 | 3 6 18 4 16 32 | 9 16 11 14 7 33 | 8 11 10 7 8 34 | 10 10 15 8 13 35 | 1 15 5 13 1 36 | 0 5 4 1 2 37 | 2 4 16 2 14 38 | -------------------------------------------------------------------------------- /fs_2/std_wv.box: -------------------------------------------------------------------------------- 1 | dim3.rea 2 | 2 spatial dimension 3 | 1 number of fields 4 | #======================================================== 5 | # 6 | # 7 | # comments: Dimitrios Giannakis JCP paper 8 | # 9 | # 10 | #======================================================== 11 | # 12 | Box 13 | -6 10 1 nelx,nely,nelz for Box 14 | 0 6 1 x0 x1 ratio 15 | -1 -.995 -.98 -.95 -.91 -.86 -.8 -.6 -.3 -.1 0 y0 y1 16 | P ,P ,W ,MS , , , bc's ! NOTE sigma given in usrdat2 17 | -------------------------------------------------------------------------------- /fs_2/std_wv.map: -------------------------------------------------------------------------------- 1 | 36 42 5 32 144 42 0 2 | 31 36 27 35 26 3 | 29 27 25 26 30 4 | 28 25 34 30 33 5 | 23 34 21 33 20 6 | 21 21 19 20 24 7 | 20 19 36 24 35 8 | 31 35 26 32 29 9 | 30 26 30 29 28 10 | 27 30 33 28 31 11 | 23 33 20 31 23 12 | 22 20 24 23 22 13 | 19 24 35 22 32 14 | 25 32 29 42 41 15 | 24 29 28 41 40 16 | 26 28 31 40 39 17 | 17 31 23 39 38 18 | 16 23 22 38 37 19 | 18 22 32 37 42 20 | 15 42 41 18 9 21 | 13 41 40 9 12 22 | 12 40 39 12 17 23 | 7 39 38 17 3 24 | 5 38 37 3 6 25 | 4 37 42 6 18 26 | 15 18 9 16 11 27 | 14 9 12 11 10 28 | 11 12 17 10 15 29 | 7 17 3 15 5 30 | 6 3 6 5 4 31 | 3 6 18 4 16 32 | 9 16 11 14 7 33 | 8 11 10 7 8 34 | 10 10 15 8 13 35 | 1 15 5 13 1 36 | 0 5 4 1 2 37 | 2 4 16 2 14 38 | -------------------------------------------------------------------------------- /hemi/README.md: -------------------------------------------------------------------------------- 1 | # Particle tracking in a flow past a hemispherical roughness. 2 | 3 | This example illustrates particle tracking being used in a "bubble wire" 4 | mode in which particles are periodicly released along a horizontal 5 | line segment upstream of a hemispherical roughness element [1,2]. 6 | 7 | ## PARTICLE TRACKING 8 | 9 | Currently, this is set up to support only a few bubble wires, 10 | in order to illustrate basic particle tracking. 11 | 12 | ## CONFIGURATION: 13 | 14 | The hemisphere of radius R=0.5 is placed onto a thin cylinder of 15 | radius R and height dz = 0.1R, which is placed onto a smooth 16 | plate. The depth, width and length of the channel are H=6.5R, 17 | B=12.8R and L=36.4R. The boundary conditions (BC) are a Dirichlet 18 | BC as a prescribed Blasius profile at the inlet, outflow BC 19 | at the outlet and stress free symmetry conditions at the lateral 20 | boundaries and at the channel surface. 21 | 22 | The Blasius profile is approximated with the following formula: 23 | 24 | u = U0 sin ( pi y / 2d ) 25 | 26 | d=1.2R is the boundary layer thickness 27 | U0 =1.0 is the free stream velocity. 28 | 29 | Suggested Reynolds numbers (Re=UR/nu): Re=100, Re=450, Re=700 30 | 31 | Particles can be plotted with the attached matlab script, "plotit.m" 32 | 33 | A visit script will be provided soon. 34 | 35 | [1] M.S. Acalar and C.R. Smith, "A study of hairpin vortices in a laminar 36 | boundary layer: Part 1, hairpin vortices generated by a hemisphere 37 | protuberance," J. Fluid Mech. 175, pp. 1-41, 1987 38 | 39 | [2] H.M. Tufo, P.F. Fischer, M.E. Papka and K. Blom, "Numerical simulation 40 | and immersive visualization of hairpin vortices," Proc. of the ACM/IEEE 41 | SC99 Conf. on High Performance Networking and Computing, IEEE Computer Soc., 1999. 42 | -------------------------------------------------------------------------------- /hemi/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=5) ! GLL points per element along each direction 14 | parameter (lxd=7) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=2100) ! max number of global elements 18 | parameter (lpmin=2) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /hemi/plotit.m: -------------------------------------------------------------------------------- 1 | 2 | load circ.dat 3 | 4 | %%% aviobj = avifile('mv1.avi','compression','None'); 5 | %%% fig=figure; 6 | 7 | x = [-1 -1]; y=[-.25 .25]; z=[.13 .13]; 8 | 9 | 10 | for ii=001:161 11 | iname=sprintf('part%05d.3D',ii); 12 | part = load(iname); 13 | 14 | h=plot3(x,y,z,'k-',... 15 | circ(:,1),circ(:,2),circ(:,3),'r-',... 16 | circ(:,2),circ(:,1),circ(:,3),'r-',... 17 | part(:,1),part(:,2),part(:,3),'k.','markersize',3); 18 | axis equal;axis ([-1 1.5 -1.1 1.1 0 .7]);view([90,00]); 19 | drawnow 20 | 21 | % F = getframe(fig); 22 | % aviobj = addframe(aviobj,F); 23 | end 24 | %%% aviobj = close(aviobj); 25 | -------------------------------------------------------------------------------- /kovasznay/README.md: -------------------------------------------------------------------------------- 1 | # Kovasznay flow: flow behind a two-dimensional grid 2 | 3 | This flow is an analytical, two-dimensional, steady solution to the incompressible Navier-Stokes equations. 4 | As the analytical solution exists, this test can be used to demonstrates spectral convergence of the Kovasznay 5 | solution for the case of PN-PN. (Easily changed to PN-PN-2, by editing SIZE and setting lx2=lx1-2). The error 6 | printed in the log file consists essentially of different norms of the velocity error. 7 | 8 | The results for Pn-PN should look something like (N- polynomial order): 9 | 10 | %nstep N Err 1 Err 2 Err 3 Err 4 final time 11 | 15000 3 3.80564E-01 2.25192E-01 1.73472E-02 3.30967E-02 1.50000E+01 err 12 | 15000 4 9.60456E-02 5.68423E-02 4.03567E-03 8.27257E-03 1.50000E+01 err 13 | 15000 5 6.33196E-03 3.74929E-03 1.75654E-04 4.90411E-04 1.50000E+01 err 14 | 15000 6 1.78099E-03 1.05473E-03 3.78376E-05 1.29057E-04 1.50000E+01 err 15 | 15000 7 9.33791E-05 5.53076E-05 1.31083E-06 7.20706E-06 1.50000E+01 err 16 | 15000 8 1.93170E-05 1.14416E-05 2.23850E-07 1.32963E-06 1.50000E+01 err 17 | 15000 9 1.01962E-06 6.03945E-07 9.72991E-09 7.20755E-08 1.50000E+01 err 18 | 15000 10 1.36397E-07 8.07892E-08 1.57699E-09 7.18209E-09 1.50000E+01 err 19 | 15000 11 1.75185E-08 1.03638E-08 8.86536E-10 2.05708E-09 1.50000E+01 err 20 | 15000 12 1.94871E-08 1.15182E-08 1.28181E-09 2.53149E-09 1.50000E+01 err 21 | 15000 13 2.20911E-08 1.30527E-08 1.56650E-09 2.99709E-09 1.50000E+01 err 22 | 15000 14 2.56139E-08 1.51300E-08 1.91387E-09 3.74751E-09 1.50000E+01 err 23 | 15000 15 1.14514E-08 6.78022E-09 3.42498E-10 9.69512E-10 1.50000E+01 err 24 | -------------------------------------------------------------------------------- /kovasznay/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /kovasznay/kov.map: -------------------------------------------------------------------------------- 1 | 8 12 3 8 32 12 0 2 | 6 12 11 6 5 3 | 7 11 10 5 4 4 | 4 6 5 9 8 5 | 5 5 4 8 7 6 | 2 9 8 3 2 7 | 3 8 7 2 1 8 | 0 3 2 12 11 9 | 1 2 1 11 10 10 | -------------------------------------------------------------------------------- /lib/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /lib/nekFileConfig.py: -------------------------------------------------------------------------------- 1 | import os, stat, re 2 | 3 | 4 | def config_size(params, infile, outfile): 5 | """ Redefine parameters in a SIZE file 6 | 7 | Given a path to infile, redefine the variables & values in params, then 8 | output to outfile. The infile and outfile can be the same file. 9 | 10 | Only the parameters already declared in infile may be set. This function 11 | doesn't allow you to declare any new parameters. 12 | (TODO: Raise warning when attempting to declare a new parameter.) 13 | 14 | Args: 15 | params ({variable : value}): Each 'variable' will be set to 'value' 16 | in the output SIZE file 17 | infile (str): Path to the input SIZE file 18 | outfile (str): Path to output SIZE file 19 | 20 | """ 21 | with open(infile, 'r') as f: 22 | lines = f.readlines() 23 | 24 | # Substitute all the variables 25 | for key, value in params.iteritems(): 26 | if value: 27 | lines = [ 28 | re.sub( 29 | r'(.*\bparameter\b.*\b{0} *= *)\S+?( *[),])'.format(key), 30 | r'\g<1>{0}\g<2>'.format(value), l, flags=re.I) 31 | for l in lines] 32 | 33 | with open(outfile, 'w') as f: 34 | f.writelines(lines) 35 | 36 | 37 | def config_parfile(opts, infile, outfile): 38 | """ Set values in a parfile using ConfigParser 39 | 40 | Given a path to infile, substitute the options & values in opts, then 41 | output to outfile. The infile and outfile can be the same file. 42 | 43 | opts is interpreted as a nested dict of the form: 44 | {section: {optname: value, ...}, ...} 45 | where "optname = value" are set in [section]. If 'optname' is not set in 46 | infile, then it will be added to outfile. If 'optname' is already set in 47 | infile, then it will be overridden in outfile. If an option is listed in 48 | infile but is not listed in in 'opts', then it will be copied to outfile 49 | without modification.. 50 | 51 | Args: 52 | opts ({section: {optname : value}}): Set each "optname = value" in 53 | each "[section]" 54 | infile (str): Path to input parfile 55 | outfile (str): Path to output parfile 56 | 57 | """ 58 | import ConfigParser 59 | 60 | parfile = ConfigParser.SafeConfigParser() 61 | parfile.read(infile) 62 | 63 | for section, name_vals in opts.iteritems(): 64 | for name, val in name_vals.iteritems(): 65 | parfile.set(section, name, val) 66 | 67 | with open(outfile, 'w') as f: 68 | parfile.write(f) 69 | -------------------------------------------------------------------------------- /lin_channel2D/README.md: -------------------------------------------------------------------------------- 1 | # Linear direct and adjoint simulation of 2D Poiseuille flow. 2 | 3 | This is small 2D example of the linear direct and adjoint simulation 4 | of 2D Poiseuille flow, in which a fluid is moving laterally between 5 | two plates whose length and width is much greater than the distance 6 | separating them. Stability of this 2D parallel flow can be investigated 7 | analitcally by local analysis and we compare growth rate of the strongest 8 | mode with the stability calculation. 9 | -------------------------------------------------------------------------------- /lin_channel2D/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=10) ! GLL points per element along each direction 14 | parameter (lxd=15) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelg/lpmin + 4) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=lelt) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /lin_channel2D/lin_chan_adj.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_channel2D/lin_chan_adj.ma2 -------------------------------------------------------------------------------- /lin_channel2D/lin_chan_adj.par: -------------------------------------------------------------------------------- 1 | [GENERAL] 2 | stopat = numSteps #endTime 3 | numsteps = 1000 4 | 5 | userparam01 = 1 6 | 7 | dt = -1.0e-02 8 | timestepper = bdf2 9 | variableDt = no 10 | writecontrol = timeStep #runTime 11 | writeinterval = 90000 12 | dealiasing = yes 13 | 14 | [PROBLEMTYPE] 15 | equation = incompLinAdjNS # incompLinNS 16 | numberOfPerturbations = 1 17 | solveBaseflow = no 18 | variableProperties = no 19 | 20 | [PRESSURE] 21 | residualtol = 1e-08 22 | residualproj = no 23 | 24 | [VELOCITY] 25 | residualtol = 1e-08 26 | residualproj = no 27 | density = 1 28 | viscosity = -2000.0 29 | -------------------------------------------------------------------------------- /lin_channel2D/lin_chan_adj.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_channel2D/lin_chan_adj.re2 -------------------------------------------------------------------------------- /lin_channel2D/lin_chan_dir.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_channel2D/lin_chan_dir.ma2 -------------------------------------------------------------------------------- /lin_channel2D/lin_chan_dir.par: -------------------------------------------------------------------------------- 1 | [GENERAL] 2 | stopat = numSteps #endTime 3 | numsteps = 1000 4 | 5 | userparam01 = 1 6 | 7 | dt = -1.0e-02 8 | timestepper = bdf2 9 | variableDt = no 10 | writecontrol = timeStep #runTime 11 | writeinterval = 90000 12 | dealiasing = yes 13 | 14 | [PROBLEMTYPE] 15 | equation = incompLinNS # incompLinNS 16 | numberOfPerturbations = 1 17 | solveBaseflow = no 18 | variableProperties = no 19 | 20 | [PRESSURE] 21 | residualtol = 1e-08 22 | residualproj = no 23 | 24 | [VELOCITY] 25 | residualtol = 1e-08 26 | residualproj = no 27 | density = 1 28 | viscosity = -2000.0 -------------------------------------------------------------------------------- /lin_channel2D/lin_chan_dir.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_channel2D/lin_chan_dir.re2 -------------------------------------------------------------------------------- /lin_channel2D/prtlin_chan_adj0.restart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_channel2D/prtlin_chan_adj0.restart -------------------------------------------------------------------------------- /lin_channel2D/prtlin_chan_dir0.restart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_channel2D/prtlin_chan_dir0.restart -------------------------------------------------------------------------------- /lin_dfh_cav/README.md: -------------------------------------------------------------------------------- 1 | # Linear direct and adjoint simulation of 2D differentially heated square cavity. 2 | 3 | This is small 2D example of the linear direct and adjoint simulation 4 | of differentially heated square cavity. The linear stability of natural 5 | convection is tested and the grow rate of one of the modes is compared 6 | with the result of the linear stability analysis. 7 | This simulation tests temperature adjoint. -------------------------------------------------------------------------------- /lin_dfh_cav/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=9) ! GLL points per element along each direction 14 | parameter (lxd=13) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelg/lpmin + 4) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=lelt) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /lin_dfh_cav/baseflow.restart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_dfh_cav/baseflow.restart -------------------------------------------------------------------------------- /lin_dfh_cav/egvcavity_adj.restart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_dfh_cav/egvcavity_adj.restart -------------------------------------------------------------------------------- /lin_dfh_cav/egvcavity_dir.restart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_dfh_cav/egvcavity_dir.restart -------------------------------------------------------------------------------- /lin_dfh_cav/lin_dfh_cav_adj.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_dfh_cav/lin_dfh_cav_adj.ma2 -------------------------------------------------------------------------------- /lin_dfh_cav/lin_dfh_cav_adj.par: -------------------------------------------------------------------------------- 1 | [GENERAL] 2 | startFrom = baseflow.restart 3 | stopAt = numSteps 4 | numsteps = 1000 5 | 6 | userparam02 = 0.01500 # PRANDTL number 7 | userparam03 = 45000.0 # RAYLEIGH number 8 | 9 | dt = -5.0e-03 10 | timeStepper = bdf2 11 | variableDt = no 12 | writeinterval = 90000 13 | 14 | [PROBLEMTYPE] 15 | equation = incompLinAdjNS # incompLinNS 16 | solveBaseflow = no 17 | variableProperties = yes 18 | numberOfPerturbations = 1 19 | 20 | [PRESSURE] 21 | residualtol = 1e-08 22 | residualproj = no 23 | 24 | [VELOCITY] 25 | residualtol = 1e-08 26 | residualproj = no 27 | density = 1 28 | viscosity = 1.0 29 | 30 | [TEMPERATURE] # temperature with Hmholtz 31 | rhoCp = 1.0 32 | conductivity = 0.5 33 | residualTol = 1e-08 34 | -------------------------------------------------------------------------------- /lin_dfh_cav/lin_dfh_cav_adj.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_dfh_cav/lin_dfh_cav_adj.re2 -------------------------------------------------------------------------------- /lin_dfh_cav/lin_dfh_cav_dir.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_dfh_cav/lin_dfh_cav_dir.ma2 -------------------------------------------------------------------------------- /lin_dfh_cav/lin_dfh_cav_dir.par: -------------------------------------------------------------------------------- 1 | [GENERAL] 2 | startFrom = baseflow.restart 3 | stopAt = numSteps 4 | numsteps = 1000 5 | 6 | userparam02 = 0.01500 # PRANDTL number 7 | userparam03 = 45000.0 # RAYLEIGH number 8 | 9 | dt = -5.0e-03 10 | timeStepper = bdf2 11 | variableDt = no 12 | writeinterval = 90000 13 | 14 | [PROBLEMTYPE] 15 | equation = incompLinNS # incompLinAdjNS 16 | solveBaseflow = no 17 | variableProperties = yes 18 | numberOfPerturbations = 1 19 | 20 | [PRESSURE] 21 | residualtol = 1e-08 22 | residualproj = no 23 | 24 | [VELOCITY] 25 | residualtol = 1e-08 26 | residualproj = no 27 | density = 1 28 | viscosity = 1.0 29 | 30 | [TEMPERATURE] # temperature with Hmholtz 31 | rhoCp = 1.0 32 | conductivity = 0.5 33 | residualTol = 1e-08 34 | -------------------------------------------------------------------------------- /lin_dfh_cav/lin_dfh_cav_dir.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lin_dfh_cav/lin_dfh_cav_dir.re2 -------------------------------------------------------------------------------- /lowMach_test/README.md: -------------------------------------------------------------------------------- 1 | # Low-Mach number example. 2 | 3 | Linearized Model problem described in Ananias G. Tomboulides et. al, JCP 146, CP986079, 1998 -------------------------------------------------------------------------------- /lowMach_test/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=14) ! GLL points per element along each direction 14 | parameter (lxd=20) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /lowMach_test/lowMach_test.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lowMach_test/lowMach_test.ma2 -------------------------------------------------------------------------------- /lowMach_test/lowMach_test.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | stopAt = numSteps #endTime 6 | numSteps = 500 7 | dt = 1e-03 8 | timeStepper = bdf3 9 | 10 | [PROBLEMTYPE] 11 | equation = lowMachNS 12 | variableProperties = yes 13 | 14 | [PRESSURE] 15 | residualTol = 1e-08 16 | residualProj = yes 17 | 18 | [VELOCITY] 19 | residualTol = 1e-12 20 | 21 | [TEMPERATURE] 22 | residualTol = 1e-12 23 | #solver= cvode 24 | #absoluteTol = 1e-12 25 | residualProj = no #yes 26 | 27 | [CVODE] 28 | relativeTol = 1e-12 29 | stiff = no 30 | dtmax = 1e-3 31 | -------------------------------------------------------------------------------- /lowMach_test/lowMach_test.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/lowMach_test/lowMach_test.re2 -------------------------------------------------------------------------------- /mhd/README.md: -------------------------------------------------------------------------------- 1 | # Helical Forcing Dynamo. 2 | 3 | This example gives a cicular Polarized Flow of Galloway & Proctor [1]. 4 | Magnetic field growth rate (or 1/2 of magnetic energy growth rate) 5 | is equal to ~ 0.3 for K_z=0.57 at Rm=100 (magnetic Reynolds #) 6 | 7 | Note: magnetic field growth rate (or 1/2 of magnetic energy growth 8 | rate) is equal to ~ 0.26 for K_z=0.57 at Rm=10 (CKPT95) 9 | 10 | Files: 11 | gpf.* Base case (Re=Rm=10) 12 | gpf_re.rea Case w/ Re=Rm=100 13 | 14 | ## MHD: 15 | 16 | For an MHD case, B-field is stored after temperature array 17 | (and passive scalars if any) so ldimt>=2. Note that in all routines 18 | w/ NEKUSE common block i.e. uservp, userf, userq, userbc & useric, 19 | B-field can be accessed through ux,uy,uz when 20 | they are called with ifield=ifldmhd (ifield=1 is for velocity, 21 | ifield=2 for temperature or ifield=ifldmhd=2 when IFHEAT=.FALSE., 22 | etc.) in addition to the direct reference bx(ix,iy,iz,ieg), 23 | by(ix,iy,iz,ieg), etc. 24 | Also note that a call to outpost in userchk enforces B-field dump 25 | in odd numbers of .f/.fld files in place of velocity. Then for 26 | restart, one has to provide two files in .rea file -- first, 27 | velocity .f/.fld (even number) file name and on the next line, a 28 | file name of the B-field dump (odd .f/.fld number) both preceeded 29 | with a line 30 | 31 | 2 PRESOLVE/RESTART OPTIONS 32 | 33 | A major limitation of the current version of MHD implementation, 34 | is the requirement that the boundary conditions for magnetic field 35 | have to be of the same type as for velocity field, e.g., 36 | both periodic ('PER'), Direchlet ('v '), etc. 37 | Also ioinfo control and avg_all routine do not have a support 38 | for magnetic field yet. 39 | -------------------------------------------------------------------------------- /mhd/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=6) ! GLL points per element along each direction 14 | parameter (lxd=1+3*lx1/2) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=150) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=2) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=200) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=1) ! unused 35 | parameter (lelx=4,lely=4,lelz=8) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=lelt) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /mhd/gpf.box: -------------------------------------------------------------------------------- 1 | gpf.rea 2 | 3 (spatial dimensions: <0 for .re2) 3 | 2.1 (number of fields) : v,T,B 4 | # 5 | # Circular Polarized Flow of Galloway & Proctor (Dynamo) 6 | # 7 | # 8 | #======================================================== 9 | # 10 | Box 1 11 | -4 -4 -8 (nelx,nely,nelz for Box) 12 | 0.0 1.0 1.0 (x0, x1 ratio or xe_i) 13 | 0.0 1.0 1.0 (y0, y1 ratio or ye_j) 14 | 0.0 1.0 1.0 (z0, z1 ratio or ze_k) 15 | P ,P ,P ,P ,P ,P (cbx0, cbx1, cby0, cby1, cbz0, cbz1) Velocity (3 characters) 16 | P ,P ,P ,P ,P ,P (cbx0, cbx1, cby0, cby1, cbz0, cbz1) Temperature 17 | P ,P ,P ,P ,P ,P (cbx0, cbx1, cby0, cby1, cbz0, cbz1) Magnetic Field 18 | -------------------------------------------------------------------------------- /mhd/gpf.fld01i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/mhd/gpf.fld01i -------------------------------------------------------------------------------- /mhd/gpf.fld02i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/mhd/gpf.fld02i -------------------------------------------------------------------------------- /moffatt/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=20) ! GLL points per element along each direction 14 | parameter (lxd=22) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=100) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=2) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /moffatt/moff2.m: -------------------------------------------------------------------------------- 1 | % 2 | % matlab script to solve for quantities related to Moffatt eddies, 3 | % described in 4 | % 5 | % "Viscous and resistive eddies near a sharp corner" 6 | % H.K. Moffatt, J. Fluid Mech., (18) 1, January, 1964, 7 | % pp. 1--18. 8 | % 9 | % See the Nek5000 user file, moff.usr, for more detail. 10 | % 11 | % 12 | % sin a2p cosh a2q + p sin a2 = 0 a2=28.5 deg 13 | % cos a2p sinh a2q + q sin a2 = 0 14 | % 15 | % k = sin a2/a2 16 | % 17 | % sin x cosh y + kx = 0 18 | % cos x sinh y + ky = 0 19 | % 20 | % (2n-1) pi < x_n < (2n-1/2) pi 21 | % 22 | format compact; format longe; hold off 23 | 24 | x=2*ones(2,1); f=0*x; 25 | 26 | J=eye(2); 27 | 28 | a2 = pi*(28.5)/180; %% 28.5 degree interior angle 29 | k = sin(a2)/a2; 30 | 31 | xi = 4.2; eta = 2.2; %% Initial guess from Moffatt 64, Table 1. 32 | 33 | f(1) = sin(xi)*cosh(eta) + xi*k; 34 | f(2) = cos(xi)*sinh(eta) + eta*k; 35 | 36 | x=[xi;eta]; 37 | 38 | for iter=1:20; % Solve nonlinear system with Broyden's method 39 | 40 | s = -J\f; 41 | x = x+s; 42 | 43 | fo = f; xi=x(1);eta=x(2); 44 | 45 | f(1) = sin(xi)*cosh(eta) + xi*k; 46 | f(2) = cos(xi)*sinh(eta) + eta*k; 47 | % [ x(1) x(2) f(1) f(2) ] 48 | 49 | y = f-fo; 50 | J = J - ((J*s-y)*s')/(s'*s); 51 | plot(x(1),x(2),'ro','linewidth',2); axis square; drawnow; hold on; pause(.1) 52 | ns = norm(s); nf = norm(f); [ns nf]; 53 | if ns < 1.e-12; break; end; 54 | 55 | end; 56 | 57 | [ x(1) x(2) f(1) f(2) ], xi=x(1);eta=x(2); 58 | 59 | p1 = xi/a2; q1 = eta/a2; 60 | 61 | size_ratio = exp(pi/q1), % Moffatt (3.11a) 62 | strg_ratio = exp(pi*p1/q1), % Moffatt (3.12) 63 | 64 | -------------------------------------------------------------------------------- /moffatt/moff_circ.map: -------------------------------------------------------------------------------- 1 | 24 34 4 16 96 34 0 2 | 1 8 7 5 4 3 | 13 3 29 22 28 4 | 3 33 32 9 17 5 | 11 25 21 26 20 6 | 12 22 28 24 23 7 | 3 34 33 6 9 8 | 7 32 31 17 14 9 | 15 24 23 34 33 10 | 9 26 20 32 31 11 | 13 2 27 3 29 12 | 10 27 19 29 21 13 | 8 21 19 20 18 14 | 7 31 30 14 11 15 | 9 20 18 31 30 16 | 15 23 26 33 32 17 | 11 29 21 28 25 18 | 14 28 25 23 26 19 | 5 16 13 15 10 20 | 4 13 12 10 1 21 | 1 7 16 4 15 22 | 2 6 9 8 7 23 | 5 17 14 16 13 24 | 6 14 11 13 12 25 | 0 9 17 7 16 26 | -------------------------------------------------------------------------------- /moffatt/moffatt.map: -------------------------------------------------------------------------------- 1 | 24 34 4 16 96 34 0 2 | 7 7 15 14 13 3 | 13 6 29 22 28 4 | 3 18 11 17 10 5 | 11 26 21 25 20 6 | 12 22 28 24 23 7 | 7 34 33 7 15 8 | 3 32 31 18 11 9 | 15 24 23 34 33 10 | 11 25 20 32 31 11 | 13 5 27 6 29 12 | 1 11 9 10 4 13 | 9 21 3 20 19 14 | 2 31 30 11 9 15 | 10 20 19 31 30 16 | 5 15 18 13 17 17 | 8 29 21 28 26 18 | 14 28 26 23 25 19 | 6 33 32 15 18 20 | 15 23 25 33 32 21 | 9 27 3 29 21 22 | 4 14 13 2 12 23 | 0 17 10 16 8 24 | 1 10 4 8 1 25 | 5 13 17 12 16 26 | -------------------------------------------------------------------------------- /moffatt/run_all: -------------------------------------------------------------------------------- 1 | 2 | genmap << EOF 3 | moffatt 4 | .1 5 | EOF 6 | 7 | makenek moffatt; nekl moffatt; grep -i success logfile 8 | 9 | genmap << EOF 10 | moff_circ 11 | .1 12 | EOF 13 | 14 | makenek moff_circ; nekl moff_circ; grep -i success logfile 15 | -------------------------------------------------------------------------------- /mv_cyl/README.md: -------------------------------------------------------------------------------- 1 | # Moving cylinder example using CVODE 2 | 3 | This is small 2D example of a closed domain with a moving postion. 4 | The resulting isentropic flow is compared to an analytical solution. 5 | 6 | ## TO BUILD: 7 | 8 | PPLIST="CVODE" 9 | export PPLIST 10 | makenek mv_cyl -------------------------------------------------------------------------------- /mv_cyl/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-0) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=10) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=lelt) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /mv_cyl/mv_cyl.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/mv_cyl/mv_cyl.ma2 -------------------------------------------------------------------------------- /mv_cyl/mv_cyl.par: -------------------------------------------------------------------------------- 1 | [GENERAL] 2 | stopat = endTime 3 | endtime = 1.0 4 | dt = 1e-3 5 | timestepper = bdf3 6 | writecontrol = runTime 7 | writeinterval = 0.1 8 | userparam01 = 1 9 | numsteps = 1e3 10 | 11 | [PROBLEMTYPE] 12 | equation = lowMachNS 13 | variableproperties = yes 14 | dp0dt = yes 15 | 16 | [MESH] 17 | motion = user # elasticity 18 | 19 | [PRESSURE] 20 | residualtol = 1e-10 21 | residualproj = no 22 | 23 | [VELOCITY] 24 | residualtol = 1e-12 25 | residualproj = no 26 | 27 | [TEMPERATURE] 28 | solver = cvode 29 | absolutetol = 1e-12 30 | 31 | [CVODE] 32 | relativetol = 1e-12 33 | stiff = no 34 | dtmax = 1e-2 35 | 36 | -------------------------------------------------------------------------------- /mv_cyl/mv_cyl.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/mv_cyl/mv_cyl.re2 -------------------------------------------------------------------------------- /mv_cyl/plot_err: -------------------------------------------------------------------------------- 1 | grep err $1 | awk '{print $2, $3, $4, $5, $6, $7}' > jpp ; sed '1,10d' jpp > jp; xmgrace -nxy jp 2 | -------------------------------------------------------------------------------- /mv_wall/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1 -2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=10) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /ocyl/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=10) ! GLL points per element along each direction 14 | parameter (lxd=16) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=100) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /os7000/README.md: -------------------------------------------------------------------------------- 1 | # TS waves in plane Poiseuille flow. 2 | 3 | This usr file originated from the Orr-Sommerfeld study presented 4 | in the Overlapping Schwarz paper [P.F. Fischer, JCP 133 1997]. 5 | 6 | Here it's modified to take either re7000 or re7500 eigenfunction 7 | input generated by the author's OS code (available on request). 8 | 9 | The code monitors energy growth rate and compares with the values 10 | from linear theory. These should match to roughly 5 digits. 11 | 12 | To see the error vs. time: 13 | 14 | grep egn logfile > t.e 15 | 16 | gnuplot 17 | set logscale y 18 | plot 't.e' u 1:8 w l 19 | 20 | -------------------------------------------------------------------------------- /os7000/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=14) ! GLL points per element along each direction 14 | parameter (lxd=3*lx1/2) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=100) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /os7000/u3_t020_n13.map: -------------------------------------------------------------------------------- 1 | 15 18 3 8 60 18 0 2 | 7 13 12 2 10 3 | 7 11 13 9 2 4 | 6 12 11 10 9 5 | 3 4 1 7 6 6 | 3 1 3 6 5 7 | 2 3 4 5 7 8 | 6 18 17 12 11 9 | 5 17 8 11 13 10 | 5 8 18 13 12 11 | 1 14 16 18 17 12 | 4 16 15 17 8 13 | 4 15 14 8 18 14 | 1 7 6 14 16 15 | 0 6 5 16 15 16 | 2 5 7 15 14 17 | -------------------------------------------------------------------------------- /peris/README.md: -------------------------------------------------------------------------------- 1 | # Peristaltic flow. 2 | 3 | This .usr/.rea/SIZE trio provides a rudimentary example of peristaltic 4 | flow in a tube with inflow/outflow boundary conditions. 5 | 6 | Technically, this example is flawed because the amplitude and frequency 7 | of the peristaltic pumping has no impact on the overall flow rate, due 8 | to the Dirichlet inflow condition specified for velocity. It thus 9 | should be viewed only as an illustration of one approach to implementing 10 | the boundary conditions and the mesh velocity for the ALE formulation. 11 | 12 | This case also illustrates the use of the special outflow treatment, 13 | where div U > 0 is imposed in the last layer of elements in order 14 | to ensure that all characteristics are outgoing where outflow 15 | conditions have been specified. 16 | 17 | The statement ifusermv=.true. in userdat2() indicates that the user 18 | will provide the mesh velocity, wx,wy, and wz. Note that in SIZE, 19 | it is necessary to set lx1m=lx1, ly1m=ly1, and lz1m=lz1 to allocate 20 | the moving mesh array space. -------------------------------------------------------------------------------- /peris/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=6) ! GLL points per element along each direction 14 | parameter (lxd=9) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=200) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /phill/README.md: -------------------------------------------------------------------------------- 1 | # 3D PERIODIC HILL 2 | 3 | This example is similar to the one presented in Nek5000 documentation, however 4 | the hill profile is consistent with Almeida et al. 1993 and described at 5 | https://turbmodels.larc.nasa.gov/Other_LES_Data/2Dhill_periodic/hill-geometry.dat 6 | 7 | HOW TO RUN THE CASE 8 | 1. Compile the code 9 | 2. Build the initial box mesh using genbox and phill.box -> box.re2 10 | 3. cp box.re2 phill.re2 11 | 4. genmap on phill.re2 12 | 5. Check phill.par and run the simulation 13 | 5. The mesh of the periodic hill is saved as newre2.re2 14 | 15 | REMARKS: 16 | - phill.re2 is a rectangular channel 17 | - the geometric parameters of the hill are defined in userdat2 18 | - it is assumed that the Reynolds number is based on the average velocity 19 | over the inlet plane 20 | -------------------------------------------------------------------------------- /phill/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=7000) ! max number of global elements 18 | parameter (lpmin=12) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=2) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /phill/phill.box: -------------------------------------------------------------------------------- 1 | -3 spatial dimension 2 | 1 number of fields (U) 3 | #======================================================================= 4 | # 5 | # .box file for channel flow 6 | # 7 | # If nelx (y or z) < 0, then genbox automatically generates the 8 | # grid spacing in the x (y or z) direction 9 | # with a geometric ratio given by "ratio". 10 | # ( ratio=1 implies uniform spacing ) 11 | # 12 | # Note that the character bcs _must_ have 3 spaces. 13 | # 14 | #======================================================================= 15 | # 16 | Box 17 | -22 -16 -19 nelx,nely for Box 18 | 0.0 1.0 1.0 x0,xn,gain 19 | 0.0 1.0 1.0 y0,yn,gain 20 | 0.0 1.0 1.0 z0,zn,gain 21 | P ,P ,W ,W ,P ,P 22 | -------------------------------------------------------------------------------- /phill/phill.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | #startFrom = 6 | stopAt = numSteps #endTime 7 | endTime = 1.0 8 | numSteps =500 9 | 10 | dt = 5e-03 11 | timeStepper = bdf3 #char #steady 12 | variableDt = yes 13 | targetCFL = 0.5 14 | 15 | writeControl = timeStep #runTime 16 | writeInterval = 250 17 | 18 | userParam01 = 200 # start time collecting statistics 19 | userParam02 = 20 # writeInterval 1D statistics 20 | 21 | dealiasing = yes 22 | filtering = hpfrt #hpfrt, none, explicit 23 | filterWeight = 10.0 24 | filterCutoffRatio = 0.9 25 | 26 | [PROBLEMTYPE] 27 | equation = incompNS 28 | stressFormulation = no 29 | variableProperties = no 30 | 31 | [PRESSURE] 32 | preconditioner = semg_xxt 33 | residualTol = 1e-4 34 | residualProj = yes 35 | 36 | [VELOCITY] 37 | residualTol = 1e-6 38 | residualProj = yes 39 | density = 1.0 40 | viscosity = -10000 41 | advection = yes -------------------------------------------------------------------------------- /pipe/README.md: -------------------------------------------------------------------------------- 1 | # Pipe flow 2 | 3 | This directory contains three pipe cases, where the geometry 4 | is altered by routine `usrdat2` in the .usr file. 5 | 6 | stenosis 7 | helix 8 | cyclic - simulation of bent pipe (torus section) with cyclic bc and 9 | azimuthal volume forcing 10 | 11 | The geometry for "stenosis" was generated by running n2to3, 12 | which extrudes a 2D mesh into a 3D one. Once n2to3 is compiled, 13 | one can create this geometry by: 14 | 15 | n2to3 < n2to3.in 16 | 17 | Then run genmap on the result. The file n2to3.in can be 18 | modified to suit. 19 | 20 | -------------------------------------------------------------------------------- /pipe/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=6) ! GLL points per element along each direction 14 | parameter (lxd=10) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-0) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=500) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver; for cyclic bc only 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /pipe/n2to3.in: -------------------------------------------------------------------------------- 1 | w2dcyl020a 2 | stenosis 3 | 0 ascii output 4 | 20 input number of levels: (1, 2, 3,... etc.?): 5 | 0 input z min: 6 | 10 input z max: 7 | 1 input gain (0=custom,1=uniform,other=geometric spacing): 8 | n This is for CEM: yes or no: 9 | v Enter Z (5) boundary condition (P,v,O): 10 | O Enter Z (6) boundary condition (v,O): 11 | y Formatted .rea file? (y or Y): 12 | -------------------------------------------------------------------------------- /pipe/w2dcyl020a.map: -------------------------------------------------------------------------------- 1 | 20 25 4 16 80 25 0 2 | 15 25 24 15 4 3 | 13 23 22 18 14 4 | 12 18 14 17 15 5 | 14 22 25 14 15 6 | 15 17 15 16 4 7 | 11 17 16 13 3 8 | 9 23 18 21 12 9 | 8 21 12 20 13 10 | 10 18 17 12 13 11 | 11 20 13 19 3 12 | 7 20 19 8 2 13 | 5 23 21 11 7 14 | 4 11 7 10 8 15 | 6 21 20 7 8 16 | 7 10 8 9 2 17 | 3 10 9 6 1 18 | 1 23 11 22 5 19 | 0 22 5 25 6 20 | 2 11 10 5 6 21 | 3 25 6 24 1 22 | -------------------------------------------------------------------------------- /rayleigh/README.md: -------------------------------------------------------------------------------- 1 | # Rayleigh-Benard convection. 2 | 3 | Parameters are set in routine rayleigh_const for convenience. 4 | 5 | With this nondimensionalization, set rho==1 (parameter p1 in .rea 6 | file) and visocity (p2) to be the desired Prandtl number. 7 | 8 | Rayleigh number is set as Ra = Rc*(1+eps), Rc=p76, eps=p75. 9 | 10 | The buoyancy is ffy = Ra Pr T, where T is determined by 11 | boundary and initial conditions. 12 | 13 | Critical Rayleigh number is around 1707.762 14 | (Somehow I was recalling 1734, but that appears to be for a 15 | particular geometric configuration considered by Laurette Tuckerman 16 | & Dwight Barkley) 17 | 18 | GEOMETRY: 19 | 20 | There are two primary cases, ray1.box and ray2.box. 21 | The former specifies 10 elements in x, the latter only 9, 22 | both for a 9x1 domain. 23 | 24 | NOTES: 25 | 26 | A time trace of (u,v)_max vs t is output to the logfile. See userchk. 27 | 28 | Be careful about selecting an even number of elements in x 29 | as it appears that the RB system likes to lock onto the grid spacing 30 | and give a number of rolls that matches the number of elements, if the 31 | elements have order-unity aspect ratio, as in the present case. 32 | Thus, in the case, the 9 element mesh is likely to be more faithful 33 | to the linear stability theory, at least for modest polynomial orders 34 | of lx1=12. 35 | 36 | It appears that one cannot realize Courant conditions of CFL ~ 0.5 37 | with these cases because of the explicit convection treatment. 38 | The given value dt=.02 is stable with lx1=12. 39 | 40 | -------------------------------------------------------------------------------- /rayleigh/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=12) ! GLL points per element along each direction 14 | parameter (lxd=18) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=50) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /rayleigh/ray0.map: -------------------------------------------------------------------------------- 1 | 10 20 3 8 40 20 0 2 | 7 20 4 19 3 3 | 7 4 14 3 13 4 | 6 14 16 13 15 5 | 5 16 12 15 11 6 | 4 12 18 11 17 7 | 3 18 2 17 1 8 | 3 2 8 1 7 9 | 2 8 10 7 9 10 | 1 10 6 9 5 11 | 0 6 20 5 19 12 | -------------------------------------------------------------------------------- /rayleigh/ray1.box: -------------------------------------------------------------------------------- 1 | base.rea 2 | 2 spatial dimension 3 | 2 number of fields 4 | #======================================================== 5 | # 6 | # This gives a 9 x 1 box, periodic in x, 7 | # here used for Rayleigh Benard convection. 8 | # 9 | # Note that number of fields < 0 implies that box.rea 10 | # will be ascii. 11 | # 12 | #======================================================== 13 | # 14 | Box 15 | -10 1 nelx,nely,nelz for Box) 16 | 0 9 1 x0 x1 ratio 17 | 0 1 1 y0 y1 ratio 18 | P ,P ,W ,W , V bc's ! NB: 3 characters each ! 19 | P ,P ,t ,t , T bc's ! You must have 2 spaces!! 20 | -------------------------------------------------------------------------------- /rayleigh/ray1.map: -------------------------------------------------------------------------------- 1 | 10 20 3 8 40 20 0 2 | 7 20 4 19 3 3 | 7 4 14 3 13 4 | 6 14 16 13 15 5 | 5 16 12 15 11 6 | 4 12 18 11 17 7 | 3 18 2 17 1 8 | 3 2 8 1 7 9 | 2 8 10 7 9 10 | 1 10 6 9 5 11 | 0 6 20 5 19 12 | -------------------------------------------------------------------------------- /rayleigh/ray2.box: -------------------------------------------------------------------------------- 1 | ray0.rea 2 | 2 spatial dimension 3 | 2 number of fields 4 | #======================================================== 5 | # 6 | # This gives a 9 x 1 box, periodic in x, 7 | # here used for Rayleigh Benard convection. 8 | # 9 | # Note that number of fields < 0 implies that box.rea 10 | # will be ascii. 11 | # 12 | #======================================================== 13 | # 14 | Box 15 | -9 1 nelx,nely,nelz for Box) 16 | 0 9 1 x0 x1 ratio 17 | 0 1 1 y0 y1 ratio 18 | P ,P ,W ,W , V bc's ! NB: 3 characters each ! 19 | P ,P ,t ,t , T bc's ! You must have 2 spaces!! 20 | -------------------------------------------------------------------------------- /rayleigh/ray2.map: -------------------------------------------------------------------------------- 1 | 9 18 3 8 36 18 0 2 | 5 10 14 9 13 3 | 7 14 2 13 1 4 | 7 2 12 1 11 5 | 6 12 18 11 17 6 | 3 18 6 17 5 7 | 2 6 8 5 7 8 | 1 8 4 7 3 9 | 0 4 16 3 15 10 | 4 16 10 15 9 11 | -------------------------------------------------------------------------------- /robin/README.md: -------------------------------------------------------------------------------- 1 | # Unsteady conduction with Robin boundary conditions. 2 | 3 | This is a 1-element unsteady conduction example that 4 | illustrates the use of the convection heat-transfer 5 | boundary condition, which is based on the Newton 6 | law of cooling. 7 | 8 | For this boundary condition, the thermal flux at 9 | the wall is proportional to the difference between 10 | the wall temperature, Tw, and the ambient temperature, 11 | Tinf (T_infinity), with proportionality coefficient 12 | given by the heat transfer coefficient, hc. That is, 13 | at the wall, 14 | 15 | -div k grad T = hc(T-Tinf) 16 | 17 | The thermal boundary condition is specified in Nek5000 18 | as "c " when hc and Tinf are given in userbc(), or 19 | "C " when hc and Tinf are given as constant parameters 20 | in the .rea file. For example, if Element 1, Side 2, 21 | were to have Tinf=5 and hc=9, the .rea file would have 22 | 23 | ***** THERMAL BOUNDARY CONDITIONS ***** 24 | : : : 25 | : : : 26 | C 1 2 5.000000 9.000000 0.0000000E+00 0.0000000E+00 0.0000000E+00 27 | : : : 28 | : : : 29 | 30 | This condition could also be set via userbc() with the following 31 | lines in the .rea and .usr files. 32 | 33 | robin.rea: 34 | 35 | ***** THERMAL BOUNDARY CONDITIONS ***** 36 | : : : 37 | : : : 38 | c 1 2 5.000000 9.000000 0.0000000E+00 0.0000000E+00 0.0000000E+00 39 | : : : 40 | 41 | robin.usr: 42 | 43 | subroutine userbc (ix,iy,iz,iside,ieg) 44 | : 45 | : 46 | tinf=5.0 47 | hc=9.0 48 | : 49 | 50 | 51 | The latter approach is used in the robin example given 52 | here. 53 | 54 | -------------------------------------------------------------------------------- /robin/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/robin/README.pdf -------------------------------------------------------------------------------- /robin/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=12) ! GLL points per element along each direction 14 | parameter (lxd=18) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=10) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=3) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /robin/robin.map: -------------------------------------------------------------------------------- 1 | 1 4 0 1 4 4 0 2 | 0 4 3 2 1 3 | -------------------------------------------------------------------------------- /shear4/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=9) ! GLL points per element along each direction 14 | parameter (lxd=13) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=300) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=4) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=16,lely=16,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /smoother/README.md: -------------------------------------------------------------------------------- 1 | # Mesh smoothing in Nek5000. 2 | 3 | For more information see pdf file -------------------------------------------------------------------------------- /smoother/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/smoother/README.pdf -------------------------------------------------------------------------------- /smoother/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=3) ! GLL points per element along each direction 14 | parameter (lxd=4) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=10000) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /smoother/lpt.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/smoother/lpt.ma2 -------------------------------------------------------------------------------- /smoother/lpt.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | #startFrom = restart.fld 6 | numSteps = 100 7 | writeInterval = 0 8 | dt = 1.e-5 9 | 10 | [PROBLEMTYPE] 11 | 12 | [PRESSURE] 13 | residualTol = 1e-06 14 | residualProj = yes 15 | 16 | [VELOCITY] 17 | residualTol = 1e-08 18 | residualProj = yes 19 | density = 1 20 | viscosity = 0.0001 21 | -------------------------------------------------------------------------------- /smoother/lpt.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/smoother/lpt.re2 -------------------------------------------------------------------------------- /solid/README.md: -------------------------------------------------------------------------------- 1 | # Thick-wall hollow sphere under an internal pressure. 2 | 3 | This is an example of using the linear elasticity steady 3D solid solver 4 | in Nek5000 5 | 6 | The test case corresponds to a thick-wall hollow sphere under an internal 7 | pressure P (and zero external pressure) which has the analytical solution 8 | 9 | u_r=P*r1^3*[(1-2nu)r+(1+nu)r2^3/(2r^2)]/E/(r2^3-r1^3) 10 | u_theta=u_phi=0 11 | (see, for example, Fung "Foundations of Solid Mechanics") 12 | 13 | E is Young's modulus, nu is Poisson's ratio 14 | 15 | r1=0.5-inner radius, r2=1-outer radius 16 | 17 | Traction boundary conditions are used in the current example: 18 | normal stress = -P at the inner sphere (b.c. option 'S'), 19 | stress-free at the outer sphere (b.c. option 'O') 20 | IFSTRS=T is necessary to use traction boundary conditions 21 | 22 | Displacement (Dirichlet) boundary conditions can be used as well 23 | (corresponding boundary values for displacements are also in userbc) 24 | To use - change 'S' and 'O' to 'v' in .rea file 25 | 26 | Standard NEK arrays for velocities (vx,vy,vz) in fluid formulation 27 | contain displacements in solid formulation 28 | 29 | Description of the SEM method for linear elasticity and convergence 30 | results for the current test case, as well as for the other cases, 31 | can be found at http://www.mcs.anl.gov/~peet/solid.pdf 32 | 33 | All additional subroutines necessary for using linear elasticity 34 | solver are currently in .usr file and include 35 | - steady_elast_solve, elast, elast2d_e, elast3d_e (elasticity routines) 36 | - cg, solveM, axcg (conjugate gradient routines) 37 | - getstress (traction boundary conditions routine) 38 | - energy_norm (routine for calculating error in the energy norm) 39 | -------------------------------------------------------------------------------- /solid/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=50) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /strat/README.md: -------------------------------------------------------------------------------- 1 | # Stratified 2D flow. 2 | 3 | These are Boussinesq-based stratified-flow examples that illustrate 4 | the blocking phenomena in which fluid particles resist change in 5 | elevation because of the potential energy change required to overcome 6 | strong stratification. The examples are based on a discussion found 7 | in Tritton, "Physical Fluid Dynamics" (Oxford University Press, 1988). 8 | Results for these cases can be found in the Nek5000 "users.pdf" examples 9 | file. 10 | 11 | Two cases are considered iwth Prandtl number equal 1 and 1000. 12 | 13 | In the simulations here, the hydrostatic pressure distribution is altered 14 | so that we solve for a field that is uniform (i.e., not varying in the 15 | y direction) at outflow, as this is the standard outflow condition in 16 | Nek5000. To illustrate the point, consider that the Boussinesq approximation 17 | with a constant temperature field would give rise to a uniform body force in 18 | the negative y-direction, and that the resulting hydrostatic pressure field 19 | would vary linearly in y. In the (linear) stratified flow case the forcing 20 | is of the form 21 | 22 | ffy = temp / Fr2 23 | 24 | where Fr2 is the Froude number squared and the temperature field has for 25 | initial- and boundary-conditions a linear variation in y. As it stands, 26 | such a forcing would lead to a hydrostatice pressure field that varies 27 | quadratically in y, and it is clear that p=0 at outflow would be incorrect. 28 | To account for the vertical loading, we modify the forcing term to be 29 | 30 | ffy = (temp-y) / Fr2 31 | 32 | which implies that the computed pressure differs from the actual pressure 33 | by -.5*y*y/Fr2. For the incompressible Navier-Stokes equations and the 34 | given boundary conditions this modification has no impact on the dynamics 35 | of the flow. 36 | -------------------------------------------------------------------------------- /strat/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/strat/README.pdf -------------------------------------------------------------------------------- /strat/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=400) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /strat/re10f1000p0001.usr: -------------------------------------------------------------------------------- 1 | c----------------------------------------------------------------------- 2 | subroutine uservp (ix,iy,iz,ieg) 3 | include 'SIZE' 4 | include 'TOTAL' 5 | include 'NEKUSE' 6 | C 7 | udiff =0. 8 | utrans=0. 9 | return 10 | end 11 | c----------------------------------------------------------------------- 12 | subroutine userf (ix,iy,iz,ieg) 13 | include 'SIZE' 14 | include 'TOTAL' 15 | include 'NEKUSE' 16 | c 17 | Fr2 = param(4) ! Froude number squared 18 | ffx = 0.0 19 | ffy = (temp - y) / Fr2 20 | ffz = 0.0 21 | return 22 | end 23 | c----------------------------------------------------------------------- 24 | subroutine userq (ix,iy,iz,ieg) 25 | include 'SIZE' 26 | include 'TOTAL' 27 | include 'NEKUSE' 28 | C 29 | qvol = 0.0 30 | source = 0.0 31 | return 32 | end 33 | c----------------------------------------------------------------------- 34 | subroutine userchk 35 | include 'SIZE' 36 | include 'TOTAL' 37 | return 38 | end 39 | c----------------------------------------------------------------------- 40 | subroutine userbc (ix,iy,iz,iside,ieg) 41 | include 'SIZE' 42 | include 'TOTAL' 43 | include 'NEKUSE' 44 | ux=1.0 45 | uy=0.0 46 | uz=0.0 47 | temp=y 48 | return 49 | end 50 | c----------------------------------------------------------------------- 51 | subroutine useric (ix,iy,iz,ieg) 52 | include 'SIZE' 53 | include 'TOTAL' 54 | include 'NEKUSE' 55 | ux=1.0 56 | uy=0.0 57 | uz=0.0 58 | temp=y 59 | return 60 | end 61 | c----------------------------------------------------------------------- 62 | subroutine usrdat 63 | include 'SIZE' 64 | include 'TOTAL' 65 | c 66 | return 67 | end 68 | c----------------------------------------------------------------------- 69 | subroutine usrdat2 70 | include 'SIZE' 71 | include 'TOTAL' 72 | c 73 | return 74 | end 75 | c----------------------------------------------------------------------- 76 | subroutine usrdat3 77 | include 'SIZE' 78 | include 'TOTAL' 79 | c 80 | return 81 | end 82 | c----------------------------------------------------------------------- 83 | -------------------------------------------------------------------------------- /strat/re10f1000p1000.usr: -------------------------------------------------------------------------------- 1 | c----------------------------------------------------------------------- 2 | subroutine uservp (ix,iy,iz,ieg) 3 | include 'SIZE' 4 | include 'TOTAL' 5 | include 'NEKUSE' 6 | C 7 | udiff =0. 8 | utrans=0. 9 | return 10 | end 11 | c----------------------------------------------------------------------- 12 | subroutine userf (ix,iy,iz,ieg) 13 | include 'SIZE' 14 | include 'TOTAL' 15 | include 'NEKUSE' 16 | c 17 | Fr2 = param(4) ! Froude number squared 18 | ffx = 0.0 19 | ffy = (temp - y) / Fr2 20 | ffz = 0.0 21 | return 22 | end 23 | c----------------------------------------------------------------------- 24 | subroutine userq (ix,iy,iz,ieg) 25 | include 'SIZE' 26 | include 'TOTAL' 27 | include 'NEKUSE' 28 | C 29 | qvol = 0.0 30 | source = 0.0 31 | return 32 | end 33 | c----------------------------------------------------------------------- 34 | subroutine userchk 35 | include 'SIZE' 36 | include 'TOTAL' 37 | return 38 | end 39 | c----------------------------------------------------------------------- 40 | subroutine userbc (ix,iy,iz,iside,ieg) 41 | include 'SIZE' 42 | include 'TOTAL' 43 | include 'NEKUSE' 44 | ux=1.0 45 | uy=0.0 46 | uz=0.0 47 | temp=y 48 | return 49 | end 50 | c----------------------------------------------------------------------- 51 | subroutine useric (ix,iy,iz,ieg) 52 | include 'SIZE' 53 | include 'TOTAL' 54 | include 'NEKUSE' 55 | ux=1.0 56 | uy=0.0 57 | uz=0.0 58 | temp=y 59 | return 60 | end 61 | c----------------------------------------------------------------------- 62 | subroutine usrdat 63 | include 'SIZE' 64 | include 'TOTAL' 65 | c 66 | return 67 | end 68 | c----------------------------------------------------------------------- 69 | subroutine usrdat2 70 | include 'SIZE' 71 | include 'TOTAL' 72 | c 73 | return 74 | end 75 | c----------------------------------------------------------------------- 76 | subroutine usrdat3 77 | include 'SIZE' 78 | include 'TOTAL' 79 | c 80 | return 81 | end 82 | c----------------------------------------------------------------------- 83 | -------------------------------------------------------------------------------- /taylor/README.md: -------------------------------------------------------------------------------- 1 | # Taylor-Couette flow. -------------------------------------------------------------------------------- /taylor/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=10) ! GLL points per element along each direction 14 | parameter (lxd=16) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=20) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=4) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /taylor/taylor.box: -------------------------------------------------------------------------------- 1 | ray2.rea 2 | 2 spatial dimension 3 | 2 number of fields 4 | #======================================================== 5 | # 6 | # This gives a 9 x 1 box, periodic in x, 7 | # here used for Rayleigh Benard convection. 8 | # It is rescale in x in .usr to fit 4 x most unstable 9 | # wavelength l (Chandrasekhar's 1961, p.43): 10 | # l=2.*pi/3.117=2.0158 for Ra_c_min=1707.8 11 | # 12 | # Note that number of fields < 0 implies that box.rea 13 | # will be ascii. 14 | # 15 | #======================================================== 16 | # 17 | Box 18 | -9 1 nelx,nely,nelz for Box) 19 | 0. 1. 1. x0 x1 ratio 20 | 0. 1. 1. y0 y1 ratio 21 | P ,P ,W ,W , V bc's ! NB: 3 characters each ! 22 | P ,P ,t ,t , T bc's ! You must have 2 spaces!! 23 | -------------------------------------------------------------------------------- /taylor/taylor.map: -------------------------------------------------------------------------------- 1 | 9 18 3 8 36 18 0 2 | 5 10 14 9 13 3 | 7 14 2 13 1 4 | 7 2 12 1 11 5 | 6 12 18 11 17 6 | 3 18 6 17 5 7 | 2 6 8 5 7 8 | 1 8 4 7 3 9 | 0 4 16 3 15 10 | 4 16 10 15 9 11 | -------------------------------------------------------------------------------- /tgv/README.md: -------------------------------------------------------------------------------- 1 | # DNS of the Taylor-Green vortex at Re=1600 2 | 3 | HiOCFD5 Testcase: WS1 4 | 5 | Three meshes are available: 6 | * MS0: 8x8x8 7 | * MS1: 16x16x16 8 | * MS2: 32x32x32 9 | 10 | Reference: 11 | (1) https://how5.cenaero.be/content/ws1-dns-taylor-green-vortex-re1600 12 | -------------------------------------------------------------------------------- /tgv/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-0) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=600) ! max number of global elements 18 | parameter (lpmin=2) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /tgv/ms0.box: -------------------------------------------------------------------------------- 1 | base.rea 2 | -3 spatial dimension ( < 0 --> generate .rea/.re2 pair) 3 | 1 number of fields 4 | #======================================================================= 5 | # 6 | # Example of .box file for Taylor-Green 7 | # 8 | # If nelx (y or z) < 0, then genbox automatically generates the 9 | # grid spacing in the x (y or z) direction 10 | # with a geometric ratio given by "ratio". 11 | # ( ratio=1 implies uniform spacing ) 12 | # 13 | # Note that the character bcs _must_ have 3 spaces. 14 | # 15 | #======================================================================= 16 | # 17 | Box 18 | -8 -8 -8 nelx,nely,nelz for Box 19 | 0 8 1. x0,x1,gain (rescaled in usrdat) 20 | 0 8 1. y0,y1,gain (rescaled in usrdat) 21 | 0 8 1. z0,z1,gain 22 | P ,P ,P ,P ,P ,P bc's (3 chars each!) 23 | -------------------------------------------------------------------------------- /tgv/ms1.box: -------------------------------------------------------------------------------- 1 | base.rea 2 | -3 spatial dimension ( < 0 --> generate .rea/.re2 pair) 3 | 1 number of fields 4 | #======================================================================= 5 | # 6 | # Example of .box file for Taylor-Green 7 | # 8 | # If nelx (y or z) < 0, then genbox automatically generates the 9 | # grid spacing in the x (y or z) direction 10 | # with a geometric ratio given by "ratio". 11 | # ( ratio=1 implies uniform spacing ) 12 | # 13 | # Note that the character bcs _must_ have 3 spaces. 14 | # 15 | #======================================================================= 16 | # 17 | Box 18 | -16 -16 -16 nelx,nely,nelz for Box 19 | 0 16 1. x0,x1,gain (rescaled in usrdat) 20 | 0 16 1. y0,y1,gain (rescaled in usrdat) 21 | 0 16 1. z0,z1,gain 22 | P ,P ,P ,P ,P ,P bc's (3 chars each!) 23 | -------------------------------------------------------------------------------- /tgv/ms2.box: -------------------------------------------------------------------------------- 1 | base.rea 2 | -3 spatial dimension ( < 0 --> generate .rea/.re2 pair) 3 | 1 number of fields 4 | #======================================================================= 5 | # 6 | # Example of .box file for Taylor-Green 7 | # 8 | # If nelx (y or z) < 0, then genbox automatically generates the 9 | # grid spacing in the x (y or z) direction 10 | # with a geometric ratio given by "ratio". 11 | # ( ratio=1 implies uniform spacing ) 12 | # 13 | # Note that the character bcs _must_ have 3 spaces. 14 | # 15 | #======================================================================= 16 | # 17 | Box 18 | -32 -32 -32 nelx,nely,nelz for Box 19 | 0 32 1. x0,x1,gain (rescaled in usrdat) 20 | 0 32 1. y0,y1,gain (rescaled in usrdat) 21 | 0 32 1. z0,z1,gain 22 | P ,P ,P ,P ,P ,P bc's (3 chars each!) 23 | -------------------------------------------------------------------------------- /tgv/tgv.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/tgv/tgv.ma2 -------------------------------------------------------------------------------- /tgv/tgv.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | stopAt = endTime 6 | endTime = 20.0 7 | dt = 1e-02 8 | timeStepper = bdf2 9 | extrapolation = OIFS 10 | targetCFL = 1.9 11 | 12 | writeControl = runTime 13 | writeInterval = 0 14 | 15 | [PROBLEMTYPE] 16 | equation = incompNS 17 | 18 | [PRESSURE] 19 | residualTol = 1e-05 20 | residualProj = yes 21 | 22 | [VELOCITY] 23 | residualTol = 1e-06 24 | density = 1 25 | viscosity = -1600 26 | -------------------------------------------------------------------------------- /tgv/tgv.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/tgv/tgv.re2 -------------------------------------------------------------------------------- /turbChannel/README.md: -------------------------------------------------------------------------------- 1 | # LES of a turbulent channel flow. 2 | 3 | HiOCFD5 Testcase: WS2 / Resolution Coarse (ID:MS3) 4 | LES of a turbulent channel flow with Re_tau=550 5 | 6 | Reference: 7 | [1] https://how5.cenaero.be/content/ws2-les-plane-channel-ret550 8 | 9 | [2] Myoungkyu Lee and Robert D. Moser, 10 | Direct numerical simulation of turbulent channel flow up to 11 | Re_tau = 5200, 2015, Journal of Fluid Mechanics, vol. 774, 12 | pp. 395-415 13 | 14 | Note: 1-D statistics are dumped to 15 | mean_prof.dat and vel_fluc_prof.dat 16 | -------------------------------------------------------------------------------- /turbChannel/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=1536) ! max number of global elements 18 | parameter (lpmin=4) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20) ! max dim of projection space 32 | parameter (lgmres=30) ! max dim Krylov space 33 | parameter (lorder=3) ! max order in time 34 | parameter (lx1m=1) ! GLL points mesh solver 35 | parameter (lfdm=0) ! unused 36 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 37 | 38 | parameter (lbelt=1) ! lelt for mhd 39 | parameter (lpelt=1) ! lelt for linear stability 40 | parameter (lcvelt=1) ! lelt for cvode 41 | 42 | ! INTERNALS 43 | include 'SIZE.inc' 44 | -------------------------------------------------------------------------------- /turbChannel/turbChannel.amg.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbChannel/turbChannel.amg.dat -------------------------------------------------------------------------------- /turbChannel/turbChannel.amg_AfP.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbChannel/turbChannel.amg_AfP.dat -------------------------------------------------------------------------------- /turbChannel/turbChannel.amg_Aff.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbChannel/turbChannel.amg_Aff.dat -------------------------------------------------------------------------------- /turbChannel/turbChannel.amg_W.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbChannel/turbChannel.amg_W.dat -------------------------------------------------------------------------------- /turbChannel/turbChannel.box: -------------------------------------------------------------------------------- 1 | base.rea 2 | -3 spatial dimension ( < 0 --> generate .rea/.re2 pair) 3 | 1 number of fields 4 | #======================================================================= 5 | Box 6 | -16 -12 -8 nelx,nely,nelz for Box 7 | 0 1 1. x0,x1,gain 8 | 0 1 1. y0,y1,gain 9 | 0 1 1. z0,z1,gain 10 | P ,P ,W ,W ,P ,P bc's (3 chars each!) 11 | -------------------------------------------------------------------------------- /turbChannel/turbChannel.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbChannel/turbChannel.ma2 -------------------------------------------------------------------------------- /turbChannel/turbChannel.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | polynomialOrder = 7 6 | PnPnFormulation = yes 7 | minNumProcesses = 4 8 | 9 | #startFrom = restart.fld time=0 10 | stopAt = endTime 11 | endTime = 400 12 | 13 | dt = 0 14 | timeStepper = bdf2 15 | extrapolation = OIFS 16 | variableDt = yes 17 | targetCFL = 3.5 18 | 19 | writeControl = runTime 20 | writeInterval = 50.0 21 | 22 | userParam01 = 200 # start time collecting statistics 23 | userParam02 = 20 # writeInterval 1D statistics 24 | 25 | filtering = hpfrt 26 | filterWeight = 10 27 | filterCutoffRatio = 0.9 28 | 29 | [PROBLEMTYPE] 30 | #variableProperties = yes 31 | equation = incompNS 32 | 33 | [PRESSURE] 34 | preconditioner = semg_amg 35 | residualTol = 1e-4 36 | residualProj = yes 37 | 38 | [VELOCITY] 39 | residualTol = 1e-6 40 | density = 1 41 | viscosity = -10000 42 | 43 | #[TEMPERATURE] 44 | #rhoCp = 1. 45 | #conductivity = -10000 46 | #residualTol = 1e-6 47 | -------------------------------------------------------------------------------- /turbChannel/turbChannel.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbChannel/turbChannel.re2 -------------------------------------------------------------------------------- /turbJet/README.md: -------------------------------------------------------------------------------- 1 | # LES of a round turbulent jet 2 | A jet issuing from a pipe with fully developed turbulent flow into a larger 3 | cylindrical domain. The Reynolds number based on the mean (bulk) velocity in 4 | the pipe and the pipe diameter is 19000. The domain of size D = 10d and 5 | L = 20d, where d is the nozzle diameter is used eliminate the boundary effects. 6 | The inlet boundary extends 1d upstream of the nozzle exit where the velocity 7 | is obtained from another session (turbPipe). 8 | 9 | The mesh was generated in Cubit, exported as EXODUSI and storred at ./turbJet/mesh/jet.exo. 10 | Finally it was converted to nek format using ext2nek. 11 | 12 | ## How to run this example 13 | 14 | ### Step 1 - Precursor Turbulent Inlet 15 | * cp -a ../turbPipe . 16 | * Run turbPipe for say t=200 to get a fully turbulent pipe flow 17 | 18 | ### Step 2 - Coupled Simulation 19 | * Restart turbPipe from the saved checkpoint 20 | * Run the two sessions using e.g. 21 | ``` 22 | neknekb_mpmd turbPipe turbJet 4 28 uncoupled 23 | ``` 24 | * Note, adjust the number of MPI ranks used for each session such that turbJet 25 | never waits (check 'data exchange' timings in turbJet.logfile) for the inflow data. 26 | -------------------------------------------------------------------------------- /turbJet/turbJet/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=10) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-0) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=12228) ! max total number of elements 18 | parameter (lpmin=24) ! min MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=1000) ! max history/monitoring points 26 | parameter (maxobj=4) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=2) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /turbJet/turbJet/mesh/jet.exo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbJet/turbJet/mesh/jet.exo -------------------------------------------------------------------------------- /turbJet/turbJet/turbJet.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbJet/turbJet/turbJet.ma2 -------------------------------------------------------------------------------- /turbJet/turbJet/turbJet.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | #startFrom = restart.fld time=0 6 | stopAt = endTime 7 | endTime = 600 8 | 9 | dt = 1.0e-2 10 | timeStepper = bdf2 11 | extrapolation = OIFS 12 | targetCFL = 3.8 13 | 14 | writeControl = runTime 15 | writeInterval = 4 16 | 17 | filtering = hpfrt 18 | filterWeight = 10 19 | filterCutoffRatio = 0.9 20 | 21 | [MESH] 22 | numberOfBCFields = 1 23 | 24 | [PROBLEMTYPE] 25 | equation = incompNS 26 | stressFormulation = yes 27 | 28 | [PRESSURE] 29 | residualTol = 1e-04 30 | residualProj = yes 31 | 32 | [VELOCITY] 33 | residualTol = 1e-06 34 | density = 1 35 | viscosity = -19000 36 | -------------------------------------------------------------------------------- /turbJet/turbJet/turbJet.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbJet/turbJet/turbJet.re2 -------------------------------------------------------------------------------- /turbPipe/README.md: -------------------------------------------------------------------------------- 1 | # LES of a round turbulent pipe flow at Re_tau=550. 2 | 3 | Reference: 4 | [1] ftp://ftp.mech.kth.se/pub/pschlatt/DATA/PIPE/ 5 | -------------------------------------------------------------------------------- /turbPipe/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=6) ! GLL points per element along each direction 14 | parameter (lxd=8) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-0) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=1620) ! max number of global elements 18 | parameter (lpmin=4) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=1) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=2) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /turbPipe/turbPipe.ma2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbPipe/turbPipe.ma2 -------------------------------------------------------------------------------- /turbPipe/turbPipe.par: -------------------------------------------------------------------------------- 1 | # 2 | # nek parameter file 3 | # 4 | [GENERAL] 5 | #startFrom = restart.fld U time=0 6 | stopAt = endTime 7 | endTime = 150 8 | 9 | dt = 1.0e-2 10 | timeStepper = bdf2 11 | extrapolation = OIFS 12 | targetCFL = 3.8 13 | 14 | writeControl = runTime 15 | writeInterval = 20 16 | 17 | filtering = hpfrt 18 | filterWeight = 10 19 | filterCutoffRatio = 0.9 20 | 21 | [MESH] 22 | numberOfBCFields = 1 23 | 24 | [PROBLEMTYPE] 25 | equation = incompNS 26 | 27 | [PRESSURE] 28 | residualTol = 1e-04 29 | residualProj = yes 30 | 31 | [VELOCITY] 32 | density = 1. 33 | viscosity = -19000 34 | residualTol = 1e-06 35 | -------------------------------------------------------------------------------- /turbPipe/turbPipe.re2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/turbPipe/turbPipe.re2 -------------------------------------------------------------------------------- /vortex/README.md: -------------------------------------------------------------------------------- 1 | # Vortex breakdown in a container with a rotating lid. 2 | 3 | For more information see pdf file. -------------------------------------------------------------------------------- /vortex/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/vortex/README.pdf -------------------------------------------------------------------------------- /vortex/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=3) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=200) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=2) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=30) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=1,lely=1,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /vortex/r1492_n08.fld27: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nek5000/NekExamples/294cbfc32304b129370865d9f56fdae80432615b/vortex/r1492_n08.fld27 -------------------------------------------------------------------------------- /vortex2/README.md: -------------------------------------------------------------------------------- 1 | # Vortex breakdown in a container with a rotating lid (axisymmetric case). 2 | 3 | 4 | See vortex example for more detail about the corresponding 3D simulation 5 | configuration at Re=1854. 6 | 7 | This is an axisymmetric example of the vortex breakdown problem 8 | described in the Nek5000 Examples document. 9 | 10 | The domain size is 2x1. The rotating lid is located at x=2. 11 | For Re=1492, there is a single flow reversal (bubble) on the axis. 12 | 13 | In this example, the azimuthal velocity is stored in the temperature 14 | array t(...). 15 | 16 | To have temperature serve the role of azimuthal velocity, you must 17 | set the flag IFAZIV to be true either in the .usr file or in the .rea 18 | file. 19 | 20 | Note that the .rea and .box files specify "A " on the y=0 boundary, 21 | which is requisite for any axisymmetric flow problem that includes 22 | the x-axis. 23 | 24 | Also, any element touching the x-axis must be oriented with the "r" 25 | direction pointing in the positive x direction. (This condition 26 | is automatically met for elements generated with genbox.) -------------------------------------------------------------------------------- /vortex2/SIZE: -------------------------------------------------------------------------------- 1 | c 2 | c Include file to dimension static arrays 3 | c and to set some hardwired run-time parameters 4 | c 5 | integer ldim,lx1,lxd,lx2,lx1m,lelg,lelt,lpmin,ldimt 6 | integer lpelt,lbelt,toteq,lcvelt 7 | integer lelx,lely,lelz,mxprev,lgmres,lorder,lhis 8 | integer maxobj,lpert,nsessmax,lxo 9 | integer lfdm,ldimt_proj,lelr 10 | 11 | ! BASIC 12 | parameter (ldim=2) ! domain dimension (2 or 3) 13 | parameter (lx1=8) ! GLL points per element along each direction 14 | parameter (lxd=12) ! GL points for over-integration (dealiasing) 15 | parameter (lx2=lx1-2) ! GLL points for pressure (lx1 or lx1-2) 16 | 17 | parameter (lelg=300) ! max number of global elements 18 | parameter (lpmin=1) ! min number of MPI ranks 19 | parameter (lelt=lelg/lpmin + 3) ! max number of local elements per MPI rank 20 | parameter (ldimt=4) ! max auxiliary fields (temperature + scalars) 21 | 22 | ! OPTIONAL 23 | parameter (ldimt_proj=1) ! max auxiliary fields residual projection 24 | parameter (lelr=lelt) ! max number of local elements per restart file 25 | parameter (lhis=100) ! max history/monitoring points 26 | parameter (maxobj=1) ! max number of objects 27 | parameter (lpert=1) ! max number of perturbations 28 | parameter (toteq=1) ! max number of conserved scalars in CMT 29 | parameter (nsessmax=1) ! max sessions to NEKNEK 30 | parameter (lxo=lx1) ! max GLL points on output (lxo>=lx1) 31 | parameter (mxprev=20,lgmres=40) ! max dim of projection & Krylov space 32 | parameter (lorder=3) ! max order in time 33 | parameter (lx1m=lx1) ! GLL points mesh solver 34 | parameter (lfdm=0) ! unused 35 | parameter (lelx=20,lely=60,lelz=1) ! global tensor mesh dimensions 36 | 37 | parameter (lbelt=1) ! lelt for mhd 38 | parameter (lpelt=1) ! lelt for linear stability 39 | parameter (lcvelt=1) ! lelt for cvode 40 | 41 | ! INTERNALS 42 | include 'SIZE.inc' 43 | -------------------------------------------------------------------------------- /vortex2/v2d.box: -------------------------------------------------------------------------------- 1 | v1.rea 2 | 2 spatial dimension 3 | 2 number of fields 4 | # 5 | #======================================================== 6 | # 7 | # Axisymmetric variant of the vortex breakdown problem 8 | # 9 | #======================================================== 10 | # 11 | Box 1 12 | 5 4 nel_x, nel_r 13 | 0 .4 1. 1.6 1.96 2. x0,...,xn 14 | 0 .4 .8 .950 1.0 r0,...,rn 15 | W ,v ,A ,v bcs 16 | t ,t ,A ,t bcs 17 | -------------------------------------------------------------------------------- /vortex2/v2d.map: -------------------------------------------------------------------------------- 1 | 20 30 4 16 80 30 0 2 | 15 7 19 6 20 3 | 14 19 30 20 29 4 | 7 30 5 29 27 5 | 7 5 13 27 12 6 | 5 13 4 12 11 7 | 15 6 20 22 21 8 | 13 20 29 21 28 9 | 12 29 27 28 26 10 | 6 27 12 26 15 11 | 4 12 11 15 14 12 | 11 22 21 3 18 13 | 10 21 28 18 25 14 | 3 28 26 25 24 15 | 3 26 15 24 10 16 | 1 15 14 10 8 17 | 11 3 18 2 17 18 | 9 18 25 17 16 19 | 8 25 24 16 23 20 | 2 24 10 23 9 21 | 0 10 8 9 1 22 | --------------------------------------------------------------------------------