Skip to content

Commit

Permalink
This was missed with the moisture overhaul. (#1393)
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi authored Jan 20, 2024
1 parent 12c661e commit 88ea1f0
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions Source/Diffusion/DiffusionSrcForState_T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,26 +91,29 @@ DiffusionSrcForState_T (const amrex::Box& bx, const amrex::Box& domain,
const int qty_offset = RhoTheta_comp;

// Theta, KE, QKE, Scalar
Vector<Real> alpha_eff(NVAR_max, 0.0);
Vector<Real> alpha_eff(NVAR_max, 0.0);
if (l_consA) {
for (int i = 0; i < NVAR_max; ++i) {
switch (i) {
case PrimTheta_comp:
alpha_eff[PrimTheta_comp] = diffChoice.alpha_T;
break;
case PrimScalar_comp:
alpha_eff[PrimScalar_comp] = diffChoice.alpha_C;
break;
case PrimQ1_comp:
alpha_eff[PrimQ1_comp] = diffChoice.alpha_C;
break;
case PrimQ2_comp:
alpha_eff[PrimQ2_comp] = diffChoice.alpha_C;
break;
default:
alpha_eff[i] = 0.0;
break;
}
for (int i = 0; i < NVAR_max; ++i) {
switch (i) {
case PrimTheta_comp:
alpha_eff[PrimTheta_comp] = diffChoice.alpha_T;
break;
case PrimScalar_comp:
alpha_eff[PrimScalar_comp] = diffChoice.alpha_C;
break;
case PrimQ1_comp:
alpha_eff[PrimQ1_comp] = diffChoice.alpha_C;
break;
case PrimQ2_comp:
alpha_eff[PrimQ2_comp] = diffChoice.alpha_C;
break;
case PrimQ3_comp:
alpha_eff[PrimQ3_comp] = diffChoice.alpha_C;
break;
default:
alpha_eff[i] = 0.0;
break;
}
}
} else {
for (int i = 0; i < NVAR_max; ++i) {
Expand All @@ -127,16 +130,18 @@ DiffusionSrcForState_T (const amrex::Box& bx, const amrex::Box& domain,
case PrimQ2_comp:
alpha_eff[PrimQ2_comp] = diffChoice.rhoAlpha_C;
break;
case PrimQ3_comp:
alpha_eff[PrimQ3_comp] = diffChoice.rhoAlpha_C;
break;
default:
alpha_eff[i] = 0.0;
break;
}
}
}

Vector<int> eddy_diff_idx{EddyDiff::Theta_h, EddyDiff::KE_h, EddyDiff::QKE_h, EddyDiff::Scalar_h, EddyDiff::Q1_h, EddyDiff::Q2_h};
Vector<int> eddy_diff_idy{EddyDiff::Theta_h, EddyDiff::KE_h, EddyDiff::QKE_h, EddyDiff::Scalar_h, EddyDiff::Q1_h, EddyDiff::Q2_h};
Vector<int> eddy_diff_idz{EddyDiff::Theta_v, EddyDiff::KE_v, EddyDiff::QKE_v, EddyDiff::Scalar_v, EddyDiff::Q1_v, EddyDiff::Q2_v};
Vector<int> eddy_diff_idx{EddyDiff::Theta_h, EddyDiff::KE_h, EddyDiff::QKE_h, EddyDiff::Scalar_h, EddyDiff::Q1_h, EddyDiff::Q2_h, EddyDiff::Q3_h};
Vector<int> eddy_diff_idy{EddyDiff::Theta_h, EddyDiff::KE_h, EddyDiff::QKE_h, EddyDiff::Scalar_h, EddyDiff::Q1_h, EddyDiff::Q2_h, EddyDiff::Q3_h};
Vector<int> eddy_diff_idz{EddyDiff::Theta_v, EddyDiff::KE_v, EddyDiff::QKE_v, EddyDiff::Scalar_v, EddyDiff::Q1_v, EddyDiff::Q2_v, EddyDiff::Q3_h};

// Device vectors
Gpu::AsyncVector<Real> alpha_eff_d;
Expand All @@ -146,7 +151,7 @@ DiffusionSrcForState_T (const amrex::Box& bx, const amrex::Box& domain,
eddy_diff_idy_d.resize(eddy_diff_idy.size());
eddy_diff_idz_d.resize(eddy_diff_idz.size());

Gpu::copy(Gpu::hostToDevice, alpha_eff.begin(), alpha_eff.end(), alpha_eff_d.begin());
Gpu::copy(Gpu::hostToDevice, alpha_eff.begin() , alpha_eff.end() , alpha_eff_d.begin());
Gpu::copy(Gpu::hostToDevice, eddy_diff_idx.begin(), eddy_diff_idx.end(), eddy_diff_idx_d.begin());
Gpu::copy(Gpu::hostToDevice, eddy_diff_idy.begin(), eddy_diff_idy.end(), eddy_diff_idy_d.begin());
Gpu::copy(Gpu::hostToDevice, eddy_diff_idz.begin(), eddy_diff_idz.end(), eddy_diff_idz_d.begin());
Expand Down

0 comments on commit 88ea1f0

Please sign in to comment.