Skip to content

Commit

Permalink
Use Tv in ComputeQKESourceTerms
Browse files Browse the repository at this point in the history
  • Loading branch information
ewquon committed Aug 16, 2024
1 parent 2be6792 commit 4806cad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Source/Diffusion/DiffusionSrcForState_N.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace amrex;
* @param[in] mu_turb turbulent viscosity
* @param[in] diffChoice container of diffusion parameters
* @param[in] turbChoice container of turbulence parameters
* @param[in] tm_arr theta mean array
* @param[in] tvm_arr thetav mean array
* @param[in] grav_gpu gravity vector
* @param[in] bc_ptr container with boundary conditions
* @param[in] use_most whether we have turned on MOST BCs
Expand Down Expand Up @@ -61,7 +61,7 @@ DiffusionSrcForState_N (const Box& bx, const Box& domain,
const Array4<const Real>& mu_turb,
const DiffChoice &diffChoice,
const TurbChoice &turbChoice,
const Array4<const Real>& tm_arr,
const Array4<const Real>& tvm_arr,
const GpuArray<Real,AMREX_SPACEDIM> grav_gpu,
const BCRec* bc_ptr,
const bool use_most,
Expand Down Expand Up @@ -536,7 +536,7 @@ DiffusionSrcForState_N (const Box& bx, const Box& domain,
{
cell_rhs(i, j, k, qty_index) += ComputeQKESourceTerms(i,j,k,u,v,cell_data,cell_prim,
mu_turb,cellSizeInv,domain,
pbl_mynn_B1_l,tm_arr(i,j,0),
pbl_mynn_B1_l,tvm_arr(i,j,0),
use_moisture,
c_ext_dir_on_zlo, c_ext_dir_on_zhi,
u_ext_dir_on_zlo, u_ext_dir_on_zhi,
Expand Down
6 changes: 3 additions & 3 deletions Source/Diffusion/DiffusionSrcForState_T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using namespace amrex;
* @param[in] mu_turb turbulent viscosity
* @param[in] diffChoice container of diffusion parameters
* @param[in] turbChoice container of turbulence parameters
* @param[in] tm_arr theta mean array
* @param[in] tvm_arr thetav mean array
* @param[in] grav_gpu gravity vector
* @param[in] bc_ptr container with boundary conditions
* @param[in] use_most whether we have turned on MOST BCs
Expand Down Expand Up @@ -74,7 +74,7 @@ DiffusionSrcForState_T (const Box& bx, const Box& domain,
const Array4<const Real>& mu_turb,
const DiffChoice &diffChoice,
const TurbChoice &turbChoice,
const Array4<const Real>& tm_arr,
const Array4<const Real>& tvm_arr,
const GpuArray<Real,AMREX_SPACEDIM> grav_gpu,
const BCRec* bc_ptr,
const bool use_most,
Expand Down Expand Up @@ -744,7 +744,7 @@ DiffusionSrcForState_T (const Box& bx, const Box& domain,
const Real met_h_zeta = detJ(i,j,k);
cell_rhs(i, j, k, qty_index) += ComputeQKESourceTerms(i,j,k,u,v,cell_data,cell_prim,
mu_turb,cellSizeInv,domain,
pbl_mynn_B1_l,tm_arr(i,j,0),
pbl_mynn_B1_l,tvm_arr(i,j,0),
use_moisture,
c_ext_dir_on_zlo, c_ext_dir_on_zhi,
u_ext_dir_on_zlo, u_ext_dir_on_zhi,
Expand Down
10 changes: 5 additions & 5 deletions Source/TimeIntegration/ERF_slow_rhs_post.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ void erf_slow_rhs_post (int level, int finest_level,
DiffChoice dc = solverChoice.diffChoice;
TurbChoice tc = solverChoice.turbChoice[level];

const MultiFab* t_mean_mf = nullptr;
if (most) t_mean_mf = most->get_mac_avg(0,2);
const MultiFab* tv_mean_mf = nullptr;
if (most) tv_mean_mf = most->get_mac_avg(0,4);

const bool l_use_terrain = solverChoice.use_terrain;
const bool l_reflux = (solverChoice.coupling_type != CouplingType::OneWay);
Expand Down Expand Up @@ -404,7 +404,7 @@ void erf_slow_rhs_post (int level, int finest_level,

if (l_use_diff) {

const Array4<const Real> tm_arr = t_mean_mf ? t_mean_mf->const_array(mfi) : Array4<const Real>{};
const Array4<const Real> tvm_arr = tv_mean_mf ? tv_mean_mf->const_array(mfi) : Array4<const Real>{};

if (l_use_terrain) {
DiffusionSrcForState_T(tbx, domain, start_comp, num_comp, exp_most, rot_most, u, v,
Expand All @@ -414,15 +414,15 @@ void erf_slow_rhs_post (int level, int finest_level,
dxInv, SmnSmn_a, mf_m, mf_u, mf_v,
hfx_x, hfx_y, hfx_z, q1fx_x, q1fx_y, q1fx_z,q2fx_z, diss,
mu_turb, dc, tc,
tm_arr, grav_gpu, bc_ptr_d, use_most, l_use_moisture);
tvm_arr, grav_gpu, bc_ptr_d, use_most, l_use_moisture);
} else {
DiffusionSrcForState_N(tbx, domain, start_comp, num_comp, exp_most, u, v,
new_cons, cur_prim, cell_rhs,
diffflux_x, diffflux_y, diffflux_z,
dxInv, SmnSmn_a, mf_m, mf_u, mf_v,
hfx_z, q1fx_z, q2fx_z, diss,
mu_turb, dc, tc,
tm_arr, grav_gpu, bc_ptr_d, use_most, l_use_moisture);
tvm_arr, grav_gpu, bc_ptr_d, use_most, l_use_moisture);
}
} // use_diff
} // valid slow var
Expand Down
10 changes: 5 additions & 5 deletions Source/TimeIntegration/ERF_slow_rhs_pre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ void erf_slow_rhs_pre (int level, int finest_level,
DiffChoice dc = solverChoice.diffChoice;
TurbChoice tc = solverChoice.turbChoice[level];

const MultiFab* t_mean_mf = nullptr;
if (most) t_mean_mf = most->get_mac_avg(0,2);
const MultiFab* tv_mean_mf = nullptr;
if (most) tv_mean_mf = most->get_mac_avg(0,4);

int start_comp = 0;
int num_comp = 2;
Expand Down Expand Up @@ -488,7 +488,7 @@ if (cell_data(i,j,k,RhoTheta_comp) < 0.) printf("BAD THETA AT %d %d %d %e %e \n"
Array4<Real> q2fx_z = (Q2fx3) ? Q2fx3->array(mfi) : Array4<Real>{};
Array4<Real> diss = Diss->array(mfi);

const Array4<const Real> tm_arr = t_mean_mf ? t_mean_mf->const_array(mfi) : Array4<const Real>{};
const Array4<const Real> tvm_arr = tv_mean_mf ? tv_mean_mf->const_array(mfi) : Array4<const Real>{};

// NOTE: No diffusion for continuity, so n starts at 1.
int n_start = amrex::max(start_comp,RhoTheta_comp);
Expand All @@ -501,15 +501,15 @@ if (cell_data(i,j,k,RhoTheta_comp) < 0.) printf("BAD THETA AT %d %d %d %e %e \n"
z_nd, ax_arr, ay_arr, az_arr, detJ_arr,
dxInv, SmnSmn_a, mf_m, mf_u, mf_v,
hfx_x, hfx_y, hfx_z, q1fx_x, q1fx_y, q1fx_z, q2fx_z, diss, mu_turb, dc, tc,
tm_arr, grav_gpu, bc_ptr_d, l_use_most, l_use_moisture);
tvm_arr, grav_gpu, bc_ptr_d, l_use_most, l_use_moisture);
} else {
DiffusionSrcForState_N(bx, domain, n_start, n_comp, l_exp_most, u, v,
cell_data, cell_prim, cell_rhs,
diffflux_x, diffflux_y, diffflux_z,
dxInv, SmnSmn_a, mf_m, mf_u, mf_v,
hfx_z, q1fx_z, q2fx_z, diss,
mu_turb, dc, tc,
tm_arr, grav_gpu, bc_ptr_d, l_use_most, l_use_moisture);
tvm_arr, grav_gpu, bc_ptr_d, l_use_most, l_use_moisture);
}
}

Expand Down

0 comments on commit 4806cad

Please sign in to comment.