|
[Sponsors] |
October 12, 2020, 14:25 |
|
#21 |
Member
Conor Crickmore
Join Date: Jan 2020
Location: Leicestershire, United Kingdom
Posts: 36
Rep Power: 6 |
As an update for those looking for a "cleaner" or just more general solution, I've since implemented the previously discussed codedFunctionObject as a traditional functionObject following the same format as other fieldExpression derived objects.
I've included the .C and .H files, to be inserted and compiled in either the main or a user-defined src/functionObjects/fields directory, alongside an example of how to load the function within a simulation (by adding to controlDict or as a file within the system directory) Don't forget to make the necessary additions to Make/files prior to compiling!
__________________
Conor Crickmore PhD Researcher in Automotive Aerodynamics Aeronautical and Automotive Engineering Loughborough University LE11 3TU |
|
December 7, 2021, 07:38 |
|
#22 |
New Member
Join Date: May 2021
Posts: 9
Rep Power: 5 |
Hi guys,
I know the discussiun ended a year ago. But this is my way to to qualify my LES mesh resolution. I usually just calculate the UPrime2Mean of course, as you explained before, to calculate my TKE via diagonal components of the Reynolds Stress Tensor. The SGS-part of the TKE is modelled anyway and printed (in e.g. kEquation and dynamicKEquation LES-Model) automatically. If it is not, one can use the tubulenceFields functionObject in controlDict. To finally quantify my LES-mesh quality I use the Paraview calculator: (0.5*(UPrime2Mean_XX+UPrime2Mean_YY+UPrime2Mean_ZZ ))/((0.5*(UPrime2Mean_XX+UPrime2Mean_YY+UPrime2Mean_Z Z))+k) I guess this is a pretty easy way get your results and it might work for DES aswell. David |
|
March 31, 2022, 06:24 |
|
#23 | |
Member
Join Date: Apr 2014
Location: N/A
Posts: 50
Rep Power: 12 |
Quote:
|
||
January 23, 2023, 12:18 |
|
#24 | |
Member
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 70
Rep Power: 17 |
Quote:
Note that in this version the denominator trace does NOT include k, while in cjc96's version it does! What's right? /EDIT: I mixed up R and k, they are the difference! |
||
May 10, 2023, 08:18 |
|
#25 |
New Member
Saeed Salehi
Join Date: Aug 2010
Posts: 27
Rep Power: 16 |
Hi,
I think Conor's code is implemented nicely. However, in my opinion, there is one small issue which is here, the mean resolved turbulent kinetic is compared energy with the instantaneous modeled energy. I think the correct comparison, would be to compare mean resolved and mean modeled kinetic energies. So, first, one needs to average both U (with primes) and R (without primes) during the simulation and then run the functionObject script. Additionally, I rewrote the whole script to make it more aligned with the current OpenFOAM coding style. It is assumed that UPrime2Mean and RMean are already available. Code:
readFields { type readFields; libs (fieldFunctionObjects); fields (UPrime2Mean turbulenceProperties:RMean); } LESIndex { type coded; libs (utilityFunctionObjects); name LESIndex; codeExecute #{ auto* LESIndexPtr = mesh().getObjectPtr<volScalarField>("LESIndex"); if (!LESIndexPtr) { Info<< "Create total turbulent kinetik energy field" << nl; LESIndexPtr = new volScalarField ( IOobject ( "LESIndex", mesh().time().timeName(), mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh(), dimless ); regIOobject::store(LESIndexPtr); } auto& LESIndex = *LESIndexPtr; Info<< "Computing total turbulent kinetik energy field\n" << endl; auto* RPtr = mesh().getObjectPtr<volSymmTensorField>("turbulenceProperties:RMean"); auto* UPrime2MeanPtr = mesh().getObjectPtr<volSymmTensorField>("UPrime2Mean"); if (RPtr && UPrime2MeanPtr) { auto& R = *RPtr; auto& UPrime2Mean = *UPrime2MeanPtr; volScalarField resolvedTKE = 0.5*tr(UPrime2Mean); volScalarField totalTKE = 0.5*tr(R) + 0.5*tr(UPrime2Mean); LESIndex = resolvedTKE/(totalTKE + dimensionedScalar("small", totalTKE.dimensions(), SMALL)); LESIndex.write(); // Not necessary if the funcitonObject is used during the simulation } else { Warning << endl << " Unable to compute total turbulent kinetik energy" << endl << " UPrime2Mean and/or RMean Unavailable" << endl; } #}; } |
|
July 18, 2024, 05:00 |
|
#26 | |
New Member
Xin Li
Join Date: Apr 2020
Posts: 2
Rep Power: 0 |
Quote:
|
||
Tags |
des les, les, reynolds stress tensor, turbulent kinetic energy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
LES best practice: resolved and modelled turbulence kinetic energy | em17 | OpenFOAM Running, Solving & CFD | 22 | April 17, 2020 14:01 |
Relation between k and UPrime2Mean etc in LES | Tarak | OpenFOAM Running, Solving & CFD | 49 | August 10, 2018 14:10 |
Worse accuracy in LES models than in RANS models | dferrando | OpenFOAM Running, Solving & CFD | 0 | August 30, 2017 05:56 |
Resolved KE versus SGS KE - LES | smog | OpenFOAM | 0 | February 11, 2016 19:01 |
Bug in Dynamic 1Eq Eddy Viscosity LES Model Incompressible flow | harishg | OpenFOAM Bugs | 5 | December 2, 2008 19:18 |