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

How to calculate <w'T'>?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By ripperjack
  • 1 Post By ripperjack
  • 2 Post By morard

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2013, 15:18
Default How to calculate <w'T'>?
  #1
Member
 
Jack
Join Date: Dec 2011
Posts: 94
Rep Power: 14
ripperjack is on a distinguished road
Hi guys,

I am simulating DNS channel flows using Openfoam, and I want to show contours of <w'T'>, where <> means average, w' is the z-direction velocity fluctuation, and T' is temperature fluctuation.

I tried to define a new variable Q=w*T and average Q by adding the following lines into system/controlDict. But it seems to be incorrect because it will calculate <(wT)'> instead of <w'T'>.
Code:
    fieldAverage1
    {
     ...
        fields
        (
            Q
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
     ...
I am thinking if I can add some lines into the solver to define <w'T'> as a new variables and output them correctly.You guys can give me some hint to do this? Many thanks!
tariq likes this.
ripperjack is offline   Reply With Quote

Old   April 4, 2013, 16:59
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
I guess the easiest way would be to do two simulations.
1. During the first run you calculate <w> and <T>
2. During the second run you read in <w> and <T>, and evaluate Q = (w-<w>)*(T-<T>) and take the average of Q like you are doing

I'm aware that this is a bit unfavourable from computational point of view, but I don't really see an other option. If you find one however, let me know! cause this is an interesting issue.

Cheers,

L
Lieven is offline   Reply With Quote

Old   April 4, 2013, 21:23
Default
  #3
Member
 
Jack
Join Date: Dec 2011
Posts: 94
Rep Power: 14
ripperjack is on a distinguished road
Quote:
Originally Posted by Lieven View Post
I guess the easiest way would be to do two simulations.
1. During the first run you calculate <w> and <T>
2. During the second run you read in <w> and <T>, and evaluate Q = (w-<w>)*(T-<T>) and take the average of Q like you are doing

I'm aware that this is a bit unfavourable from computational point of view, but I don't really see an other option. If you find one however, let me know! cause this is an interesting issue.

Cheers,

L
Hi Lieven,
Thanks very much for your reply!
Based on your suggestion, I am thinking may be I can do it in one run. I will try the following procedures:
1. Define new variables w (U.component(2)), wMean (<w>) and TMean (<T>) in solver and read their values from meshes (an initial value is given at start-time).
2. Define new variable Q=(w-wMean)*(T-TMean). (that is the instant w'T' value, not averaged one)
3. Add the following average lines in system/controlDict to calculate wMean, TMean, and QMean (that is <w'T'> we want).
Code:
    fieldAverage1
    {
       .....
        fields
        (
            ....
            w
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
            T
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
            Q
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
         .....
By doing this, at each running step, the solver will read wMean and TMean calculated by the above commands in system/controlDict. And based on the wMean and TMean, the instant w'T' is calcualted and then <w'T'> can be calculated.
I have added the lines mentioned above into my solver, and it is running, no error. However, I need to run a real simulation to verify if the above method produce correct results.
Cheers!
tariq likes this.
ripperjack is offline   Reply With Quote

Old   April 5, 2013, 03:00
Default
  #4
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16
morard is on a distinguished road
Hi ripperjack,

you just have to add a new field in your solve, wT, and then average it. You wil also need averaged values of w and T. At the end, you can modify postChannel utility to calculate <w'T'>.

<w'T'> = <wT> - <w><T>

Regards
Lieven and ripperjack like this.
morard is offline   Reply With Quote

Old   April 5, 2013, 09:13
Default
  #5
Member
 
Jack
Join Date: Dec 2011
Posts: 94
Rep Power: 14
ripperjack is on a distinguished road
Quote:
Originally Posted by morard View Post
Hi ripperjack,

you just have to add a new field in your solve, wT, and then average it. You wil also need averaged values of w and T. At the end, you can modify postChannel utility to calculate <w'T'>.

<w'T'> = <wT> - <w><T>

Regards
Hi Morard,
Great! That the simplest way to do it! Thanks Morard!
Regards
ripperjack 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
[swak4Foam] Problem to calculate grad(U) using swak4Foam Hugoles OpenFOAM Community Contributions 12 November 24, 2020 10:28
calculate Nu number Diana.N FLUENT 3 February 27, 2012 13:40
How to calculate grid width in control volume Ingenierias2003 OpenFOAM 5 November 24, 2010 12:40
calculate values for eps and k from Re or u????? sbar OpenFOAM Pre-Processing 5 August 16, 2010 04:10
How to calculate Torque for francis turbine manish CFX 4 March 15, 2007 02:57


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