|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
#include <AMReX.H>#include <AMReX_MultiFab.H>#include <ERF_Utils.H>#include <ERF_AdvectionSrcForScalars.H>
Functions | |
| void | ConvertForProjection (const MultiFab &den_div, const MultiFab &den_mlt, MultiFab &xmom, MultiFab &ymom, MultiFab &zmom, const Box &domain, const Vector< BCRec > &domain_bcs_type_h) |
| void | compute_influx_outflux (Array< MultiFab *, AMREX_SPACEDIM > &vels_vec, Array< MultiFab *, AMREX_SPACEDIM > &area_vec, const Geometry &geom, Real &influx, Real &outflux) |
| void | correct_outflow (const Geometry &geom_lev, Array< MultiFab *, AMREX_SPACEDIM > &vels_vec, const Box &domain, const Real alpha_fcf) |
| void | enforceInOutSolvability (int, Array< MultiFab *, AMREX_SPACEDIM > &vels_vec, Array< MultiFab *, AMREX_SPACEDIM > &area_vec, const Geometry &geom) |
| void | MakeProjectionWeights (const MultiFab &den_div, const MultiFab &den_mlt, const MultiFab &xmom, const MultiFab &ymom, const MultiFab &zmom, Array< MultiFab, AMREX_SPACEDIM > &beta, const Box &domain, const Vector< BCRec > &domain_bcs_type_h) |
| void | MakeAdvectiveProjectionWeights (const MultiFab &den_div, const MultiFab &den_mlt, const MultiFab &xmom, const MultiFab &ymom, const MultiFab &zmom, Array< MultiFab, AMREX_SPACEDIM > &beta, const AdvType horiz_adv_type, const AdvType vert_adv_type, const Real horiz_upw_frac, const Real vert_upw_frac, const Periodicity &period) |
| void compute_influx_outflux | ( | Array< MultiFab *, AMREX_SPACEDIM > & | vels_vec, |
| Array< MultiFab *, AMREX_SPACEDIM > & | area_vec, | ||
| const Geometry & | geom, | ||
| Real & | influx, | ||
| Real & | outflux | ||
| ) |
| void ConvertForProjection | ( | const MultiFab & | den_div, |
| const MultiFab & | den_mlt, | ||
| MultiFab & | xmom, | ||
| MultiFab & | ymom, | ||
| MultiFab & | zmom, | ||
| const Box & | domain, | ||
| const Vector< BCRec > & | domain_bcs_type_h | ||
| ) |
Convert momentum to velocity by dividing by density averaged onto faces
| [out] | xvel | x-component of velocity |
| [out] | yvel | y-component of velocity |
| [out] | zvel | z-component of velocity |
| [in] | density | density at cell centers |
| [in] | xmom_in | x-component of momentum |
| [in] | ymom_in | y-component of momentum |
| [in] | zmom_in | z-component of momentum |
| [in] | domain | Domain at this level |
| [in] | domain_bcs_type_h | host vector for domain boundary conditions |
Referenced by ERF::project_momenta().


| void correct_outflow | ( | const Geometry & | geom_lev, |
| Array< MultiFab *, AMREX_SPACEDIM > & | vels_vec, | ||
| const Box & | domain, | ||
| const Real | alpha_fcf | ||
| ) |
Referenced by enforceInOutSolvability().


| void enforceInOutSolvability | ( | int | , |
| Array< MultiFab *, AMREX_SPACEDIM > & | vels_vec, | ||
| Array< MultiFab *, AMREX_SPACEDIM > & | area_vec, | ||
| const Geometry & | geom | ||
| ) |
Referenced by ERF::project_momenta().


| void MakeAdvectiveProjectionWeights | ( | const MultiFab & | den_div, |
| const MultiFab & | den_mlt, | ||
| const MultiFab & | xmom, | ||
| const MultiFab & | ymom, | ||
| const MultiFab & | zmom, | ||
| Array< MultiFab, AMREX_SPACEDIM > & | beta, | ||
| const AdvType | horiz_adv_type, | ||
| const AdvType | vert_adv_type, | ||
| const Real | horiz_upw_frac, | ||
| const Real | vert_upw_frac, | ||
| const Periodicity & | period | ||
| ) |
Face weights beta = den_mlt / den_div mapped onto the faces the way the advection scheme maps a scalar onto them: the cell-centered ratio den_mlt / den_div (on the valid and ghost cells) is reconstructed on each face by BuildScalarAdvectionFaceValues with the given schemes and upwind fractions, the upwind side picked from the sign of the momenta passed in. On a pseudo-incompressible level, with den_mlt = rho0 theta0 and den_div = rho, this is the face value of theta with which (rho theta) is advected when rho theta = rho0 theta0, so the projected flux beta (rho u) is the advective flux of (rho theta).
| [in] | den_div | density divided out, at cell centers (component Rho_comp), with ghost cells |
| [in] | den_mlt | density multiplied in, at cell centers (component Rho_comp), with ghost cells |
| [in] | xmom | x-face momentum (its sign picks the upwind side) |
| [in] | ymom | y-face momentum (its sign picks the upwind side) |
| [in] | zmom | z-face vertical mass flux, Omega on a terrain-fitted mesh (its sign picks the upwind side) |
| [out] | beta | face weights on the valid faces of xmom, ymom and zmom (defined here) |
| [in] | horiz_adv_type | horizontal advection scheme |
| [in] | vert_adv_type | vertical advection scheme |
| [in] | horiz_upw_frac | horizontal upwind fraction |
| [in] | vert_upw_frac | vertical upwind fraction |
| [in] | period | periodicity of the level, to fill the ratio's ghost cells between boxes |
The ratio is computed on the valid and ghost cells and then its ghost cells inside the domain (between boxes and across periodic boundaries) are filled from the neighboring valid cells, so that they hold the same values as the valid cells there: the reconstruction reads two or three cells past the face, and the base state's ghost cells beyond the first are not filled between boxes. Outside the domain the ratio comes from the ghost cells of den_div and den_mlt; a cell with no density (covered by an embedded boundary, or a corner the boundary conditions leave unfilled) gets the ratio one.
Referenced by ERF::project_momenta().


| void MakeProjectionWeights | ( | const MultiFab & | den_div, |
| const MultiFab & | den_mlt, | ||
| const MultiFab & | xmom, | ||
| const MultiFab & | ymom, | ||
| const MultiFab & | zmom, | ||
| Array< MultiFab, AMREX_SPACEDIM > & | beta, | ||
| const Box & | domain, | ||
| const Vector< BCRec > & | domain_bcs_type_h | ||
| ) |
Face weights beta = den_mlt / den_div with which ConvertForProjection converts (den_div u) to (den_mlt u), on the valid faces of xmom, ymom and zmom: the same face averages and the same one-sided values on the ext_dir and ext_dir_upwind faces of the lateral domain boundaries (the upwind side chosen from the sign of the momentum passed in). Multiplying the momenta by beta is then what ConvertForProjection does, and dividing by the same beta undoes it.
| [in] | den_div | density divided out, at cell centers (component Rho_comp) |
| [in] | den_mlt | density multiplied in, at cell centers (component Rho_comp) |
| [in] | xmom | x-face momentum (its sign picks the upwind side) |
| [in] | ymom | y-face momentum (its sign picks the upwind side) |
| [in] | zmom | z-face momentum (its layout only) |
| [out] | beta | face weights on the valid faces of xmom, ymom and zmom (defined here) |
| [in] | domain | Domain at this level |
| [in] | domain_bcs_type_h | host vector for domain boundary conditions |
A face with no density on either side (covered by an embedded boundary) gets beta = 1.
Referenced by ERF::project_momenta().

