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

age functionObject writes every timestep in processor directories, how to change?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 3, 2022, 05:57
Post age functionObject writes every timestep in processor directories, how to change?
  #1
Member
 
Join Date: Oct 2011
Posts: 56
Rep Power: 15
fanta is on a distinguished road
Hi, here is my controlDict. I noticed that my age functionObject is written in every single timestep in the processordirectories. That's not needed. How do i write the age functionObject only in the last timestep?

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

#include "../masterfile"

application     MYsimpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         4000;

deltaT         	1;

writeControl    timeStep;

writeInterval   200;

purgeWrite      0;

writeFormat     binary;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions {
	age
	{
        type            scalarTransport;
	    libs            (solverFunctionObjects);
	

	    // Optional entries

		// Name of scalar field to transport, default = 's'
		field           age;

		// Name of flux field, default = 'phi'
		phi             phi;

		// Name of density field for compressible cases, default = 'rho'
		rho             rho;
	
		// Name of phase field to constrain scalar to, default = 'none'
		phase           none;

		// Set the scalar to zero on start/re-start
		resetOnStartUp  no;

		// Name of field to use when looking up schemes from fvSchemes
		// default = <field>
		schemesField    U;

		// Diffusivity
	
		// Fixed value diffusivity
		D               #eval{ $k_/$dichte_/$cp_ };
	
		// Name of field to use as diffusivity, default = 'none'
		nut             none;

    	// Run-time selectable sources
    	fvOptions
    	{
		IncrementTime
			{
				type            scalarSemiImplicitSource;
				active          true;
				scalarSemiImplicitSourceCoeffs
				{
					selectionMode all;
					volumeMode  specific;
					injectionRateSuSp
					{
						age       (1 0);
					}
				}
			}
    	}
	}
}

libs
(
  "libMYLIB.so"
);

// ************************************************************************* //
fanta is offline   Reply With Quote

Old   August 4, 2022, 05:03
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hi Fanta,

You can use writeControl and writeInterval parameters inside your function object in order to manage when the data is written.

https://www.openfoam.com/documentati...n-objects.html

Regards,
Yann
fanta likes this.
Yann 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
[OpenFOAM] Can't change timestep on a decomposed case with python scripts Gambenius ParaView 1 May 21, 2020 10:16
How to use "translation" in solidBodyMotionFunction in OpenFOAM rupesh_w OpenFOAM Running, Solving & CFD 5 August 16, 2016 05:27
Timestep and Pressure Correction Relationship in SIMPLE rks171 Main CFD Forum 23 May 4, 2012 02:04
change timestep after a certain iteration number Sans CFX 5 June 3, 2007 06:17
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


All times are GMT -4. The time now is 00:58.