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