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

CO2 and Age of Air

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 25, 2022, 09:56
Default CO2 and Age of Air
  #1
Member
 
Ben Simpson
Join Date: Dec 2019
Location: UK
Posts: 32
Rep Power: 7
b.simpson is on a distinguished road
Hi,

I have a simple natural ventilation model using OpenFOAM v8. It uses the buoyantSimpleFoam and k-omega SST.

The aim of the model is to predict the ventilation performance. Part of this requires sampling an internally generated contaminant (CO2) and the age of the air.

The model appears to be running and converging correctly but when I calculate the ventilation performance metrics using the predicted CO2 and age of air I am getting unrealistic metric values.

I have included the main files used for generating and sampling the CO2 and age of air. Can anyone see any mistakes or issues with the way I am modelling these two fields?

I have also attached a compressed version of my model if that helps.

Thank you for any assistance.

Regards,
Ben

controlDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  | Model:    VE_Practice                           |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     buoyantSimpleFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         5000;

deltaT          1;

writeControl    timeStep;

writeInterval   1000;

purgeWrite      3;

writeFormat     ascii;

writePrecision  8;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

/*libs (
      "libOpenFOAM.so"
      "libsimpleSwakFunctionObjects.so"
      "libswakFunctionObjects.so"
      "libgroovyBC.so"
     );*/

functions
{
	#include "surfaces"
	#include "surfaces2"
	  
	CO2
		{
			type    			scalarTransport;
			libs 				("libsolverFunctionObjects.so");
			writeControl       	timeStep;
			writeInterval      	1;
			active          	true;
			autoSchemes     	false;
			nCorr           	0;
			resetOnStartUp 		false;
			field				CO2;
			fvOptions       
			{
				generalSource
				{
					type            semiImplicitSource;
					active          true;
					selectionMode	cellZone;
					cellZone		spaceZone;
					volumeMode		absolute;
					sources
					{
						CO2
						{
							explicit	1;
							implicit	0;
						}
					}
				}
			}
		}
		
	comfortAnalysis
		{
			type            comfort;
			libs            ("libfieldFunctionObjects.so");
			
			metabolicRate	1.2;
			clothing		0.7;
			extWork			0.0;

			executeControl  writeTime;
			writeControl    writeTime;

		}
		
	AoA
		{
			type    scalarTransport;
			libs 	("libutilityFunctionObjects.so");
			enabled true;
			writeControl writeTime;
			log yes;
			nCorr 1;

			field AoA;
			active          true;
			autoSchemes     false;
			resetOnStartUp false;
			DT              1e-5;
			nCorr 0;

			fvOptions
			{
				IncrementTime
				{
					type            semiImplicitSource;
					active          true;
					selectionMode all;
					volumeMode  specific;
					sources
					{
						AoA
						{
							explicit 1;
							implicit 0;
						}
					}
				}
			}
		}
	
	fieldMinMax
		{
			type                fieldMinMax;
			libs  				("libfieldFunctionObjects.so");
			log                 true;
			writeControl       	writeTime;
			//writeInterval      	1;
			//mode              magnitude;
			fields             	( U p T rho CO2 AoA);
		}
		
	breathingZoneAverages
		{
			type            volFieldValue;
			libs            ("libfieldFunctionObjects.so");
			log				true;
			writeControl    writeTime;
			writeFields		true;
			
			regionType		cellZone;
			name			breathingZone;
			
			operation		volAverage;

			fields
			(
				T
				CO2
				U
				PMV
				PPD
				AoA
			);
		}
		
	breathingZoneValuesAvg
		{
			type            volFieldValue;
			libs            ("libfieldFunctionObjects.so");
			log				true;
			writeControl    writeTime;
			writeFields		true;
			
			regionType		cellZone;
			name			breathingZone;
			
			operation		average;

			fields
			(
				T
				CO2
				U
				PMV
				PPD
				AoA
			);
		}
		
	breathingZoneValuesSum
		{
			type            volFieldValue;
			libs            ("libfieldFunctionObjects.so");
			log				true;
			writeControl    writeTime;
			writeFields		true;
			
			regionType		cellZone;
			name			breathingZone;
			
			operation		sum;

			fields
			(
				T
				CO2
				U
				PMV
				PPD
				AoA
			);
		}
	
	spaceVolAverage
		{
			type            volFieldValue;
			libs            ("libfieldFunctionObjects.so");
			log				true;
			writeControl    writeTime;
			writeFields		true;
			
			regionType		cellZone;
			name			spaceZone;
			
			operation		volAverage;

			fields
			(
				T
				CO2
				U
				AoA
			);
		}
		
	spaceAverage
		{
			type            volFieldValue;
			libs            ("libfieldFunctionObjects.so");
			log				true;
			writeControl    writeTime;
			writeFields		true;
			
			regionType		cellZone;
			name			spaceZone;
			
			operation		average;

			fields
			(
				T
				CO2
				U
				AoA
			);
		}
	
	residuals
    {
        type            residuals;
        functionObjectLibs ("libutilityFunctionObjects.so");
        enabled         true;
        writeControl   timeStep;
        writeInterval  1;

        fields
        (
            p_rgh
            U
            k
            omega
		CO2
		e
		AoA
        );
    }
	
	probes
    {
        type            probes;
        libs            ("libsampling.so");
        writeControl    timeStep;
        writeInterval   1;

        fields
        (
            p_rgh
		U
		T
		CO2
		k
		omega
		AoA
        );

        probeLocations
        (
                (1.6 3.1 2)		//convergence point Occ1
		(3.1 3.1 2)		//convergence point Center
	        (4.6 3.1 2)		//convergence point Occ2
        );

    }
}

// ************************************************************************* //
fvSolution:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  | Model:    VE_Practice                           |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-06;
        relTol          0.01;
    }

    "(U|T|CO2|e|k|omega|AoA)"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-05;
        relTol          0.1;
    }

    G
    {
        $p_rgh;
        tolerance       1e-05;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue       0;

    residualControl
    {
        p_rgh           1e-2;
        U               1e-5;
	CO2             1e-4;
        T               1e-2;
        G               1e-3;
	e				1e-2;

        // possibly check turbulence fields
        "(k|omega)" 1e-3;
    }
}

relaxationFactors
{
    fields
	{
	rho             1.0;
        p_rgh           0.9;
    }
    equations
    {
        U               0.1;
	CO2             0.3;
        T               0.5;
	e               0.5;
        "(k|R)" 		0.7;
	P				0.8;
	G               0.7;
	omega           0.7;
	AoA				0.4;
    }
}


// ************************************************************************* //
thermophysicalProperties:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          eConst;
    equationOfState Boussinesq;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        molWeight       28.9;
    }
    equationOfState
    {
        rho0            1;
        T0              300;
        beta            3e-03;
    }
    thermodynamics
    {
        Cv              712;
        Hf              0;
    }
    transport
    {
        mu              1e-05;
        Pr              0.7;
    }
}

CO2
{
    specie
    {
        molWeight       44.01;
    }
    thermodynamics
    {
        Tlow            200;
        Thigh           5000;
        Tcommon         1000;
        highCpCoeffs    ( 4.45362 0.00314017 -1.27841e-06 2.394e-10 -1.66903e-14 -48967 -0.955396 );
        lowCpCoeffs     ( 2.27572 0.00992207 -1.04091e-05 6.86669e-09 -2.11728e-12 -48373.1 10.1885 );
    }
    transport
    {
        As              1.67212e-06;
        Ts              170.672;
    }
}


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

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    "xmin|xmax|ymin|ymax||zmax_north|zmax_south"
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }
    "zmin|Ceiling|Floor|East_Wall|North_Wall|South_Wall|West_Wall|Computer|Person|zmax_ceiling|North_Window|South_Window"
    {
        type            zeroGradient;
    }
	
	#includeEtc "caseDicts/setConstraintTypes"
}


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

dimensions      [0 0 1 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    "xmin|xmax|ymin|ymax|zmax_north|zmax_south"
    {
        type            fixedValue;
        value           uniform 0;
    }
	"zmin|Ceiling|Floor|East_Wall|North_Wall|South_Wall|West_Wall|Computer|Person|zmax_ceiling|North_Window|South_Window"
    {
        type            zeroGradient;
    }
	
	#includeEtc "caseDicts/setConstraintTypes"
}

// ************************************************************************* //
surfaces:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

surfaces
{
    type            surfaces;
    libs            ("libsampling.so");
    writeControl    writeTime;

    surfaceFormat   raw;
    fields          (U T CO2 AoA);

    interpolationScheme cell;

    surfaces
    (
		NorthSlice
        {
            type            cuttingPlane;
            planeType       pointAndNormal;
            pointAndNormalDict
            {
                point   (0 6.15 0);
                normal  (0 1 0);
            }
            interpolate     false;
        }
		SouthSlice
        {
            type            cuttingPlane;
            planeType       pointAndNormal;
            pointAndNormalDict
            {
                point   (0 0.05 0);
                normal  (0 1 0);
            }
            interpolate     false;
        }		
    );
}


// ************************************************************************* //
topoSetDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1906                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
    {
        name    brZoneCells;
        type    cellSet;
        action  new;
        source  boxToCell;
		sourceInfo
		{
			box		(0.7 0.7 0.175) (5.5 5.5 1.9);
		}
    }
    {
        name    breathingZone;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
		sourceInfo
		{
			set     brZoneCells;
		}
    }
	
	{
        name    spaceCells;
        type    cellSet;
        action  new;
        source  boxToCell;
		sourceInfo
		{
			box		(0.1  0.1  0.1) (6.1  6.1  3.1);
		}
    }
    {
        name    spaceZone;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
		sourceInfo
		{
			set     spaceCells;
		}
    }
);

// ************************************************************************* //
Attached Files
File Type: gz model.tar.gz (99.5 KB, 9 views)
b.simpson is offline   Reply With Quote

Old   September 16, 2022, 07:08
Default Any thoughts?
  #2
Member
 
Ben Simpson
Join Date: Dec 2019
Location: UK
Posts: 32
Rep Power: 7
b.simpson is on a distinguished road
Anyone have any advice on this?
b.simpson is offline   Reply With Quote

Reply

Tags
age of air, buoyantsimplefoam, contaminant, k-omega sst


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 change effectiveness in a naturally ventilated building kingjewel1 FLUENT 0 November 30, 2015 16:30
fluent air flow and co2 mix species transport BC cabin e.m.sabry Fluent Multiphase 0 August 29, 2015 10:08
Air Exhalation in Humans saisanthoshm88 Main CFD Forum 1 January 30, 2012 18:14
tracer experiment for age of air Tad CFX 1 October 26, 2003 23:55


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