CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Mean Age of Air (https://www.cfd-online.com/Forums/openfoam-post-processing/68300-mean-age-air.html)

Greenplan September 14, 2009 14:15

Mean Age of Air
 
Hi all,

I am a new member and may be asking an old, already answered question. If so I apologise.

I notice that quite some time ago (~2007) Vincent enquired about determining mean age of air predictions with OpenFOAM but I could not find any response to that. It seems that relatively simple techniques exist to do this post-processing with many commercial CFD software packages.
My requirement is to use Mean Age of Air data to measure Air Change Effectiveness in buildings according to the ASHRAE 129-1977 std.

Your help will be appreciated!

Thanks in advance,

Francois

lindner March 15, 2010 08:42

I have almost the same problem, I want to output a custom variable "maa" (mean age air) to measure Air Change Effectiveness. I have the function from articles, i just want to see this variable on paraview. Should i create a new solver? I just need the velocity fields like scalarTransportFoam, so modifying this solver will be enough? If yes what file contains the function from scalarTransportFoam to modify?

thanks for the patience reading =)

matejfor March 16, 2010 05:00

Hi,
as far as I remember, the mean age of air is a scalar with a density as a source term. scalarTransportFoam is a good choice. Just be aware it is written for incompressible flow with no density variation. You have to do few small changes to work with your solution which I assume is not isothermal.

Other possibility would be to add your maa scalar to your solver of course.

good luck
matej

andersking March 18, 2010 22:56

1 Attachment(s)
I have attached a solver that can do this.

To get air change effectiveness, you'll have to do some postprocessing on the age field. (which could probably be moved into the solver).

It can use an existing flow field, or solve it as part of the calculation.

Also it's written to live with the main OF solvers, you may want to change Make/files to use FOAM_USER_APPBIN for stand-alone use.

Feedback welcome. (Attribution appreciated as well - since that is what they measured by the powers that be)

Regards,
Andrew

lindner March 19, 2010 03:24

Thanks matejf and Andrew!
I will test the solver now and will post the results.

Thanks for the attention,
Guilherme

lindner March 22, 2010 07:17

uuuuuuuuuu

lindner March 22, 2010 07:18

Hi andersking,
The solver worked and i got results close to the literature, thank you!
But i have a question, the equation you are using to calculate the age is the same as the one from this article or is it another one? www.ibpsa.org/proceedings/BS2001/BS01_0773_780.pdf
And another question (my lack of programming knowledge), the sentence in the scalar part of the code
dimensionedScalar("ageSource", age.dimensions()*dimensionSet(0,0,-1,0,0), 1)
means what?
I did a test changing to the value 1 and it gave the same result.

Thanks for the help,
Guilherme

andersking March 22, 2010 20:30

It is essentially the same as that equation. (Assuming a schmidt no of 1 - this should probably be changeable though).

the
Code:

dimensionedScalar("ageSource", age.dimensions()*dimensionSet(0,0,-1,0,0), 1)
term just implements a source term of "1", which is essentially the same as the density in this case. The rest just sets the dimensions to match (ie [unit] per second - since it's a source).

Regards,
Andrew

lindner March 23, 2010 03:26

Ok, now I understand. Im studying the code to be able to create my own solvers later on.
Thanks for everything, the Local Mean Age problem is solved.

Guilherme

braennstroem March 23, 2010 13:09

Hello,

maybe, this is another option or add-on:
http://sourceforge.net/projects/openfoamadd-ons/

Fabian

Ramyhamdy November 30, 2011 13:55

Quote:

Originally Posted by andersking (Post 250738)
I have attached a solver that can do this.

To get air change effectiveness, you'll have to do some postprocessing on the age field. (which could probably be moved into the solver).

It can use an existing flow field, or solve it as part of the calculation.

Also it's written to live with the main OF solvers, you may want to change Make/files to use FOAM_USER_APPBIN for stand-alone use.

Feedback welcome. (Attribution appreciated as well - since that is what they measured by the powers that be)

Regards,
Andrew

Hello, I can not download the file of mean age of air and I want to know the source term of its equation.

Tobi May 14, 2012 13:19

hi to all,

there is a discussion in our office of the mean time of a fluid in two geometrys. So i just wanna analyse what mean time is bigger.

Therefor I implemented a new scalar in my solver

Code:


solve
(
            fvm::ddt(S)
  + fvm::div(phi, S)
      -  laplacian(nuEff, S)
)

So ... where is the differences to your suggestion?
I read your repost for the last line but i do not understand it!

Tobi

Tobi June 26, 2012 05:40

Hi its me again,


my solver can`t handle the

Code:

laplacian(nuEff(),age)
so I want to change it so
Code:

laplacian(turbulent->mut()/sigmat,age)
but I do not know if that is correct and I ll get the right solutions.
Can someone give me an advice?

Tobi

Tobi July 2, 2012 08:41

Well okay that`s wrong i think couse

Code:

nuEff = nu + nut
and
Code:

nu = mu * rho
So the code should be like
Code:

laplacian(turbulence->mut()*rho+mu*rho,age)
Can someone give me a short feedback?

maybe its just "DnuTildaEff" ???
Tobi

andersking July 2, 2012 09:13

Quote:

Originally Posted by Tobi (Post 369277)
Well okay that`s wrong i think couse

Code:

nuEff = nu + nut
and
Code:

nu = mu * rho
So the code should be like
Code:

laplacian(turbulence->mut()*rho+mu*rho,age)
Can someone give me a short feedback?

maybe its just "DnuTildaEff" ???
Tobi


If you are using a solver with density (which is likely if you have mu available), then you probably should be using turbulence->muEff(), which is the effective viscosity. also , nu = mu / rho.

The source term of "1", grows with time, so for stagnant areas age = t, whereas for areas with "fresh" fluid inlet, age = 0 (which should be the boundary conditions on inlet). (you can normalise it versus t to get values from 0 to 1).

Regards,
Andrew

Tobi July 3, 2012 04:22

Hi andrew,

thanks for your replay!
Well is mu = dynamic viscosity, nu = kinematic viskosity, or?
There was a problem in my head with the litrature.

Okay.
Now its clear. But I have problems in my calculations with the dimensions

Code:

incompatible dimensions for operation
    [age[0 0 -2 0 0 0 0] ] + [age[1 -3 -2 0 0 0 0] ]

my code is (rhoSimpleFoam)

Code:

        fvScalarMatrix ageEqn
        (
            fvm::ddt(age)
          + fvm::div(phi, age)
          - fvm::laplacian(turbulence->muEff(), age)
          ==
            dimensionedScalar("ageSource", age.dimensions()*dimensionSet(0,0,-1,0,0), 1)
        );

I am looking for the error now.

Tobi July 3, 2012 04:36

Hi again,

I made a mistake :)
Now I changed the code for the ddt() and the source...

Code:

      fvScalarMatrix ageEqn
        (
            fvm::ddt(rho, age)
          + fvm::div(phi, age)
          - fvm::laplacian(turbulence->muEff(), age)
          ==
            dimensionedScalar("ageSource", age.dimensions()*dimensionSet(1,-3,-1,0,0), 1)
        );

Is that correct?

Tobi July 19, 2012 03:40

Hi again,

is there a way to validate the solved age time? I am not sure about my results. Using combustion and in the flame zone I have age values to 5 (like 5s) and that should be something like 0.3 sec ... did I do sth. wrong?

Toorop July 20, 2012 11:14

2 Attachment(s)
Hi Tobias,

I got the same result. I compared the method that you used with a new solution to calculate the residence time with field sources (OF2.1).

If anyone interested, I attached the solver and a pitzDaily demo.
I have used it successfully before, but I tried to recompile it this morning and it failed ...
Any ideas are appreciated!

Tobi July 20, 2012 15:25

3 Attachment(s)
Hey Tibor,

I changed some lines in your solver and now it works again :)
Is there a reason why you set DT - its zero or not ?

Hmmm ... I ll try it with the simpleFoam again and compare it.


At least a question.
If I analyse a flow structure with a long inlet (time = 0) and get to a diffusor.
How can I get the time which the fluid need to flow through the diffusor when the fluid needs 5 seconds to get to the diffusor!?

Do you know what I mean?
Tobi


All times are GMT -4. The time now is 10:56.