# How to calculate <w'T'>?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 4, 2013, 15:18 How to calculate ? #1 Member   Ping Join Date: Dec 2011 Posts: 63 Rep Power: 5 Hi guys, I am simulating DNS channel flows using Openfoam, and I want to show contours of , 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 . Code: ``` fieldAverage1 { ... fields ( Q { mean on; prime2Mean on; base time; } ...``` I am thinking if I can add some lines into the solver to define as a new variables and output them correctly.You guys can give me some hint to do this? Many thanks!

 April 4, 2013, 16:59 #2 Senior Member   Lieven Join Date: Dec 2011 Location: Mol, Belgium Posts: 295 Rep Power: 13 I guess the easiest way would be to do two simulations. 1. During the first run you calculate and 2. During the second run you read in and , and evaluate Q = (w-)*(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

April 4, 2013, 21:23
#3
Member

Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5
Quote:
 Originally Posted by Lieven I guess the easiest way would be to do two simulations. 1. During the first run you calculate and 2. During the second run you read in and , and evaluate Q = (w-)*(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,
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!

 April 5, 2013, 03:00 #4 Member   Dejan Morar Join Date: Nov 2010 Posts: 78 Rep Power: 7 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 . = - Regards Lieven and ripperjack like this.

April 5, 2013, 09:13
#5
Member

Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5
Quote:
 Originally Posted by morard 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 . = - Regards
Hi Morard,
Great! That the simplest way to do it! Thanks Morard!
Regards

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Hugoles OpenFOAM Post-Processing 11 September 25, 2014 19:07 Diana.N FLUENT 3 February 27, 2012 14:40 Ingenierias2003 OpenFOAM 5 November 24, 2010 13:40 sbar OpenFOAM Pre-Processing 5 August 16, 2010 04:10 manish CFX 4 March 15, 2007 03:57

All times are GMT -4. The time now is 22:33.