From 8e04a529d9edcc35a927be97b6995f9c6d776413 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 4 Feb 2016 20:23:22 +0000 Subject: [PATCH] TurbulenceModels: Reorder stress component evaluation This ensures the U boundary conditions are updated before the explicit parts of the stress are evaluated. Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1988 --- .../ReynoldsStress/ReynoldsStress.C | 28 +++++++++---------- .../linearViscousStress/linearViscousStress.C | 6 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C index 55001003da..0893bea4a6 100644 --- a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C +++ b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -238,43 +238,43 @@ Foam::ReynoldsStress::divDevRhoReff { return ( - fvc::div + fvc::laplacian + ( + (1.0 - couplingFactor_)*this->alpha_*this->rho_*this->nut(), + U, + "laplacian(nuEff,U)" + ) + + fvc::div ( this->alpha_*this->rho_*R_ + couplingFactor_ *this->alpha_*this->rho_*this->nut()*fvc::grad(U), "div(devRhoReff)" ) - + fvc::laplacian - ( - (1.0 - couplingFactor_)*this->alpha_*this->rho_*this->nut(), - U, - "laplacian(nuEff,U)" - ) - - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) - fvc::div(this->alpha_*this->rho_*this->nu()*dev2(T(fvc::grad(U)))) + - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) ); } else { return ( - fvc::div(this->alpha_*this->rho_*R_) - + fvc::laplacian + fvc::laplacian ( this->alpha_*this->rho_*this->nut(), U, "laplacian(nuEff,U)" ) - - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) + + fvc::div(this->alpha_*this->rho_*R_) - fvc::div(this->alpha_*this->rho_*this->nu()*dev2(T(fvc::grad(U)))) + - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) ); } return ( - - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) - fvc::div((this->alpha_*this->rho_*this->nuEff())*dev2(T(fvc::grad(U)))) + - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) ); } @@ -289,8 +289,8 @@ Foam::ReynoldsStress::divDevRhoReff { return ( - - fvm::laplacian(this->alpha_*rho*this->nuEff(), U) - fvc::div((this->alpha_*rho*this->nuEff())*dev2(T(fvc::grad(U)))) + - fvm::laplacian(this->alpha_*rho*this->nuEff(), U) ); } diff --git a/src/TurbulenceModels/turbulenceModels/linearViscousStress/linearViscousStress.C b/src/TurbulenceModels/turbulenceModels/linearViscousStress/linearViscousStress.C index 1ac59915cf..d5e61def56 100644 --- a/src/TurbulenceModels/turbulenceModels/linearViscousStress/linearViscousStress.C +++ b/src/TurbulenceModels/turbulenceModels/linearViscousStress/linearViscousStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,8 +97,8 @@ Foam::linearViscousStress::divDevRhoReff { return ( - - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) - fvc::div((this->alpha_*this->rho_*this->nuEff())*dev2(T(fvc::grad(U)))) + - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) ); } @@ -113,8 +113,8 @@ Foam::linearViscousStress::divDevRhoReff { return ( - - fvm::laplacian(this->alpha_*rho*this->nuEff(), U) - fvc::div((this->alpha_*rho*this->nuEff())*dev2(T(fvc::grad(U)))) + - fvm::laplacian(this->alpha_*rho*this->nuEff(), U) ); }