|
[Sponsors] |
February 2, 2014, 07:18 |
|
#41 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Yes, thanks. Strongly support your jobs!!
|
|
February 2, 2014, 12:20 |
|
#42 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Quick note: I've adapted the official bug fix to my repository, but there is a somewhat small discrepancy in the results achieved with the function object versus my custom utility.
The reason is likely because I'm using the "rho" from the thermodynamic model, while the function object is using the one from the turbulence model. I have not yet changed this, because it's a bit complicated to do so. There is an issue open for fixing this, so for anyone reading this, feel free to contribute: https://github.com/wyldckat/yPlusLES...sible/issues/1 |
|
April 10, 2014, 09:15 |
|
#43 | |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Just comment here:
In openfoam, to correctly predict the y+, we need the the velocity gradient at the wall snGrad. Actually, this is just just a difference using the deltaCoeff and velocity difference, so in LES, if the first cell is very far from the wall, the y+ that OF give will not be very accurate. This is my personal understanding, Please comment as well if what I am saying is not reasonable. OFFO Quote:
|
||
April 10, 2014, 16:03 |
|
#44 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi OFFO,
Quote:
The thing is that if the cell centre is very far away, then the y+ value will probably be very large as well, which would make it a bit redundant to know if the y+ is 1002 or 1100, since... well, it's clearly still in the region where we can use the wall function. And in such a case, it probably means that your mesh needs some fine tuning. But there are a few other problems associated with this:
edit: my guess is that those bug reports won't be closed, unless there is explicit sponsorship for those fixes to be implemented. Best regards, Bruno
__________________
|
||
April 11, 2014, 05:36 |
|
#45 | |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Thank you for your comments.
For wall function in RANS for mut (mutUWallFunction): Since log law will be used for the first cell near the wall, then we must make that y lie in the log-law region (y+>30); For wall function in LES for muSsgs (USpaldingWallFunction): Since this wall law is semi-emperical formula to fit the linear law and log law, so this law can be used in whole inner turbulent boundary layer, i.e. viscous sublayer, buffer layer and log law regions. So for this case, y+ is only reqiured to lie in inner layer, instead of only log law. About the way to calculate the y+, actually, in the implementations for MutUWallFunction Code:
OpenFOAM-2.1.x / src / turbulenceModels / compressible / RAS / derivedFvPatchFields / wallFunctions / mutWallFunctions / mutUWallFunction / mutUWallFunctionFvPatchScalarField.C Code:
tmp<scalarField> mutUWallFunctionFvPatchScalarField::calcYPlus ( const scalarField& magUp ) const { const label patchI = patch().index(); const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; const fvPatchScalarField& rhow = rasModel.rho().boundaryField()[patchI]; const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI]; tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0)); scalarField& yPlus = tyPlus(); forAll(yPlus, faceI) { scalar kappaRe = kappa_*magUp[faceI]*y[faceI]/(muw[faceI]/rhow[faceI]); scalar yp = yPlusLam_; scalar ryPlusLam = 1.0/yp; int iter = 0; scalar yPlusLast = 0.0; do { yPlusLast = yp; yp = (kappaRe + yp)/(1.0 + log(E_*yp)); } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.01 && ++iter < 10); yPlus[faceI] = max(0.0, yp); } return tyPlus; } OFFO Quote:
|
||
April 11, 2014, 17:32 |
|
#46 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi OFFO,
Problem is that most (if not all) implementations will require the distance of the centre of the cell (or at least I think it is) to be accurate enough, otherwise all y+ calculations will be too different from the "real" values. I took a quick look at where y+ was used in the source code:
With some effort, it's possible to adapt the code made available on the second bug report: http://www.openfoam.org/mantisbt/view.php?id=968 - the idea would be to copy-paste-rename the turbulence models you want to use and modify them to use this new wall distance calculation, instead of the standard one. Best regards, Bruno
__________________
|
|
April 11, 2014, 17:43 |
|
#47 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
What you said is correct. The discussion with you always make me learn lots of knowledge about Openfoam. Thank you.
OFFO |
|
March 19, 2015, 11:15 |
|
#48 |
New Member
Pratik Mitra
Join Date: Oct 2014
Posts: 4
Rep Power: 11 |
Hello
This post has been a great help for me.I am currently working in of version 2.3.0.I tried to calculate y+ for compressible flow but it is still asking for nuSgs file. I tried the method mentioned above of compiling the yPlusCompreesibleWLES file with wmake however i got the error message: Code:
Making dependency list for source file yPlusLESCompressible.C SOURCE=yPlusLESCompressible.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam230/src/meshTools/lnInclude -I/opt/openfoam230/src/turbulenceModels -I/opt/openfoam230/src/turbulenceModels/LES/LESdeltas/lnInclude -I/opt/openfoam230/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam230/src/transportModels -I/opt/openfoam230/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam230/src/OpenFOAM/lnInclude -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/yPlusLESCompressible.o yPlusLESCompressible.C: In function ‘void calcIncompressibleYPlus(const Foam::fvMesh&, const Foam::Time&, const volVectorField&, Foam::volScalarField&)’: yPlusLESCompressible.C:60:22: error: ‘sgsModel’ was not declared in this scope volScalarField nuEff(sgsModel->nuEff()); ^ yPlusLESCompressible.C: In function ‘void calcCompressibleYPlus(const Foam::fvMesh&, const Foam::Time&, const volVectorField&, Foam::volScalarField&)’: yPlusLESCompressible.C:126:1: error: no matching function for call to ‘Foam::compressible::LESModel::New(Foam::volScalarField&, const volVectorField&, Foam::surfaceScalarField&, Foam::basicThermo&)’ ) ^ yPlusLESCompressible.C:126:1: note: candidate is: In file included from yPlusLESCompressible.C:40:0: /opt/openfoam230/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&) static autoPtr<LESModel> New ^ /opt/openfoam230/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/yPlusLESCompressible.o] Error 1 pratik@ubuntu:~/OpenFOAM/yPlusLESCompressible$ wclean pratik@ubuntu:~/OpenFOAM/yPlusLESCompressible$ wmake Making dependency list for source file yPlusLESCompressible.C SOURCE=yPlusLESCompressible.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam230/src/meshTools/lnInclude -I/opt/openfoam230/src/turbulenceModels -I/opt/openfoam230/src/turbulenceModels/LES/LESdeltas/lnInclude -I/opt/openfoam230/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam230/src/transportModels -I/opt/openfoam230/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam230/src/OpenFOAM/lnInclude -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/yPlusLESCompressible.o yPlusLESCompressible.C: In function ‘void calcIncompressibleYPlus(const Foam::fvMesh&, const Foam::Time&, const volVectorField&, Foam::volScalarField&)’: yPlusLESCompressible.C:60:22: error: ‘sgsModel’ was not declared in this scope volScalarField nuEff(sgsModel->nuEff()); ^ yPlusLESCompressible.C: In function ‘void calcCompressibleYPlus(const Foam::fvMesh&, const Foam::Time&, const volVectorField&, Foam::volScalarField&)’: yPlusLESCompressible.C:126:1: error: no matching function for call to ‘Foam::compressible::LESModel::New(Foam::volScalarField&, const volVectorField&, Foam::surfaceScalarField&, Foam::basicThermo&)’ ) ^ yPlusLESCompressible.C:126:1: note: candidate is: In file included from yPlusLESCompressible.C:40:0: /opt/openfoam230/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&) static autoPtr<LESModel> New ^ /opt/openfoam230/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/yPlusLESCompressible.o] Error 1 Kindly help me to resolve the same Pratik Last edited by wyldckat; March 19, 2015 at 14:46. Reason: Added [CODE][/CODE] |
|
March 21, 2015, 15:47 |
|
#49 | |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Does it mean that the versions of y+ utility and your openfoam used are not compatiable with each other?
Quote:
|
||
March 21, 2015, 23:11 |
|
#50 |
New Member
Pratik Mitra
Join Date: Oct 2014
Posts: 4
Rep Power: 11 |
Thank you for your reply
I tried to follow the instructions given in the site to calculate yPlusLES for compressible flows: https://github.com/wyldckat/yPlusLES...ble/tree/of21x However I got the error message mentioned in my earlier post when i used wmake. My OpenFoam version is 2.3.0 and i guess the file is not compatible with the version i use. Pratik |
|
March 22, 2015, 06:36 |
|
#51 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Pratik: I've updated the instructions: https://github.com/wyldckat/yPlusLES...swcompressible Best regards, Bruno |
|
March 24, 2015, 12:56 |
|
#52 | |
New Member
Pratik Mitra
Join Date: Oct 2014
Posts: 4
Rep Power: 11 |
Quote:
|
||
March 24, 2015, 12:58 |
|
#53 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
||
March 24, 2015, 13:23 |
|
#54 |
New Member
Pratik Mitra
Join Date: Oct 2014
Posts: 4
Rep Power: 11 |
yPlusLES for compressible flow is available for openFoam 2.3.0 and is given in the website : https://github.com/wyldckat/yPlusLES...swcompressible
|
|
March 27, 2015, 10:53 |
|
#55 | |
Member
Howar
Join Date: Mar 2015
Posts: 53
Rep Power: 11 |
Quote:
|
||
March 27, 2015, 11:18 |
|
#56 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
||
August 27, 2015, 07:25 |
|
#57 |
New Member
Dan Pearce
Join Date: May 2013
Posts: 9
Rep Power: 12 |
Hi All,
Thanks for the discussion of the y+ treatment, following the thread from the start has been really helpful for me. I do have a couple of questions though, hence why I resurrected this thread... I am running OF 2.4.0 on Ubuntu 14.04. 1. I tried to run yPlusLES on the throttle tutorial for cavitatingFoam but I got the error keyword transportModel is undefined in dictionary "/home/dan/OpenFOAM/dan-2.4.0/run/tutorials/multiphase/cavitatingFoam/les/throttle/constant/transportProperties" file: /home/dan/OpenFOAM/dan-2.4.0/run/tutorials/multiphase/cavitatingFoam/les/throttle/constant/transportProperties from line 18 to line 64. From function dictionary::lookupEntry(const word&, bool, bool) const in file db/dictionary/dictionary.C at line 442. Is this due to the change in structure for multiphase transport properties dict between 2.4.0 and previous OF versions? should I log this as a bug? 2. The -compressible option has been removed, what is the correct useage now? Do I need to follow the instructions from wyldckat for v2.3.0 with some modifications to use the different transportProperties dict? Thanks, Dan Edit: I found the problem (it should have been obvious to me earlier but anyway) is that the utility does not handle a multiphase definition of nu / mu. A work around is to assume that all cells close to the wall are alpha = 1 and at the end of the run, temporarily rem out the vapour phase definitions in the transportProperties file. Unfortunately in my case this assumption does not always hold true so now looking at making my own utility, I will post back if I have any success Last edited by Dan Pearce; August 27, 2015 at 11:16. |
|
August 30, 2015, 16:49 |
|
#58 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
@Dan: Quick answers:
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compressible flow, no data at the outlet | mireis | FLUENT | 6 | September 3, 2015 02:10 |
Natural Convection using Compressible Flow (chtMultiRegionFOAM) | msarkar | OpenFOAM | 2 | September 7, 2010 00:13 |
help with compressible flow BC's (need subsonic flow) | meangreen | Main CFD Forum | 5 | July 24, 2010 13:16 |
Compressible Fluid Flow in COMSOL Multiphysics | BBG | COMSOL | 1 | November 19, 2008 14:05 |
Solving unsteady compressible low speed flow | atit | Main CFD Forum | 8 | July 31, 2000 13:19 |