ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_SrcHeaders.H
Go to the documentation of this file.
1 #ifndef ERF_INTEGRATION_H_
2 #define ERF_INTEGRATION_H_
3 
4 #include <AMReX_MultiFab.H>
5 #include <AMReX_EBMultiFabUtil.H>
6 
7 #include "ERF_DataStruct.H"
9 #include "ERF_TurbPertStruct.H"
10 
11 /**
12  * Function for computing the buoyancy term to be used in the evolution
13  * equation for the z-component of momentum in the slow integrator. There
14  * are three options for how buoyancy is computed (two are the same in the absence of moisture).
15  */
16 void make_buoyancy (amrex::Vector< amrex::MultiFab>& S_data,
17  const amrex::MultiFab & S_prim,
18  amrex::MultiFab& buoyancy,
19  const amrex::Geometry geom,
20  const SolverChoice& solverChoice,
21  const amrex::MultiFab& base_state,
22  const int n_qstate,
23  const int anelastic);
24 
25 void make_sources (int level, int nrk,
26  amrex::Real dt, amrex::Real time,
27  amrex::Vector<amrex::MultiFab>& S_data,
28  const amrex::MultiFab& S_prim,
29  amrex::MultiFab& cc_source,
30  std::unique_ptr<amrex::MultiFab>& z_phys_cc,
31 #if defined(ERF_USE_RRTMGP)
32  const amrex::MultiFab* qheating_rates,
33 #endif
34  amrex::MultiFab* terrain_blank,
35  const amrex::Geometry geom,
36  const SolverChoice& solverChoice,
37  std::unique_ptr<amrex::MultiFab>& mapfac_u,
38  std::unique_ptr<amrex::MultiFab>& mapfac_v,
39  std::unique_ptr<amrex::MultiFab>& mapfac_m,
40  const amrex::Real* dptr_rhotheta_src,
41  const amrex::Real* dptr_rhoqt_src,
42  const amrex::Real* dptr_wbar_sub,
43  const amrex::Vector<amrex::Real*> d_rayleigh_ptrs_at_lev,
44  InputSoundingData& input_sounding_data,
45  TurbulentPerturbation& turbPert);
46 
47 void make_mom_sources (int level, int nrk,
48  amrex::Real dt, amrex::Real time,
49  amrex::Vector<amrex::MultiFab>& S_data,
50  const amrex::MultiFab& S_prim,
51  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
52  std::unique_ptr<amrex::MultiFab>& z_phys_cc,
53  const amrex::MultiFab& xvel,
54  const amrex::MultiFab& yvel,
55  const amrex::MultiFab& wvel,
56  amrex::MultiFab& xmom_source,
57  amrex::MultiFab& ymom_source,
58  amrex::MultiFab& zmom_source,
59  const amrex::MultiFab& base_state,
60  amrex::MultiFab* forest_drag,
61  amrex::MultiFab* terrain_blank,
62  const amrex::Geometry geom,
63  const SolverChoice& solverChoice,
64  std::unique_ptr<amrex::MultiFab>& mapfac_m,
65  std::unique_ptr<amrex::MultiFab>& mapfac_u,
66  std::unique_ptr<amrex::MultiFab>& mapfac_v,
67  const amrex::Real* dptr_rhotheta_src,
68  const amrex::Real* dptr_rhoqt_src,
69  const amrex::Real* dptr_wbar_sub,
70  const amrex::Vector<amrex::Real*> d_rayleigh_ptrs_at_lev,
71  const amrex::Vector<amrex::Real*> d_sponge_ptrs_at_lev,
72  InputSoundingData& input_sounding_data,
73  const int n_qstate);
74 
75 void add_thin_body_sources (amrex::MultiFab& xmom_source,
76  amrex::MultiFab& ymom_source,
77  amrex::MultiFab& zmom_source,
78  std::unique_ptr<amrex::iMultiFab>& xflux_imask_lev,
79  std::unique_ptr<amrex::iMultiFab>& yflux_imask_lev,
80  std::unique_ptr<amrex::iMultiFab>& zflux_imask_lev,
81  std::unique_ptr<amrex::MultiFab>& thin_xforce_lev,
82  std::unique_ptr<amrex::MultiFab>& thin_yforce_lev,
83  std::unique_ptr<amrex::MultiFab>& thin_zforce_lev);
84 
85 #if defined(ERF_USE_NETCDF)
86 void
87 moist_set_rhs (const amrex::Box& tbx,
88  const amrex::Box& gtbx,
89  const amrex::Array4<amrex::Real const>& old_cons,
90  const amrex::Array4<amrex::Real const>& new_cons,
91  const amrex::Array4<amrex::Real >& cell_rhs,
92  const amrex::Real& bdy_time_interval,
93  const amrex::Real& start_bdy_time,
94  const amrex::Real& new_stage_time,
95  const amrex::Real& dt,
96  int width, int set_width,
97  const amrex::Box& domain,
98  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_xlo,
99  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_xhi,
100  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_ylo,
101  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_yhi);
102 #endif
103 
104 void ApplySpongeZoneBCsForCC (const SpongeChoice& spongeChoice,
105  const amrex::Geometry geom,
106  const amrex::Box& bx,
107  const amrex::Array4<amrex::Real>& cell_rhs,
108  const amrex::Array4<const amrex::Real>& cell_data);
109 
110 void ApplySpongeZoneBCsForMom (const SpongeChoice& spongeChoice,
111  const amrex::Geometry geom,
112  const amrex::Box& tbx,
113  const amrex::Box& tby,
114  const amrex::Box& tbz,
115  const amrex::Array4<amrex::Real>& rho_u_rhs,
116  const amrex::Array4<amrex::Real>& rho_v_rhs,
117  const amrex::Array4<amrex::Real>& rho_w_rhs,
118  const amrex::Array4<const amrex::Real>& rho_u,
119  const amrex::Array4<const amrex::Real>& rho_v,
120  const amrex::Array4<const amrex::Real>& rho_w);
121 
123  const amrex::Geometry geom,
124  const amrex::Box& tbx,
125  const amrex::Box& tby,
126  const amrex::Array4<const amrex::Real>& cell_data,
127  const amrex::Array4<amrex::Real>& rho_u_rhs,
128  const amrex::Array4<amrex::Real>& rho_v_rhs,
129  const amrex::Array4<const amrex::Real>& rho_u,
130  const amrex::Array4<const amrex::Real>& rho_v,
131  const amrex::Vector<amrex::Real*> d_sponge_ptrs_at_lev);
132 #endif
void ApplySpongeZoneBCsForMom(const SpongeChoice &spongeChoice, const amrex::Geometry geom, const amrex::Box &tbx, const amrex::Box &tby, const amrex::Box &tbz, const amrex::Array4< amrex::Real > &rho_u_rhs, const amrex::Array4< amrex::Real > &rho_v_rhs, const amrex::Array4< amrex::Real > &rho_w_rhs, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &rho_w)
void ApplySpongeZoneBCsForCC(const SpongeChoice &spongeChoice, const amrex::Geometry geom, const amrex::Box &bx, const amrex::Array4< amrex::Real > &cell_rhs, const amrex::Array4< const amrex::Real > &cell_data)
void make_buoyancy(amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &S_prim, amrex::MultiFab &buoyancy, const amrex::Geometry geom, const SolverChoice &solverChoice, const amrex::MultiFab &base_state, const int n_qstate, const int anelastic)
void add_thin_body_sources(amrex::MultiFab &xmom_source, amrex::MultiFab &ymom_source, amrex::MultiFab &zmom_source, std::unique_ptr< amrex::iMultiFab > &xflux_imask_lev, std::unique_ptr< amrex::iMultiFab > &yflux_imask_lev, std::unique_ptr< amrex::iMultiFab > &zflux_imask_lev, std::unique_ptr< amrex::MultiFab > &thin_xforce_lev, std::unique_ptr< amrex::MultiFab > &thin_yforce_lev, std::unique_ptr< amrex::MultiFab > &thin_zforce_lev)
void make_mom_sources(int level, int nrk, amrex::Real dt, amrex::Real time, amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &S_prim, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &z_phys_cc, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &wvel, amrex::MultiFab &xmom_source, amrex::MultiFab &ymom_source, amrex::MultiFab &zmom_source, const amrex::MultiFab &base_state, amrex::MultiFab *forest_drag, amrex::MultiFab *terrain_blank, const amrex::Geometry geom, const SolverChoice &solverChoice, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, const amrex::Real *dptr_rhotheta_src, const amrex::Real *dptr_rhoqt_src, const amrex::Real *dptr_wbar_sub, const amrex::Vector< amrex::Real * > d_rayleigh_ptrs_at_lev, const amrex::Vector< amrex::Real * > d_sponge_ptrs_at_lev, InputSoundingData &input_sounding_data, const int n_qstate)
void make_sources(int level, int nrk, amrex::Real dt, amrex::Real time, amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &S_prim, amrex::MultiFab &cc_source, std::unique_ptr< amrex::MultiFab > &z_phys_cc, amrex::MultiFab *terrain_blank, const amrex::Geometry geom, const SolverChoice &solverChoice, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, std::unique_ptr< amrex::MultiFab > &mapfac_m, const amrex::Real *dptr_rhotheta_src, const amrex::Real *dptr_rhoqt_src, const amrex::Real *dptr_wbar_sub, const amrex::Vector< amrex::Real * > d_rayleigh_ptrs_at_lev, InputSoundingData &input_sounding_data, TurbulentPerturbation &turbPert)
void ApplySpongeZoneBCsForMom_ReadFromFile(const SpongeChoice &spongeChoice, const amrex::Geometry geom, const amrex::Box &tbx, const amrex::Box &tby, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< amrex::Real > &rho_u_rhs, const amrex::Array4< amrex::Real > &rho_v_rhs, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Vector< amrex::Real * > d_sponge_ptrs_at_lev)
@ xvel
Definition: ERF_IndexDefines.H:130
@ yvel
Definition: ERF_IndexDefines.H:131
Definition: ERF_InputSoundingData.H:22
Definition: ERF_DataStruct.H:82
Definition: ERF_SpongeStruct.H:15
Definition: ERF_TurbPertStruct.H:18