View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001141 | OpenFOAM | Bug | public | 2014-01-26 15:53 | 2014-02-01 22:02 |
Reporter | wyldckat | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Summary | 0001141: Missing rho in the compressible option for the function object yPlusLES | ||||
Description | The method "calcCompressibleYPlus" in "src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C" seems to be missing the product by "rho" inside the square root: yPlus.boundaryField()[patchi] = d[patchi] *sqrt ( muEff.boundaryField()[patchi] *mag(U.boundaryField()[patchi].snGrad()) *rho.boundaryField()[patchi] //this line is the one missing ) /muLam.boundaryField()[patchi]; I have not found any proof in the source code on whether "muEff" already takes into account "rho", hence the bug report. | ||||
Steps To Reproduce | For keeping this bug report well documented, here's the analysis made for reaching this conclusion: The y+ equation in image "expanded_equation.png": [math]y^+ \equiv y \, \frac{\sqrt{\frac{\mu \left(\frac{\partial u}{\partial y} \right)_{y=0}}{\rho}}}{\frac{\mu}{\rho}} [/math] The y+ equation used in the current source code is in image "implemented.png": [math]y^+ \equiv y \, \frac {\sqrt{ \mu_{Eff} \, \|{\frac{\partial u}{\partial y}}\| } } {\mu} [/math] Sources: - http://www.cfd-online.com/Wiki/Dimensionless_wall_distance_%28y_plus%29 - http://www.cfd-online.com/Wiki/Friction_velocity - http://www.cfd-online.com/Wiki/Wall_shear_stress | ||||
Additional Information | This was reported/asked by a forum member at CFD-Online: http://www.cfd-online.com/Forums/openfoam/117857-yplusles-2.html#post471298 post #24 And the analysis on the equations are done here: http://www.cfd-online.com/Forums/openfoam/117857-yplusles-2.html#post471818 post #27 | ||||
Tags | No tags attached. | ||||
|
|
|
|
|
mu and muEff, in fact all viscosities starting with mu are dynamic not kinematic. |
|
My sincere apologies if I'm being very daft here and to reopen this report, but from what I can see in the source code and in the equations, something doesn't "add up". "mu" is the dynamic viscosity and "nu" is the kinematic viscosity. The relation between the two is: mu = rho * nu The method "calcIncompressibleYPlus" uses the kinematic viscosity, because it's for the incompressible calculation, hence it's as good as "mu / rho", as it is done in the y+ equation "expanded_equation.png": yPlus.boundaryField()[patchi] = d[patchi] *sqrt ( nuEff.boundaryField()[patchi] *mag(U.boundaryField()[patchi].snGrad()) ) /nuLam.boundaryField()[patchi]; In the method "calcCompressibleYPlus" is used the dynamic viscosity, because it's for the compressible calculation: yPlus.boundaryField()[patchi] = d[patchi] *sqrt ( muEff.boundaryField()[patchi] *mag(U.boundaryField()[patchi].snGrad()) ) /muLam.boundaryField()[patchi]; The problem I'm referring to is that the two implemented equations only differ in the viscosity used, but do not strictly represent the same equation, because "(1/sqrt(rho)) / (1/rho)" is still missing from the implemented equation for the compressible calculation. Because the only other explanation I can find is that the y+ value for the compressible flow is "dynamic" as well, while the one for incompressible flow is the y+ "kinematic"... which would mean that the CFD Online wiki needs some tuning... |
|
|
|
|
|
I've attached two cases with the same fluid properties, boundary conditions, same mesh, use the function object yPlusLES from OpenFOAM 2.2.x and have Allrun scripts ready to be used: - cavity_compressible_rhoPimpleFoam.tar.gz - cavity_incompressible_pimpleFoam.tar.gz The mesh is 20x20x20 cells (based on "icoFoam/cavity"), 10m on each side of the cube shaped domain. The reference fluid properties used in both cases are: mu 1.8e-05; rho 1.15862; nu = mu / rho = 1.8e-05 / 1.15862 = 1.5536e-05 The moving wall speed is 0.1 m/s. All other patches are fixed walls. An example of the results given by the function object in the solver output, for the (almost) same time instance at 1000s, are as follows: - rhoPimpleFoam - patch fixedWalls y+ : min = 3.36536, max = 186.845, average = 57.2321 - pimpleFoam - patch fixedWalls y+ : min = 3.62354, max = 201.036, average = 61.8245 If we multiply the rhoPimpleFoam y+ values by "sqrt(rho)", we approximately get: patch fixedWalls y+ : min = 3.6224, max = 201.118, average = 61.604 |
|
Just a side-note: the "implemented" y+ has dimensions: [m^3/2 kg^-1/2] and thus inherently incorrect. The proposed "expanded_equation" is non-dimensional, as would be expected... |
|
Thanks for the bug-report. Resolved by commit 5cc33a23168577c9f91564fe6117f4ec1bde1348 |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-01-26 15:53 | wyldckat | New Issue | |
2014-01-26 15:53 | wyldckat | File Added: expanded_equation.png | |
2014-01-26 15:53 | wyldckat | File Added: implemented.png | |
2014-01-26 17:27 | henry | Note Added: 0002784 | |
2014-01-26 17:27 | henry | Status | new => closed |
2014-01-26 17:27 | henry | Assigned To | => henry |
2014-01-26 17:27 | henry | Resolution | open => fixed |
2014-01-26 21:17 | wyldckat | Note Added: 0002785 | |
2014-01-26 21:17 | wyldckat | Status | closed => feedback |
2014-01-26 21:17 | wyldckat | Resolution | fixed => reopened |
2014-02-01 03:56 | wyldckat | File Added: cavity_compressible_rhoPimpleFoam.tar.gz | |
2014-02-01 03:57 | wyldckat | File Added: cavity_incompressible_pimpleFoam.tar.gz | |
2014-02-01 04:19 | wyldckat | Note Added: 0002799 | |
2014-02-01 04:19 | wyldckat | Status | feedback => assigned |
2014-02-01 10:19 | michele | Note Added: 0002801 | |
2014-02-01 22:01 | henry | Note Added: 0002802 | |
2014-02-01 22:01 | henry | Status | assigned => resolved |
2014-02-01 22:02 | henry | Resolution | reopened => fixed |