CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

No rms values for LES

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alberto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 7, 2008, 17:56
Default Dear Foamers I have simulat
  #1
New Member
 
OpenFOAM Newbie
Join Date: Mar 2009
Posts: 20
Rep Power: 17
lofty is on a distinguished road
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.
lofty is offline   Reply With Quote

Old   April 7, 2008, 18:50
Default Hi , As far as i know , the
  #2
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17
kumar2 is on a distinguished road
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
kumar2 is offline   Reply With Quote

Old   April 8, 2008, 03:57
Default Hi, I want to confirm what
  #3
Senior Member
 
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17
cedric_duprat is on a distinguished road
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
cedric_duprat is offline   Reply With Quote

Old   April 8, 2008, 04:36
Default Hi all Off course it would
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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 rms-value 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 Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   April 8, 2008, 06:55
Default Hi Thanks for your answers
  #5
New Member
 
OpenFOAM Newbie
Join Date: Mar 2009
Posts: 20
Rep Power: 17
lofty is on a distinguished road
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
lofty is offline   Reply With Quote

Old   April 8, 2008, 07:33
Default One last thing in FoamX if we
  #6
New Member
 
OpenFOAM Newbie
Join Date: Mar 2009
Posts: 20
Rep Power: 17
lofty is on a distinguished road
One last thing in FoamX if we follow on from velocityField there is an option callled "uprime". What is this for? Thanks
lofty is offline   Reply With Quote

Old   April 8, 2008, 07:56
Default Hi Newbie I do not think th
  #7
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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 les-folders.

Have fun,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   April 8, 2008, 07:58
Default BTW are you using a constant t
  #8
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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 Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   March 14, 2010, 07:38
Default
  #9
New Member
 
Bastian Nebenfuehr
Join Date: Feb 2010
Location: Sverige
Posts: 27
Rep Power: 16
basneb is on a distinguished road
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 aero-acoustic 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
basneb is offline   Reply With Quote

Old   March 15, 2010, 03:55
Default
  #10
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by basneb View Post
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 aero-acoustic 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
Take a look at what channelFoam and postChannel do, and consider the channelFoam as tutorial.

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;
            }
        );
    }
}
This means that the mean and the prime2Mean values are computed and stored accounting for the correct time step, and that's all you need. You can re-use the settings in your controlDict, adapting them

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));
and collapse.H, after collapsing the fields (it makes sense in the case of the channel due to the periodicity, but if you're not in these conditions, it does not), reports

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,
missios likes this.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based 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
alberto is offline   Reply With Quote

Old   March 15, 2010, 04:34
Default
  #11
New Member
 
Bastian Nebenfuehr
Join Date: Feb 2010
Location: Sverige
Posts: 27
Rep Power: 16
basneb is on a distinguished road
Quote:
Originally Posted by alberto View Post
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));
and collapse.H, after collapsing the fields (it makes sense in the case of the channel due to the periodicity, but if you're not in these conditions, it does not), reports

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.
Hi alberto,
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 post-processing (i.e. with the calculator tool in EnSight)?
Thanks again.

Best regards,
Bastian
basneb is offline   Reply With Quote

Old   March 15, 2010, 09:50
Default
  #12
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
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.
panda60 is offline   Reply With Quote

Old   March 15, 2010, 11:07
Default
  #13
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by basneb View Post
Hi alberto,
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?
Yes. Notice you do p is actually p/rho in incompressible codes.

Quote:
And if so, does it make a difference, if I take the sqrt during run time or during post-processing (i.e. with the calculator tool in EnSight)?
You can take the sqrt at the end, which is what postChannel does ;-)

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 (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   March 15, 2010, 11:09
Default
  #14
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by panda60 View Post
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.
I would say the easiest way it to add a few lines of code to compute these quantities in you solver and output them.

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 (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   March 15, 2010, 11:11
Default
  #15
New Member
 
Bastian Nebenfuehr
Join Date: Feb 2010
Location: Sverige
Posts: 27
Rep Power: 16
basneb is on a distinguished road
Quote:
Originally Posted by alberto View Post
Yes. Notice you do p is actually p/rho in incompressible codes.



You can take the sqrt at the end, which is what postChannel does ;-)

Best,
Okay, great! Thanks a lot!

/Bastian
basneb is offline   Reply With Quote

Old   June 10, 2010, 03:53
Default
  #16
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
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*(nCounter-1)+U.component(2))/nCounter;
Tave = (Tave*(nCounter-1)+T)/nCounter;

WTA = (WTA*(nCounter-1)+(U.component(2)-Wave)*(T-Tave))/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 .
panda60 is offline   Reply With Quote

Old   January 2, 2016, 16:39
Default
  #17
New Member
 
Eslam Reda
Join Date: Jun 2009
Posts: 19
Rep Power: 17
Eslam Reda is on a distinguished road
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;
}
);
}

}
Eslam Reda is offline   Reply With Quote

Old   December 2, 2018, 03:19
Default
  #18
New Member
 
priyesh kakka
Join Date: Jan 2018
Posts: 13
Rep Power: 8
kakkapriyesh is on a distinguished road
Quote:
Originally Posted by Eslam Reda View Post
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;
}
);
}

}
This is incorrect as it will give <UT'UT'> and not <u'T'>,anyone has a code to do this??
kakkapriyesh is offline   Reply With Quote

Old   December 24, 2018, 14:09
Default
  #19
Member
 
Ramana
Join Date: Jul 2017
Location: India
Posts: 58
Rep Power: 9
svramana is on a distinguished road
Hi Priyesh,
Please write correct one
svramana is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ensight - node values -cell values leo FLUENT 1 May 12, 2010 09: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 10:36
y+ values Mark Fahey CFX 4 January 10, 2004 00:05
Y+ Values Matthias Main CFD Forum 1 November 21, 2001 05:24


All times are GMT -4. The time now is 15:05.