AMReX-Hydro
AMReX-based hydro routines for low Mach number flows
hydro_mol.H
Go to the documentation of this file.
1 /**
2  * \file hydro_mol.H
3  * \brief A documented file.
4  *
5  * Here is where detailed documentation for the file can go.
6  *
7  */
8 
9 /** \addtogroup MOL
10  * @{
11  */
12 
13 
14 
15 
16 
17 #ifndef HYDRO_MOL_H_
18 #define HYDRO_MOL_H_
19 
20 #include <AMReX_MultiFab.H>
21 #include <AMReX_BCRec.H>
22 
23 
24 /**
25  * \namespace MOL
26  * The procedures for computing MAC velocities and edge states with MOL does
27  * not involve time derivatives. All slope computations use second-order
28  * limited slopes as described in
29  * <a href="https://amrex-codes.github.io/amrex/hydro_html/MOL.html#sec:slopes">[sec:slopes]</a>.
30  *
31  */
32 
33 
34 namespace MOL {
35 
36 /**
37  *
38  * \brief Compute upwinded face-centered states by extrapolating cell-centered values in SPACE ONLY.
39  * \param [in] a_bx Current grid patch
40  * \param [in,out] xedge Array4 containing x-edges, starting at component of interest
41  * \param [in,out] yedge Array4 containing y-edges, starting at component of interest
42  * \param [in,out] zedge Array4 containing z-edges, starting at component of interest
43  * \param [in] q Array4 of state, starting at component of interest
44  * \param [in] ncomp Number of components to work on
45  * \param [in] umac x-Face velocities.
46  * \param [in] vmac y-Face velocities.
47  * \param [in] wmac z-Face velocities.
48  * \param [in] domain Problem domain.
49  * \param [in] bcs Vector of boundary conditions
50  * \param [in] d_bcrec_ptr BCRec
51  * \param [in] is_velocity Indicates a component is velocity so boundary conditions can
52  * be properly addressed. The header hydro_constants.H
53  * defines the component positon by [XYZ]VEL macro.
54  *
55  * Compute upwinded FC states by extrapolating CC values in SPACE ONLY.
56  * This is NOT a Godunov type extrapolation: there is NO dependence on time!
57  * The resulting FC states are computed at the CENTROID of the face.
58  *
59  */
60 
61 void ComputeEdgeState (amrex::Box const& a_bx,
63  amrex::Array4<amrex::Real> const& yedge,
64  amrex::Array4<amrex::Real> const& zedge),
66  int ncomp,
70  amrex::Box const& domain,
71  amrex::Vector<amrex::BCRec> const& bcs,
72  amrex::BCRec const* d_bcrec_ptr,
73  bool is_velocity);
74 
75 
76 /**
77  *
78  * \brief Compute upwinded FC velocities by extrapolating CC values in SPACE ONLY.
79  * \param vel The cell-centered velocity field
80  * \param umac x-component of velocity on centroid of x-face
81  * \param vmac y-component of velocity on centroid of y-face
82  * \param wmac z-component of velocity on centroid of z-face
83  * \param a_geom Geometry object at this level
84  * \param h_bcrec Host version of BCRec
85  * \param d_bcrec Device version of BCRec
86  *
87  * Compute upwinded FC velocities by extrapolating CC values in SPACE ONLY.
88  * This is NOT a Godunov type extrapolation: there is NO dependence on time!
89  * The resulting FC velocities are computed at the CENTROID of the face.
90  *
91  */
92 
93 
96  amrex::MultiFab& vmac,
97  amrex::MultiFab& wmac ),
98  const amrex::Geometry& a_geom,
99  amrex::Vector<amrex::BCRec> const& h_bcrec,
100  const amrex::BCRec* d_bcrec );
101 
102 /**
103  * \brief For Computing the pre-MAC edge states to be MAC-projected.
104  *
105  * For detailed info on the algorithm, see
106  * <a href="https://amrex-codes.github.io/amrex/hydro_html/MOL.html#pre-mac-mol-extrapveltofacesbox"> MOL</a>.
107  *
108  */
110  amrex::Box const& vbx,
111  amrex::Box const& wbx ),
114  amrex::Array4<amrex::Real> const& w ),
116  const amrex::Geometry& geom,
117  amrex::Vector<amrex::BCRec> const& h_bcrec,
118  const amrex::BCRec* d_bcrec );
119 
120 
121 }
122 #endif
123 /** @}*/
#define AMREX_D_DECL(a, b, c)
void ExtrapVelToFacesBox(AMREX_D_DECL(amrex::Box const &ubx, amrex::Box const &vbx, amrex::Box const &wbx), AMREX_D_DECL(amrex::Array4< amrex::Real > const &u, amrex::Array4< amrex::Real > const &v, amrex::Array4< amrex::Real > const &w), amrex::Array4< amrex::Real const > const &vcc, const amrex::Geometry &geom, amrex::Vector< amrex::BCRec > const &h_bcrec, const amrex::BCRec *d_bcrec)
For Computing the pre-MAC edge states to be MAC-projected.
void ExtrapVelToFaces(const amrex::MultiFab &vel, AMREX_D_DECL(amrex::MultiFab &umac, amrex::MultiFab &vmac, amrex::MultiFab &wmac), const amrex::Geometry &a_geom, amrex::Vector< amrex::BCRec > const &h_bcrec, const amrex::BCRec *d_bcrec)
Compute upwinded FC velocities by extrapolating CC values in SPACE ONLY.
void ComputeEdgeState(amrex::Box const &a_bx, AMREX_D_DECL(amrex::Array4< amrex::Real > const &xedge, amrex::Array4< amrex::Real > const &yedge, amrex::Array4< amrex::Real > const &zedge), amrex::Array4< amrex::Real const > const &q, int ncomp, 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::Box const &domain, amrex::Vector< amrex::BCRec > const &bcs, amrex::BCRec const *d_bcrec_ptr, bool is_velocity)
Compute upwinded face-centered states by extrapolating cell-centered values in SPACE ONLY.