Skip to content
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
1 change: 0 additions & 1 deletion Exec/DoubleRamp/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "IndexDefines.H"
#include "prob_parm.H"
#include "CAMR_params.H"
#include "EOS.H"

AMREX_GPU_DEVICE
Expand Down
2 changes: 0 additions & 2 deletions Exec/MovingEBCases/MovingPlane_Shock/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "IndexDefines.H"
#include "prob_parm.H"
#include "CAMR_params.H"
#include "EOS.H"

AMREX_GPU_DEVICE
Expand All @@ -22,7 +21,6 @@ CAMR_initdata( int i, int j, int k,
const amrex::Real* dx = geomdata.CellSize();

amrex::Real x = prob_lo[0] + (i+amrex::Real(0.5))*dx[0];
amrex::Real y = prob_lo[1] + (j+amrex::Real(0.5))*dx[1];

amrex::Real Pt, rhot, uxt;
if (x < amrex::Real(0.5)) {
Expand Down
1 change: 0 additions & 1 deletion Exec/ReReTest/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "IndexDefines.H"
#include "prob_parm.H"
#include "CAMR_params.H"
#include "EOS.H"

AMREX_GPU_DEVICE
Expand Down
1 change: 0 additions & 1 deletion Exec/Sod/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "IndexDefines.H"
#include "prob_parm.H"
#include "CAMR_params.H"
#include "EOS.H"

AMREX_GPU_DEVICE
Expand Down
4 changes: 4 additions & 0 deletions Exec/SodPlusSphere/converging_nozzle.inp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is a 3D problem: the converging-nozzle geometry is axisymmetric (built
# with a lathe), so it must be run with an executable built with DIM = 3.
# Note that the GNUmakefile in this directory defaults to DIM = 2.

amrex.fpe_trap_invalid = 1
amrex.fpe_trap_zero = 1
amrex.fpe_trap_overflow = 1
Expand Down
1 change: 0 additions & 1 deletion Exec/SodPlusSphere/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "IndexDefines.H"
#include "prob_parm.H"
#include "CAMR_params.H"
#include "EOS.H"

AMREX_GPU_DEVICE
Expand Down
27 changes: 12 additions & 15 deletions Source/CAMR.H
Original file line number Diff line number Diff line change
Expand Up @@ -479,29 +479,26 @@ CAMR::numGrow()
int ng = 4;
#ifdef AMREX_USE_EB
// IF MOL + FRD then 5
// IF Godunov + FRD then 6
// IF Godunov + FRD then 7
// IF MOL + SRD then 6
// IF Godunov + SRD then 7
// IF Godunov + SRD then 8
// IF MOL + none then 5
// IF Godunov + none then 6
//
// NoRedist takes the same ngrow_bx = 2 as FluxRedist in
// construct_hydro_source, so it needs the same number of ghost cells
if (redistribution_type == "FluxRedist" || redistribution_type == "NoRedist")
// Godunov + redistribution needs one more than the PLM stencil: the traced
// states on the outer ring of the EB Godunov box feed the redistributed
// update, and flatten_eb() needs q at +-3 around that ring.
if (redistribution_type == "FluxRedist")
{
if (do_mol) {
ng = 5;
} else {
ng = 6;
}
ng = (do_mol) ? 5 : 7;
}
else if (redistribution_type == "NoRedist")
{
ng = (do_mol) ? 5 : 6;
}
else if (redistribution_type == "StateRedist")
{
if (do_mol) {
ng = 6;
} else {
ng = 7;
}
ng = (do_mol) ? 6 : 8;
}
#endif
return ng;
Expand Down
11 changes: 6 additions & 5 deletions Source/CAMR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,13 @@ CAMR::read_params()
}
#endif

// for the moment, ppm_type = 0 does not support ppm_trace_sources --
// we need to add the momentum sources to the states (and not
// add it in trans_3d
if (ppm_type == 0 && ppm_trace_sources == 1) {
// Source tracing is not implemented for either reconstruction: the
// PPM source block in PPM.cpp is commented out and PLM never had one.
// Sources are added in hydro_transd/hydro_transdd instead.
if (ppm_trace_sources == 1) {
amrex::Print()
<< "WARNING: ppm_trace_sources = 1 not implemented for ppm_type = 0"
<< "WARNING: ppm_trace_sources = 1 is not implemented (ppm_type = "
<< ppm_type << "); sources are added in the transverse step instead"
<< std::endl;
ppm_trace_sources = 0;
pp.add("ppm_trace_sources", ppm_trace_sources);
Expand Down
8 changes: 8 additions & 0 deletions Source/EB/eb_converging_nozzle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ using namespace amrex;
********************************************************************************/
void make_eb_converging_nozzle (const Geometry& geom, int required_coarsening_level)
{
#if (AMREX_SPACEDIM != 3)
// In 2D amrex's LatheIF revolves about the origin and RotationIF ignores the
// axis argument, so the same expression below builds an unrelated geometry
// rather than a nozzle.
amrex::ignore_unused(geom, required_coarsening_level);
amrex::Abort("CAMR.geometry = converging-nozzle is an axisymmetric (lathe) geometry and requires DIM = 3");
#else
amrex::Real d_inlet = 8;
amrex::Real l_inlet = 24;
amrex::Real l_nozzle = 5;
Expand Down Expand Up @@ -52,4 +59,5 @@ void make_eb_converging_nozzle (const Geometry& geom, int required_coarsening_le
auto polys = amrex::EB2::makeUnion(main, nozzle_exit);
auto gshop = amrex::EB2::makeShop(polys);
EB2::Build(gshop, geom, required_coarsening_level, required_coarsening_level);
#endif
}
8 changes: 5 additions & 3 deletions Source/Hydro/Hydro_utils_eb_K.H
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,13 @@ void eb_compute_div (int i, int j, int k, int n,
if (eb_weights_type == 0) {
redistwgt(i,j,k) = 1.0;
} else if (eb_weights_type == 1) {
redistwgt(i,j,k) = q(i,j,k,QRHO)*( q(i,j,k,QREINT) +
// Total energy density; note QREINT is rho*e in CAMR (CNS's QEINT
// is e, which is where the old rho*(...) form came from).
redistwgt(i,j,k) = q(i,j,k,QREINT) + 0.5*q(i,j,k,QRHO)*(
#if (AMREX_SPACEDIM == 2)
0.5*(q(i,j,k,QU)*q(i,j,k,QU) + q(i,j,k,QV)*q(i,j,k,QV)) );
q(i,j,k,QU)*q(i,j,k,QU) + q(i,j,k,QV)*q(i,j,k,QV) );
#else
0.5*(q(i,j,k,QU)*q(i,j,k,QU) + q(i,j,k,QV)*q(i,j,k,QV) + q(i,j,k,QW)*q(i,j,k,QW)) );
q(i,j,k,QU)*q(i,j,k,QU) + q(i,j,k,QV)*q(i,j,k,QV) + q(i,j,k,QW)*q(i,j,k,QW) );
#endif
}
else if (eb_weights_type == 2) {
Expand Down
5 changes: 3 additions & 2 deletions Source/Hydro/MOL/MOL_umeth_eb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ MOL_umeth_eb (const Box& bx_to_fill,
// ****************************************************************
// Slopes -- we will compute divc on bxg2 so need slopes on bxg3
// ****************************************************************
FArrayBox slopetmp;
slopetmp.resize(bxg_ii,QVAR);
// Async arena: the Riemann kernels that read the slopes are still in
// flight when this function returns and nothing here synchronizes.
FArrayBox slopetmp(bxg_ii, QVAR, amrex::The_Async_Arena());
auto const& slope = slopetmp.array();

AMREX_D_TERM(auto const& fx_arr = flux_tmp[0];,
Expand Down
8 changes: 6 additions & 2 deletions Source/Params/_cpp_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ const_grav Real 0.0
# 2: extrema-preserving ppm (deprecated in C++)
ppm_type int 0

# to we reconstruct and trace under the parabolas of the source
# terms to the velocity
# do we reconstruct and trace under the parabolas of the source
# terms to the velocity. Not implemented for any ppm_type: the source
# tracing in PPM.cpp is commented out and the sources are added in the
# transverse step instead, so setting this to 1 warns and resets it to 0.
ppm_trace_sources int 0

# for piecewise linear, reconstruction order to use
Expand Down Expand Up @@ -104,6 +106,8 @@ transverse_reset_density int 1
#-----------------------------------------------------------------------------
# category: EB
#-----------------------------------------------------------------------------
# weights used to distribute the small-cell correction in flux redistribution:
# 0: uniform; 1: total energy density; 2: density; 3: volume fraction
eb_weights_type int 2
redistribution_type string "FluxRedist"

Expand Down
7 changes: 5 additions & 2 deletions Source/Params/parse_CAMR_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,12 @@ def get_decl_string(self):
# this is the line that goes into CAMR_params.H included
# into CAMR.H

static = ""
# prob.H includes this header at file scope, so the declarations are
# also unused file-scope statics in several translation units; the
# attribute keeps -Wall -Werror builds quiet.
static = "[[maybe_unused]]"
if self.static:
static = "static"
static = "[[maybe_unused]] static"

if self.dtype == "int":
tstr = "{} int {};\n".format(static, self.cpp_var_name)
Expand Down
Loading