From 4a3dbecf152c9a1f6e4c01a17ae865bbc90a67c6 Mon Sep 17 00:00:00 2001 From: Bumseok Lee Date: Fri, 20 Sep 2024 14:19:19 -0600 Subject: [PATCH] changed the implementation in SDR w/ and w/o the transition model --- src/SpecificDissipationRateEquationSystem.C | 66 ++++++++++++--------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/src/SpecificDissipationRateEquationSystem.C b/src/SpecificDissipationRateEquationSystem.C index bea476aba..2e5785f4e 100644 --- a/src/SpecificDissipationRateEquationSystem.C +++ b/src/SpecificDissipationRateEquationSystem.C @@ -267,42 +267,50 @@ SpecificDissipationRateEquationSystem::register_interior_algorithm( auto& solverAlgMap = solverAlgDriver_->solverAlgMap_; process_ngp_node_kernels( solverAlgMap, realm_, part, this, + [&](AssembleNGPNodeSolverAlgorithm& nodeAlg) { if (!elementMassAlg) nodeAlg.add_kernel(realm_.bulk_data(), sdr_); - if ( - TurbulenceModel::SST == realm_.solutionOptions_->turbulenceModel_ && - !realm_.solutionOptions_->gammaEqActive_) { - nodeAlg.add_kernel(realm_.meta_data()); - } else if ( - TurbulenceModel::SST == realm_.solutionOptions_->turbulenceModel_ && - realm_.solutionOptions_->gammaEqActive_) { + if (realm_.solutionOptions_->gammaEqActive_) { + if (TurbulenceModel::SST == realm_.solutionOptions_->turbulenceModel_) { nodeAlg.add_kernel(realm_.meta_data()); - } else if ( - TurbulenceModel::SSTLR == realm_.solutionOptions_->turbulenceModel_) { - nodeAlg.add_kernel(realm_.meta_data()); - } else if ( - (TurbulenceModel::SST_DES == - realm_.solutionOptions_->turbulenceModel_) || - (TurbulenceModel::SST_IDDES == - realm_.solutionOptions_->turbulenceModel_)) { - nodeAlg.add_kernel(realm_.meta_data()); - } else if ( - TurbulenceModel::SST_AMS == - realm_.solutionOptions_->turbulenceModel_) { - nodeAlg.add_kernel( - realm_.meta_data(), - realm_.solutionOptions_->get_coordinates_name()); - } else if ( - TurbulenceModel::KO == realm_.solutionOptions_->turbulenceModel_) { - nodeAlg.add_kernel(realm_.meta_data()); - } else { - throw std::runtime_error( - "Invalid turbulence model in SDR equation system: " + + } else { + throw std::runtime_error( + "Invalid turbulene model: Currently the transition model only works with SST " + TurbulenceModelNames[static_cast( - realm_.solutionOptions_->turbulenceModel_)]); + realm_.solutionOptions_->turbulenceModel_)]); + } + } else { + if ( + TurbulenceModel::SST == realm_.solutionOptions_->turbulenceModel_ ) { + nodeAlg.add_kernel(realm_.meta_data()); + } else if ( + TurbulenceModel::SSTLR == realm_.solutionOptions_->turbulenceModel_) { + nodeAlg.add_kernel(realm_.meta_data()); + } else if ( + (TurbulenceModel::SST_DES == + realm_.solutionOptions_->turbulenceModel_) || + (TurbulenceModel::SST_IDDES == + realm_.solutionOptions_->turbulenceModel_)) { + nodeAlg.add_kernel(realm_.meta_data()); + } else if ( + TurbulenceModel::SST_AMS == + realm_.solutionOptions_->turbulenceModel_) { + nodeAlg.add_kernel( + realm_.meta_data(), + realm_.solutionOptions_->get_coordinates_name()); + } else if ( + TurbulenceModel::KO == realm_.solutionOptions_->turbulenceModel_) { + nodeAlg.add_kernel(realm_.meta_data()); + } else { + throw std::runtime_error( + "Invalid turbulence model in SDR equation system: " + + TurbulenceModelNames[static_cast( + realm_.solutionOptions_->turbulenceModel_)]); + } } }, + [&](AssembleNGPNodeSolverAlgorithm& nodeAlg, std::string& srcName) { if (srcName == "gcl") { nodeAlg.add_kernel(realm_.bulk_data(), sdr_);