Skip to content

Commit

Permalink
TurbulenceModels: Reorder stress component evaluation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Henry Weller committed Feb 4, 2016
1 parent 7265d90 commit 8e04a52
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Expand Up @@ -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
Expand Down Expand Up @@ -238,43 +238,43 @@ Foam::ReynoldsStress<BasicTurbulenceModel>::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)
);
}

Expand All @@ -289,8 +289,8 @@ Foam::ReynoldsStress<BasicTurbulenceModel>::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)
);
}

Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -97,8 +97,8 @@ Foam::linearViscousStress<BasicTurbulenceModel>::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)
);
}

Expand All @@ -113,8 +113,8 @@ Foam::linearViscousStress<BasicTurbulenceModel>::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)
);
}

Expand Down

0 comments on commit 8e04a52

Please sign in to comment.