Skip to content

Commit

Permalink
format for CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bumseok Lee committed Sep 20, 2024
1 parent 4a3dbec commit 0298ac4
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 34 deletions.
8 changes: 5 additions & 3 deletions src/node_kernels/BLTGammaM2015NodeKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ BLTGammaM2015NodeKernel::execute(
const DblType fonset1 = Rev / 2.2 / Re0c;
const DblType fonset2 = stk::math::min(fonset1, 2.0);
const DblType rt = density * tke / sdr / visc;
const DblType fonset3 = stk::math::max(1.0 - stk::math::pow(rt / 3.5, 3), 0.0);
const DblType fonset3 =
stk::math::max(1.0 - stk::math::pow(rt / 3.5, 3), 0.0);
const DblType fonset = stk::math::max(fonset2 - fonset3, 0.0);
const DblType fturb = stk::math::exp(-rt * rt * rt * rt / 16.0);

Expand All @@ -167,14 +168,15 @@ BLTGammaM2015NodeKernel::execute(
// lhs(0, 0) += (DgammaDir - PgammaDir) * dVol;

// Jacobian with the Positivity in the implicit operator
const DblType PgammaDir = flength * density * sijMag * fonset * (1.0 - gamint);
const DblType PgammaDir =
flength * density * sijMag * fonset * (1.0 - gamint);
const DblType PgammaDirP = -flength * density * sijMag * fonset;

const DblType DgammaDir =
caTwo * density * vortMag * fturb * (ceTwo * gamint - 1.0);
const DblType DgammaDirP = caTwo * density * vortMag * fturb * ceTwo;

const DblType gamma_pos1 = stk::math::max(DgammaDir - PgammaDir, 0.0);
const DblType gamma_pos1 = stk::math::max(DgammaDir - PgammaDir, 0.0);
const DblType gamma_pos2 = stk::math::max(DgammaDirP - PgammaDirP, 0.0);

rhs(0) += (Pgamma - Dgamma) * dVol;
Expand Down
6 changes: 3 additions & 3 deletions src/node_kernels/TKESSTBLTM2015NodeKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ TKESSTBLTM2015NodeKernel::execute(

// Pk based on Kato-Launder formulation
const DblType Pk = gamint * tvisc * sijMag * vortMag;
const DblType Pklim = 5.0 * Ck_BLT * stk::math::max(gamint - 0.2, 0.0) * (1.0 - gamint) *
Fonlim * stk::math::max(3.0 * CSEP * visc - tvisc, 0.0) * sijMag *
vortMag;
const DblType Pklim =
5.0 * Ck_BLT * stk::math::max(gamint - 0.2, 0.0) * (1.0 - gamint) * Fonlim *
stk::math::max(3.0 * CSEP * visc - tvisc, 0.0) * sijMag * vortMag;
const DblType Dk =
betaStar_ * density * sdr * tke * stk::math::max(gamint, 0.1);

Expand Down
5 changes: 3 additions & 2 deletions unit_tests/kernels/UnitTestKernelUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ struct TrigFieldFunction

// Range should be from 0.02 to 1.0
qField[0] =
gamma_intermittencynot + abs(std::cos(a * pi * x) * std::sin(a * pi * y) *
std::sin(a * pi * z))/(1.0 - gamma_intermittencynot);
gamma_intermittencynot +
abs(std::cos(a * pi * x) * std::sin(a * pi * y) * std::sin(a * pi * z)) /
(1.0 - gamma_intermittencynot);
}

void dwalldistdx(const double* coords, double* qField) const
Expand Down
18 changes: 12 additions & 6 deletions unit_tests/kernels/UnitTestKernelUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,10 @@ class SSTKernelHex8Mesh : public LowMachKernelHex8Mesh
stk::topology::NODE_RANK, "turbulent_viscosity")),
gamma_intermittency_(&meta_->declare_field<double>(
stk::topology::NODE_RANK, "gamma_transition")),
dwalldistdx_(&meta_->declare_field<double>(stk::topology::NODE_RANK, "dwalldistdx")),
dnDotVdx_(&meta_->declare_field<double>(stk::topology::NODE_RANK, "dnDotVdx")),
dwalldistdx_(
&meta_->declare_field<double>(stk::topology::NODE_RANK, "dwalldistdx")),
dnDotVdx_(
&meta_->declare_field<double>(stk::topology::NODE_RANK, "dnDotVdx")),
maxLengthScale_(&meta_->declare_field<double>(
stk::topology::NODE_RANK, "sst_max_length_scale")),
minDistance_(&meta_->declare_field<double>(
Expand Down Expand Up @@ -778,7 +780,8 @@ class SSTKernelHex8Mesh : public LowMachKernelHex8Mesh
stk::mesh::put_field_on_mesh(*sdrbc_, meta_->universal_part(), nullptr);
stk::mesh::put_field_on_mesh(*visc_, meta_->universal_part(), nullptr);
stk::mesh::put_field_on_mesh(*tvisc_, meta_->universal_part(), nullptr);
stk::mesh::put_field_on_mesh(*gamma_intermittency_, meta_->universal_part(), nullptr);
stk::mesh::put_field_on_mesh(
*gamma_intermittency_, meta_->universal_part(), nullptr);
stk::mesh::put_field_on_mesh(
*maxLengthScale_, meta_->universal_part(), nullptr);
stk::mesh::put_field_on_mesh(
Expand All @@ -798,10 +801,12 @@ class SSTKernelHex8Mesh : public LowMachKernelHex8Mesh
stk::io::set_field_output_type(*dwdx_, stk::io::FieldOutputType::VECTOR_3D);
stk::mesh::put_field_on_mesh(
*dwalldistdx_, meta_->universal_part(), spatialDim_, nullptr);
stk::io::set_field_output_type(*dwalldistdx_, stk::io::FieldOutputType::VECTOR_3D);
stk::io::set_field_output_type(
*dwalldistdx_, stk::io::FieldOutputType::VECTOR_3D);
stk::mesh::put_field_on_mesh(
*dnDotVdx_, meta_->universal_part(), spatialDim_, nullptr);
stk::io::set_field_output_type(*dnDotVdx_, stk::io::FieldOutputType::VECTOR_3D);
stk::io::set_field_output_type(
*dnDotVdx_, stk::io::FieldOutputType::VECTOR_3D);
double initOpenMassFlowRate[sierra::nalu::AlgTraitsQuad4::numScsIp_];
for (int i = 0; i < sierra::nalu::AlgTraitsQuad4::numScsIp_; ++i) {
initOpenMassFlowRate[i] = 10.0;
Expand Down Expand Up @@ -833,7 +838,8 @@ class SSTKernelHex8Mesh : public LowMachKernelHex8Mesh
*bulk_, *coordinates_, *density_);
unit_test_kernel_utils::tke_test_function(*bulk_, *coordinates_, *tke_);
unit_test_kernel_utils::sdr_test_function(*bulk_, *coordinates_, *sdr_);
unit_test_kernel_utils::gamma_intermittency_test_function(*bulk_, *coordinates_, *gamma_intermittency_);
unit_test_kernel_utils::gamma_intermittency_test_function(
*bulk_, *coordinates_, *gamma_intermittency_);
unit_test_kernel_utils::minimum_distance_to_wall_test_function(
*bulk_, *coordinates_, *minDistance_);
unit_test_kernel_utils::sst_f_one_blending_test_function(
Expand Down
9 changes: 1 addition & 8 deletions unit_tests/node_kernels/UnitTestBLTGammaM2015NodeKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@ namespace {
namespace hex8_golds {
namespace blt_gamma {
static constexpr double rhs[8] = {
0,
0,
0,
0.12823826807242,
0,
0,
-0.043287170452808,
0.43035793150449,
0, 0, 0, 0.12823826807242, 0, 0, -0.043287170452808, 0.43035793150449,
};

static constexpr double lhs[8][8] = {
Expand Down
20 changes: 8 additions & 12 deletions unit_tests/node_kernels/UnitTestSSTNodeKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -410,17 +410,11 @@ static constexpr double rhs[8] = {
};
} // namespace tke_sst_des_sust


namespace tke_sst_trans {
static constexpr double rhs[8] = {
-0.004499999980007,
-0.0026450336235646,
-0.0037149722043966,
-0.0013217844303503,
-0.0026450336153232,
-0.0015547117509048,
-0.017568942314324,
0.0073065228754648,
-0.004499999980007, -0.0026450336235646, -0.0037149722043966,
-0.0013217844303503, -0.0026450336153232, -0.0015547117509048,
-0.017568942314324, 0.0073065228754648,
};

static constexpr double lhs[8][8] = {
Expand Down Expand Up @@ -505,7 +499,7 @@ static constexpr double lhs[8][8] = {
0.0022476729243034,
},
};
} // // namespace tke_sst_trans
} // namespace tke_sst_trans

namespace sdr_sst {
static constexpr double rhs[8] = {
Expand Down Expand Up @@ -1147,7 +1141,8 @@ TEST_F(SSTKernelHex8Mesh, NGP_tke_sst_trans_node)
unit_test_utils::NodeHelperObjects helperObjs(
bulk_, stk::topology::HEX_8, 1, partVec_[0]);

helperObjs.nodeAlg->add_kernel<sierra::nalu::TKESSTBLTM2015NodeKernel>(*meta_);
helperObjs.nodeAlg->add_kernel<sierra::nalu::TKESSTBLTM2015NodeKernel>(
*meta_);

helperObjs.execute();

Expand Down Expand Up @@ -1365,7 +1360,8 @@ TEST_F(SSTKernelHex8Mesh, NGP_sdr_sst_trans_node)
unit_test_utils::NodeHelperObjects helperObjs(
bulk_, stk::topology::HEX_8, 1, partVec_[0]);

helperObjs.nodeAlg->add_kernel<sierra::nalu::SDRSSTBLTM2015NodeKernel>(*meta_);
helperObjs.nodeAlg->add_kernel<sierra::nalu::SDRSSTBLTM2015NodeKernel>(
*meta_);

helperObjs.execute();

Expand Down

0 comments on commit 0298ac4

Please sign in to comment.