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

Run function objects on final time

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 11, 2020, 08:15
Default Run function objects on final time
  #1
New Member
 
Ben Simpson
Join Date: Dec 2019
Location: UK
Posts: 18
Rep Power: 3
b.simpson is on a distinguished road
Hi all,

I am running a range of natural ventilation simulations. I have a handful of function objects and two surfaces files that I want to run on the final time/iteration of the simulation once my convergence criteria has been met.

The problem I am having is that when the simulation converges some of my function objects and my two surface files are not getting updated with the results from the final simulation time. The probes and residual function objects are updated correctly at the end of the simulation but my four volFieldValue, FieldMinMax and surface files are not.

Does anyone know if there is a method by which I can either get my simulation to run all my function objects at time of convergence or re-run them after the simulation has finished?

The postProcessing folder is updated correctly with all my function objects and surface files values at the declared writeIntervals in the controlDict. Ideally, I want to find a way for the simulation to automatically update the postProcessing folder at the end of the simulation instead of me having to manually change the writeInterval when the simulation gets close to converging.

I have looked into the postProcess tool but when I use the -list command their is no volFieldValue in the list of function objects. So I am not sure if that function object is available for use with the postProcess tool.

I am using OpenFOAM 8 on Ubuntu 18.04.2. I am running buoyantSimpleFoam in parallel on 6 processors. My simulations are converging correctly and the reconstruct process appears to be working as intended.

Thank you in advance for any support you can provide me.

Kind regards,

Ben

My 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         10000;

deltaT          1;

writeControl    timeStep;

writeInterval   1000;

purgeWrite      3;

writeFormat     ascii;

writePrecision  8;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

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       
			{
			 
			}
		}
		
	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                 yes;
			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
			(
				CO2
			);
		}
	
	spaceAverage
		{
			type            volFieldValue;
			libs            ("libfieldFunctionObjects.so");
			log				true;
			writeControl    writeTime;
			writeFields		true;
			
			regionType		cellZone;
			name			spaceZone;
			
			operation		volAverage;

			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
        );
    }
	
	probes
    {
        type            probes;
        libs            ("libsampling.so");
        writeControl    timeStep;
        writeInterval   1;

        fields
        (
            p_rgh
			U
			T
			CO2
			k
			omega
        );

        probeLocations
        (
            (2.55 1.3 1.5)		//convergence point
        );

    }
}

// ************************************************************************* //
My surface file:
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 5.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;
        }		
    );
}


// ************************************************************************* //
b.simpson is offline   Reply With Quote

Reply

Tags
buoyantsimplefoam, function objects, openfoam 8, postprocessing

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 06:28
pressure in incompressible solvers e.g. simpleFoam chrizzl OpenFOAM Running, Solving & CFD 13 March 28, 2017 06:49
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 03:20
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 05:03
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16


All times are GMT -4. The time now is 23:24.