Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add the TaylorGreen vortex breakdown case from PeleC #106

Merged
merged 5 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Docs/source/Validation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
PeleLMeX validations
====================

This section is work-in-progress.

Taylor-Green vortex breakdown
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Taylor-Green vortex breakdown case is a classical CFD test case
described in `here <>`

Building and running
####################

.. code-block:: bash

$ make -j 16 DIM=3 USE_MPI=TRUE TPL
$ make -j 16 DIM=3 USE_MPI=TRUE
$ mpiexec -n 16 $EXECUTABLE inputs_3d amr.ncell=64 64 64

The user can run a convergence study by varying ``amr.ncell``.

Results
#######

The following figures shows the kinetic energy, the dissipation rate and
the enstrophy as function of time (all quantities are non-dimensional)
for increasing resolutions (ranging from 64^3 to 512^3) and compared
to the results of a high-order spectral solver with a 512^3 resolution.

.. figure:: images/validations/TaylorGreen/KinEnergy.png
:align: center
:figwidth: 60%

.. figure:: images/validations/TaylorGreen/Dissipation.png
:align: center
:figwidth: 60%

.. figure:: images/validations/TaylorGreen/Enstrophy.png
:align: center
:figwidth: 60%
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ point your web browser at the file ``${PELELMEX_HOME}/Docs/build/html/index.html
:caption: Contents:

Model.rst
Validation.rst
LMeXControls.rst
Troubleshooting.rst

Expand Down
29 changes: 29 additions & 0 deletions Exec/RegTests/TaylorGreen/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
TOP = ../../../..
AMREX_HOME ?= ${TOP}/amrex
PELELMEX_HOME ?= ${TOP}/PeleLMeX
PELE_PHYSICS_HOME ?= ${TOP}/PelePhysics
AMREX_HYDRO_HOME ?= ${TOP}/AMReX-Hydro


# AMReX
DIM = 3
DEBUG = FALSE
PRECISION = DOUBLE
VERBOSE = FALSE
TINY_PROFILE = FALSE

# Compilation
COMP = llvm
USE_MPI = TRUE
USE_OMP = FALSE
USE_CUDA = FALSE
USE_HIP = FALSE

# PeleLMeX

# PelePhysics
Chemistry_Model = air
Eos_Model = Fuego
Transport_Model = Constant

include $(PELELMEX_HOME)/Utils/Make.PeleLMeX
19 changes: 19 additions & 0 deletions Exec/RegTests/TaylorGreen/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Taylor-Green Vortex (pulled from PeleC)

This setup is one of the test problems outlined by [the High-Order CFD workshop](https://www.grc.nasa.gov/hiocfd/).

A complete description of the problem can be found
[here](https://www.grc.nasa.gov/hiocfd/wp-content/uploads/sites/22/case_c3.3.pdf) and
the reference data is found
[here](https://www.grc.nasa.gov/wp-content/uploads/sites/22/C3.3_datafiles.zip). More
details of the problem and methods used to obtain the reference data
can be found in Bull and Jameson (2014) 7th AIAA Theoretical Fluid
Mechanics Conference (doi: 10.2514/6.2014-3210) and DeBonis (2013)
51st AIAA Aerospace Sciences Meeting (doi:10.2514/6.2013-382).

To directly plot the evolution of integrated kinetic energy and enstrophy, use
the data provided in temporals/tempState with the help of the processTGdata.py
script.

Note that these commands provide adimentional results, with t\* = t/(L\_0/V\_0),
E\_k\* = E\_k / ( rho\_0 * V\_0 * V\_0) and psi\* = psi / (V\_0/L\_0)^2
60 changes: 60 additions & 0 deletions Exec/RegTests/TaylorGreen/input.3d_BDS
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#----------------------DOMAIN DEFINITION------------------------
geometry.is_periodic = 1 1 1 # For each dir, 0: non-perio, 1: periodic
geometry.coord_sys = 0 # 0 => cart, 1 => RZ
geometry.prob_lo = -0.01 -0.01 -0.01 # x_lo y_lo (z_lo)
geometry.prob_hi = 0.01 0.01 0.01 # x_hi y_hi (z_hi)

# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<
# Interior, Inflow, Outflow, Symmetry,
# SlipWallAdiab, NoSlipWallAdiab, SlipWallIsotherm, NoSlipWallIsotherm
peleLM.lo_bc = Interior Interior Interior
peleLM.hi_bc = Interior Interior Interior


#-------------------------AMR CONTROL----------------------------
amr.n_cell = 32 32 32 # Level 0 number of cells in each direction
amr.n_cell = 64 64 64 # Level 0 number of cells in each direction
amr.v = 1 # AMR verbose
amr.max_level = 0 # maximum level number allowed
amr.ref_ratio = 2 2 2 2 # refinement ratio
amr.regrid_int = 2 # how often to regrid
amr.n_error_buf = 1 1 2 2 # number of buffer cells in error est
amr.grid_eff = 0.7 # what constitutes an efficient grid
amr.blocking_factor = 16 # block factor in grid generation (min box size)
amr.max_grid_size = 64 # max box size


#--------------------------- Problem -------------------------------
prob.T_mean = 351.59509
prob.P_mean = 101325.0
prob.reynolds = 1600.0
prob.mach = 0.08
prob.prandtl = 0.71

#-------------------------PeleLM CONTROL----------------------------
peleLM.v = 1
peleLM.incompressible = 0
peleLM.sdc_iterMax = 1
peleLM.advection_scheme = "Godunov_BDS"

peleLM.do_temporals = 1
peleLM.temporal_int = 5

amr.check_int = 100
amr.plot_int = 100
amr.max_step = 500
amr.dt_shrink = 0.1
amr.stop_time = 0.0021160148
amr.cfl = 0.7
amr.derive_plot_vars = avg_pressure mag_vort
#amr.restart = chk00500

#--------------------REFINEMENT CONTROL------------------------
#amr.refinement_indicators = temp
#amr.temp.max_level = 2
#amr.temp.value_greater = 305
#amr.temp.field_name = temp

#amrex.fpe_trap_invalid = 1
#amrex.fpe_trap_zero = 1
#amrex.fpe_trap_overflow = 1
60 changes: 60 additions & 0 deletions Exec/RegTests/TaylorGreen/input.3d_PLM
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#----------------------DOMAIN DEFINITION------------------------
geometry.is_periodic = 1 1 1 # For each dir, 0: non-perio, 1: periodic
geometry.coord_sys = 0 # 0 => cart, 1 => RZ
geometry.prob_lo = -0.01 -0.01 -0.01 # x_lo y_lo (z_lo)
geometry.prob_hi = 0.01 0.01 0.01 # x_hi y_hi (z_hi)

# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<
# Interior, Inflow, Outflow, Symmetry,
# SlipWallAdiab, NoSlipWallAdiab, SlipWallIsotherm, NoSlipWallIsotherm
peleLM.lo_bc = Interior Interior Interior
peleLM.hi_bc = Interior Interior Interior


#-------------------------AMR CONTROL----------------------------
amr.n_cell = 32 32 32 # Level 0 number of cells in each direction
#amr.n_cell = 64 64 64 # Level 0 number of cells in each direction
amr.v = 1 # AMR verbose
amr.max_level = 0 # maximum level number allowed
amr.ref_ratio = 2 2 2 2 # refinement ratio
amr.regrid_int = 2 # how often to regrid
amr.n_error_buf = 1 1 2 2 # number of buffer cells in error est
amr.grid_eff = 0.7 # what constitutes an efficient grid
amr.blocking_factor = 16 # block factor in grid generation (min box size)
amr.max_grid_size = 64 # max box size


#--------------------------- Problem -------------------------------
prob.T_mean = 351.59509
prob.P_mean = 101325.0
prob.reynolds = 1600.0
prob.mach = 0.08
prob.prandtl = 0.71

#-------------------------PeleLM CONTROL----------------------------
peleLM.v = 1
peleLM.incompressible = 0
peleLM.sdc_iterMax = 1
peleLM.advection_scheme = "Godunov_PPM"

peleLM.do_temporals = 1
peleLM.temporal_int = 5

amr.check_int = 100
amr.plot_int = 100
amr.max_step = 500
amr.dt_shrink = 0.1
amr.stop_time = 0.0021160148
amr.cfl = 0.7
amr.derive_plot_vars = avg_pressure mag_vort
#amr.restart = chk00500

#--------------------REFINEMENT CONTROL------------------------
#amr.refinement_indicators = temp
#amr.temp.max_level = 2
#amr.temp.value_greater = 305
#amr.temp.field_name = temp

#amrex.fpe_trap_invalid = 1
#amrex.fpe_trap_zero = 1
#amrex.fpe_trap_overflow = 1
60 changes: 60 additions & 0 deletions Exec/RegTests/TaylorGreen/input.3d_PPM
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#----------------------DOMAIN DEFINITION------------------------
geometry.is_periodic = 1 1 1 # For each dir, 0: non-perio, 1: periodic
geometry.coord_sys = 0 # 0 => cart, 1 => RZ
geometry.prob_lo = -0.01 -0.01 -0.01 # x_lo y_lo (z_lo)
geometry.prob_hi = 0.01 0.01 0.01 # x_hi y_hi (z_hi)

# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<
# Interior, Inflow, Outflow, Symmetry,
# SlipWallAdiab, NoSlipWallAdiab, SlipWallIsotherm, NoSlipWallIsotherm
peleLM.lo_bc = Interior Interior Interior
peleLM.hi_bc = Interior Interior Interior


#-------------------------AMR CONTROL----------------------------
amr.n_cell = 32 32 32 # Level 0 number of cells in each direction
amr.n_cell = 64 64 64 # Level 0 number of cells in each direction
amr.v = 1 # AMR verbose
amr.max_level = 0 # maximum level number allowed
amr.ref_ratio = 2 2 2 2 # refinement ratio
amr.regrid_int = 2 # how often to regrid
amr.n_error_buf = 1 1 2 2 # number of buffer cells in error est
amr.grid_eff = 0.7 # what constitutes an efficient grid
amr.blocking_factor = 16 # block factor in grid generation (min box size)
amr.max_grid_size = 64 # max box size


#--------------------------- Problem -------------------------------
prob.T_mean = 351.59509
prob.P_mean = 101325.0
prob.reynolds = 1600.0
prob.mach = 0.08
prob.prandtl = 0.71

#-------------------------PeleLM CONTROL----------------------------
peleLM.v = 1
peleLM.incompressible = 0
peleLM.sdc_iterMax = 1
peleLM.advection_scheme = "Godunov_PPM"

peleLM.do_temporals = 1
peleLM.temporal_int = 5

amr.check_int = 100
amr.plot_int = 100
amr.max_step = 500
amr.dt_shrink = 0.1
amr.stop_time = 0.0021160148
amr.cfl = 0.7
amr.derive_plot_vars = avg_pressure mag_vort
#amr.restart = chk00500

#--------------------REFINEMENT CONTROL------------------------
#amr.refinement_indicators = temp
#amr.temp.max_level = 2
#amr.temp.value_greater = 305
#amr.temp.field_name = temp

#amrex.fpe_trap_invalid = 1
#amrex.fpe_trap_zero = 1
#amrex.fpe_trap_overflow = 1
110 changes: 110 additions & 0 deletions Exec/RegTests/TaylorGreen/pelelm_prob.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#ifndef PELELM_PROB_H_
#define PELELM_PROB_H_

#include <AMReX_Geometry.H>
#include <AMReX_FArrayBox.H>
#include <AMReX_SPACE.H>

#include <PeleLM_Index.H>
#include <pelelm_prob_parm.H>
#include <PMFData.H>
#include <PelePhysics.H>

AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void pelelm_initdata(int i, int j, int k,
int is_incompressible,
amrex::Array4<amrex::Real> const& state,
amrex::Array4<amrex::Real> const& aux,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const * /*pmf_data*/)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();
const amrex::Real* dx = geomdata.CellSize();

AMREX_D_TERM(const amrex::Real x = prob_lo[0] + (i+0.5)*dx[0];,
const amrex::Real y = prob_lo[1] + (j+0.5)*dx[1];,
const amrex::Real z = prob_lo[2] + (k+0.5)*dx[2];);

AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0];,
const amrex::Real Ly = prob_hi[1] - prob_lo[1];,
const amrex::Real Lz = prob_hi[2] - prob_lo[2]);

auto eos = pele::physics::PhysicsType::eos();

amrex::Real massfrac[NUM_SPECIES] = {0.0};
massfrac[O2_ID] = 0.233;
massfrac[N2_ID] = 0.767;

// TG functions
amrex::Real u[3] = {0.0};
u[0] = prob_parm.v0 * AMREX_D_TERM( sin(prob_parm.omega_x * x / prob_parm.L),
*cos(prob_parm.omega_y * y / prob_parm.L),
*cos(prob_parm.omega_z * z / prob_parm.L));
u[1] = -prob_parm.v0 * AMREX_D_TERM( cos(prob_parm.omega_x * x / prob_parm.L),
*sin(prob_parm.omega_y * y / prob_parm.L),
*cos(prob_parm.omega_z * z / prob_parm.L));
if (prob_parm.convecting) {
u[0] += prob_parm.v0;
u[1] += prob_parm.v0;
}

AMREX_D_TERM(state(i,j,k,VELX) = u[0];,
state(i,j,k,VELY) = u[1];,
state(i,j,k,VELZ) = u[2]);

state(i,j,k,TEMP) = prob_parm.T_mean;

amrex::Real P_cgs = prob_parm.P_mean * 10.0;

// Density
amrex::Real rho_cgs = 0.0;
eos.PYT2R(P_cgs, massfrac, state(i,j,k,TEMP), rho_cgs);
state(i,j,k,DENSITY) = rho_cgs * 1.0e3;

// Enthalpy
amrex::Real h_cgs = 0.0;
eos.TY2H(state(i,j,k,TEMP), massfrac, h_cgs);
state(i,j,k,RHOH) = h_cgs * 1.0e-4 * state(i,j,k,DENSITY);

// Species mass
for (int n = 0; n < NUM_SPECIES; n++) {
state(i,j,k,FIRSTSPEC+n) = massfrac[n] * state(i,j,k,DENSITY);
}

}

AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void
bcnormal(
const amrex::Real* /*x[AMREX_SPACEDIM]*/,
const int /*m_nAux*/,
amrex::Real* /*s_ext[NVAR]*/,
const int /*idir*/,
const int /*sgn*/,
const amrex::Real /*time*/,
amrex::GeometryData const& /*geomdata*/,
ProbParm const& /*prob_parm*/,
pele::physics::PMF::PmfData::DataContainer const * /*pmf_data*/)
{
}

AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void
zero_visc (int i, int j, int k,
amrex::Array4<amrex::Real> const& beta,
amrex::GeometryData const& geomdata,
amrex::Box const& domainBox,
const int dir,
const int beta_comp,
const int nComp)
{
amrex::ignore_unused(i,j,k,beta,geomdata,domainBox,dir,beta_comp,nComp);
// We treat species when beta_comp == 0 and nComp == NUM_SPECIES
// otherwise this routine could be called for other face diffusivity (Temp, velocity, ...)
}
#endif
Loading