
[Sponsors] 
April 7, 2008, 16:56 
Dear Foamers
I have simulat

#1 
New Member
OpenFOAM Newbie
Join Date: Mar 2009
Posts: 20
Rep Power: 9 
Dear Foamers
I have simulated a LES case. In results files I have mean values, R values but there are no rms values. How are rms values for velocity abbreviated and where can I find them? Thanks in advance for your help. 

April 7, 2008, 17:50 
Hi ,
As far as i know , the

#2 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 9 
Hi ,
As far as i know , there are no rms values output. you will have to post process the output files to calculate these. and the R values denotes a part of SGS stresses. hope this helps kumar 

April 8, 2008, 02:57 
Hi,
I want to confirm what

#3 
Senior Member
Cedric DUPRAT
Join Date: Mar 2009
Location: Belgium
Posts: 179
Rep Power: 9 
Hi,
I want to confirm what kumar said. And add, that, there is a tool called postChannel which calculate rms value BUT, for a channel. If your geometry looks like a channel or is a periodic geometry, you can modify the tool. But in other case .... as far as I know, there is no tools. enjoy, Cedric 

April 8, 2008, 03:36 
Hi all
Off course it would

#4 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,687
Rep Power: 26 
Hi all
Off course it would be possible for you to get an estimate of the rms values using postprocessing, but if you want the rms some quantity, e.g. pressure, then I would suggest that you rerun your calculation and calculate the rmsvalue during runtime. In that way you are certain that you get the effect of all turbulent fluctuations. By the way, I have been looking quickly in oodles and lesInterFoam and it looks like the average values are calculated in a wrong way. At the moment the average value is calculated based on a counter which is incremented each time step. This gives an even weighting of all time steps, but are you using a Courant based time step then the averaging should take the actual time step into account, otherwise the velocities for the small time steps get a significantly larger impact on the average, and since the velocities are large during these small time steps, the average velocities will be larger than is actually correct. Do you agree with me, or is it still too early in the morning  Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

April 8, 2008, 05:55 
Hi
Thanks for your answers

#5 
New Member
OpenFOAM Newbie
Join Date: Mar 2009
Posts: 20
Rep Power: 9 
Hi
Thanks for your answers guys. Yes I would like to calculate my rms values during the run as Neils suggested. However, when I set up the case I dont see no options to set up rms calculations. If you want to calculate P rms for channelOodles tutorials where would you set up the rms calculations? My mean results look Ok when I compare them with published results! OF Newbie 

April 8, 2008, 06:33 
One last thing in FoamX if we

#6 
New Member
OpenFOAM Newbie
Join Date: Mar 2009
Posts: 20
Rep Power: 9 
One last thing in FoamX if we follow on from velocityField there is an option callled "uprime". What is this for? Thanks


April 8, 2008, 06:56 
Hi Newbie
I do not think th

#7 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,687
Rep Power: 26 
Hi Newbie
I do not think there is such an option, so if you need the rms values during runtime, you have to make your own implementation. You could try to take a look at the calculateAverages.H, which is in the lesfolders. Have fun, Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

April 8, 2008, 06:58 
BTW are you using a constant t

#8 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,687
Rep Power: 26 
BTW are you using a constant time step? If so that explains why your average values match with experiments.
 Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

March 14, 2010, 07:38 

#9 
New Member
Bastian Nebenfuehr
Join Date: Feb 2010
Location: Sverige
Posts: 27
Rep Power: 8 
Hello everybody, hello ngj,
you are talking about making an own implementation for calculating the rms value during runtime of a simulation. Since I am a total newbie in programming with C/C++, I have no idea, how an implementation could look like. Has anyone of you already made an own implementation or give me some hints on how to do it? For some aeroacoustic application I need the rms value of the pressure, but for now, I'm stuck with my work, unfortunately. I would be very grateful, if anyone could try to help me out! Thanks already and have a nice sunday. /Bastian 

March 15, 2010, 03:55 

#10  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,904
Rep Power: 27 
Quote:
The channelFoam solver computes the averages automatically during the simulation using the fieldAverage function object. At the end of the controlDict you find Code:
functions { fieldAverage1 { type fieldAverage; functionObjectLibs ( "libfieldFunctionObjects.so" ); enabled true; outputControl outputTime; fields ( U { mean on; prime2Mean on; base time; } p { mean on; prime2Mean on; base time; } ); } } If you then take a look at postChannel, you find out how the RMS are computed. In particular readFields.H contains: Code:
volSymmTensorField UPrime2Mean ( IOobject ( "UPrime2Mean", runTime.timeName(), mesh, IOobject::MUST_READ ), mesh ); volScalarField Rxx(UPrime2Mean.component(symmTensor::XX)); volScalarField Ryy(UPrime2Mean.component(symmTensor::YY)); volScalarField Rzz(UPrime2Mean.component(symmTensor::ZZ)); volScalarField Rxy(UPrime2Mean.component(symmTensor::XY)); scalarField urmsValues = sqrt(mag(RxxValues)); scalarField vrmsValues = sqrt(mag(RyyValues)); scalarField wrmsValues = sqrt(mag(RzzValues)); To make it short, you simply have to write a small utility that does this, since the unsteady data are already stored for you by the fieldAverage. @Niels: What version of OF are you looking at? It seems to me averages are computed correctly in 1.6.x: http://foam.sourceforge.net/doc/Doxy...ce.html#l00139 If you consider to know the average <u> at time t, and you want to update it at t+dt, you just need to do, assuming sum_i(dt) is updated to the current time: (<u> *(sum_i(dt)  dt_current) + dt_current*u_current)/(sum_i(dt)) which should give you the correct weighted average. Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. Last edited by alberto; March 15, 2010 at 03:56. Reason: Added OF version 

March 15, 2010, 04:34 

#11  
New Member
Bastian Nebenfuehr
Join Date: Feb 2010
Location: Sverige
Posts: 27
Rep Power: 8 
Quote:
thanks for your help. This clarifies a lot. So, in order to get the rms of the pressure, it is sufficient to simply take the sqrt of pPrime2Mean and compensate for the density, since it is already a scalar field? And if so, does it make a difference, if I take the sqrt during run time or during postprocessing (i.e. with the calculator tool in EnSight)? Thanks again. Best regards, Bastian 

March 15, 2010, 09:50 

#12 
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 8 
Dear Alberto,
fieldAverage seems only can export u'^2, v'^2, w'^2, u'v', u'w' ,v'w', p'^2, T'^2. but if I want to get vector and scalar multiply componet, <u'T'>,<v'T'>, <w'T'>, which T is tempeture, how can I modify to release this ? Thank you very much. 

March 15, 2010, 11:07 

#13  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,904
Rep Power: 27 
Quote:
Quote:
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

March 15, 2010, 11:09 

#14  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,904
Rep Power: 27 
Quote:
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

March 15, 2010, 11:11 

#15 
New Member
Bastian Nebenfuehr
Join Date: Feb 2010
Location: Sverige
Posts: 27
Rep Power: 8 

June 10, 2010, 02:53 

#16 
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 8 
Dear all,
my field has temperature, I want to get turbulent heat flux <w'T'>. I do like this: 1. Add three field variables to creatFields.H . Info<< "Reading field Wave\n" << endl; // the averaged value of w velocity. volScalarField Wave ( IOobject ( "Wave", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Info<< "Reading field Tave\n" << endl; // the averaged value of temperature. volScalarField Tave ( IOobject ( "Tave", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Info<< "Reading field WTA\n" << endl; // the value o f<w'T'>. volScalarField WTA ( IOobject ( "WTA", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); 2. in my solver of *.C file, I add the following: int main(int argc, char *argv[]) { ................... ................... int nCounter = 0; Info<< "\nStarting time loop\n" << endl; while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; nCounter++; // new added #include "readTimeControls.H" #include "readPISOControls.H" #include "CourantNo.H" #include "setDeltaT.H" #include "UEqn.H" #include "TEqn.H" #include "CEqn.H" //  PISO loop for (int corr=0; corr<nCorr; corr++) { #include "pEqn.H" } turbulence>correct(); Wave = (Wave*(nCounter1)+U.component(2))/nCounter; Tave = (Tave*(nCounter1)+T)/nCounter; WTA = (WTA*(nCounter1)+(U.component(2)Wave)*(TTave))/nCounter; runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } I can get my result. but I think this is not smart. Because the definition of so many field variables will consume a lot of memory. And I think if I use functionObject " fieldAverage" in the same time, I don't need to calculate the average value Wave and Tave, because fieldAvegare already do this , but How can I use this average value from fieldAverage ? Who can give me some suggestions ? Thanks . 

January 2, 2016, 16:39 

#17 
New Member
Eslam Reda
Join Date: Jun 2009
Posts: 16
Rep Power: 8 
1) I added these few lines at the end of the creatFields.H file of the solver:[/B]
Info<< "Reading field UT\n" << endl; volVectorField UT ( IOobject ( "UT", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); 2) Then added this line to the buoyantPimpleFoam.C file UT = thermo.T()*U; just after the two lines #include "UEqn.H" #include "EEqn.H" 3) Make a file for "UT" in the "0" directory with proper (calculated) initial and boundary conditions and dimensions (0 1 1 1 0 0 0) 4) Now OpenFOAM knows "UT" and you can add it to the filedAverage items in the ControlDict file: functions { fieldAverage1 { type fieldAverage; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl outputTime; fields ( U { mean on; prime2Mean on; base time; } p { mean on; prime2Mean on; base time; } T { mean on; prime2Mean on; base time; } UT { mean on; prime2Mean on; base time; } ); } } 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Ensight  node values cell values  leo  FLUENT  1  May 12, 2010 08:47 
node values or cell values?  aPpA  FLUENT  0  November 10, 2006 09:56 
3D  How to set Ref. values... ?  Cyril  FLUENT  0  June 22, 2006 09:36 
y+ values  Mark Fahey  CFX  4  January 10, 2004 00:05 
Y+ Values  Matthias  Main CFD Forum  1  November 21, 2001 05:24 