-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some documentation on EB and Poiseuille V&V (#146)
* Add Poiseuille V&V. * Add some EB documentation. * Minor fixes. * Add plot python for Poiseuille (lifted from PeleC). * Add an input file for the Poiseuille test. * Update AMReX-Hydro & PP
- Loading branch information
Showing
11 changed files
with
278 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+47.7 KB
Docs/source/images/validations/Poiseuille3D/PoiseuilleConvergence.png
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#----------------------DOMAIN DEFINITION------------------------ | ||
geometry.is_periodic = 1 0 0 # For each dir, 0: non-perio, 1: periodic | ||
geometry.coord_sys = 0 # 0 => cart, 1 => RZ | ||
geometry.prob_lo = 0.0 -0.01 -0.01 # x_lo y_lo (z_lo) | ||
geometry.prob_hi = 0.04 0.01 0.01 # x_hi y_hi (z_hi) | ||
|
||
# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< | ||
# Interior, Inflow, Outflow, Symmetry, | ||
# SlipWallAdiab, NoSlipWallAdiab, SlipWallIsotherm, NoSlipWallIsotherm | ||
peleLM.lo_bc = Interior NoSlipWallAdiab SlipWallAdiab | ||
peleLM.hi_bc = Interior NoSlipWallAdiab SlipWallAdiab | ||
|
||
|
||
#-------------------------AMR CONTROL---------------------------- | ||
amr.n_cell = 32 16 16 # 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 = 8 # 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 = 18.0 | ||
prob.meanFlowDir = 1 | ||
|
||
#-------------------------PeleLM CONTROL---------------------------- | ||
peleLM.v = 2 | ||
peleLM.incompressible = 1 | ||
peleLM.rho = 1.0 | ||
peleLM.mu = 0.0576 | ||
peleLM.gradP0 = -82944.0 0.0 0.0 | ||
peleLM.do_temporals = 1 | ||
|
||
#amr.restart = chk01000 | ||
amr.check_int = 500 | ||
amr.plot_int = 100 | ||
amr.max_step = 20000 | ||
amr.dt_shrink = 1.0 | ||
amr.stop_time = 0.015 | ||
amr.cfl = 0.7 | ||
amr.derive_plot_vars = avg_pressure mag_vort | ||
|
||
#------------------------- EB SETUP ----------------------------- | ||
eb2.geom_type = cylinder | ||
eb2.cylinder_radius = 0.01 | ||
eb2.cylinder_direction = 0 | ||
eb2.cylinder_center = 0.0 0.0 0.0 | ||
eb2.cylinder.internal_flow = true | ||
eb2.cylinder_has_fluid_inside = 1 | ||
eb2.small_volfrac = 1.0e-4 | ||
|
||
#--------------------REFINEMENT CONTROL------------------------ | ||
amr.refinement_indicators = vort | ||
amr.vort.max_level = 2 | ||
amr.vort.vorticity_greater = 500 | ||
|
||
fabarray.mfiter_tile_size = 1024 1024 1024 | ||
|
||
nodal_proj.verbose = 0 | ||
nodal_proj.mg_max_coarsening_level = 2 | ||
amrex.fpe_trap_invalid = 1 | ||
amrex.fpe_trap_zero = 1 | ||
amrex.fpe_trap_overflow = 1 |
Submodule AMReX-Hydro
updated
from 572322 to d959ee
Submodule PelePhysics
updated
9 files
+17 −0 | Docs/sphinx/Chemistry.rst | |
+280 −0 | Docs/sphinx/EOS.rst | |
+10 −6 | Docs/sphinx/GettingStarted.rst | |
+5 −4 | Docs/sphinx/Introduction.rst | |
+4 −5 | Docs/sphinx/IntroductionToCvode.rst | |
+9 −0 | Docs/sphinx/Transport.rst | |
+1 −1 | Docs/sphinx/conf.py | |
+10 −10 | Docs/sphinx/index.rst | |
+2 −2 | ThirdParty/GNUmakefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import os | ||
import argparse | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
from matplotlib.backends.backend_pdf import PdfPages | ||
|
||
# A script to plot data from the EB_PipeFlow case | ||
# when running a simple Poiseuille flow. | ||
# Flow properties are hardcoded to: G = 82944.0, | ||
# mu = 0.0576, radius = 0.01, umax = 36.0 | ||
# Data from LMeX run at increasing resolution must be extracted | ||
# using fextract a-priori and stored in nr* folders. | ||
|
||
cmap = [ | ||
"#EE2E2F", | ||
"#008C48", | ||
"#185AA9", | ||
"#F47D23", | ||
"#662C91", | ||
"#A21D21", | ||
"#B43894", | ||
"#010202", | ||
] | ||
|
||
def theory_ooa(order, res, orig): | ||
return orig * (res[0] / res) ** order | ||
|
||
def eval_u_exact(r, dr): | ||
return 82944.0 / (4.0 * 0.0576) * (0.01 ** 2 - r ** 2) | ||
|
||
if __name__ == "__main__": | ||
radius = 0.01 | ||
umax = 36 | ||
r = np.linspace(-radius, radius, 200) | ||
u_exact = eval_u_exact(r, 0.0001) | ||
|
||
# Plot the exact data (pointwise, not cell-averaged) | ||
plt.figure("u") | ||
plt.rc('font', size=12) | ||
plt.plot( | ||
r / radius, u_exact/umax, lw=2, color=cmap[-1], label="Exact" | ||
) | ||
|
||
# Read in LMeX data | ||
resolution=[8,16,32,64] | ||
|
||
errors = np.zeros((2, len(resolution))) | ||
for k, r in enumerate(resolution): | ||
f = open('./nr{}/nr{}prof.dat'.format(r,r), 'r') | ||
rlabel="res{}".format(r) | ||
rad = [] | ||
u_x = [] | ||
for line in f: | ||
line = line.strip() | ||
columns = line.split() | ||
rad.append(float(columns[0])) | ||
u_x.append(float(columns[1])) | ||
plt.plot( | ||
np.array(rad)/radius, np.array(u_x)/umax, linestyle='--', lw=1, color=cmap[k], label=rlabel | ||
) | ||
errors[0, k] = r | ||
errors[1, k] = np.sqrt( | ||
np.sum( | ||
( | ||
np.array(u_x) / umax | ||
- eval_u_exact(np.array(rad), 0.0001) / umax | ||
) | ||
** 2 | ||
) | ||
/ r | ||
) | ||
|
||
plt.xlabel(r"$r / R$",fontsize=14) | ||
plt.ylabel(r"$u / Umax$",fontsize=14) | ||
plt.grid(which='both',color='#E6E3E3', linestyle=':', linewidth=1.0) | ||
plt.legend(bbox_to_anchor=(0.5, 0.4), loc=1, borderaxespad=0.) | ||
plt.savefig("PoiseuilleVelProf.png") | ||
|
||
plt.figure("error") | ||
plt.loglog( | ||
errors[0, :], | ||
errors[1, :], | ||
label="PeleLMeX", | ||
) | ||
p2 = theory_ooa(2, errors[0, :], 0.95*errors[1, 0]) | ||
plt.loglog(errors[0, :], p2, color='k', linestyle='--', label=f"2nd-order") | ||
plt.grid(which='both',color='#E6E3E3', linestyle=':', linewidth=1.0) | ||
plt.xlabel("Resolution") | ||
plt.ylabel("Error L2-norm") | ||
plt.legend(bbox_to_anchor=(0.9, 0.9), loc=1, borderaxespad=0.) | ||
plt.savefig("PoiseuilleConvergence.png") |