CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   y+ and u+ values with low-Re RANS turbulence models: utility + testcase (https://www.cfd-online.com/Forums/openfoam/86562-y-u-values-low-re-rans-turbulence-models-utility-testcase.html)

Joanna Huang February 14, 2013 08:28

Quote:

Originally Posted by aljazari (Post 400571)
I just ran this case using Allrun, then ran yPlus -latestTime, it went fine.

It didn't work the first time because the file "turbulenceProperties" was not found. I have no idea how the simulation worked without it. By including this file, yPlus worked with no problems.

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
simulationType  RASModel;
 
 
// ************************************************************************* //

yPlus-latestTime

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.1-221db2718bbb
Exec  : yPlus -latestTime
Date  : Jan 07 2013
Time  : 17:12:58
Host  : "p150"
PID    : 11118
Case  : /home/abdulhaq/OpenFOAM/abdulhaq-2.1.1/run/tutorials/incompressible/simpleFoam/motorBike
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations
 
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
 
Create mesh for time = 500
 
Time = 500
Calculating wall distance
 
Writing wall distance to field y
 
Reading field U
 
Reading/calculating face flux field phi
 
Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    alphaK1        0.85034;
    alphaK2        1;
    alphaOmega1    0.5;
    alphaOmega2    0.85616;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1          0.075;
    beta2          0.0828;
    betaStar        0.09;
    a1              0.31;
    c1              10;
}
 
Patch 3 named lowerWall
 d  : min: 0.000397575 max: 0.112139 average: 0.0112107
 y+ : min: 3.1981 max: 1512.07 average: 120.613
 
Patch 5 named motorBike_frt-fairing:001%1
 d  : min: 0.000268932 max: 0.0140758 average: 0.00364481
 y+ : min: 1.38902 max: 742.058 average: 128.173
 
Patch 6 named motorBike_windshield:002%2
 d  : min: 0.000430623 max: 0.00514934 average: 0.00220496
 y+ : min: 6.71703 max: 181.397 average: 94.8434
 
Patch 7 named motorBike_rr-wh-rim:005%5
 d  : min: 0.000326252 max: 0.0118033 average: 0.00415699
 y+ : min: 2.63874 max: 500.176 average: 115.064
 
Patch 8 named motorBike_rr-wh-rim:010%10
 d  : min: 0.000327294 max: 0.0115265 average: 0.00661764
 y+ : min: 2.88247 max: 599.602 average: 190.942
 
Patch 9 named motorBike_fr-wh-rim:011%11
 d  : min: 0.0023297 max: 0.0119296 average: 0.00677875
 y+ : min: 36.5513 max: 545 average: 223.732
 
Patch 10 named motorBike_fr-wh-brake-disk:012%12
 d  : min: 0.00284218 max: 0.0120569 average: 0.00762753
 y+ : min: 28.1762 max: 504.851 average: 243.077
 
Patch 11 named motorBike_frame:016-shadow%13
 d  : min: 0.000390573 max: 0.014721 average: 0.00620935
 y+ : min: 6.03975 max: 680.548 average: 223.03
 
Patch 12 named motorBike_rear-susp:014%14
 d  : min: 0.000280177 max: 0.012389 average: 0.00399244
 y+ : min: 1.01297 max: 528.538 average: 59.9596
 
Patch 13 named motorBike_rear-susp:014-shadow%15
 d  : min: 0.000306696 max: 0.0128792 average: 0.00373295
 y+ : min: 1.12489 max: 417.635 average: 57.7303
 
Patch 14 named motorBike_frame:016%16
 d  : min: 0.000362031 max: 0.0151413 average: 0.00555179
 y+ : min: 5.3446 max: 648.579 average: 202.398
 
Patch 15 named motorBike_rr-wh-rim:005-shadow%17
 d  : min: 0.000328156 max: 0.0118508 average: 0.0043253
 y+ : min: 3.76975 max: 495.027 average: 120.949
 
Patch 16 named motorBike_rr-wh-chain-hub:022%22
 d  : min: 0.0026924 max: 0.0112263 average: 0.00619253
 y+ : min: 33.3899 max: 528.787 average: 169.589
 
Patch 17 named motorBike_rearseat%24
 d  : min: 0.000355204 max: 0.0129121 average: 0.00357538
 y+ : min: 4.37037 max: 592.86 average: 125.88
 
Patch 18 named motorBike_frt-fairing%25
 d  : min: 0.000288805 max: 0.0124963 average: 0.0032173
 y+ : min: 1.6081 max: 559.374 average: 120.952
 
Patch 19 named motorBike_windshield%26
 d  : min: 0.000327636 max: 0.0121903 average: 0.00318627
 y+ : min: 2.67853 max: 491.891 average: 109.613
 
Patch 20 named motorBike_headlights%27
 d  : min: 0.00033471 max: 0.00865439 average: 0.00208301
 y+ : min: 4.35855 max: 252.623 average: 85.2525
 
Patch 21 named motorBike_driversseat%28
 d  : min: 0.000305473 max: 0.0124167 average: 0.00515002
 y+ : min: 0.914448 max: 386.061 average: 108.287
 
Patch 22 named motorBike_rear-body%29
 d  : min: 0.000292051 max: 0.0138328 average: 0.00451681
 y+ : min: 1.30529 max: 668.102 average: 109.362
 
Patch 23 named motorBike_fuel-tank%30
 d  : min: 0.000271334 max: 0.0136267 average: 0.00280589
 y+ : min: 1.14045 max: 348.381 average: 61.4069
 
Patch 24 named motorBike_exhaust%31
 d  : min: 0.000274933 max: 0.0146777 average: 0.00556152
 y+ : min: 1.52015 max: 693.262 average: 142.121
 
Patch 25 named motorBike_rr-wh-rim%32
 d  : min: 0.00030843 max: 0.0137104 average: 0.00350059
 y+ : min: 0.650911 max: 510.374 average: 78.4556
 
Patch 26 named motorBike_fr-mud-guard%33
 d  : min: 0.000303715 max: 0.0147352 average: 0.0047335
 y+ : min: 2.22657 max: 681.515 average: 144.748
 
Patch 27 named motorBike_fr-wh-rim%34
 d  : min: 0.00207944 max: 0.0125446 average: 0.00642802
 y+ : min: 13.0476 max: 553.624 average: 184.083
 
Patch 28 named motorBike_fr-wh-brake-disk%35
 d  : min: 0.000289026 max: 0.0130605 average: 0.00431061
 y+ : min: 1.66993 max: 600.062 average: 132.527
 
Patch 29 named motorBike_fr-brake-caliper%36
 d  : min: 0.00222925 max: 0.0133883 average: 0.00812573
 y+ : min: 23.8092 max: 525.755 average: 230.996
 
Patch 30 named motorBike_fr-wh-tyre%37
 d  : min: 0.000351147 max: 0.0128806 average: 0.00646112
 y+ : min: 3.27931 max: 699.639 average: 224.714
 
Patch 31 named motorBike_hbars%38
 d  : min: 0.00224132 max: 0.0150466 average: 0.00752225
 y+ : min: 19.7341 max: 794.713 average: 259.965
 
Patch 32 named motorBike_fr-forks%39
 d  : min: 0.00210806 max: 0.0161755 average: 0.00715355
 y+ : min: 11.4949 max: 719.727 average: 256.833
 
Patch 33 named motorBike_chain%40
 d  : min: 0.000361469 max: 0.016935 average: 0.00941252
 y+ : min: 6.89163 max: 705.813 average: 264.784
 
Patch 34 named motorBike_rr-wh-tyre%41
 d  : min: 0.000326759 max: 0.0145594 average: 0.00315657
 y+ : min: 1.84505 max: 714.16 average: 100.195
 
Patch 35 named motorBike_square-dial%42
 d  : min: 0.00394236 max: 0.0087235 average: 0.0063372
 y+ : min: 127.826 max: 257.126 average: 192.043
 
Patch 36 named motorBike_round-dial%43
 d  : min: 0.00475714 max: 0.0119439 average: 0.00785584
 y+ : min: 142.534 max: 345.877 average: 229.736
 
Patch 37 named motorBike_dial-holder%44
 d  : min: 0.00256609 max: 0.016704 average: 0.00648968
 y+ : min: 9.52715 max: 450.862 average: 123.603
 
Patch 38 named motorBike_rear-susp%45
 d  : min: 0.000282067 max: 0.0149661 average: 0.00578968
 y+ : min: 0.928264 max: 672.979 average: 161.333
 
Patch 39 named motorBike_rear-brake-lights%46
 d  : min: 0.00220472 max: 0.0152285 average: 0.00747612
 y+ : min: 8.98794 max: 213.055 average: 92.0237
 
Patch 40 named motorBike_rear-light-bracket%47
 d  : min: 0.000347537 max: 0.0117151 average: 0.00487275
 y+ : min: 2.40855 max: 269.656 average: 72.6323
 
Patch 41 named motorBike_frame%48
 d  : min: 0.000277013 max: 0.0141278 average: 0.00438018
 y+ : min: 0.86809 max: 700.369 average: 123.249
 
Patch 42 named motorBike_rear-mud-guard%49
 d  : min: 0.000320764 max: 0.0136426 average: 0.00384965
 y+ : min: 2.19329 max: 557.792 average: 105.802
 
Patch 43 named motorBike_rear-susp-spring-damp%50
 d  : min: 0.00198034 max: 0.0125607 average: 0.00641261
 y+ : min: 5.82302 max: 329.074 average: 85.663
 
Patch 44 named motorBike_fairing-inner-plate%51
 d  : min: 0.000285014 max: 0.0120323 average: 0.0041921
 y+ : min: 2.07677 max: 476.768 average: 97.1625
 
Patch 45 named motorBike_clutch-housing%52
 d  : min: 0.000271344 max: 0.0130613 average: 0.00312992
 y+ : min: 0.830421 max: 611.69 average: 79.8648
 
Patch 46 named motorBike_radiator%53
 d  : min: 0.00374399 max: 0.0202953 average: 0.0104274
 y+ : min: 55.7322 max: 709.455 average: 377.254
 
Patch 47 named motorBike_water-pipe%54
 d  : min: 0.00159212 max: 0.0143308 average: 0.00883537
 y+ : min: 32.0802 max: 762.355 average: 299.535
 
Patch 48 named motorBike_water-pump%55
 d  : min: 0.00297517 max: 0.012476 average: 0.00692214
 y+ : min: 4.92335 max: 262.53 average: 108.687
 
Patch 49 named motorBike_engine%56
 d  : min: 0.000306856 max: 0.0148045 average: 0.00332984
 y+ : min: 0.82158 max: 772.277 average: 89.4703
 
Patch 50 named motorBike_rear-shock-link%57
 d  : min: 0.00419348 max: 0.0141306 average: 0.00752708
 y+ : min: 20.9748 max: 254.993 average: 123.762
 
Patch 51 named motorBike_rear-brake-fluid-pot-bracket%58
 d  : min: 0.000339113 max: 0.0124309 average: 0.00418814
 y+ : min: 2.10608 max: 373.013 average: 65.2629
 
Patch 52 named motorBike_rear-brake-fluid-pot%59
 d  : min: 0.00273476 max: 0.0141282 average: 0.0083839
 y+ : min: 36.6767 max: 200.626 average: 123.659
 
Patch 53 named motorBike_footpeg%60
 d  : min: 0.00250189 max: 0.0133891 average: 0.00802141
 y+ : min: 19.6311 max: 670.721 average: 284.097
 
Patch 54 named motorBike_rr-wh-chain-hub%61
 d  : min: 0.000360962 max: 0.0115398 average: 0.005402
 y+ : min: 3.1775 max: 524.782 average: 146.742
 
Patch 55 named motorBike_rear-brake-caliper%62
 d  : min: 0.000357519 max: 0.013734 average: 0.00643976
 y+ : min: 5.35867 max: 768.159 average: 294.679
 
Patch 56 named motorBike_rider-helmet%65
 d  : min: 0.000303999 max: 0.0142727 average: 0.00289369
 y+ : min: 2.85383 max: 744.973 average: 124.842
 
Patch 57 named motorBike_rider-visor%66
 d  : min: 0.000910223 max: 0.00908061 average: 0.00246434
 y+ : min: 46.2841 max: 365.14 average: 158.312
 
Patch 58 named motorBike_rider-boots%67
 d  : min: 0.000271891 max: 0.01308 average: 0.00379892
 y+ : min: 1.56582 max: 648.84 average: 154.276
 
Patch 59 named motorBike_rider-gloves%68
 d  : min: 0.00228877 max: 0.0150876 average: 0.00731412
 y+ : min: 23.4853 max: 618.235 average: 208.937
 
Patch 60 named motorBike_rider-body%69
 d  : min: 0.000276985 max: 0.0129954 average: 0.00327886
 y+ : min: 0.846533 max: 790.118 average: 102.37
 
Patch 61 named motorBike_frame:0%70
 d  : min: 0.000351371 max: 0.0105157 average: 0.00345257
 y+ : min: 2.68923 max: 344.934 average: 102.693
 
Patch 62 named motorBike_frt-fairing:001-shadow%74
 d  : min: 0.000277253 max: 0.0139939 average: 0.00357307
 y+ : min: 1.44804 max: 662.019 average: 122.051
 
Patch 63 named motorBike_windshield-shadow%75
 d  : min: 0.000342722 max: 0.00956641 average: 0.00318237
 y+ : min: 3.87715 max: 376.309 average: 104.55
 
Patch 64 named motorBike_fr-mud-guard-shadow%81
 d  : min: 0.000328392 max: 0.012176 average: 0.00430565
 y+ : min: 2.78677 max: 518.462 average: 126.926
 
Patch 65 named motorBike_fr-wh-brake-disk-shadow%83
 d  : min: 0.000285772 max: 0.0144996 average: 0.00413188
 y+ : min: 2.25531 max: 699.929 average: 135.181
 
Patch 66 named motorBike_rear-mud-guard-shadow%84
 d  : min: 0.000295653 max: 0.013536 average: 0.00399838
 y+ : min: 2.03781 max: 510.218 average: 104.402
 
Patch 67 named motorBike_rear-susp-spring-damp-shadow%85
 d  : min: 0.00327178 max: 0.0123216 average: 0.00651848
 y+ : min: 8.7858 max: 331.149 average: 80.401
 
Patch 68 named motorBike_radiator-shadow%86
 d  : min: 0.00376333 max: 0.0202953 average: 0.0111452
 y+ : min: 51.8406 max: 764.851 average: 436.34
 
Patch 69 named motorBike_rear-shock-link-shadow%87
 d  : min: 0.00462519 max: 0.0119373 average: 0.0082026
 y+ : min: 75.663 max: 242.782 average: 141.328
 
Patch 70 named motorBike_rear-brake-fluid-pot-bracket-shadow%88
 d  : min: 0.000350817 max: 0.0120304 average: 0.00447425
 y+ : min: 2.50756 max: 201.903 average: 69.0392
 
Patch 71 named motorBike_rr-wh-chain-hub-shadow%89
 d  : min: 0.000430666 max: 0.0102251 average: 0.00555544
 y+ : min: 6.13939 max: 479.068 average: 147.676
 
Writing yPlus to field yPlus
 
End




Hi:

I saw your results of yPlus, the value seems very big, and how can we judg the y+ is in the proper range?

dkokron April 5, 2013 12:48

1 Attachment(s)
@post 71.

I posting here as I have not found any other source for the yPlus utility from Daniel WEI.

I have attached a patch to allow yPlus.C to be compiled under OpenFOAM-2.2.x. Runs fine in my environment. Please check my work.

bscphil May 27, 2013 08:33

1 Attachment(s)
Quote:

Originally Posted by romant (Post 314402)
hej,

unfortunately, one cannot compile this one with OF 2.0.0. It throws the following error message:

Code:

plusPostRANS.C: In function ‘int main(int, char**)’:
plusPostRANS.C:96:40: error: ‘class Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >’ has no member named ‘boundaryField’
plusPostRANS.C:99:36: error: ‘class Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >’ has no member named ‘boundaryField’

apparently, the class geometric field was changed.


Hi foamers,

i have change the source code of the "plusPostRANS" tool for the usage in OpenFOAM 2.2.0 (see the attached file)

Just compile it and it works ;)

@romant: i hope this helps..

lakeat May 28, 2013 11:22

Quote:

Originally Posted by dkokron (Post 418602)
@post 71.

I posting here as I have not found any other source for the yPlus utility from Daniel WEI.

I have attached a patch to allow yPlus.C to be compiled under OpenFOAM-2.2.x. Runs fine in my environment. Please check my work.


Sorry, I was too busy. Thanks a lot for your contribution.

bscphil May 29, 2013 06:47

Quote:

Originally Posted by lakeat (Post 394770)
Hi again,

I think I have fixed the bug.

yPlus utility: Attachment 17317
yStar utility: Attachment 17318

Equations used for incompressible flow:
http://mathurl.com/cezmn22.png
Code:

y^+=\frac{y\sqrt{\frac{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}{\rho}}}{\frac{\mu_{lam}}{\rho}}=\frac{y\sqrt{{\nu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}}}{\nu_{lam}}
Equations used for compressible flow:
http://mathurl.com/bmx22f9.png


Hi foamers,

firstly thanks for the nice tool. I want to compile the yPlus.C under OpenFoam 2.2.0 and have some errors due to a new header file: they change the name from "basicThermo.H" to "fluidThermo.H" (OpenFoam 2.1.x --> OpenFoam 2.2.x). This is why i change all entries in the source code of "yPlus.C" and it works fine, now. I have attached the new files for OpenFoam 2.2.x:

bscphil May 29, 2013 06:56

1 Attachment(s)
Quote:

Originally Posted by bscphil (Post 430703)
Hi foamers,

firstly thanks for the nice tool. I want to compile the yPlus.C under OpenFoam 2.2.0 and have some errors due to a new header file: they change the name from "basicThermo.H" to "fluidThermo.H" (OpenFoam 2.1.x --> OpenFoam 2.2.x). This is why i change all entries in the source code of "yPlus.C" and it works fine, now. I have attached the new files for OpenFoam 2.2.x:

ok, sorry, the file::

immortality June 5, 2013 16:44

1 Attachment(s)
Hi
is this useful tool appropriate for low-Re turbulent models only or is general?
also I have found another tool for yPlus calculating.
could someone have a look into it to see if its correct too and what are the differences and which is more suitable for compressible unsteady cases?
and also could someone suggest some turbulent methods for compressible unsteady internal flow cases with low-Re mesh(y+<=1) and with wall function(30<=y+<60 or 100 in some unsteady cases)
thanks.
----------------------------------------------------------
complement:
in the file I have attached the fomula of yPlus is:
Code:

yPlus.boundaryField()[patchi] =
                y[patchi]
              * sqrt
                (
                  mut.boundaryField()[patchi]
                * mag(U.boundaryField()[patchi].snGrad())
                / rho.boundaryField()[patchi]
                )
              / (RASModel->mu().boundaryField()[patchi]/rho.boundaryField()[patchi]);

and in previous:
Code:

yPlus.boundaryField()[patchi] =
                        d[patchi]
                      *sqrt
                        (
                            rho.boundaryField()[patchi]
                          *muEff.boundaryField()[patchi]
                          *mag(U.boundaryField()[patchi].snGrad())
                        )
                      /muLam.boundaryField()[patchi];

the difference look to be only in mu's.could someone give more explanation on this subject?
(if there are other differences anyone notices please let me know)

Jonathan July 19, 2013 11:03

Hi Dan,

just a heads up to say thanks for the x2 tools - worked great for me and i thought well distributed functionality (i.e. in terms of separating yStar / yPlus / refinedWallLayer etc).

much appreciated
Jon

Quote:

Originally Posted by lakeat (Post 430560)
Sorry, I was too busy. Thanks a lot for your contribution.


gcengineer August 5, 2013 02:48

I'm having trouble building yPlus with wmake. I have no problem running OF 2.2.1 in Ubuntu 12.04 64-bit.

I extracted yPlus.c and the Make folder to /opt/openfoam221/src. It seems that, according to

http://www.openfoam.org/docs/user/co...0-720003.2.2.1,

all I need to do is run wmake (no arguments, no directory) from /opt/openfoam221/src/yPlus. But when I run wmake, I get the following errors.

gac@gac-vm01:/opt/openfoam221/src/yPlus$ wmake
mkdir: cannot create directory `linuxGccDPOpt': Permission denied
/bin/sh: 1: cannot create linuxGccDPOpt/options: Directory nonexistent
make: *** [linuxGccDPOpt/options] Error 2
/opt/openfoam221/wmake/MakefileFiles:40: linuxGccDPOpt/options: No such file or directory
make: *** No rule to make target `linuxGccDPOpt/options'. Stop.
wmake error: file 'Make/linuxGccDPOpt/objectFiles' could not be created in /opt/openfoam221/src/yPlus

Thanks for any assistance.

Regards,
Glenn

Bernhard August 5, 2013 02:58

Try either "sudo wmake" if you have root privileges, or compile it from a directory where you do have write access, e.g. "cd $WM_PROJECT_USER_DIR"

gcengineer August 5, 2013 03:27

Thanks for quick reply.

Extracting yPlus.c and Make folder to $WM_PROJECT_USER_DIR/yPlus helped (proper permissions), but I get another permission error when I run wmake from there:

gac@gac-vm01:~/OpenFOAM/gac-2.2.1/yPlus$ wmake
Making dependency list for source file yPlus.C
SOURCE=yPlus.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam221/src/meshTools/lnInclude -I/opt/openfoam221/src/turbulenceModels -I/opt/openfoam221/src/transportModels -I/opt/openfoam221/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam221/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam221/src/OpenFOAM/lnInclude -I/opt/openfoam221/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/yPlus.o
g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam221/src/meshTools/lnInclude -I/opt/openfoam221/src/turbulenceModels -I/opt/openfoam221/src/transportModels -I/opt/openfoam221/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam221/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam221/src/OpenFOAM/lnInclude -I/opt/openfoam221/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linuxGccDPOpt/yPlus.o -L/opt/openfoam221/platforms/linuxGccDPOpt/lib \
-lcompressibleTurbulenceModel -lcompressibleRASModels -lcompressibleLESModels -lincompressibleTurbulenceModel -lincompressibleTransportModels -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lgenericPatchFields -lOpenFOAM -ldl -lm -o /opt/openfoam221/platforms/linuxGccDPOpt/bin/yPlus
/usr/bin/ld: cannot open output file /opt/openfoam221/platforms/linuxGccDPOpt/bin/yPlus: Permission denied
collect2: ld returned 1 exit status

When I run 'sudo wmake', I get the error 'sudo: wmake: command not found'.

Perhaps next time I will not install OpenFOAM as root.

Thanks again.

gcengineer August 5, 2013 04:08

I successfully built yPlus by changing 'FOAM_APPBIN' in Make/files to 'FOAM_USER_APPBIN'.

lakeat October 15, 2013 17:12

2 Attachment(s)
Hey guys,

1. I found calculate wall distance twice is unnecessary, so I disable it.
2. Here are the two utilities doing the same job as before, with small changes. Tested on OpenFOAM-2.2.x
3. I have also added a few write-out control.

Please use "-help" to find more info.

yPlus: Attachment 26083
yStar: Attachment 26084

cm_jubayer November 18, 2013 12:44

may be of interest to someone:

http://www.openfoam.org/mantisbt/view.php?id=835

Jubayer

borhanalhoseini November 24, 2013 20:42

Ask for your help
 
Dear all,

This issue was already discussed in some length in various threads. Therefore I finally reviewed and attached my plusPostRANS utility.

It calculates y+ and u+ values when using one of the available low-Re RANS turbulence models. I hope the code as well as the output will be self-explaining

I also attached a case. It is a straight pipe (wedge) with periodic inlet/outlet boundary conditions. The Reynolds number based on the mean axial velocity is Re=5300. You can run the case using pisoFoam.

I would appreciate any feedback, it might be still improved at some point!

Best regards,
Florian

borhanalhoseini November 24, 2013 20:50

Ask for your help
 
Dear all,

This issue was already discussed in some length in various threads. Therefore I finally reviewed and attached my plusPostRANS utility.

It calculates y+ and u+ values when using one of the available low-Re RANS turbulence models. I hope the code as well as the output will be self-explaining

I also attached a case. It is a straight pipe (wedge) with periodic inlet/outlet boundary conditions. The Reynolds number based on the mean axial velocity is Re=5300. You can run the case using pisoFoam.

I would appreciate any feedback, it might be still improved at some point!

Best regards,
Florian


Dear Florian,
I guess you have been discussing about y+. I have a series of experimental data (u as velocity and y as normal distance+ u free stream+ characteristic length) and I would like to u* and then y+ as well as u+...I was wondering if you or any friend can help me in this respect.

aylalisa February 25, 2014 16:14

Dear borhanalhoseini,

is there a working version of yPlusUplus (or plusPostRANS) for OF.2.2.2 for LES simulations (NWR) that calculates the fields - as originally intended by florian_krause - to be able to create plots u+ vs. y+?

Quote:

Within the two mentioned lines I calculate fields of y+ and u+. If you think about a fully developed turbulent channel or pipe flow you might want to compare your results to, for instance, available DNS data by means of the near wall velocity profile in wall units or in other words comparing a profile of u+ over y+.
#3

Thank you !

Aylalisa

ArathoN April 28, 2014 05:11

The best way is to simulate the case then use the wallshearstress to calculate tau or the yplus (you'll have yplus and y so you can derive utau). At this point you have all the needed data to calculate uplus.

aylalisa April 29, 2014 03:48

Hello ArathoN,

documentation for wallShearStress utility says:
'Calculates and writes the wall shear stress, for the specified times when using RAS turbulence models. ' This description prevented me to use it.

The computation of stress is 'stress tensor * vector', that is what wallShearStress utility does. Why does the documentation insist on RAS turbulence models:confused:


Aylalisa

ArathoN April 29, 2014 06:09

Quote:

Originally Posted by aylalisa (Post 488822)
Hello ArathoN,

documentation for wallShearStress utility says:
'Calculates and writes the wall shear stress, for the specified times when using RAS turbulence models. ' This description prevented me to use it.

The computation of stress is 'stress tensor * vector', that is what wallShearStress utility does. Why does the documentation insist on RAS turbulence models:confused:


Aylalisa


Never noticed that part, unfortunately my C++ knowledge is almost null so i can't delve into the appropriate code.

If you have the yPlus, y and the cinematic viscosity you can calculate the friction velocity (utau) and from it you can compute the uPlus.

My only problem here would be how to consider the utau, because I'm certain it is variable on the domain so it's better to averag it (in my opinion) but I'm not certain about this.

P.S Another doubt what section would you consider when you want to compare the simulated data with the experimental data for example in a channel?

HanSolo123 May 11, 2014 07:13

Hello,

I have the same problem like aylalisa. The post-Processing utility "wallShearStress" actually only works for RANS-Simulation. I actually dont understand why it is so but ok.

I found a thread here on the forum how to calculate the wall shear stress tau_w for LES(
http://www.cfd-online.com/Forums/ope...imulation.html )
but this does not work for OP2.3.0 anymore. I had a look in wallShearStress.C, but there is no reference to #include "incompressible/RAS/RASModel/RASModel.H" anymore as mentioned in the above thread.

I want to plot u+ over y+ as well, therefor I need u+. When I extract u_tau from y+, is it possible to calculate u+ then with
u+ = u / u_tau?

I am unsure about the directions. In which direction points u_tau, when you have a simple Channel flow in x-direction? When I extract it from y+, does it point in x-direction then? The u+ over y+ graph is actually a dimensionless velocity profile, so it is velocity in x over wall distance in y. But i am unsure about u_tau.
Any tips?

ArathoN May 11, 2014 12:22

Quote:

Originally Posted by HanSolo123 (Post 491094)
Hello,

I have the same problem like aylalisa. The post-Processing utility "wallShearStress" actually only works for RANS-Simulation. I actually dont understand why it is so but ok.

I found a thread here on the forum how to calculate the wall shear stress tau_w for LES(
http://www.cfd-online.com/Forums/ope...imulation.html )
but this does not work for OP2.3.0 anymore. I had a look in wallShearStress.C, but there is no reference to #include "incompressible/RAS/RASModel/RASModel.H" anymore as mentioned in the above thread.

I want to plot u+ over y+ as well, therefor I need u+. When I extract u_tau from y+, is it possible to calculate u+ then with
u+ = u / u_tau?

I am unsure about the directions. In which direction points u_tau, when you have a simple Channel flow in x-direction? When I extract it from y+, does it point in x-direction then? The u+ over y+ graph is actually a dimensionless velocity profile, so it is velocity in x over wall distance in y. But i am unsure about u_tau.
Any tips?

Here my answer to the same question about u+ vs y+ calculation.

The u_tau calculated is the magnitude of the friction velocity utau (u_taux, u_tauy , u_tauz); same thing for the wallshearstress. Obviously if you study a 1-D case the values over that direction are the ones to study hence their value over the other 2 directions are negligeble.

adambarfi May 22, 2014 00:11

hi,

I have some problem in making compressibleyPlusLES utility.
when I want to make it the following error is appeared:

Code:

In file included from compressibleyPlusLES.C:70:0:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:112:57: error: no matching function for call to ‘Foam::compressible::LESModel::New(Foam::volScalarField&, Foam::volVectorField&, Foam::surfaceScalarField&, Foam::basicThermo&)’
createFields.H:112:57: note: candidate is:
/home/mostafa/OpenFOAM/OpenFOAM-2.2.2/src/turbulenceModels/compressible/LES/LESModel/LESModel.H:150:34: note: static Foam::autoPtr<Foam::compressible::LESModel> Foam::compressible::LESModel::New(const volScalarField&, const volVectorField&, const surfaceScalarField&, const Foam::fluidThermo&, const Foam::word&)
/home/mostafa/OpenFOAM/OpenFOAM-2.2.2/src/turbulenceModels/compressible/LES/LESModel/LESModel.H:150:34: note:  no known conversion for argument 4 from ‘Foam::basicThermo’ to ‘const Foam::fluidThermo&’
make: *** [Make/linux64GccDPOpt/compressibleyPlusLES.o] Error 1

anybody knows what should I do?

Regards,
Mostafa

Edit: I'm using OF-2.2.2

adambarfi May 22, 2014 01:24

1 Attachment(s)
Hi dear FOAMERs, specially LES fans!

I decided to change the compressibleyPlusLES to incompressibleyPlusLES utility. I made the changes and fortunately it was made without any errors.
I attach the final utility and if it's possible for you guys to check it and if I made some mistakes in writing the codes, please let me know.

Regards,
Mostafa

New_OpenFOAM_user September 9, 2014 13:23

Quote:

Originally Posted by lakeat (Post 457156)
Hey guys,

1. I found calculate wall distance twice is unnecessary, so I disable it.
2. Here are the two utilities doing the same job as before, with small changes. Tested on OpenFOAM-2.2.x
3. I have also added a few write-out control.

Please use "-help" to find more info.

yPlus: Attachment 26083
yStar: Attachment 26084

Hi,

Thank you for continually updating and uploading your utility for newer versions of OF.

I have a question about your utility. Please forgive if it is an ignorant question, but I haven't been able to find the answers elsewhere. I read that you wrote it for low Re numbers, is it valid for high Re turbulence models (in my case realizable k-eps)?

Also when I build and run your utility (in OF version 2.3.x) it only displays the yPlus values for one of my patches and the value displayed is much lower than the y* values calculated by the yPlusRAS utility. Is it working correctly, or could you suggest how to modify it? Or is there something else I am missing?

Thank youin advance, your help is greatly appreciated!
Chrissy.

ArathoN October 15, 2014 12:06

Quote:

Originally Posted by New_OpenFOAM_user (Post 509720)
.................................


yplus and ystar have different relations so they will obviously give different values. They have a comparable results only in the log layer because the assumption to define ystar depends on the log layer.

this utility gives the possibility to calculate yplus when you are using a wall resolved case where nut at wall must be set as calculated. However the yPlusRAS calculate yplus only if it is declared a nutWallFunction (whatever it is) so for the wall resolved case, it will give you errors and no yplus will be clculated.

For high Re meshes use teh yPlusRAS included in OF, take care on how it is defined yplus in the wallfunction, because the utility yPlusRAS does only call the function to calculate yplus inside the nutWallFunction chosen in /0/nut. Some of them use ystar others not, I Advice you to read teh code and you'll understand better (see the unige and chalmers course for OF they are really good).

Alhasan January 13, 2015 14:13

Quote:

Originally Posted by lakeat (Post 394770)
Hi again,

I think I have fixed the bug.

yPlus utility: Attachment 17317
yStar utility: Attachment 17318

Equations used for incompressible flow:
http://mathurl.com/cezmn22.png
Code:

y^+=\frac{y\sqrt{\frac{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}{\rho}}}{\frac{\mu_{lam}}{\rho}}=\frac{y\sqrt{{\nu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}}}{\nu_{lam}}
Equations used for compressible flow:
http://mathurl.com/bmx22f9.png

Code:

y^+=\frac{y\sqrt{\frac{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}{\rho}}}{\frac{\mu_{lam}}{\rho}}=\frac{y\sqrt{\rho{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}}}{\mu_{lam}}

Hello I beleive this is for OpenFOAM V2.1.0
but when I try to compile I am getting this error
Code:

Making dependency list for source file yPlus.C
SOURCE=yPlus.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/meshTools/lnInclude -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/turbulenceModels -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/transportModels -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/thermophysicalModels/basic/lnInclude -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude -I/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/yPlus.o
yPlus.C: In function ‘int main(int, char**)’:
yPlus.C:160:38: error: no matching function for call to ‘Foam::basicThermo::New(Foam::fvMesh&)’
yPlus.C:160:38: note: candidate is:
/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/dictionary.H:238:36: note: static Foam::autoPtr<Foam::dictionary> Foam::dictionary::New(Foam::Istream&)
/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/dictionary.H:238:36: note:  no known conversion for argument 1 from ‘Foam::fvMesh’ to ‘Foam::Istream&’
yPlus.C:222:46: error: no matching function for call to ‘Foam::basicThermo::New(Foam::fvMesh&)’
yPlus.C:222:46: note: candidate is:
/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/dictionary.H:238:36: note: static Foam::autoPtr<Foam::dictionary> Foam::dictionary::New(Foam::Istream&)
/users/mk14466/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/dictionary.H:238:36: note:  no known conversion for argument 1 from ‘Foam::fvMesh’ to ‘Foam::Istream&’
make: *** [Make/linux64GccDPOpt/yPlus.o] Error 1

What is happening here

Thanks for your time,
Hasan K.J

hamsteri15 March 14, 2015 09:21

plusPostRANS
 
I have a question about the plusPostRANS utility. If I understood correctly, the average(uTauWall) function calculates the wall-average of u_tau. So for a flat plate flow ,for example, if I wanted to plot the dimensionless velocity profile at certain x-coordinate location using the u+ and y+ values output from the utility, the values are actually quite far off?

Has anyone come up with a nice way to plot the accurate dimensionless velocity profile with low-Re models? So far I've always calculated the u+ and y+ manually using the velocity gradient (wallGradU) at certain point but for more complex geometries this is quite tedious.

Is it possible to modify the utility so that it uses the same location for the surface normal gradient of the velocity and the point at the wall it calculates the distance to?

KateEisenhower June 9, 2015 08:13

1 Attachment(s)
Quote:

Originally Posted by lakeat (Post 457156)
Hey guys,

1. I found calculate wall distance twice is unnecessary, so I disable it.
2. Here are the two utilities doing the same job as before, with small changes. Tested on OpenFOAM-2.2.x
3. I have also added a few write-out control.

Please use "-help" to find more info.

yPlus: Attachment 26083
yStar: Attachment 26084

Hello,

when I try to compile it I get the attached output.

I'm running OpenFOAM 2.3.1 on OS X Yosemite. I'd appreciate it if anyone could answer my questions:

1) Has anyone successfully compiled the tool on 2.3.x?
2) What is the compiler complaining about?
3) How can I make it work?

Best regards,

Kate

Astrodan March 24, 2016 07:36

Quote:

Originally Posted by lakeat (Post 394770)
Equations used for compressible flow:
http://mathurl.com/bmx22f9.png

Code:

y^+=\frac{y\sqrt{\frac{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}{\rho}}}{\frac{\mu_{lam}}{\rho}}=\frac{y\sqrt{\rho{\mu_{eff}\left(\frac{\partial U}{\partial y}\right)_{y=0}}}}{\mu_{lam}}

Although this might be true, you apparently also changed the calculation of u_\tau, which appears to be wrong:
u_\tau = \sqrt{\frac{\tau_w}{\rho}} = \sqrt{\frac{\mu_{eff} \left(\frac{\partial U}{\partial y}\right)_{y=0}}{\rho}}
while your current code (line 314 [(int) pi*100, yeah])
u_\tau = \sqrt{\rho \cdot \mu_{eff} \left(\frac{\partial U}{\partial y}\right)_{y=0}}
The fact that y^+ has the \rho in the nominator is due to the \nu in the nominator of the y^+-Equation:
y^+ = \frac{u_\tau y}{\nu} = \frac{u_\tau y \cdot \rho}{\mu}
At least that's my take at those equations. Maybe someone should re-check, I got a bit confused with all the mu, nu, muEff, nuEff, y+ and y* reading.
Anyway, thanks for the utility, works great so far (tested with 2.3.x).

Astrodan April 21, 2016 11:54

1 Attachment(s)
Hi there, me again.

For whoever is interested, I updated lakeat's code with the above mentioned correction for u_{\tau}, since so far no one complained. Apart from that I added a -newTimes option, which is just like the -newTimes option in reconstructPar. And finally I update the Make/files to build the tool in the FOAM_USER_APPBIN, not in the global one, so it can be compiled by everyone.

Tested with OF 2.3.x. Both tools in one package. And zipped. I hate .tar.gz.

gu1 April 28, 2018 09:35

erro compilation
 
Quote:

Originally Posted by florian_krause (Post 301087)
Dear all,

This issue was already discussed in some length in various threads. Therefore I finally reviewed and attached my plusPostRANS utility.

It calculates y+ and u+ values when using one of the available low-Re RANS turbulence models. I hope the code as well as the output will be self-explaining

I also attached a case. It is a straight pipe (wedge) with periodic inlet/outlet boundary conditions. The Reynolds number based on the mean axial velocity is Re=5300. You can run the case using pisoFoam.

I would appreciate any feedback, it might be still improved at some point! :)

Best regards,
Florian

Hi, can you help me?!
ERRO:

Quote:

OpenFOAM/plusPostRANS$ wmake all
g++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/meshTools/lnInclude -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/turbulenceModels/RAS/RASModel -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/turbulenceModels/LES/LESModel -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/lnInclude -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/transportModels -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/OpenFOAM/lnInclude -I/home/cae/OpenFOAM/OpenFOAM-3.0.x/src/OSspecific/POSIX/lnInclude -fPIC -c plusPostRANS.C -o Make/linux64GccDPInt32Opt/plusPostRANS.o
In file included from plusPostRANS.C:76:0:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:75:10: error: ‘incompressible’ was not declared in this scope
autoPtr<incompressible::RASModel> RASModel
^
createFields.H:75:34: error: template argument 1 is invalid
autoPtr<incompressible::RASModel> RASModel
^
createFields.H:77:13: error: ‘incompressible’ is not a class or namespace
incompressible::RASModel::New(U, phi, laminarTransport)
^
plusPostRANS.C:90:45: error: ‘wallFvPatch’ was not declared in this scope
if (typeid(currPatch) == typeid(wallFvPatch))
^
plusPostRANS.C:96:33: error: base operand of ‘->’ is not a pointer
RASModel->nu().boundaryField()[patchi]
^
plusPostRANS.C:99:29: error: base operand of ‘->’ is not a pointer
/RASModel->nu().boundaryField()[patchi];
^
plusPostRANS.C:106:15: error: base operand of ‘->’ is not a pointer
RASModel->nu()
^
plusPostRANS.C:131:43: error: base operand of ‘->’ is not a pointer
yPlus = y.y() * uTauAvg / RASModel->nu();
^
/home/cae/OpenFOAM/OpenFOAM-3.0.x/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/plusPostRANS.o' failed
make: *** [Make/linux64GccDPInt32Opt/plusPostRANS.o] Error 1

wouter May 4, 2018 09:09

Hello gu1,
The utility was written for OF2.3.x. So compiling for OF3.0 can give problems. I cannot help you solve it, but you can download OF2.3.x and use that to run your model and the utility or you can find out what changed between OF2.3 and OF3.0 and adapt the utility to OF3.0 (please post the adapted utility if you do).

Best regards,
Wouter

calf.Z June 25, 2019 00:58

how can I plot y+ and u+ in OpenFOAM. Dose anyone modify the tools? Thank you.

fly_light August 23, 2023 05:37

Hello everyone,

I did not read all the threads. But I have done sth about calculating the yPlus value for all cells. I modified the code of chegdan for calculating yPlus for all cells. Thanks for his contribution.
This is the link to the old code: https://github.com/chegdan/yPlusUplus.
This is the link to my code: https://github.com/Ruansh233/RshOpen.../main/yPlusCFD

The old version is run on OF-2.1. And my new version can run on OF-v2106
I delete some redundant steps and omit to create too many new objects. My code is running much faster compared to the old version.


All times are GMT -4. The time now is 18:36.