AMReX-Hydro
AMReX-based hydro routines for low Mach number flows
Loading...
Searching...
No Matches
Utilities

Namespaces

namespace  HydroBC
namespace  HydroUtils

Macros

#define XVEL   0
#define YVEL   1
#define ZVEL   2

Functions

void HydroUtils::enforceInOutSolvability (const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > &vels_vec, amrex::BCRec const *bc_type, const amrex::Vector< amrex::Geometry > &geom, bool include_bndry_corners=false)
 Enforces solvablity by scaling outflow to match with inflow.
void HydroUtils::ExtrapVelToFaces (amrex::MultiFab const &vel, amrex::MultiFab const &vel_forces, AMREX_D_DECL(amrex::MultiFab &u_mac, amrex::MultiFab &v_mac, amrex::MultiFab &w_mac), amrex::Vector< amrex::BCRec > const &h_bcrec, amrex::BCRec const *d_bcrec, const amrex::Geometry &geom, amrex::Real dt, const amrex::EBFArrayBoxFactory &ebfact, bool godunov_ppm, bool godunov_use_forces_in_trans, std::string const &advection_type, int limiter_type=PPM::default_limiter, bool allow_inflow_on_outflow=false)
 Extrapolate the velocity to faces, for use as the pre-MAC velocity.
void HydroUtils::ExtrapVelToFaces (amrex::MultiFab const &vel, amrex::MultiFab const &vel_forces, AMREX_D_DECL(amrex::MultiFab &u_mac, amrex::MultiFab &v_mac, amrex::MultiFab &w_mac), amrex::Vector< amrex::BCRec > const &h_bcrec, amrex::BCRec const *d_bcrec, const amrex::Geometry &geom, amrex::Real dt, const amrex::EBFArrayBoxFactory &ebfact, amrex::MultiFab const *velocity_on_eb_inflow, bool godunov_ppm, bool godunov_use_forces_in_trans, std::string const &advection_type, int limiter_type=PPM::default_limiter, bool allow_inflow_on_outflow=false, amrex::iMultiFab *BC_MF=nullptr)
 Extrapolate the velocity to faces, for use as the pre-MAC velocity.

Variables

static constexpr amrex::Real small_vel = amrex::Real(1.e-8)
static constexpr amrex::Real hydro_covered_val = amrex::Real(1.0e40)

Detailed Description

Macro Definition Documentation

◆ XVEL

#define XVEL   0

Index for the X velocity component.

◆ YVEL

#define YVEL   1

Index for the Y velocity component.

◆ ZVEL

#define ZVEL   2

Index for the Z velocity component.

Function Documentation

◆ enforceInOutSolvability()

void HydroUtils::enforceInOutSolvability ( const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > & vels_vec,
amrex::BCRec const * bc_type,
const amrex::Vector< amrex::Geometry > & geom,
bool include_bndry_corners = false )

Enforces solvablity by scaling outflow to match with inflow.

Only boundaries with BCType::direction_dependent take part. The inflow and outflow are integrated over the tagged boundary faces, and the outflow is then scaled by influx/outflux. Each face is weighted by its own area, so 2D RZ is handled (an r-face carries 2*pi*r*dz and a z-face 2*pi*r*dr); spherical coordinates are not supported and are asserted against. The test for "no flow at all" compares the mean normal speed over the tagged faces against small_vel, so it does not depend on the length scale of the problem.

Parameters
[in,out]vels_vecPer level, the normal velocity in each direction. Each MultiFab is read and written in its boundary ghost cells, so it needs (filled) ghost cells: one in the normal direction if it is cell-centered, and one in each tangential direction if include_bndry_corners is true. This is asserted.
[in]bc_typeBoundary conditions for the normal velocity.
[in]geomPer level geometry.
[in]include_bndry_cornersAlso tag and correct the cells in the corners of the domain boundary.
Here is the call graph for this function:

◆ ExtrapVelToFaces() [1/2]

void HydroUtils::ExtrapVelToFaces ( amrex::MultiFab const & vel,
amrex::MultiFab const & vel_forces,
AMREX_D_DECL(amrex::MultiFab &u_mac, amrex::MultiFab &v_mac, amrex::MultiFab &w_mac) ,
amrex::Vector< amrex::BCRec > const & h_bcrec,
amrex::BCRec const * d_bcrec,
const amrex::Geometry & geom,
amrex::Real dt,
const amrex::EBFArrayBoxFactory & ebfact,
amrex::MultiFab const * velocity_on_eb_inflow,
bool godunov_ppm,
bool godunov_use_forces_in_trans,
std::string const & advection_type,
int limiter_type = PPM::default_limiter,
bool allow_inflow_on_outflow = false,
amrex::iMultiFab * BC_MF = nullptr )

Extrapolate the velocity to faces, for use as the pre-MAC velocity.

Note
Ghost-cell requirements: vel needs 3 filled ghost cells, or 4 for 3D EBGodunov; vel_forces needs 1; and velocity_on_eb_inflow, when given, needs 2.
advection_type must be one of "Godunov", "MOL" or "BDS", matching ComputeFluxesOnBoxFromState. BDS extrapolates the velocity to faces with Godunov PLM, so "BDS" here ignores godunov_ppm, and is not available with EB.
BC_MF, the position-dependent boundary conditions, is only supported with (EB)Godunov; passing it with "MOL" or "BDS" aborts, because those kernels would silently use h_bcrec/d_bcrec instead.
Here is the call graph for this function:

◆ ExtrapVelToFaces() [2/2]

void HydroUtils::ExtrapVelToFaces ( amrex::MultiFab const & vel,
amrex::MultiFab const & vel_forces,
AMREX_D_DECL(amrex::MultiFab &u_mac, amrex::MultiFab &v_mac, amrex::MultiFab &w_mac) ,
amrex::Vector< amrex::BCRec > const & h_bcrec,
amrex::BCRec const * d_bcrec,
const amrex::Geometry & geom,
amrex::Real dt,
const amrex::EBFArrayBoxFactory & ebfact,
bool godunov_ppm,
bool godunov_use_forces_in_trans,
std::string const & advection_type,
int limiter_type = PPM::default_limiter,
bool allow_inflow_on_outflow = false )

Extrapolate the velocity to faces, for use as the pre-MAC velocity.

Note
Ghost-cell requirements: vel needs 3 filled ghost cells, or 4 for 3D EBGodunov; vel_forces needs 1; and velocity_on_eb_inflow, when given, needs 2.
advection_type must be one of "Godunov", "MOL" or "BDS", matching ComputeFluxesOnBoxFromState. BDS extrapolates the velocity to faces with Godunov PLM, so "BDS" here ignores godunov_ppm, and is not available with EB.
This convenience overload takes neither velocity_on_eb_inflow nor BC_MF. Use the general overload below if you need either of them.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ hydro_covered_val

amrex::Real hydro_covered_val = amrex::Real(1.0e40)
staticconstexpr

◆ small_vel

amrex::Real small_vel = amrex::Real(1.e-8)
staticconstexpr

What we consider a ~zero velocity when upwinding.