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

Flow past cylinder LMeX Tutorial. #154

Merged
merged 5 commits into from
Dec 13, 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
5 changes: 4 additions & 1 deletion Docs/source/manual/LMeXControls.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
PeleLMeX controls
=================

.. _sec:control:

The input file specified on the command line is a free-format text file, one entry per row, that specifies input data processed by the AMReX ``ParmParse`` module.
This file needs to specified along with the executable as an `argv` option, for example:

Expand Down Expand Up @@ -76,10 +78,11 @@ IO parameters

#--------------------------IO CONTROL--------------------------
amr.plot_int = 20 # [OPT, DEF=-1] Frequency (as step #) for writting plot file
amr.plot_per = 002 # [OPT, DEF=-1] Period (time in s) for writting plot file
amr.plot_per = 0.002 # [OPT, DEF=-1] Period (time in s) for writting plot file
amr.plot_per_exact = 1 # [OPT, DEF=0] Flag to enforce exactly plt_per by shortening dt
amr.plot_file = "plt_" # [OPT, DEF="plt_"] Plot file prefix
amr.check_int = 100 # [OPT, DEF=-1] Frequency (as step #) for writting checkpoint file
amr.check_per = 0.05 # [OPT, DEF=-1] Period (time in s) for writting checkpoint file
amr.check_file = "chk" # [OPT, DEF="chk"] Checkpoint file prefix
amr.file_stepDigits = 6 # [OPT, DEF=5] Number of digits when adding nsteps to plt and chk names
amr.derive_plot_vars = avg_pressure ...# [OPT, DEF=""] List of derived variable included in the plot files
Expand Down
3 changes: 1 addition & 2 deletions Docs/source/manual/Tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ Tutorials
=========

This sections includes several self-contained tutorials.
TODO

.. toctree::
:maxdepth: 1


Tutorials_FlowPastCyl.rst
376 changes: 376 additions & 0 deletions Docs/source/manual/Tutorials_FlowPastCyl.rst

Large diffs are not rendered by default.

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.
69 changes: 69 additions & 0 deletions Exec/RegTests/EB_FlowPastCylinder/input.2d-Re500
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#----------------------DOMAIN DEFINITION-------------------------
geometry.is_periodic = 0 1 # For each dir, 0: non-perio, 1: periodic
geometry.coord_sys = 0 # 0 => cart, 1 => RZ
geometry.prob_lo = -0.02 -0.02 # x_lo y_lo (z_lo)
geometry.prob_hi = 0.10 0.02 # x_hi y_hi (z_hi)

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

#-------------------------AMR CONTROL----------------------------
amr.n_cell = 192 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 = 5 # how often to regrid
amr.n_error_buf = 2 2 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 = 300.0
prob.P_mean = 101325.0
prob.meanFlowMag = 4.255
prob.meanFlowDir = 1

#-----------------INPUTS TO CONSTANT TRANSPORT ------------------
transport.units = MKS
transport.const_viscosity = 0.0001
transport.const_bulk_viscosity = 0.0
transport.const_conductivity = 0.0
transport.const_diffusivity = 0.0

#---------------------------TIME STEPPING------------------------
amr.max_step = 30000
amr.stop_time = 0.025
amr.dt_shrink = 0.1
amr.dt_change_max = 1.1
amr.cfl = 0.7

#-------------------------PELELMEX CONTROLS----------------------
peleLM.v = 1

#---------------------------IO CONTROL---------------------------
#amr.restart = chk_07136
amr.check_file = "chk_"
amr.check_per = 0.05
amr.plot_file = "plt_"
amr.plot_per = 0.005
amr.derive_plot_vars = avg_pressure mag_vort

#------------------------- EB SETUP -----------------------------
eb2.geom_type = sphere
eb2.sphere_radius = 0.005
eb2.sphere_center = 0.0 0.0
eb2.sphere_has_fluid_inside = 0
eb2.small_volfrac = 1.0e-4

#--------------------REFINEMENT CONTROL--------------------------
amr.refinement_indicators = VortL VortH
amr.VortL.max_level = 1
amr.VortL.value_less = -1000
amr.VortL.field_name = mag_vort
amr.VortH.max_level = 1
amr.VortH.value_greater = 1000
amr.VortH.field_name = mag_vort
2 changes: 1 addition & 1 deletion Exec/RegTests/FlameSheet/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ VERBOSE = FALSE
TINY_PROFILE = FALSE

# Compilation
COMP = gnu
COMP = llvm
USE_MPI = TRUE
USE_OMP = FALSE
USE_CUDA = FALSE
Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/FlameSheet/input.2d-regt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ amr.regrid_int = 5 # 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
amr.max_grid_size = 256 # max box size


#--------------------------- Problem -------------------------------
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Overview

*PeleLMeX* is a non-subcycling version of [*PeleLM*](https://github.com/AMReX-Combustion/PeleLM) based on AMReX's [AmrCore](https://amrex-codes.github.io/amrex/docs_html/AmrCore.html) and borrowing from the incompressible solver [incflo](https://github.com/AMReX-Codes/incflo).
*PeleLMeX* is a non-subcycling version of [*PeleLM*](https://github.com/AMReX-Combustion/PeleLM) based on AMReX's [AmrCore](https://amrex-codes.github.io/amrex/docs_html/AmrCore.html) and borrowing from the incompressible solver [incflo](https://github.com/AMReX-Codes/incflo).

*PeleLMeX* is part of the [Pele combustion Suite](https://amrex-combustion.github.io/).

Expand All @@ -28,11 +28,13 @@ https://amrex-combustion.github.io/PeleLMeX/manual/html/Model.html#pelelmex-algo

A set of self-contained tutorials describing more complex problems is also provided:

https://amrex-combustion.github.io/PeleLMeX/manual/html/Tutorials.html

## Installation

### Using git submodules

You can clone the PeleLMeX and tested versions of its submodules
You can clone the PeleLMeX and tested versions of its submodules
([amrex](https://github.com/AMReX-Codes/amrex), [AMReX-Hydro](https://github.com/AMReX-Codes/AMReX-Hydro) and [PelePhysics](https://github.com/AMReX-Combustion/PelePhysics)) using:

```
Expand Down Expand Up @@ -91,14 +93,14 @@ To clean the installation, use either `make clean` or `make realclean`.

## Contributing

New contributions to *PeleLM* are welcome ! Contributing Guidelines are provided in [CONTRIBUTING.md](CONTRIBUTING.md).
New contributions to *PeleLMeX* are welcome ! Contributing Guidelines are provided in [CONTRIBUTING.md](CONTRIBUTING.md).

## Acknowledgment

This research was supported by the Exascale Computing Project (ECP), Project
Number: 17-SC-20-SC, a collaborative effort of two DOE organizations -- the
Number: 17-SC-20-SC, a collaborative effort of two DOE organizations -- the
Office of Science and the National Nuclear Security Administration --
responsible for the planning and preparation of a capable exascale ecosystem --
including software, applications, hardware, advanced system engineering, and
including software, applications, hardware, advanced system engineering, and
early testbed platforms -- to support the nation's exascale computing
imperative.
1 change: 1 addition & 0 deletions Source/PeleLM.H
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ class PeleLM : public amrex::AmrCore {
amrex::Real m_plot_per_approx = -1.;
amrex::Real m_plot_per_exact = -1.;
int m_check_int = 0;
amrex::Real m_check_per = -1.;
int m_message_int = 10;
int m_evaluatePlotVarCount = 0;
int m_plot_grad_p = 1;
Expand Down
28 changes: 27 additions & 1 deletion Source/PeleLMEvolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,34 @@ PeleLM::writeCheckNow()

if ( m_check_int > 0 && (m_nstep % m_check_int == 0) ) {
write_now = true;
} else if (m_check_per > 0.0) {
// Check to see if we've crossed a plot_per interval by comparing
// the number of intervals that have elapsed for both the current
// time and the time at the beginning of this timestep.
int num_per_old = static_cast<int>((m_cur_time-m_dt) / m_check_per);
int num_per_new = static_cast<int>((m_cur_time ) / m_check_per);
// Before using these, however, we must test for the case where we're
// within machine epsilon of the next interval. In that case, increment
// the counter, because we have indeed reached the next plot_per interval
// at this point.
const Real eps = std::numeric_limits<Real>::epsilon() * 10.0_rt * std::abs(m_cur_time);
const Real next_check_time = (num_per_old + 1) * m_check_per;
if ((num_per_new == num_per_old) && std::abs(m_cur_time - next_check_time) <= eps)
{
num_per_new += 1;
}
// Similarly, we have to account for the case where the old time is within
// machine epsilon of the beginning of this interval, so that we don't double
// count that time threshold -- we already plotted at that time on the last timestep.
if ((num_per_new != num_per_old) && std::abs((m_cur_time - m_dt) - next_check_time) <= eps)
{
num_per_old += 1;
}
if (num_per_old != num_per_new)
{
write_now = true;
}
}
// TODO : time controled ?

return write_now;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/PeleLMInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ void PeleLM::initData() {
if (m_plot_int > 0 || m_plot_per_approx > 0. || m_plot_per_exact > 0.) {
WritePlotFile();
}
if (m_check_int > 0 ) {
if (m_check_int > 0 || m_check_per > 0.) {
WriteCheckPointFile();
}

Expand Down
1 change: 1 addition & 0 deletions Source/PeleLMSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ void PeleLM::readIOParameters() {

pp.query("check_file", m_check_file);
pp.query("check_int" , m_check_int);
pp.query("check_per" , m_check_per);
pp.query("restart" , m_restart_chkfile);
pp.query("initDataPlt" , m_restart_pltfile);
pp.query("initDataPltSource" , pltfileSource);
Expand Down