AMReX-Hydro
AMReX-based hydro routines for low Mach number flows
 
Loading...
Searching...
No Matches
hydro_bds.H
Go to the documentation of this file.
1/**
2 * \file hydro_bds.H
3 *
4 * \addtogroup BDS
5 * @{
6 */
7
8#ifndef HYDRO_BDS_H
9#define HYDRO_BDS_H
10
11#include <AMReX_MultiFabUtil.H>
12#include <AMReX_BCRec.H>
13
14/**
15 * Collection of routines for the BDS (Bell-Dawson-Shubin) algorithm.
16 */
17namespace BDS {
18
19/**
20 * Uses the Bell-Dawson-Shubin (BDS) algorithm, a higher order Godunov
21 * method for scalar conservation laws in three dimensions, to compute
22 * edge states.
23 *
24 * \param [in] bx Current grid patch
25 * \param [in] ncomp Number of components to work on
26 * \param [in] q Array4 of state, starting at component of interest
27 * \param [in,out] xedge Array4 containing x-edges, starting at component of interest
28 * \param [in,out] yedge Array4 containing y-edges, starting at component of interest
29 * \param [in,out] zedge Array4 containing z-edges, starting at component of interest
30 * \param [in] umac x-Face velocities.
31 * \param [in] vmac y-Face velocities.
32 * \param [in] wmac z-Face velocities.
33 * \param [in] divu Velocity divergence. Read whenever iconserv is set
34 * for a component, and not checked for null there, so
35 * it must be a valid Array4 unless every component is
36 * convective.
37 * \param [in] fq Array4 for forces, starting at component of interest
38 * \param [in] geom Level geometry.
39 * \param [in] l_dt Time step.
40 * \param [in] h_bcrec Boundary conditions (host).
41 * \param [in] pbc Boundary conditions (device).
42 * \param [in] iconserv If true, use conservative form, otherwise use convective.
43 * \param [in] is_velocity Indicates a component is velocity so boundary conditions can
44 * be properly addressed. The header hydro_constants.H
45 * defines the component position by [XYZ]VEL macro.
46 * \param [in] allow_inflow_on_outflow If true, do not clamp the normal velocity
47 * to be outflowing at a foextrap/hoextrap face, so that an
48 * inflowing MAC velocity there is carried through.
49 *
50 * \note Ghost-cell requirements: q needs 3 filled ghost cells including corners,
51 * because of the bicubic stencil used for the slopes; the MAC velocities
52 * need 1; and divu needs 1.
53 */
54
55void ComputeEdgeState ( amrex::Box const& bx, int ncomp,
58 amrex::Array4<amrex::Real> const& yedge,
59 amrex::Array4<amrex::Real> const& zedge),
65 amrex::Geometry geom,
66 amrex::Real l_dt,
67 amrex::Vector<amrex::BCRec> const& h_bcrec,
68 amrex::BCRec const* pbc,
69 int const* iconserv,
70 bool is_velocity,
71 bool allow_inflow_on_outflow = false);
72
73/**
74 * Compute bilinear slopes for BDS algorithm.
75 *
76 * \param [in] bx Current grid patch
77 * \param [in] geom Level geometry.
78 * \param [in] icomp Component of the state Array4.
79 * \param [in] s Array4<const> of state vector.
80 * \param [out] slopes Array4 to store slope information.
81 * \param [in] h_bcrec Boundary conditions (host).
82 *
83 */
84
85void ComputeSlopes ( amrex::Box const& bx,
86 const amrex::Geometry& geom,
87 int icomp,
89 amrex::Array4<amrex::Real > const& slopes,
90 amrex::Vector<amrex::BCRec> const& h_bcrec);
91
92/**
93 * Compute Conc for BDS algorithm.
94 *
95 * \param [in] bx Current grid patch
96 * \param [in] geom Level geometry.
97 * \param [in] icomp Component of the Array4s.
98 * \param [in] s Array4 of state.
99 * \param [in,out] sedgex Array4 containing x-edges.
100 * \param [in,out] sedgey Array4 containing y-edges.
101 * \param [in,out] sedgez Array4 containing z-edges.
102 * \param [in] slopes Array4 containing slope information.
103 * \param [in] umac Array4 for u-face velocity.
104 * \param [in] vmac Array4 for v-face velocity.
105 * \param [in] wmac Array4 for z-face velocity.
106 * \param [in] force Array4 for forces.
107 * \param [in] iconserv If true, use conservative form, otherwise use convective.
108 * \param [in] dt Time step.
109 * \param [in] h_bcrec Boundary conditions (host).
110 * \param [in] pbc Boundary conditions (device).
111 * \param [in] is_velocity Indicates a component is velocity so boundary conditions can
112 * be properly addressed. The header hydro_constants.H
113 * defines the component position by [XYZ]VEL macro.
114 * \param [in] allow_inflow_on_outflow If true, do not clamp the normal velocity
115 * to be outflowing at a foextrap/hoextrap face, so that an
116 * inflowing MAC velocity there is carried through.
117 *
118 *
119 */
120
121void ComputeConc ( amrex::Box const& bx,
122 const amrex::Geometry& geom,
123 int icomp,
126 amrex::Array4<amrex::Real > const& sedgey,
127 amrex::Array4<amrex::Real > const& sedgez),
134 int const* iconserv,
135 amrex::Real dt,
136 amrex::Vector<amrex::BCRec> const& h_bcrec,
137 amrex::BCRec const* pbc,
138 bool is_velocity,
139 bool allow_inflow_on_outflow = false);
140
141}
142#endif
143/** @} */
#define AMREX_D_DECL(a, b, c)
amrex_real Real
Definition hydro_bds.H:17
void ComputeEdgeState(amrex::Box const &bx, int ncomp, amrex::Array4< amrex::Real const > const &q, AMREX_D_DECL(amrex::Array4< amrex::Real > const &xedge, amrex::Array4< amrex::Real > const &yedge, amrex::Array4< amrex::Real > const &zedge), 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::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, amrex::BCRec const *pbc, int const *iconserv, bool is_velocity, bool allow_inflow_on_outflow=false)
void ComputeSlopes(amrex::Box const &bx, const amrex::Geometry &geom, int icomp, amrex::Array4< amrex::Real const > const &s, amrex::Array4< amrex::Real > const &slopes, amrex::Vector< amrex::BCRec > const &h_bcrec)
void ComputeConc(amrex::Box const &bx, const amrex::Geometry &geom, int icomp, amrex::Array4< amrex::Real const > const &s, AMREX_D_DECL(amrex::Array4< amrex::Real > const &sedgex, amrex::Array4< amrex::Real > const &sedgey, amrex::Array4< amrex::Real > const &sedgez), amrex::Array4< amrex::Real const > const &slopes, 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::Array4< amrex::Real const > const &divu, amrex::Array4< amrex::Real const > const &force, int const *iconserv, amrex::Real dt, amrex::Vector< amrex::BCRec > const &h_bcrec, amrex::BCRec const *pbc, bool is_velocity, bool allow_inflow_on_outflow=false)