ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
TI_utils.H File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Variables

auto cons_to_prim
 
auto apply_bcs
 

Variable Documentation

◆ apply_bcs

auto apply_bcs

This routine is called before the first step of the time integration, and in the case of a multi-stage method like RK3, this is called from "pre_update_fun" which is called before every subsequent stage. Since we advance the variables in conservative form, we must convert momentum to velocity before imposing the bcs.

Referenced by ERF::advance_dycore().

◆ cons_to_prim

auto cons_to_prim
Initial value:
= [&](const MultiFab& cons_state, int ng)
{
BL_PROFILE("cons_to_prim()");
int ncomp_prim = S_prim.nComp();
for (MFIter mfi(cons_state,TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
const Box& gbx = mfi.growntilebox(ng);
const Array4<const Real>& cons_arr = cons_state.array(mfi);
const Array4< Real>& prim_arr = S_prim.array(mfi);
const Array4< Real>& pi_stage_arr = pi_stage.array(mfi);
const Real rdOcp = solverChoice.rdOcp;
amrex::ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
Real rho = cons_arr(i,j,k,Rho_comp);
Real rho_theta = cons_arr(i,j,k,RhoTheta_comp);
prim_arr(i,j,k,PrimTheta_comp) = rho_theta / rho;
pi_stage_arr(i,j,k) = getExnergivenRTh(rho_theta, rdOcp);
for (int n = 1; n < ncomp_prim; ++n) {
prim_arr(i,j,k,PrimTheta_comp + n) = cons_arr(i,j,k,RhoTheta_comp + n) / rho;
}
});
}
}
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getExnergivenRTh(const amrex::Real rhotheta, const amrex::Real rdOcp, const amrex::Real qv=0.0)
Definition: EOS.H:116
#define Rho_comp
Definition: IndexDefines.H:12
#define RhoTheta_comp
Definition: IndexDefines.H:13
#define PrimTheta_comp
Definition: IndexDefines.H:33
@ rho
Definition: Kessler.H:30

Define the primitive variables by dividing the conserved variables by density

Referenced by ERF::advance_dycore().