ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_TI_slow_headers.H
Go to the documentation of this file.
1 #ifndef ERF_SLOW_INTEGRATION_H_
2 #define ERF_SLOW_INTEGRATION_H_
3 
4 #include <AMReX_MultiFab.H>
5 #include <AMReX_BCRec.H>
6 #include <AMReX_YAFluxRegister.H>
7 #include "ERF_DataStruct.H"
8 #include "ERF_IndexDefines.H"
9 #include "ERF_ABLMost.H"
10 
11 #include <ERF_Advection.H>
12 #include <ERF_Diffusion.H>
13 #include <ERF_EddyViscosity.H>
14 #include <ERF_PlaneAverage.H>
15 #include <ERF_TerrainMetrics.H>
16 #include <ERF_TileNoZ.H>
17 
18 #ifdef ERF_USE_EB
19 #include <AMReX_MultiCutFab.H>
20 #include <AMReX_EBMultiFabUtil.H>
21 #endif
22 
23 void erf_make_tau_terms (int level, int nrk,
24  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
25  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
26  amrex::Vector<amrex::MultiFab>& S_data,
27  const amrex::MultiFab& xvel,
28  const amrex::MultiFab& yvel,
29  const amrex::MultiFab& zvel,
30  amrex::MultiFab& Omega,
31  amrex::MultiFab* Tau11,
32  amrex::MultiFab* Tau22,
33  amrex::MultiFab* Tau33,
34  amrex::MultiFab* Tau12,
35  amrex::MultiFab* Tau13,
36  amrex::MultiFab* Tau21,
37  amrex::MultiFab* Tau23,
38  amrex::MultiFab* Tau31,
39  amrex::MultiFab* Tau32,
40  amrex::MultiFab* SmnSmn,
41  amrex::MultiFab* eddyDiffs,
42  const amrex::Geometry geom,
43  const SolverChoice& solverChoice,
44  std::unique_ptr<ABLMost>& most,
45  std::unique_ptr<amrex::MultiFab>& dJ,
46  std::unique_ptr<amrex::MultiFab>& mapfac_m,
47  std::unique_ptr<amrex::MultiFab>& mapfac_u,
48  std::unique_ptr<amrex::MultiFab>& mapfac_v);
49 
50 /**
51  * Function for computing the slow RHS for the evolution equations for the density, potential temperature and momentum.
52  *
53  */
54 void erf_slow_rhs_pre (int level, int finest_level, int nrk,
55  amrex::Real dt,
56  amrex::Vector<amrex::MultiFab>& S_rhs,
57  amrex::Vector<amrex::MultiFab>& S_old,
58  amrex::Vector<amrex::MultiFab>& S_data,
59  const amrex::MultiFab & S_prim,
60  amrex::Vector<amrex::MultiFab>& S_scratch,
61  const amrex::MultiFab& xvel,
62  const amrex::MultiFab& yvel,
63  const amrex::MultiFab& zvel,
64  std::unique_ptr<amrex::MultiFab>& z_t,
65  amrex::MultiFab& Omega,
66  const amrex::MultiFab& cc_src,
67  const amrex::MultiFab& xmom_src,
68  const amrex::MultiFab& ymom_src,
69  const amrex::MultiFab& zmom_src,
70  amrex::MultiFab* Tau11,
71  amrex::MultiFab* Tau22,
72  amrex::MultiFab* Tau33,
73  amrex::MultiFab* Tau12,
74  amrex::MultiFab* Tau13,
75  amrex::MultiFab* Tau21,
76  amrex::MultiFab* Tau23,
77  amrex::MultiFab* Tau31,
78  amrex::MultiFab* Tau32,
79  amrex::MultiFab* SmnSmn,
80  amrex::MultiFab* eddyDiffs,
81  amrex::MultiFab* Hfx1,
82  amrex::MultiFab* Hfx2,
83  amrex::MultiFab* Hfx3,
84  amrex::MultiFab* Q1fx1,
85  amrex::MultiFab* Q1fx2,
86  amrex::MultiFab* Q1fx3,
87  amrex::MultiFab* Q2fx3,
88  amrex::MultiFab* Diss,
89  const amrex::Geometry geom,
90  const SolverChoice& solverChoice,
91  std::unique_ptr<ABLMost>& most,
92  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
93  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
94  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
95  std::unique_ptr<amrex::MultiFab>& ax,
96  std::unique_ptr<amrex::MultiFab>& ay,
97  std::unique_ptr<amrex::MultiFab>& az,
98  std::unique_ptr<amrex::MultiFab>& dJ,
99  const amrex::MultiFab* p0,
100 #ifdef ERF_USE_POISSON_SOLVE
101  const amrex::MultiFab& pp_inc,
102 #endif
103  std::unique_ptr<amrex::MultiFab>& mapfac_m,
104  std::unique_ptr<amrex::MultiFab>& mapfac_u,
105  std::unique_ptr<amrex::MultiFab>& mapfac_v,
106 #ifdef ERF_USE_EB
107  amrex::EBFArrayBoxFactory const& ebfact,
108 #endif
109  amrex::YAFluxRegister* fr_as_crse,
110  amrex::YAFluxRegister* fr_as_fine);
111 
112 /**
113  * Function for computing the slow RHS for the evolution equations for the scalars other than density or potential temperature
114  *
115  */
116 void erf_slow_rhs_post (int level, int finest_level, int nrk,
117  amrex::Real dt,
118  int n_qstate,
119  amrex::Vector<amrex::MultiFab>& S_rhs,
120  amrex::Vector<amrex::MultiFab>& S_old,
121  amrex::Vector<amrex::MultiFab>& S_new,
122  amrex::Vector<amrex::MultiFab>& S_data,
123  const amrex::MultiFab& S_prim,
124  amrex::Vector<amrex::MultiFab >& S_scratch,
125  const amrex::MultiFab& xvel,
126  const amrex::MultiFab& yvel,
127  const amrex::MultiFab& zvel,
128  const amrex::MultiFab& source,
129  const amrex::MultiFab* SmnSmn,
130  const amrex::MultiFab* eddyDiffs,
131  amrex::MultiFab* Hfx1,
132  amrex::MultiFab* Hfx2,
133  amrex::MultiFab* Hfx3,
134  amrex::MultiFab* Q1fx1,
135  amrex::MultiFab* Q1fx2,
136  amrex::MultiFab* Q1fx3,
137  amrex::MultiFab* Q2fx3,
138  amrex::MultiFab* Diss,
139  const amrex::Geometry geom,
140  const SolverChoice& solverChoice,
141  std::unique_ptr<ABLMost>& most,
142  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
143  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
144  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
145  std::unique_ptr<amrex::MultiFab>& ax,
146  std::unique_ptr<amrex::MultiFab>& ay,
147  std::unique_ptr<amrex::MultiFab>& az,
148  std::unique_ptr<amrex::MultiFab>& dJ_old,
149  std::unique_ptr<amrex::MultiFab>& dJ_new,
150  std::unique_ptr<amrex::MultiFab>& mapfac_m,
151  std::unique_ptr<amrex::MultiFab>& mapfac_u,
152  std::unique_ptr<amrex::MultiFab>& mapfac_v,
153 #ifdef ERF_USE_EB
154  amrex::EBFArrayBoxFactory const& ebfact,
155 #endif
156 #if defined(ERF_USE_NETCDF)
157  const bool& moist_zero,
158  const amrex::Real& bdy_time_interval,
159  const amrex::Real& start_bdy_time,
160  const amrex::Real& new_stage_time,
161  int width,
162  int set_width,
163  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_xlo,
164  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_xhi,
165  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_ylo,
166  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_yhi,
167 #endif
168  amrex::YAFluxRegister* fr_as_crse,
169  amrex::YAFluxRegister* fr_as_fine);
170 
171 
172 /**
173  * Function for computing the slow RHS for the evolution equations for the density, potential temperature and momentum.
174  *
175  */
176 void erf_slow_rhs_inc (int level, int nrk,
177  amrex::Real dt,
178  amrex::Vector<amrex::MultiFab>& S_rhs,
179  amrex::Vector<amrex::MultiFab>& S_old,
180  amrex::Vector<amrex::MultiFab>& S_data,
181  const amrex::MultiFab& S_prim,
182  amrex::Vector<amrex::MultiFab >& S_scratch,
183  const amrex::MultiFab& xvel,
184  const amrex::MultiFab& yvel,
185  const amrex::MultiFab& zvel,
186  amrex::MultiFab& Omega,
187  const amrex::MultiFab& cc_src,
188  const amrex::MultiFab& xmom_src,
189  const amrex::MultiFab& ymom_src,
190  const amrex::MultiFab& zmom_src,
191  amrex::MultiFab* Tau11,
192  amrex::MultiFab* Tau22,
193  amrex::MultiFab* Tau33,
194  amrex::MultiFab* Tau12,
195  amrex::MultiFab* Tau13,
196  amrex::MultiFab* Tau21,
197  amrex::MultiFab* Tau23,
198  amrex::MultiFab* Tau31,
199  amrex::MultiFab* Tau32,
200  amrex::MultiFab* SmnSmn,
201  amrex::MultiFab* eddyDiffs,
202  amrex::MultiFab* Hfx3,
203  amrex::MultiFab* Diss,
204  const amrex::Geometry geom,
205  const SolverChoice& solverChoice,
206  std::unique_ptr<ABLMost>& most,
207  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
208  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
209  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
210  std::unique_ptr<amrex::MultiFab>& ax,
211  std::unique_ptr<amrex::MultiFab>& ay,
212  std::unique_ptr<amrex::MultiFab>& az,
213  std::unique_ptr<amrex::MultiFab>& dJ,
214  const amrex::MultiFab* p0,
215  const amrex::MultiFab& pp_inc,
216  std::unique_ptr<amrex::MultiFab>& mapfac_m,
217  std::unique_ptr<amrex::MultiFab>& mapfac_u,
218  std::unique_ptr<amrex::MultiFab>& mapfac_v);
219 #endif
void erf_slow_rhs_pre(int level, int finest_level, int nrk, amrex::Real dt, amrex::Vector< amrex::MultiFab > &S_rhs, amrex::Vector< amrex::MultiFab > &S_old, amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &S_prim, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel, std::unique_ptr< amrex::MultiFab > &z_t, amrex::MultiFab &Omega, const amrex::MultiFab &cc_src, const amrex::MultiFab &xmom_src, const amrex::MultiFab &ymom_src, const amrex::MultiFab &zmom_src, amrex::MultiFab *Tau11, amrex::MultiFab *Tau22, amrex::MultiFab *Tau33, amrex::MultiFab *Tau12, amrex::MultiFab *Tau13, amrex::MultiFab *Tau21, amrex::MultiFab *Tau23, amrex::MultiFab *Tau31, amrex::MultiFab *Tau32, amrex::MultiFab *SmnSmn, amrex::MultiFab *eddyDiffs, amrex::MultiFab *Hfx1, amrex::MultiFab *Hfx2, amrex::MultiFab *Hfx3, amrex::MultiFab *Q1fx1, amrex::MultiFab *Q1fx2, amrex::MultiFab *Q1fx3, amrex::MultiFab *Q2fx3, amrex::MultiFab *Diss, const amrex::Geometry geom, const SolverChoice &solverChoice, std::unique_ptr< ABLMost > &most, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, const amrex::Vector< amrex::BCRec > &domain_bcs_type, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &ax, std::unique_ptr< amrex::MultiFab > &ay, std::unique_ptr< amrex::MultiFab > &az, std::unique_ptr< amrex::MultiFab > &dJ, const amrex::MultiFab *p0, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine)
void erf_slow_rhs_post(int level, int finest_level, int nrk, amrex::Real dt, int n_qstate, amrex::Vector< amrex::MultiFab > &S_rhs, amrex::Vector< amrex::MultiFab > &S_old, amrex::Vector< amrex::MultiFab > &S_new, amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &S_prim, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel, const amrex::MultiFab &source, const amrex::MultiFab *SmnSmn, const amrex::MultiFab *eddyDiffs, amrex::MultiFab *Hfx1, amrex::MultiFab *Hfx2, amrex::MultiFab *Hfx3, amrex::MultiFab *Q1fx1, amrex::MultiFab *Q1fx2, amrex::MultiFab *Q1fx3, amrex::MultiFab *Q2fx3, amrex::MultiFab *Diss, const amrex::Geometry geom, const SolverChoice &solverChoice, std::unique_ptr< ABLMost > &most, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, const amrex::Vector< amrex::BCRec > &domain_bcs_type, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &ax, std::unique_ptr< amrex::MultiFab > &ay, std::unique_ptr< amrex::MultiFab > &az, std::unique_ptr< amrex::MultiFab > &dJ_old, std::unique_ptr< amrex::MultiFab > &dJ_new, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine)
void erf_make_tau_terms(int level, int nrk, const amrex::Vector< amrex::BCRec > &domain_bcs_type, std::unique_ptr< amrex::MultiFab > &z_phys_nd, amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel, amrex::MultiFab &Omega, amrex::MultiFab *Tau11, amrex::MultiFab *Tau22, amrex::MultiFab *Tau33, amrex::MultiFab *Tau12, amrex::MultiFab *Tau13, amrex::MultiFab *Tau21, amrex::MultiFab *Tau23, amrex::MultiFab *Tau31, amrex::MultiFab *Tau32, amrex::MultiFab *SmnSmn, amrex::MultiFab *eddyDiffs, const amrex::Geometry geom, const SolverChoice &solverChoice, std::unique_ptr< ABLMost > &most, std::unique_ptr< amrex::MultiFab > &dJ, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v)
void erf_slow_rhs_inc(int level, int nrk, amrex::Real dt, amrex::Vector< amrex::MultiFab > &S_rhs, amrex::Vector< amrex::MultiFab > &S_old, amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &S_prim, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel, amrex::MultiFab &Omega, const amrex::MultiFab &cc_src, const amrex::MultiFab &xmom_src, const amrex::MultiFab &ymom_src, const amrex::MultiFab &zmom_src, amrex::MultiFab *Tau11, amrex::MultiFab *Tau22, amrex::MultiFab *Tau33, amrex::MultiFab *Tau12, amrex::MultiFab *Tau13, amrex::MultiFab *Tau21, amrex::MultiFab *Tau23, amrex::MultiFab *Tau31, amrex::MultiFab *Tau32, amrex::MultiFab *SmnSmn, amrex::MultiFab *eddyDiffs, amrex::MultiFab *Hfx3, amrex::MultiFab *Diss, const amrex::Geometry geom, const SolverChoice &solverChoice, std::unique_ptr< ABLMost > &most, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, const amrex::Vector< amrex::BCRec > &domain_bcs_type, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &ax, std::unique_ptr< amrex::MultiFab > &ay, std::unique_ptr< amrex::MultiFab > &az, std::unique_ptr< amrex::MultiFab > &dJ, const amrex::MultiFab *p0, const amrex::MultiFab &pp_inc, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v)
@ xvel
Definition: ERF_IndexDefines.H:130
@ zvel
Definition: ERF_IndexDefines.H:132
@ yvel
Definition: ERF_IndexDefines.H:131
Definition: ERF_DataStruct.H:78