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

Functions

void 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 ComputeFluxesOnBoxFromState (amrex::Box const &bx, int ncomp, amrex::MFIter &mfi, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &qnph, AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z), AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z), bool knownFaceState, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac), AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_flux, amrex::Array4< amrex::Real const > const &v_flux, amrex::Array4< amrex::Real const > const &w_flux), amrex::Array4< amrex::Real const > const &divu, amrex::Array4< amrex::Real const > const &fq, amrex::Geometry geom, amrex::Real l_dt, amrex::Vector< amrex::BCRec > const &h_bcrec, const amrex::BCRec *d_bcrec, int const *iconserv, const amrex::EBFArrayBoxFactory &ebfact, amrex::Array4< amrex::Real const > const &values_on_eb_inflow, bool godunov_use_ppm, bool godunov_use_forces_in_trans, bool is_velocity, bool fluxes_are_area_weighted, std::string const &advection_type, int limiter_type=PPM::default_limiter, bool allow_inflow_on_outflow=false, amrex::Array4< int const > const &bc_arr={})
 Compute edge state and flux. Most general version for use with multilevel synchronization. All other versions ultimately call this one. Allows time-depdendent inflow and inflow through EB.
 
void ComputeFluxesOnBoxFromState (amrex::Box const &bx, int ncomp, amrex::MFIter &mfi, amrex::Array4< amrex::Real const > const &q, AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z), AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z), bool knownFaceState, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac), AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_flux, amrex::Array4< amrex::Real const > const &v_flux, amrex::Array4< amrex::Real const > const &w_flux), amrex::Array4< amrex::Real const > const &divu, amrex::Array4< amrex::Real const > const &fq, amrex::Geometry geom, amrex::Real l_dt, amrex::Vector< amrex::BCRec > const &h_bcrec, const amrex::BCRec *d_bcrec, int const *iconserv, const amrex::EBFArrayBoxFactory &ebfact, amrex::Array4< amrex::Real const > const &values_on_eb_inflow, bool godunov_use_ppm, bool godunov_use_forces_in_trans, bool is_velocity, bool fluxes_are_area_weighted, std::string const &advection_type, int limiter_type=PPM::default_limiter, bool allow_inflow_on_outflow=false, amrex::Array4< int const > const &bc_arr={})
 
void ComputeFluxesOnBoxFromState (amrex::Box const &bx, int ncomp, amrex::MFIter &mfi, amrex::Array4< amrex::Real const > const &q, AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z), AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z), bool knownFaceState, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac), amrex::Array4< amrex::Real const > const &divu, amrex::Array4< amrex::Real const > const &fq, amrex::Geometry geom, amrex::Real l_dt, amrex::Vector< amrex::BCRec > const &h_bcrec, const amrex::BCRec *d_bcrec, int const *iconserv, const amrex::EBFArrayBoxFactory &ebfact, amrex::Array4< amrex::Real const > const &values_on_eb_inflow, bool godunov_use_ppm, bool godunov_use_forces_in_trans, bool is_velocity, bool fluxes_are_area_weighted, std::string const &advection_type, int limiter_type=PPM::default_limiter, bool allow_inflow_on_outflow=false, amrex::Array4< int const > const &bc_arr={})
 Compute edge state and flux. Allows inflow on EB but NOT time-dependent inflow.
 
void ComputeFluxesOnBoxFromState (amrex::Box const &bx, int ncomp, amrex::MFIter &mfi, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &qnph, AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z), AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z), bool knownFaceState, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac), amrex::Array4< amrex::Real const > const &divu, amrex::Array4< amrex::Real const > const &fq, amrex::Geometry geom, amrex::Real l_dt, amrex::Vector< amrex::BCRec > const &h_bcrec, const amrex::BCRec *d_bcrec, int const *iconserv, const amrex::EBFArrayBoxFactory &ebfact, bool godunov_use_ppm, bool godunov_use_forces_in_trans, bool is_velocity, bool fluxes_are_area_weighted, std::string const &advection_type, int limiter_type=PPM::default_limiter, bool allow_inflow_on_outflow=false, amrex::Array4< int const > const &bc_arr={})
 Compute edge state and flux. Allows time-depdendent inflow but no inflow through EB.
 
void ComputeFluxesOnBoxFromState (amrex::Box const &bx, int ncomp, amrex::MFIter &mfi, amrex::Array4< amrex::Real const > const &q, AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z), AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z), bool knownFaceState, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac), amrex::Array4< amrex::Real const > const &divu, amrex::Array4< amrex::Real const > const &fq, amrex::Geometry geom, amrex::Real l_dt, amrex::Vector< amrex::BCRec > const &h_bcrec, const amrex::BCRec *d_bcrec, int const *iconserv, const amrex::EBFArrayBoxFactory &ebfact, bool godunov_use_ppm, bool godunov_use_forces_in_trans, bool is_velocity, bool fluxes_are_area_weighted, std::string const &advection_type, int limiter_type=PPM::default_limiter, bool allow_inflow_on_outflow=false, amrex::Array4< int const > const &bc_arr={})
 Compute edge state and flux. Does NOT allow time-depdendent inflow or inflow through EB.
 
void ComputeFluxesOnBoxFromState (amrex::Box const &bx, int ncomp, amrex::MFIter &mfi, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &qnph, AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z), AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z), bool knownFaceState, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac), amrex::Array4< amrex::Real const > const &divu, amrex::Array4< amrex::Real const > const &fq, amrex::Geometry geom, amrex::Real l_dt, amrex::Vector< amrex::BCRec > const &h_bcrec, const amrex::BCRec *d_bcrec, int const *iconserv, const amrex::EBFArrayBoxFactory &ebfact, amrex::Array4< amrex::Real const > const &values_on_eb_inflow, bool godunov_use_ppm, bool godunov_use_forces_in_trans, bool is_velocity, bool fluxes_are_area_weighted, std::string const &advection_type, int limiter_type=PPM::default_limiter, bool allow_inflow_on_outflow=false, amrex::Array4< int const > const &bc_arr={})
 Compute edge state and flux. Allows time-depdendent inflow and inflow through EB.
 
void 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 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.
 
void ComputeConvectiveTerm (amrex::Box const &bx, int num_comp, amrex::MFIter &mfi, amrex::Array4< amrex::Real const > const &q, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &q_on_face_x, amrex::Array4< amrex::Real const > const &q_on_face_y, amrex::Array4< amrex::Real const > const &q_on_face_z), amrex::Array4< amrex::Real const > const &divu, amrex::Array4< amrex::Real > const &convTerm, int const *iconserv, const amrex::EBFArrayBoxFactory &ebfact, std::string const &advection_type)
 If convective, compute convTerm = u dot grad q = div (u q) - q div(u).
 
void ComputeFluxes (amrex::Box const &bx, AMREX_D_DECL(amrex::Array4< amrex::Real > const &fx, amrex::Array4< amrex::Real > const &fy, amrex::Array4< amrex::Real > const &fz), AMREX_D_DECL(amrex::Array4< amrex::Real const > const &umac, amrex::Array4< amrex::Real const > const &vmac, amrex::Array4< amrex::Real const > const &wmac), AMREX_D_DECL(amrex::Array4< amrex::Real const > const &xed, amrex::Array4< amrex::Real const > const &yed, amrex::Array4< amrex::Real const > const &zed), amrex::Geometry const &geom, int ncomp, bool fluxes_are_area_weighted, int const *iconserv)
 Compute Fluxes.
 
void ComputeDivergence (amrex::Box const &bx, amrex::Array4< amrex::Real > const &div, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fx, amrex::Array4< amrex::Real const > const &fy, amrex::Array4< amrex::Real const > const &fz), int ncomp, amrex::Geometry const &geom, amrex::Real mult, bool fluxes_are_area_weighted)
 Compute divergence.
 
void EB_ComputeFluxes (amrex::Box const &bx, AMREX_D_DECL(amrex::Array4< amrex::Real > const &fx, amrex::Array4< amrex::Real > const &fy, amrex::Array4< amrex::Real > const &fz), AMREX_D_DECL(amrex::Array4< amrex::Real const > const &umac, amrex::Array4< amrex::Real const > const &vmac, amrex::Array4< amrex::Real const > const &wmac), AMREX_D_DECL(amrex::Array4< amrex::Real const > const &xedge, amrex::Array4< amrex::Real const > const &yedge, amrex::Array4< amrex::Real const > const &zedge), AMREX_D_DECL(amrex::Array4< amrex::Real const > const &apx, amrex::Array4< amrex::Real const > const &apy, amrex::Array4< amrex::Real const > const &apz), amrex::Geometry const &geom, int ncomp, amrex::Array4< amrex::EBCellFlag const > const &flag, bool fluxes_are_area_weighted, int const *iconserv)
 Compute Fluxes in the presence of EB.
 
void EB_ComputeDivergence (amrex::Box const &bx, amrex::Array4< amrex::Real > const &div, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fx, amrex::Array4< amrex::Real const > const &fy, amrex::Array4< amrex::Real const > const &fz), amrex::Array4< amrex::Real const > const &vfrac, int ncomp, amrex::Geometry const &geom, amrex::Real mult, bool fluxes_are_area_weighted)
 
void EB_ComputeDivergence (amrex::Box const &bx, amrex::Array4< amrex::Real > const &div, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fx, amrex::Array4< amrex::Real const > const &fy, amrex::Array4< amrex::Real const > const &fz), amrex::Array4< amrex::Real const > const &vfrac, int ncomp, amrex::Geometry const &geom, amrex::Real mult, bool fluxes_are_area_weighted, amrex::Array4< amrex::Real const > const &eb_velocity, amrex::Array4< amrex::Real const > const &values_on_eb_inflow, amrex::Array4< amrex::EBCellFlag const > const &flag_arr, amrex::Array4< amrex::Real const > const &barea, amrex::Array4< amrex::Real const > const &bnorm)
 

Detailed Description

Collection of hydro utility functions

Function Documentation

◆ ComputeConvectiveTerm()

void HydroUtils::ComputeConvectiveTerm ( amrex::Box const &  bx,
int  num_comp,
amrex::MFIter &  mfi,
amrex::Array4< amrex::Real const > const &  q,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &q_on_face_x, amrex::Array4< amrex::Real const > const &q_on_face_y, amrex::Array4< amrex::Real const > const &q_on_face_z)  ,
amrex::Array4< amrex::Real const > const &  divu,
amrex::Array4< amrex::Real > const &  convTerm,
int const *  iconserv,
const amrex::EBFArrayBoxFactory &  ebfact,
std::string const &  advection_type 
)

If convective, compute convTerm = u dot grad q = div (u q) - q div(u).

◆ ComputeDivergence()

void HydroUtils::ComputeDivergence ( amrex::Box const &  bx,
amrex::Array4< amrex::Real > const &  div,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fx, amrex::Array4< amrex::Real const > const &fy, amrex::Array4< amrex::Real const > const &fz)  ,
int  ncomp,
amrex::Geometry const &  geom,
amrex::Real  mult,
bool  fluxes_are_area_weighted 
)

Compute divergence.

◆ ComputeFluxes()

void HydroUtils::ComputeFluxes ( amrex::Box const &  bx,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &fx, amrex::Array4< amrex::Real > const &fy, amrex::Array4< amrex::Real > const &fz)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &umac, amrex::Array4< amrex::Real const > const &vmac, amrex::Array4< amrex::Real const > const &wmac)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &xed, amrex::Array4< amrex::Real const > const &yed, amrex::Array4< amrex::Real const > const &zed)  ,
amrex::Geometry const &  geom,
int  ncomp,
bool  fluxes_are_area_weighted,
int const *  iconserv 
)

Compute Fluxes.

Parameters
[in]iconservArray of length ncomp giving, per component: 1 conservative, 0 convective, -1 the face array already holds the final flux. For -1 the face value is copied to the flux unchanged: no velocity, no face area, no RZ $2\pi r$ and, in the EB version, no aperture factor is applied. A caller that uses -1 together with fluxes_are_area_weighted must therefore supply a face array that is already weighted by all of those factors. -1 is only meaningful with knownFaceState = true; with knownFaceState = false the edge-state kernels treat -1 as conservative and write a predicted state into the face array, which is then copied out as the flux with no velocity factor.

◆ ComputeFluxesOnBoxFromState() [1/6]

void HydroUtils::ComputeFluxesOnBoxFromState ( amrex::Box const &  bx,
int  ncomp,
amrex::MFIter &  mfi,
amrex::Array4< amrex::Real const > const &  q,
amrex::Array4< amrex::Real const > const &  qnph,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z)  ,
bool  knownFaceState,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac)  ,
amrex::Array4< amrex::Real const > const &  divu,
amrex::Array4< amrex::Real const > const &  fq,
amrex::Geometry  geom,
amrex::Real  l_dt,
amrex::Vector< amrex::BCRec > const &  h_bcrec,
const amrex::BCRec *  d_bcrec,
int const *  iconserv,
const amrex::EBFArrayBoxFactory &  ebfact,
amrex::Array4< amrex::Real const > const &  values_on_eb_inflow,
bool  godunov_use_ppm,
bool  godunov_use_forces_in_trans,
bool  is_velocity,
bool  fluxes_are_area_weighted,
std::string const &  advection_type,
int  limiter_type = PPM::default_limiter,
bool  allow_inflow_on_outflow = false,
amrex::Array4< int const > const &  bc_arr = {} 
)

Compute edge state and flux. Allows time-depdendent inflow and inflow through EB.

Note
See ComputeFluxes for the meaning of iconserv, in particular the iconserv[n] == -1 convention, which means the face array already holds the final flux and bypasses every geometric factor. It requires knownFaceState = true.
Ghost-cell requirements, when knownFaceState is false and the edge state is predicted here: q needs 3 filled ghost cells (4 for 3D EBGodunov, and BDS needs the corners as well), the MAC velocities need 1, and divu needs
  1. divu must be a valid Array4 in 3D Godunov for every component, and for BDS whenever any component is conservative.
advection_type must be one of "Godunov", "MOL" or "BDS". BDS is not available with EB.
On a level that has cut cells, the cut boxes are handled by EBGodunov, which uses PLM and adds the forces after the transverse terms. godunov_use_ppm and godunov_use_forces_in_trans are therefore ignored on every box of such a level, so that the scheme does not change from box to box and a face shared by a regular box and a cut box is computed the same way from both sides.
bc_arr, 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.

◆ ComputeFluxesOnBoxFromState() [2/6]

void HydroUtils::ComputeFluxesOnBoxFromState ( amrex::Box const &  bx,
int  ncomp,
amrex::MFIter &  mfi,
amrex::Array4< amrex::Real const > const &  q,
amrex::Array4< amrex::Real const > const &  qnph,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z)  ,
bool  knownFaceState,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac)  ,
amrex::Array4< amrex::Real const > const &  divu,
amrex::Array4< amrex::Real const > const &  fq,
amrex::Geometry  geom,
amrex::Real  l_dt,
amrex::Vector< amrex::BCRec > const &  h_bcrec,
const amrex::BCRec *  d_bcrec,
int const *  iconserv,
const amrex::EBFArrayBoxFactory &  ebfact,
bool  godunov_use_ppm,
bool  godunov_use_forces_in_trans,
bool  is_velocity,
bool  fluxes_are_area_weighted,
std::string const &  advection_type,
int  limiter_type = PPM::default_limiter,
bool  allow_inflow_on_outflow = false,
amrex::Array4< int const > const &  bc_arr = {} 
)

Compute edge state and flux. Allows time-depdendent inflow but no inflow through EB.

Note
See ComputeFluxes for the meaning of iconserv, in particular the iconserv[n] == -1 convention, which means the face array already holds the final flux and bypasses every geometric factor. It requires knownFaceState = true.
Ghost-cell requirements, when knownFaceState is false and the edge state is predicted here: q needs 3 filled ghost cells (4 for 3D EBGodunov, and BDS needs the corners as well), the MAC velocities need 1, and divu needs
  1. divu must be a valid Array4 in 3D Godunov for every component, and for BDS whenever any component is conservative.
advection_type must be one of "Godunov", "MOL" or "BDS". BDS is not available with EB.
On a level that has cut cells, the cut boxes are handled by EBGodunov, which uses PLM and adds the forces after the transverse terms. godunov_use_ppm and godunov_use_forces_in_trans are therefore ignored on every box of such a level, so that the scheme does not change from box to box and a face shared by a regular box and a cut box is computed the same way from both sides.
bc_arr, 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.

◆ ComputeFluxesOnBoxFromState() [3/6]

void HydroUtils::ComputeFluxesOnBoxFromState ( amrex::Box const &  bx,
int  ncomp,
amrex::MFIter &  mfi,
amrex::Array4< amrex::Real const > const &  q,
amrex::Array4< amrex::Real const > const &  qnph,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z)  ,
bool  knownFaceState,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_flux, amrex::Array4< amrex::Real const > const &v_flux, amrex::Array4< amrex::Real const > const &w_flux)  ,
amrex::Array4< amrex::Real const > const &  divu,
amrex::Array4< amrex::Real const > const &  fq,
amrex::Geometry  geom,
amrex::Real  l_dt,
amrex::Vector< amrex::BCRec > const &  h_bcrec,
const amrex::BCRec *  d_bcrec,
int const *  iconserv,
const amrex::EBFArrayBoxFactory &  ebfact,
amrex::Array4< amrex::Real const > const &  values_on_eb_inflow,
bool  godunov_use_ppm,
bool  godunov_use_forces_in_trans,
bool  is_velocity,
bool  fluxes_are_area_weighted,
std::string const &  advection_type,
int  limiter_type = PPM::default_limiter,
bool  allow_inflow_on_outflow = false,
amrex::Array4< int const > const &  bc_arr = {} 
)

Compute edge state and flux. Most general version for use with multilevel synchronization. All other versions ultimately call this one. Allows time-depdendent inflow and inflow through EB.

Note
See ComputeFluxes for the meaning of iconserv, in particular the iconserv[n] == -1 convention, which means the face array already holds the final flux and bypasses every geometric factor. It requires knownFaceState = true.
Ghost-cell requirements, when knownFaceState is false and the edge state is predicted here: q needs 3 filled ghost cells (4 for 3D EBGodunov, and BDS needs the corners as well), the MAC velocities need 1, and divu needs
  1. divu must be a valid Array4 in 3D Godunov for every component, and for BDS whenever any component is conservative.
advection_type must be one of "Godunov", "MOL" or "BDS". BDS is not available with EB.
On a level that has cut cells, the cut boxes are handled by EBGodunov, which uses PLM and adds the forces after the transverse terms. godunov_use_ppm and godunov_use_forces_in_trans are therefore ignored on every box of such a level, so that the scheme does not change from box to box and a face shared by a regular box and a cut box is computed the same way from both sides.
bc_arr, 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.

◆ ComputeFluxesOnBoxFromState() [4/6]

void HydroUtils::ComputeFluxesOnBoxFromState ( amrex::Box const &  bx,
int  ncomp,
amrex::MFIter &  mfi,
amrex::Array4< amrex::Real const > const &  q,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z)  ,
bool  knownFaceState,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac)  ,
amrex::Array4< amrex::Real const > const &  divu,
amrex::Array4< amrex::Real const > const &  fq,
amrex::Geometry  geom,
amrex::Real  l_dt,
amrex::Vector< amrex::BCRec > const &  h_bcrec,
const amrex::BCRec *  d_bcrec,
int const *  iconserv,
const amrex::EBFArrayBoxFactory &  ebfact,
amrex::Array4< amrex::Real const > const &  values_on_eb_inflow,
bool  godunov_use_ppm,
bool  godunov_use_forces_in_trans,
bool  is_velocity,
bool  fluxes_are_area_weighted,
std::string const &  advection_type,
int  limiter_type = PPM::default_limiter,
bool  allow_inflow_on_outflow = false,
amrex::Array4< int const > const &  bc_arr = {} 
)

Compute edge state and flux. Allows inflow on EB but NOT time-dependent inflow.

Note
See ComputeFluxes for the meaning of iconserv, in particular the iconserv[n] == -1 convention, which means the face array already holds the final flux and bypasses every geometric factor. It requires knownFaceState = true.
Ghost-cell requirements, when knownFaceState is false and the edge state is predicted here: q needs 3 filled ghost cells (4 for 3D EBGodunov, and BDS needs the corners as well), the MAC velocities need 1, and divu needs
  1. divu must be a valid Array4 in 3D Godunov for every component, and for BDS whenever any component is conservative.
advection_type must be one of "Godunov", "MOL" or "BDS". BDS is not available with EB.
On a level that has cut cells, the cut boxes are handled by EBGodunov, which uses PLM and adds the forces after the transverse terms. godunov_use_ppm and godunov_use_forces_in_trans are therefore ignored on every box of such a level, so that the scheme does not change from box to box and a face shared by a regular box and a cut box is computed the same way from both sides.
bc_arr, 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.

◆ ComputeFluxesOnBoxFromState() [5/6]

void HydroUtils::ComputeFluxesOnBoxFromState ( amrex::Box const &  bx,
int  ncomp,
amrex::MFIter &  mfi,
amrex::Array4< amrex::Real const > const &  q,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z)  ,
bool  knownFaceState,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac)  ,
amrex::Array4< amrex::Real const > const &  divu,
amrex::Array4< amrex::Real const > const &  fq,
amrex::Geometry  geom,
amrex::Real  l_dt,
amrex::Vector< amrex::BCRec > const &  h_bcrec,
const amrex::BCRec *  d_bcrec,
int const *  iconserv,
const amrex::EBFArrayBoxFactory &  ebfact,
bool  godunov_use_ppm,
bool  godunov_use_forces_in_trans,
bool  is_velocity,
bool  fluxes_are_area_weighted,
std::string const &  advection_type,
int  limiter_type = PPM::default_limiter,
bool  allow_inflow_on_outflow = false,
amrex::Array4< int const > const &  bc_arr = {} 
)

Compute edge state and flux. Does NOT allow time-depdendent inflow or inflow through EB.

Note
See ComputeFluxes for the meaning of iconserv, in particular the iconserv[n] == -1 convention, which means the face array already holds the final flux and bypasses every geometric factor. It requires knownFaceState = true.
Ghost-cell requirements, when knownFaceState is false and the edge state is predicted here: q needs 3 filled ghost cells (4 for 3D EBGodunov, and BDS needs the corners as well), the MAC velocities need 1, and divu needs
  1. divu must be a valid Array4 in 3D Godunov for every component, and for BDS whenever any component is conservative.
advection_type must be one of "Godunov", "MOL" or "BDS". BDS is not available with EB.
On a level that has cut cells, the cut boxes are handled by EBGodunov, which uses PLM and adds the forces after the transverse terms. godunov_use_ppm and godunov_use_forces_in_trans are therefore ignored on every box of such a level, so that the scheme does not change from box to box and a face shared by a regular box and a cut box is computed the same way from both sides.
bc_arr, 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.

◆ ComputeFluxesOnBoxFromState() [6/6]

void HydroUtils::ComputeFluxesOnBoxFromState ( amrex::Box const &  bx,
int  ncomp,
amrex::MFIter &  mfi,
amrex::Array4< amrex::Real const > const &  q,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &flux_x, amrex::Array4< amrex::Real > const &flux_y, amrex::Array4< amrex::Real > const &flux_z)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &face_x, amrex::Array4< amrex::Real > const &face_y, amrex::Array4< amrex::Real > const &face_z)  ,
bool  knownFaceState,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_mac, amrex::Array4< amrex::Real const > const &v_mac, amrex::Array4< amrex::Real const > const &w_mac)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &u_flux, amrex::Array4< amrex::Real const > const &v_flux, amrex::Array4< amrex::Real const > const &w_flux)  ,
amrex::Array4< amrex::Real const > const &  divu,
amrex::Array4< amrex::Real const > const &  fq,
amrex::Geometry  geom,
amrex::Real  l_dt,
amrex::Vector< amrex::BCRec > const &  h_bcrec,
const amrex::BCRec *  d_bcrec,
int const *  iconserv,
const amrex::EBFArrayBoxFactory &  ebfact,
amrex::Array4< amrex::Real const > const &  values_on_eb_inflow,
bool  godunov_use_ppm,
bool  godunov_use_forces_in_trans,
bool  is_velocity,
bool  fluxes_are_area_weighted,
std::string const &  advection_type,
int  limiter_type = PPM::default_limiter,
bool  allow_inflow_on_outflow = false,
amrex::Array4< int const > const &  bc_arr = {} 
)

◆ EB_ComputeDivergence() [1/2]

void HydroUtils::EB_ComputeDivergence ( amrex::Box const &  bx,
amrex::Array4< amrex::Real > const &  div,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fx, amrex::Array4< amrex::Real const > const &fy, amrex::Array4< amrex::Real const > const &fz)  ,
amrex::Array4< amrex::Real const > const &  vfrac,
int  ncomp,
amrex::Geometry const &  geom,
amrex::Real  mult,
bool  fluxes_are_area_weighted 
)

◆ EB_ComputeDivergence() [2/2]

void HydroUtils::EB_ComputeDivergence ( amrex::Box const &  bx,
amrex::Array4< amrex::Real > const &  div,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fx, amrex::Array4< amrex::Real const > const &fy, amrex::Array4< amrex::Real const > const &fz)  ,
amrex::Array4< amrex::Real const > const &  vfrac,
int  ncomp,
amrex::Geometry const &  geom,
amrex::Real  mult,
bool  fluxes_are_area_weighted,
amrex::Array4< amrex::Real const > const &  eb_velocity,
amrex::Array4< amrex::Real const > const &  values_on_eb_inflow,
amrex::Array4< amrex::EBCellFlag const > const &  flag_arr,
amrex::Array4< amrex::Real const > const &  barea,
amrex::Array4< amrex::Real const > const &  bnorm 
)

◆ EB_ComputeFluxes()

void HydroUtils::EB_ComputeFluxes ( amrex::Box const &  bx,
AMREX_D_DECL(amrex::Array4< amrex::Real > const &fx, amrex::Array4< amrex::Real > const &fy, amrex::Array4< amrex::Real > const &fz)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &umac, amrex::Array4< amrex::Real const > const &vmac, amrex::Array4< amrex::Real const > const &wmac)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &xedge, amrex::Array4< amrex::Real const > const &yedge, amrex::Array4< amrex::Real const > const &zedge)  ,
AMREX_D_DECL(amrex::Array4< amrex::Real const > const &apx, amrex::Array4< amrex::Real const > const &apy, amrex::Array4< amrex::Real const > const &apz)  ,
amrex::Geometry const &  geom,
int  ncomp,
amrex::Array4< amrex::EBCellFlag const > const &  flag,
bool  fluxes_are_area_weighted,
int const *  iconserv 
)

Compute Fluxes in the presence of EB.

Parameters
[in]iconservArray of length ncomp giving, per component: 1 conservative, 0 convective, -1 the face array already holds the final flux. For -1 the face value is copied to the flux unchanged: no velocity, no face area, no RZ $2\pi r$ and, in the EB version, no aperture factor is applied. A caller that uses -1 together with fluxes_are_area_weighted must therefore supply a face array that is already weighted by all of those factors. -1 is only meaningful with knownFaceState = true; with knownFaceState = false the edge-state kernels treat -1 as conservative and write a predicted state into the face array, which is then copied out as the flux with no velocity factor.
Note
EB advection requires Cartesian geometry; the routine asserts on this.

◆ 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.

◆ 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.