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

Mean Age of Air

Register Blogs Community New Posts Updated Threads Search

Like Tree24Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 7, 2015, 07:36
Default
  #61
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Of course you can use this as a post-processing too.
Just use the velocity field U of your steady-state simulation and calculate your fluxes. Then just solve the equation of AoA. Finished (:
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 7, 2015, 07:50
Default
  #62
Senior Member
 
Join Date: Jul 2009
Posts: 260
Rep Power: 17
kingjewel1 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Of course you can use this as a post-processing too.
Just use the velocity field U of your steady-state simulation and calculate your fluxes. Then just solve the equation of AoA. Finished (:
Hmm I have the AoA set as a
HTML Code:
functionObject
in my
HTML Code:
controlDict
, like this:

HTML Code:
functions
{

Tracer
    {
        type    scalarTransport;
        functionObjectLibs ("libutilityFunctionObjects.so");
        outputControl outputTime;
        active          true;
        autoSchemes     false;
        nCorr           0;
        resetOnStartUp false;
        

        fvOptions
        {
            IncrementTime 
            {
            type            scalarSemiImplicitSource;
            active          true;
            selectionMode   all;
            cellZone        Layers;
                scalarSemiImplicitSourceCoeffs
                {
                    volumeMode  specific;
                    injectionRateSuSp
                    {
                        Tracer       (1 0);
                    }
                }
            }
        }
    }
}
So how could I run it independently of
HTML Code:
pimpleFoam
?
kingjewel1 is offline   Reply With Quote

Old   December 7, 2015, 07:59
Default
  #63
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

you have to make a new solver which solves this equation.
Just modify the scalarTransportFoam.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 13, 2016, 17:26
Default
  #64
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by Tobi View Post
Hi,

you have to make a new solver which solves this equation.
Just modify the scalarTransportFoam.
Dear Tobi,

Is there any reason that one has to make a new solver and not to use the function object?
Using FO seems easier and I see no difference. Is there anything I am missing?

Best.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   June 13, 2016, 18:09
Default
  #65
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
It should work too
The problem is a bit older. When I made the first solver there was no possibility to do it with functions. Hence, I never tried it.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 23, 2017, 15:58
Default
  #66
Member
 
a_habib's Avatar
 
Ahmad Habib
Join Date: Nov 2014
Location: Aleppo, Syria
Posts: 53
Rep Power: 11
a_habib is on a distinguished road
Hello foamers.

I recently switched my working field to the thermal comfort analyses and I when I searched about that in OpenFOAM I find this code:
https://sourceforge.net/projects/openfoamadd-ons/
And by reading the code I noticed that it can calculate the mean age of air and the ventilating efficiency and some other thermal comfort indicators (PMV, PPD, etc).

But I didn't found any example of using it or weather it could be used in the steady state cases or what, so if any one used it or have any knowledge about something similar it would be great to share that with us

Regards.
a_habib is offline   Reply With Quote

Old   January 27, 2017, 13:12
Default
  #67
Senior Member
 
tian's Avatar
 
Tian
Join Date: Mar 2009
Location: Berlin, germany
Posts: 119
Rep Power: 17
tian is on a distinguished road
Hi,

here is a link for the download: comfortFoam

https://bitbucket.org/shor-ty/comfor...AM-4.x#commits

Bye
Tian


Sent from my iPhone using CFD Online Forum mobile app
Tobi likes this.
__________________
BIM HVACTool, The Green Building Simulation Tool for OpenFOAM, Energy Plus and Radiance.
tian is offline   Reply With Quote

Old   January 28, 2017, 14:08
Default
  #68
Member
 
a_habib's Avatar
 
Ahmad Habib
Join Date: Nov 2014
Location: Aleppo, Syria
Posts: 53
Rep Power: 11
a_habib is on a distinguished road
Hi Mr Tain

Please bear with me because I have a lot of questions.

I'm using OpenFOAM 2.3.0 on Ubuntu 14.04 and after pasting the cloning code into my terminal inside the openFOAM directory, a new folder named "comfortFoam" created containing only a readme file with the same containing of the web site.

Now the web site says:

NOT IMPLEMENTED TILL NOW (so we can't use it ?, if so, when we can use it?)

How to compile it
- use git for cloning (and I think that I did that, correct?)
- change to the branch (is that means to select 2.3.x ?, if so, how I can do that?, if not, what is that means ?)
- compile with wmake (so it is not a dynamic library, correct?, so how we can use it? is it calculates the AoA, PMV, ... etc for the calculated results so I should use it after the simulation is finished? is this simulation is a steady state or transient one?

And thanks for your time

Regards

Ahmad
a_habib is offline   Reply With Quote

Old   January 31, 2017, 08:46
Default
  #69
Senior Member
 
tian's Avatar
 
Tian
Join Date: Mar 2009
Location: Berlin, germany
Posts: 119
Rep Power: 17
tian is on a distinguished road
Hi,

That is correct. This is a post processing tool. You run it after your solution. Age of Air can run during your simulation via controlDict. No need to do it in comfortFoam.

I think comfortFoam is running under 4 version and 16+, too.

Bye ä
Thomas


Sent from my iPhone using CFD Online Forum mobile app
a_habib likes this.
__________________
BIM HVACTool, The Green Building Simulation Tool for OpenFOAM, Energy Plus and Radiance.
tian is offline   Reply With Quote

Old   January 31, 2017, 08:47
Default
  #70
Senior Member
 
tian's Avatar
 
Tian
Join Date: Mar 2009
Location: Berlin, germany
Posts: 119
Rep Power: 17
tian is on a distinguished road
Hi,

You download via website or git. Than only run: wmake. It create a new tool: comfortFoam.

Bye
Thomas


Sent from my iPhone using CFD Online Forum mobile app
a_habib likes this.
__________________
BIM HVACTool, The Green Building Simulation Tool for OpenFOAM, Energy Plus and Radiance.
tian is offline   Reply With Quote

Old   February 16, 2017, 03:12
Exclamation Compile error
  #71
Member
 
a_habib's Avatar
 
Ahmad Habib
Join Date: Nov 2014
Location: Aleppo, Syria
Posts: 53
Rep Power: 11
a_habib is on a distinguished road
Dear tian

I copied the files from the site and I got this error when I tried to compile it,

Code:
a-habib@ahmad-PC:~/OpenFOAM/a-habib-4.x/comfortfoam$ wmake
Making dependency list for source file comfortFoam.C
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/home/a-habib/OpenFOAM/OpenFOAM-4.x/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/a-habib/OpenFOAM/OpenFOAM-4.x/src/TurbulenceModels/incompressible/lnInclude -I/home/a-habib/OpenFOAM/OpenFOAM-4.x/src/transportModels -I/home/a-habib/OpenFOAM/OpenFOAM-4.x/src/transportModels/incompressible/singlePhaseTransportModel -I/home/a-habib/OpenFOAM/OpenFOAM-4.x/src/thermophysicalModels/radiation/lnInclude -I/home/a-habib/OpenFOAM/OpenFOAM-4.x/src/finiteVolume/lnInclude -I/home/a-habib/OpenFOAM/OpenFOAM-4.x/src/meshTools/lnInclude  -IlnInclude -I. -I/home/a-habib/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude -I/home/a-habib/OpenFOAM/OpenFOAM-4.x/src/OSspecific/POSIX/lnInclude   -fPIC -c comfortFoam.C -o Make/linux64Gcc48DPInt32Opt/comfortFoam.o
In file included from /usr/include/stdint.h:25:0,
                 from /home/a-habib/OpenFOAM/ThirdParty-4.x/platforms/linux64/gcc-4.8.4/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/include/stdint.h:9,
                 from /home/a-habib/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/int32.H:40,
                 from /home/a-habib/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/int.H:38,
                 from /home/a-habib/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/label.H:39,
                 from /home/a-habib/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/labelList.H:47,
                 from /home/a-habib/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/UPstream.H:42,
                 from /home/a-habib/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/Pstream.H:42,
                 from /home/a-habib/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/parRun.H:35,
                 from /home/a-habib/OpenFOAM/OpenFOAM-4.x/src/finiteVolume/lnInclude/fvCFD.H:4,
                 from comfortFoam.C:52:
/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
 #  include <sys/cdefs.h>
                         ^
compilation terminated.
make: *** [Make/linux64Gcc48DPInt32Opt/comfortFoam.o] Error 1
a-habib@ahmad-PC:~/OpenFOAM/a-habib-4.x/comfortfoam$
Any clue about that I how I can fix it
Thanks in advance

Last edited by a_habib; February 16, 2017 at 04:59.
a_habib is offline   Reply With Quote

Old   February 16, 2017, 03:16
Default
  #72
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
Quick random guess:
What is your gcc version?
a_habib likes this.
floquation is offline   Reply With Quote

Old   February 16, 2017, 03:22
Default
  #73
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Habib,

it seems that you installed OpenFOAM either you compiled it yourself, right? The message of the compiler is not related to the application you try to compile it is an essential packaged that is missing on your system for c++. It is a standard library that you need to compile the application. I am too lazy to search for your but »here we go« ... It is not really polite, I know, but as a supporter I want that the questioner thinks about the problem :P. Good luck.

PS: By the way it is TIAN not TAIN.

PPS: In addition, you have to switch to the branch for your OpenFOAM version. That is my fault because I have no time to update the readme till now.
Code:
git checkout
a_habib likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 16, 2017, 03:59
Default
  #74
Senior Member
 
tian's Avatar
 
Tian
Join Date: Mar 2009
Location: Berlin, germany
Posts: 119
Rep Power: 17
tian is on a distinguished road
Hi, install libc6 and libc6-dev . Bye Thomas


Sent from my iPhone using CFD Online Forum mobile app
a_habib likes this.
__________________
BIM HVACTool, The Green Building Simulation Tool for OpenFOAM, Energy Plus and Radiance.
tian is offline   Reply With Quote

Old   February 16, 2017, 05:07
Default
  #75
Member
 
a_habib's Avatar
 
Ahmad Habib
Join Date: Nov 2014
Location: Aleppo, Syria
Posts: 53
Rep Power: 11
a_habib is on a distinguished road
I'm really sorry for my mistake, I corrected it
I'm using a precompiled OP from http://rheologic.net and i know that i needed some packages to complete but my experience is not enough to figure it out

PS I don't have any experience in git that's why I rely on others in that
I'll try again
Thanks a lot
a_habib is offline   Reply With Quote

Old   February 16, 2017, 05:45
Default
  #76
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
For git you need to do the following:

Code:
git checkout <tab><tab>
HEAD                    OpenFOAM-4.x            origin/OpenFOAM-2.3.x 
master                  origin/HEAD             origin/OpenFOAM-4.x 
OpenFOAM-2.3.x          origin/master
Then check out what you need. Honestly I only have it for 2.3.x and 4.x:
Code:
git checkout OpenFOAM-4.x
And then you can compile it. However if the compilation fails, do that:
Code:
sudo apt-get install build-essential flex bison git-core cmake zlib1g-dev libboost-system-dev libboost-thread-dev libopenmpi-dev openmpi-bin gnuplot libreadline-dev libncurses-dev libxt-dev
I totally understand that not everybody is familiar with git and programming but however, I am trying to force people to think about the questions they ask in order to improve their skills. E.g. your first error message was just related to a missing header. Searching in google will lead you directly to the missing packages
a_habib likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 16, 2017, 14:15
Thumbs up It worked
  #77
Member
 
a_habib's Avatar
 
Ahmad Habib
Join Date: Nov 2014
Location: Aleppo, Syria
Posts: 53
Rep Power: 11
a_habib is on a distinguished road
Dear Tobias

Thanks a lot for your effort and I'm really sorry for being such a lazy one

I had to install a lot of things after some updating

Code:
sudo apt-get update

sudo apt-get install build-essential flex bison git-core cmake zlib1g-dev libboost-system-dev libboost-thread-dev libopenmpi-dev openmpi-bin gnuplot libreadline-dev libncurses-dev libxt-dev
and to compile 32 on 64

Code:
sudo apt-get install libx32gcc-4.8-dev

sudo apt-get install libc6-dev-i386

LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/lib32:$LIBRARY_PATH 
export LIBRARY_PATH
Thanks again
Tobi likes this.
a_habib is offline   Reply With Quote

Old   February 20, 2017, 15:02
Smile Some Questions
  #78
Member
 
a_habib's Avatar
 
Ahmad Habib
Join Date: Nov 2014
Location: Aleppo, Syria
Posts: 53
Rep Power: 11
a_habib is on a distinguished road
Dear Tobi,

I tried to use the comfortFoam tool on the hotRoom tutorial using buoyantBoussinesqPimpleFoam (as a rough start) and -thanks to you- it worked as it says in its description, and in the end i got this message (No AoA file found in last time dictionary Skip calculation of AoA) when the { if (AoAHeader.headerOk())} wasn't satisfied, so, as it's obvious I need the AOA filed in the case files. could it be like this? (not in the hotRoom case, I mean generally)

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      AOA;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 -1 0 0 0 0]; // or [0 0 1 0 0 0 0 ];

internalField   uniform 0;

boundaryField
{

    inlet
    {
        type            fixedValue;
        value           uniform 0;
    }
    outlet
    {
        type            zeroGradient;
    }
    walls
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //
And while I was reading the source file (comfortFoam.c) I noticed a few things that I want to ask about if you don't mind.

Does it calculate the AOA only in the last time step? because I saw that it is reading the AOAHeader and creating the volScalarField nut and solving the AOAEqn only if (i+1==endTime)

Code:
        //- If last time, calcualte AoA
        if (i+1 == endTime)
        {
            Info << "Read header of AoA file if available" << endl;

            IOobject AoAHeader
            (
                "AoA",
                runTime.timeName(),
                mesh,
                IOobject::READ_IF_PRESENT
            );

            if (AoAHeader.headerOk())
            {
                Info<< "Create field AoA\n" << endl;

                volScalarField AoA(AoAHeader, mesh);

                Info<< "Backup original AoA file to AoA.old\n" << endl;

                mvBak(AoA.objectPath(), "old");

                #include "createPhi.H"

                Info<< "Create field nut\n" << endl;

                const volScalarField nut 
                (
                    IOobject
                    (
                        "nut",
                        runTime.timeName(),
                        mesh,
                        IOobject::MUST_READ,
                        IOobject::AUTO_WRITE
                    ),
                    mesh
                );

                int count = 0;

                while (true)
                {
                    fvScalarMatrix AoAEqn
                    (
                        
                        fvm::ddt(AoA)
                      + fvm::div(phi, AoA)
                      - fvm::laplacian(nut, AoA)
                      ==
                        dimensionedScalar
                        (
                            "ageSource",
                            AoA.dimensions()*dimensionSet(0,0,-1,0,0,0,0),
                            scalar(1)
                        )
                    );

                    AoAEqn.relax();

                    AoAEqn.solve();

                    count++;
.
.
.
Also I saw that the AOA won't be written unless the count > 500, what is this means?

At last, I noticed that you had uncommented the calculation of the mid, max AOA and the AE, so if I recommented these lines back it should work, correct? or you'r blanning to modify some thing?

Code:
if (count > 500)
                    {
                        AoA.write();
//
//                        scalar cellsum(0);
//                        scalar midAoA(0);
//                        scalar volume(0);
//            
//                        forAll(mesh.cells(), cellI)
//                        {
//                            midAoA += AoA[cellI] * mesh.V()[cellI];
//                            volume += mesh.V()[cellI];
//                            cellsum++;
//                        };
//            
//                        scalar maxValue = max(AoA).value();
//            
//                        Info<< "Average age of air "
//                            << (midAoA/volume) << " s\n"
//                            << "Maximum age of air "
//                            << maxValue << " s\n";
//            
//                        // AE = (Tn/2TM) x 100 %
//                        Info<< "Room volume "
//                            << gSum(mesh.V()) << " m3\n";
//                            << "Ventilation efficiency AE = "
//                            << (gSum(mesh.V())/sumZuluft)/(2*(maxValue/3600))
//                            << " %" << endl;

                        break;
                    }
Thanks a lot for your great effort.

Regards,

Ahmad.
a_habib is offline   Reply With Quote

Old   February 23, 2017, 03:52
Default
  #79
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Ahmad,

first of all thank you for the feedback but the fruits should go more to Thomas Tian because he programmed it and asked me if I can extend it and or host it. Till now I just changed a few things like:
  • Formatting
  • Cleaning
  • Hosting
  • Rebuild for different FOAM-Versions
  • An extreme speedup based on a wrong build of an large array
  • Optimization to the code

You are right, if you want to calculate the mean time of the air you have to put a file to the last time step which looks like you had. The 500 times is like that we calculate the matrix 500 times in order to get an accurate solution. This implementation is stupid and I wanted to change it some when but no time. Now, I even think the whole calculation of AoA is not correct because it does not make sense for me at the moment :P. I will not work on that code till a new version is out and I have to re-build it for the new FOAM-version (if necessary). In addition, I should split the code into more files.


PS: If you think about the equation AoAEqn, you will understand that it should be definitely wrong, right? But I have to check.
a_habib likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 23, 2017, 08:16
Default
  #80
Member
 
a_habib's Avatar
 
Ahmad Habib
Join Date: Nov 2014
Location: Aleppo, Syria
Posts: 53
Rep Power: 11
a_habib is on a distinguished road
Ok dear Tobi
Thanks for the response and I'll keep looking into it and waiting for the update


Sent from my iPhone using CFD Online Forum mobile app
a_habib 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
air bubble is disappear increasing time using vof xujjun CFX 9 June 9, 2009 07:59
local age of air in starccm+ Mike23 Siemens 3 September 20, 2008 11:16
[Indoor Air Quality]How do I calcauate "Age of Air Young CFX 6 April 28, 2008 23:14
age of air teddy Siemens 3 February 9, 2007 09:41
Age of Air In Star-CD Ted Crilly Siemens 1 February 19, 2005 19:50


All times are GMT -4. The time now is 17:41.