From 80bfcd7fc19871ea775c4ce5dd6089d29debec2d Mon Sep 17 00:00:00 2001 From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de> Date: Fri, 22 Jun 2018 08:56:15 +0200 Subject: [PATCH] [freeflow][komega] Clean-up --- .../rans/twoeq/komega/staggered/fluxvariables.hh | 8 -------- .../rans/twoeq/komega/staggered/localresidual.hh | 9 +++++---- dumux/freeflow/rans/twoeq/komega/volumevariables.hh | 8 +++----- dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh | 6 ++---- test/freeflow/rans/test_pipe_laufer.cc | 2 +- 5 files changed, 11 insertions(+), 22 deletions(-) diff --git a/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh index 0864500144..8d8e0091b5 100644 --- a/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/komega/staggered/fluxvariables.hh @@ -104,8 +104,6 @@ public: = ParentType::advectiveFluxForCellCenter(problem, elemVolVars, elemFaceVars, scvf, upwindTermK); flux[dissipationEqIdx] = ParentType::advectiveFluxForCellCenter(problem, elemVolVars, elemFaceVars, scvf, upwindTermOmega); - Dune::dverb << " k_adv " << ParentType::advectiveFluxForCellCenter(problem, elemVolVars, elemFaceVars, scvf, upwindTermK); - Dune::dverb << " w_adv " << ParentType::advectiveFluxForCellCenter(problem, elemVolVars, elemFaceVars, scvf, upwindTermOmega); // calculate diffusive flux const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx()); @@ -154,9 +152,6 @@ public: += coeff_k / distance * (insideVolVars.turbulentKineticEnergy() - outsideVolVars.turbulentKineticEnergy()) * scvf.area(); - Dune::dverb << " k_diff " << coeff_k / distance - * (insideVolVars.turbulentKineticEnergy() - outsideVolVars.turbulentKineticEnergy()) - * scvf.area(); } if (!(scvf.boundary() && (bcTypes.isOutflow(Indices::dissipationEqIdx) || bcTypes.isSymmetry()))) @@ -165,9 +160,6 @@ public: += coeff_w / distance * (insideVolVars.dissipation() - outsideVolVars.dissipation()) * scvf.area(); - Dune::dverb << " w_diff " << coeff_w / distance - * (insideVolVars.dissipation() - outsideVolVars.dissipation()) - * scvf.area(); } return flux; } diff --git a/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh b/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh index baaa228d55..5d86d36043 100644 --- a/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/komega/staggered/localresidual.hh @@ -99,21 +99,22 @@ public: CellCenterPrimaryVariables source = ParentType::computeSourceForCellCenter(problem, element, fvGeometry, elemVolVars, elemFaceVars, scv); + using std::min; const auto& volVars = elemVolVars[scv]; // production - Scalar productionTerm = 2.0 * volVars.kinematicEddyViscosity()* volVars.stressTensorScalarProduct(); + Scalar productionTerm = 2.0 * volVars.kinematicEddyViscosity() * volVars.stressTensorScalarProduct(); if (ModelTraits::enableKOmegaProductionLimiter()) { Scalar productionAlternative = 20.0 * volVars.betaK() * volVars.turbulentKineticEnergy() * volVars.dissipation(); - productionTerm = std::min(productionTerm, productionAlternative); + productionTerm = min(productionTerm, productionAlternative); } source[turbulentKineticEnergyEqIdx] += productionTerm; - source[dissipationEqIdx] += volVars.alpha() * ( volVars.dissipation() / volVars.turbulentKineticEnergy() ) * productionTerm; + source[dissipationEqIdx] += volVars.alpha() * volVars.dissipation() / volVars.turbulentKineticEnergy() * productionTerm; // destruction source[turbulentKineticEnergyEqIdx] -= volVars.betaK() * volVars.turbulentKineticEnergy() * volVars.dissipation(); - source[dissipationEqIdx] -= volVars.betaOmega() * volVars.dissipation() * volVars.dissipation(); + source[dissipationEqIdx] -= volVars.betaOmega() * volVars.dissipation() * volVars.dissipation(); return source; } diff --git a/dumux/freeflow/rans/twoeq/komega/volumevariables.hh b/dumux/freeflow/rans/twoeq/komega/volumevariables.hh index d499f6441d..aad519d26c 100644 --- a/dumux/freeflow/rans/twoeq/komega/volumevariables.hh +++ b/dumux/freeflow/rans/twoeq/komega/volumevariables.hh @@ -98,7 +98,6 @@ public: storedDissipation_ = problem.storedDissipation_[RANSParentType::elementID()]; storedTurbulentKineticEnergy_ = problem.storedTurbulentKineticEnergy_[RANSParentType::elementID()]; stressTensorScalarProduct_ = problem.stressTensorScalarProduct_[RANSParentType::elementID()]; - dofPosition_ = scv.dofPosition(); if (problem.useStoredEddyViscosity_) dynamicEddyViscosity_ = problem.storedDynamicEddyViscosity_[RANSParentType::elementID()]; else @@ -200,15 +199,15 @@ public: //! \brief Returns the \$f \alpha \$f value const Scalar alpha() const - { return 0.520; } + { return 0.52; } //! \brief Returns the \$f \sigma_k \$f constant const Scalar sigmaK() const - { return 0.60; } + { return 0.6; } //! \brief Returns the \$f \sigma_{\omega} \$f constant const Scalar sigmaOmega() const - { return 0.50; } + { return 0.5; } //! \brief Returns the \$f \beta_k \$f constant const Scalar betaK() const @@ -237,7 +236,6 @@ public: protected: Scalar betaOmega_; - Dune::FieldVector<Scalar, Traits::ModelTraits::dim()> dofPosition_; Scalar eddyDiffusivity_; Scalar dynamicEddyViscosity_; Scalar dissipation_; diff --git a/dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh b/dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh index 3820a4b636..10f9c1359c 100644 --- a/dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh @@ -51,10 +51,8 @@ public: template <class VtkOutputModule> static void add(VtkOutputModule& vtk) { - vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "turbulentKineticEnergy"); - vtk.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "dissipation"); - vtk.addVolumeVariable([](const auto& v){ return v.stressTensorScalarProduct(); }, "stressTensorScalarProduct"); - vtk.addVolumeVariable([](const auto& v){ return v.kinematicEddyViscosity(); }, "eddyViscosity"); + vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); + vtk.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); vtk.addVolumeVariable([](const auto& v){ return 2.0 * v.kinematicEddyViscosity() * v.stressTensorScalarProduct();}, "production_k"); vtk.addVolumeVariable([](const auto& v){ return 2.0 * v.kinematicEddyViscosity() * v.stressTensorScalarProduct() * v.alpha() * ( v.dissipation() / v.turbulentKineticEnergy() ) ; }, "production_omega"); vtk.addVolumeVariable([](const auto& v){ return v.betaK() * v.turbulentKineticEnergy() * v.dissipation() ;}, "destruction_k"); diff --git a/test/freeflow/rans/test_pipe_laufer.cc b/test/freeflow/rans/test_pipe_laufer.cc index 1564aa1565..f736ffceda 100644 --- a/test/freeflow/rans/test_pipe_laufer.cc +++ b/test/freeflow/rans/test_pipe_laufer.cc @@ -274,7 +274,7 @@ int main(int argc, char** argv) try gnuplot_velocityProfile.addFileToPlot(std::string(fileName) + ".csv", "u 7:($28/0.2456) w l lc 7"); #elif KOMEGA gnuplot_velocityProfile.addFileToPlot("pdelab-komega.csv", "u 5:($29/0.2456) w l lw 2 t 'PDELab k-omega'"); - gnuplot_velocityProfile.addFileToPlot(std::string(fileName) + ".csv", "u 7:($32/0.2456) w l lc 7"); + gnuplot_velocityProfile.addFileToPlot(std::string(fileName) + ".csv", "u 7:($30/0.2456) w l lc 7"); #else gnuplot_velocityProfile.addFileToPlot("pdelab-zeroeq.csv", "u 5:($26/0.2456) w l lw 2 t 'PDELab 0-Eq.'"); gnuplot_velocityProfile.addFileToPlot(std::string(fileName) + ".csv", "u 7:($24/0.2456) w l lc 7"); -- GitLab