Skip to content

Commit

Permalink
Update SST-AMS with SUST
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored and jamelvin committed Sep 1, 2023
1 parent 64654e9 commit c1998de
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/node_kernels/SDRSSTAMSNodeKernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class SDRSSTAMSNodeKernel : public NGPNodeKernel<SDRSSTAMSNodeKernel>
NodeKernelTraits::DblType referenceVelocity_;
NodeKernelTraits::DblType gammaOne_;
NodeKernelTraits::DblType gammaTwo_;
NodeKernelTraits::DblType sdrAmb_;
};

} // namespace nalu
Expand Down
2 changes: 2 additions & 0 deletions include/node_kernels/TKESSTAMSNodeKernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class TKESSTAMSNodeKernel : public NGPNodeKernel<TKESSTAMSNodeKernel>

NodeKernelTraits::DblType betaStar_;
NodeKernelTraits::DblType tkeProdLimitRatio_;
NodeKernelTraits::DblType tkeAmb_;
NodeKernelTraits::DblType sdrAmb_;
const int nDim_;
};

Expand Down
6 changes: 5 additions & 1 deletion src/node_kernels/SDRSSTAMSNodeKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ SDRSSTAMSNodeKernel::setup(Realm& realm)
gammaOne_ = realm.get_turb_model_constant(TM_gammaOne);
gammaTwo_ = realm.get_turb_model_constant(TM_gammaTwo);
tkeProdLimitRatio_ = realm.get_turb_model_constant(TM_tkeProdLimitRatio);
sdrAmb_ = realm.get_turb_model_constant(TM_sdrAmb);

lengthScaleLimiter_ = realm.solutionOptions_->lengthScaleLimiter_;
if (lengthScaleLimiter_) {
Expand Down Expand Up @@ -146,7 +147,10 @@ SDRSSTAMSNodeKernel::execute(

const NodeKernelTraits::DblType dualVolume = dualNodalVolume_.get(node, 0);

rhs(0) += (Pw - Dw + Sw) * dualVolume;
// SUST source term
const NodeKernelTraits::DblType Dwamb = beta * rho * sdrAmb_ * sdrAmb_;

rhs(0) += (Pw - Dw + Dwamb + Sw) * dualVolume;

lhs(0, 0) +=
(2.0 * beta * rho * sdr + stk::math::max(Sw / sdr, 0.0)) * dualVolume;
Expand Down
8 changes: 7 additions & 1 deletion src/node_kernels/TKESSTAMSNodeKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ TKESSTAMSNodeKernel::setup(Realm& realm)
// Update turbulence model constants
betaStar_ = realm.get_turb_model_constant(TM_betaStar);
tkeProdLimitRatio_ = realm.get_turb_model_constant(TM_tkeProdLimitRatio);
tkeAmb_ = realm.get_turb_model_constant(TM_tkeAmb);
sdrAmb_ = realm.get_turb_model_constant(TM_sdrAmb);
}

KOKKOS_FUNCTION
Expand All @@ -71,7 +73,11 @@ TKESSTAMSNodeKernel::execute(

const NodeKernelTraits::DblType dualVolume = dualNodalVolume_.get(node, 0);

rhs(0) += (Pk - Dk) * dualVolume;
// SUST source term
const NodeKernelTraits::DblType Dkamb =
betaStar_ * rho_.get(node, 0) * sdrAmb_ * tkeAmb_;

rhs(0) += (Pk - Dk + Dkamb) * dualVolume;

lhs(0, 0) += tkeFac * dualVolume;
}
Expand Down

0 comments on commit c1998de

Please sign in to comment.