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)

immortality April 25, 2013 13:56

i'm confused too! ;)
then what is wrong in settings i have done?
Could you tell me to know?

immortality April 25, 2013 15:18

I'm waiting and wondering what is wrong?
please help.I'm in a hurry.:(

immortality April 26, 2013 22:12

is there any help?

immortality April 28, 2013 01:58

its very important to me.
My case is unsteady and compressible.
Why scalar transport(gas) isn't between 0 and 1?

immortality May 3, 2013 16:05

what do you mean by conserved equation?
how can make the scalar transport conservative?

tian January 28, 2014 04:33

Age of Air
 
Dear all,

my question is about Duration. I whould like that OpenFOAM calculated Age of Air every time step but my equation only work for one duration = 1. So, it seems I do not really understand the function of Duration. Can somebody help me? Thank you

Code:

functions
(
        AoA
        {
                type scalarTransport;
                functionObjectLibs ( "libutilityFunctionObjects.dll" );
               
                resetOnStartUp true;
                autoSchemes true;

                fvOptions
                {
               
                        AoA_Source
                        {
                                type            scalarExplicitSetValue;
                                active          on;
                                timeStart      0.0;
                                duration        1000;
                                selectionMode  all;
                               
                                scalarExplicitSetValueCoeffs
                                {
                                        volumeMode        specific;
                                        injectionRate
                                        {
                                                AoA            1;
                                        }
                                }
                        }
                };
               
        }
       
        AoA_MinMax
    {

        type            fieldMinMax;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled        true;
        log            true;
        write          false;

        fields
        (
            AoA
        );
    }

);


Tellur September 14, 2015 21:57

Hello everyone,

Sorry for reviving this old thread.

I want to perform some ACE simulations and this post has been the closest I have found of something like this in Openfoam.

However, I have some issues trying to compile this solver for OpenFoam 2.4. At first I had some issues concerning IOliboptions file which in the new version seems to be substituted by MRF options and porosityoptions.

After changing that in ageScalarFoam.C I now get some errors in the reference of sources in the p, h, q, files. I believe the issue is that the CreateFields.H dictionary has a line including IOliboptions sources (mesh); at the end. I am not so sure what to substitute it with in order for the solver to compile.

Anyone has any pointers? Or perhaps a running version of the solver for 2.4?

Thanks so much in advance!

Kind regards,
Theodore.

tian September 15, 2015 05:17

Hi,

if you need AoA in your CFD run, I think, you can add a function in your controlDict. No need to adjust the solver:

Code:

functions
{
      AoA
    {
        type    scalarTransport;
        functionObjectLibs ("libutilityFunctionObjects.dll");
        outputControl outputTime;
        active          true;
        autoSchemes    true;
        nCorr          0;
        resetOnStartUp false;
        //DT              1e-5;

        fvOptions
        {
            IncrementTime
            {
            type            scalarSemiImplicitSource;
            active          true;
            selectionMode  all;//cellZone;
            cellZone        Layers;
                scalarSemiImplicitSourceCoeffs
                {
                    volumeMode  specific;//absolute;
                    injectionRateSuSp
                    {
                        AoA      (1 0);
                    }
                }
            }
        }
    }


        MinMax
  {
        type            fieldMinMax;
        functionObjectLibs ("libfieldFunctionObjects.dll");
        enabled        true;
        log            true;
        write          false;
        fields
        (
            p
            U
            T
            AoA
           
                    );
    }
 
}

Bye
Thomas

Tellur September 21, 2015 01:50

Hi Tian,

Thank you so much for the information, I will try the code and see what I get.

Just a small clarification, if I want to calculate it in the breathing zone, would I have to indicate it in these lines? Or is it just a post-processing from my side to calculate it?

selectionMode ....
cellZone ....

Thanks in advance!

Tellur September 21, 2015 06:52

Thanks it works!

Now I need to just play around with it and see what the output looks like and how I can transform this into ACE calculations.

Kind regards,
Theodore.

tian September 21, 2015 07:12

Hi,

yeah, I used OpenFOAM under Windows. So you need to change:

functionObjectLibs ("libfieldFunctionObjects.dll");

to

functionObjectLibs ("libfieldFunctionObjects.so");

@breathing zone: You can use ParaView:

* Create your breathing zone as STL
* Use TopoSet to create your cellSet from your last time step.
* Use "foamToVTK -ASCII -cellSet ****" to create VTK
* Import your VTK

Bye
Thomas

Tellur October 1, 2015 21:54

Hello Thomas and forum,

I have been testing with success your code, thank you so much for providing it.

I was wondering if I can ask a couple of clarifications.

The first one is probably a silly question but bare with me. Can we actually use this code on a steady-state simulation? I understand it is using the time to calculate results, does this mean that the calculated AoA will just keep increasing at every timestep of a steadystate simulation or will it be an accurate number?

The second is concerning the calculation of Air Change Effectiveness (ACE) from Age of Air. I have found a few different formulas. I have settled down on dividing the nominal time constant to the AoA to calculate ACE. The nominal time constant seems to be the inverse of the ACH of the room. Is that a proper way to calculate ACE or do you have a different suggestion from your experience?

Again thank you so much for helping!

Kind regards,
Theodore.

tian October 3, 2015 06:01

Hi,

@steady-state simulation: Yes, possible. In the end you will get your Room mean age of air as accurate number.

@Air Change Efficiency:

Epsilon = Mean Age of air in the exhaust / (2 x Room mean age of air)

Should be between 0 to 100%

Bye
Thomas

kingjewel1 November 30, 2015 18:30

Quote:

Originally Posted by tian (Post 566326)
Hi,

@steady-state simulation: Yes, possible. In the end you will get your Room mean age of air as accurate number.

@Air Change Efficiency:

Epsilon = Mean Age of air in the exhaust / (2 x Room mean age of air)

Should be between 0 to 100%

Bye
Thomas

Hi Thomas, I see you are quite experienced in AoA.

I was wondering if you could suggest an approach for a naturally ventilated rooml especially as I am also modelling the external airflow too. I'm guessing it's not quite the same right to find the air change rate or air change effectiveness as in a mechanically ventilated room? What do you think?

Any help would be much appreciated.

Tobi December 1, 2015 03:29

Dear kingjewel1,

i suggest you to use a simple passive scalar equation that has a source term that grow with time by 1. Thats it. After that you are able to Calculate the time the air is staying at a special location. It does not matter if you have naturally or mechanical ventilation. The mathematic behind are the same.

Good luck,

kingjewel1 December 1, 2015 05:03

Quote:

Originally Posted by Tobi (Post 575743)
Dear kingjewel1,

i suggest you to use a simple passive scalar equation that has a source term that grow with time by 1. Thats it. After that you are able to Calculate the time the air is staying at a special location. It does not matter if you have naturally or mechanical ventilation. The mathematic behind are the same.

Good luck,

Hi Tobi,

Many thanks for your help. OK, so I've set this up and have results for a test case.By the way I think we met in Leeds at the OF users conference if I am not mistaken.

http://1drv.ms/1lVcZSZ

So to convert these contours into air changes per hour? 1/Age of Air? I'm not quite convinced.... What do you think?

Tobi December 1, 2015 07:18

Hi,

did you mean the PFAU11 last week in Leoben? If yes, I was there. But not in Leeds or whatever it is (:

What is Tracer in the Plot? The additional variable with the suggested equation? This is at least the mean time of air in s. If you want to know how long the air will stay at a region within hours, just divide by 3600.

kingjewel1 December 1, 2015 13:21

Quote:

Originally Posted by Tobi (Post 575784)
Hi,

did you mean the PFAU11 last week in Leoben? If yes, I was there. But not in Leeds or whatever it is (:

What is Tracer in the Plot? The additional variable with the suggested equation? This is at least the mean time of air in s. If you want to know how long the air will stay at a region within hours, just divide by 3600.

Hi Tobi,

Sorry, perhaps I was mistaken, I was sure you gave a talk on functions.

Anyway, yes the plot is the Age of Air based on the
Code:

scalarTransportFoam
run through
Code:

controlDict
with a source value of 1 in each cell. This seems to work nicely. But for calculating air change rate. Air change rate is then: Age of air/3600? Surely that would make the values very very small? Perhaps it's 3600/Age of Air?

Tobi December 1, 2015 13:31

Hi,

if you implement an equation like
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)       
);

you have to define the inlet with fixedValue = 0. Then the value of the scalar will increase within one second to the value 1. That means that everywhere you will have the value 1 after the calculation the air took 1s from inlet to that place. If you have regions with the value of 103 it means that the air stays in your domain for 103s.

Hope it is clear (:

kingjewel1 December 7, 2015 07:06

Hi Tobi,

This is working nicely now, thank you. Just a question about solving it. Imagine my building has a very high air change rate (200 times per hour), then my simulation will be very long (72 seconds at least). Which takes a long time on the server. Can I run the scalar on a frozen flow field to get a rough idea, if not exact?

Cheers,


All times are GMT -4. The time now is 08:47.