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

fieldAverage1 question

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Richard97

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2020, 12:31
Default fieldAverage1 question
  #1
Member
 
Jan Majcher
Join Date: Nov 2018
Posts: 39
Rep Power: 8
MaySea is on a distinguished road
Hi all,

I am trying to run a simulation, where a timeStep is 0.1, the output is saved each 500 time steps (meaning 50s). Additionally, I want to have averages of all the fields each 100 seconds (therefore the average should be calculated each 1000 timeSteps. My timeEnd is 1000, meaning that I want 10 averages (each 100 seconds).

I need to admit that I totally don't get the

restartOnRestart
restartOnOutput
periodicRestart

fields, even after reading the documentation. restartOnRestart seems totally non-intuitive to me, restartOnOutput means that averaging is restarted upon every output I guess and periodicRestart should restart the averaging every x seconds. Are periodicRestart units in timeStep units or rather simulation run time? E.g. if I set it as 100, will it restart every 100 timeSteps or rather 100 s of sim runtime? I realise that these are quite basic questions, but I got lost after multiple attempts.

Here is my control dict, which unfortunately doesn't serve the purpose. Any suggestions how should I amend it? Thanks a million to anyone willing to help.


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

application     pimpleFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         1000;

deltaT          0.1;

writeControl    timeStep;

writeInterval   500;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


functions

{

wallShearStress1
{
    // Mandatory entries (unmodifiable)
    type            wallShearStress;
    libs            ("libfieldFunctionObjects.so");

    // Optional entries (runtime modifiable)
    patches         ("barkley"); 

    // Optional (inherited) entries
    writePrecision  8;
    writeToFile     true;
    useUserTime     true;
    enabled         true;
    log             true;
    timeStart       0;
    timeEnd         1000;
    executeControl  timeStep;
    executeInterval 1;
    writeControl    timeStep;
    writeInterval   500;
}

fieldAverage1                                                                                                                                                       
    {                                                                                                                                                                   
        type                fieldAverage;                                                                                                                               
        libs                ("libfieldFunctionObjects.so");                                                                                                             
                                                                                                                                                                        
        writeControl    writeTime;   //maybe timeStep instead?                                                                                                                                   
                                                                                                                                                                        
        restartOnRestart    false;                                                                                                                                      
        restartOnOutput     false;                                                                                                                                      
        periodicRestart     true;                                                                                                                                      
        restartPeriod       100;                                                                                                                                      
                                                                                                                                                                        
        fields                                                                                                                                                          
        (                                                                                                                                                               
            U                                                                                                                                                           
            {                                                                                                                                                           
                mean            on;                                                                                                                                     
                prime2Mean      off;                                                                                                                                     
                base            time;  //maybe timeStep?                                                                                                                                 
                window          100.0; //maybe 1000 with timeStep as base?                                                                                                                                   
                windowName      w1;                                                                                                                                     
            }                                                                                                                                                           
            p                                                                                                                                                           
            {                                                                                                                                                           
                mean            on;                                                                                                                                     
                prime2Mean      off;                                                                                                                                     
                base            time;
		window          100.0;                                                                                                                                   
                windowName      w1;    				
				
            }
  	     k
	     {                                                                                                                                                           
                mean            on;                                                                                                                                     
                prime2Mean      off;                                                                                                                                     
                base            time;
		window          100.0;                                                                                                                                   
                windowName      w1;    				
            }
	    epsilon
	    {                                                                                                                                                           
                mean            on;                                                                                                                                     
                prime2Mean      off;                                                                                                                                     
                base            time;  
		window          100.0;                                                                                                                                   
                windowName      w1;    				
            }
            wallShearStress
	    {
		 mean        on;
		 prime2Mean  off;
		 base        time;
	         window          100.0;                                                                                                                                   
                 windowName      w1;    
	     }
        );                                                                                                                                                              
    }   

}


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

Last edited by MaySea; September 24, 2020 at 12:52.
MaySea is offline   Reply With Quote

Old   September 25, 2020, 09:58
Default Similar Problem
  #2
New Member
 
Join Date: Sep 2020
Posts: 3
Rep Power: 6
Richard97 is on a distinguished road
Been having a similar issue with the averaging, anyone able to resolve this for me?
MaySea likes this.
Richard97 is offline   Reply With Quote

Old   November 4, 2020, 14:53
Default
  #3
Member
 
Jan Majcher
Join Date: Nov 2018
Posts: 39
Rep Power: 8
MaySea is on a distinguished road
Hi,

I am still having the problem.

Code:
fieldAverage1                                                                                                                                                       
    {                                                                                                                                                                   
        type                fieldAverage;                                                                                                                               
        libs                ("libfieldFunctionObjects.so");                                                                                                             
                                                                                                                                                                        
        executeControl  timeStep;
		executeInterval 1;
		writeControl    adjustableRunTime;
		writeInterval   100; 
                                                                                                                                                                        
        restartOnRestart   	false;                                                                                                                                      
        restartOnOutput     false;                                                                                                                                      
        periodicRestart     true; 
		restartPeriod       100;
                                                                                                                                                                        
        fields                                                                                                                                                          
        (                                                                                                                                                               
            U                                                                                                                                                           
            {                                                                                                                                                           
                mean            on;                                                                                                                                     
                prime2Mean      off;    
				base 			time;
				window       100.0;
				windowName   w100;
				allowRestart true;
					
                                                                                                                              
            }                                                                                                                                                           
            p                                                                                                                                                           
            {                                                                                                                                                           
                mean            on;                                                                                                                                     
                prime2Mean      off;                                                                                                                                     
				base 			time;
				window       100.0;
				windowName   w100;
				allowRestart true;
				
            }
  			k
			{                                                                                                                                                           
                mean            on;                                                                                                                                     
                prime2Mean      off;                                                                                                                                     
				base 			time;
				window       100.0;
				windowName   w100;
				allowRestart true;
            }
			omega
			{                                                                                                                                                           
                mean            on;                                                                                                                                     
                prime2Mean      off;                                                                                                                                     
				base 			time;
				window       100.0;
				windowName   w100;
				allowRestart true;
            }
			wallShearStress
			{
				mean        on;
				prime2Mean  off;
				base 			time;
				window       100.0;
				windowName   w100;
				allowRestart true;
			}
        );                                                                                                                                                              
    }   

}
This averaging doesn't work - my averaged fields are exactly the same as fields calculated for the given time steps. Does anyone see what's wrong here?

Thanks,
Jan
MaySea is offline   Reply With Quote

Reply

Tags
averaging, controldict, functions, openfoam 6


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
Question about symmetry in Autodesk Cfd 2016 ecto Autodesk Simulation CFD 0 October 20, 2015 05:16
small question about the functionalities of topological changes in OpenFoam ngj OpenFOAM Running, Solving & CFD 2 February 28, 2013 11:02
Question Re Engineering Data Source imnull ANSYS 0 March 5, 2012 14:51
internal field question - PitzDaily Case atareen64 OpenFOAM Running, Solving & CFD 2 January 26, 2011 16:26
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 05:37


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