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

ouput function at different times than the solver writing times?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2020, 10:25
Default ouput function at different times than the solver writing times?
  #1
Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 59
Rep Power: 2
otaolafr is on a distinguished road
Hello everybody,

me again, I excuse myself for another question, I tried to find any information in the user guide or here, but could not find anything....

I am doing a transient simulation, and stocking the results each x times:
for example:
Code:
startTime       0;

stopAt          endTime;

endTime         0.1;

deltaT          0.0001;

writeControl    timeStep;

writeInterval   50;
so it will save the values of the solver each 50*0.0001,
so i will get 0;0.0050; 0.01.
i am using also a function to calculate the integral of a field in a patch, and the only option from the example i found was
Code:
        writeControl    writeTime;
so it will save the information for the same times that the solver saves it, but as it is a lot less of information, i would like it to save it at each time, so 0; 0.0001; 0.0002 ... etc. I could not find any info in the user manual, neither here (i was not sure how to search for it in the forum...)

i am sure that is a simple change of a word but i could not find the options that i can choose.
i tried to put something wrong in writeControl to have an error and follow that path but little bit lost of how to procede from the error.
Code:
From function Enum Foam::NamedEnum<Enum, nEnum>::read(Foam::Istream&) const [with Enum = Foam::timeControl::timeControls; unsigned int nEnum = 8]
    in file lnInclude/NamedEnum.C at line 69.
best regards, franco
otaolafr is offline   Reply With Quote

Old   May 18, 2020, 16:52
Default
  #2
HPE
Senior Member
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 583
Rep Power: 5
HPE is on a distinguished road
Hi,

- Never excuse yourself for a question.
- Assuming you want to set write controls for a function object, e.g. vorticity function object, you can set the following entries for `writeControl`:

Code:
Option            | Description
none              | Trigger is disabled
timeStep          | Trigger every 'Interval' time-steps, e.g. every x time steps
writeTime         | Trigger every 'Interval' output times, i.e. alongside standard field output
runTime           | Trigger every 'Interval' run time period, e.g. every x seconds of calculation time
adjustableRunTime | Currently identical to "runTime"
clockTime         | Trigger every 'Interval' clock time period
cpuTime           | Trigger every 'Interval' CPU time period
onEnd             | Trigger on end of simulation run
- For a function object documentation, links below and/or https://www.openfoam.com/documentati...n-objects.html

- You can also have conditional writing by using `runTimeControl` function object: https://www.openfoam.com/documentati...e-control.html

- If you want to see the available options for an entry, e.g. `writeControl`, do write `writeControl banana;` and execute OpenFOAM which will return an error message with alternatives.

Hope these help.
HPE is offline   Reply With Quote

Old   May 19, 2020, 02:51
Default
  #3
Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 59
Rep Power: 2
otaolafr is on a distinguished road
Quote:
Originally Posted by HPE View Post
Hi,

- Never excuse yourself for a question.
- Assuming you want to set write controls for a function object, e.g. vorticity function object, you can set the following entries for `writeControl`:

Code:
Option            | Description
none              | Trigger is disabled
timeStep          | Trigger every 'Interval' time-steps, e.g. every x time steps
writeTime         | Trigger every 'Interval' output times, i.e. alongside standard field output
runTime           | Trigger every 'Interval' run time period, e.g. every x seconds of calculation time
adjustableRunTime | Currently identical to "runTime"
clockTime         | Trigger every 'Interval' clock time period
cpuTime           | Trigger every 'Interval' CPU time period
onEnd             | Trigger on end of simulation run
- For a function object documentation, links below and/or https://www.openfoam.com/documentati...n-objects.html

- You can also have conditional writing by using `runTimeControl` function object: https://www.openfoam.com/documentati...e-control.html

- If you want to see the available options for an entry, e.g. `writeControl`, do write `writeControl banana;` and execute OpenFOAM which will return an error message with alternatives.

Hope these help.
hi!
I know but i am feeling guilty to post so much.... ehehe but thanks, and thank you a lot, for all your answers, I will respond directly here

thanks, now an small question i have from this:
EDIT: i just realise, it is because in one it is clarified "writeInterval" equal to 10 and in the other one no,so it is the default (1) (i leave the question anyway if someone needs it)
what i do not get is that i have runStep in the two sections in the controlDict, the "main" where it gives indication for the simpleFoam, and inside the defined function object.
evethought the two of them have "runStep" (and as clarification, it is giving me exactly what i wanted... it is only to understand better)
the simpleFoam stocks data only when the writeInterval is finish, but the function object, each iteration.
i mean if i have:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     simpleFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         21;

deltaT          1;

writeControl    timeStep;

writeInterval   10;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{
//#includeFunc residuals
pAverageInlet
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");

        log             false;
		writeControl    timeStep;//writeTime;
        writeFields     true;
		surfaceFormat 	none;
        regionType      patch;
        name            inlet;
        operation       areaIntegrate;
        fields
		(
		p
		);
    }
}
}

// ************************************************************************* //
i the code is saving info for the fields U and p at 0, 10, 20 (from simpleFoam)
but in the postProcessing/pAverageInlet/0/surfaceFieldValue.dat i have the values for all of it, from 0 to 21 (0, 1, 2, 3 ... etc)
but they have the two of them the same writeControl...


Quote:
- If you want to see the available options for an entry, e.g. `writeControl`, do write `writeControl banana;` and execute OpenFOAM which will return an error message with alternatives.
i tried to do this,i was my first reflex to do but i only got this when i put something random:
Quote:
From function Enum Foam::NamedEnum<Enum, nEnum>::read(Foam::Istream&) const [with Enum = Foam::timeControl::timeControls; unsigned int nEnum = 8]
in file lnInclude/NamedEnum.C at line 69.
best regards (and thanks again!), F

Last edited by otaolafr; May 19, 2020 at 05:19.
otaolafr is offline   Reply With Quote

Old   May 22, 2020, 07:53
Default
  #4
Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 59
Rep Power: 2
otaolafr is on a distinguished road
Quote:
Originally Posted by HPE View Post
Hi,

- Never excuse yourself for a question.
- Assuming you want to set write controls for a function object, e.g. vorticity function object, you can set the following entries for `writeControl`:

Code:
Option            | Description
none              | Trigger is disabled
timeStep          | Trigger every 'Interval' time-steps, e.g. every x time steps
writeTime         | Trigger every 'Interval' output times, i.e. alongside standard field output
runTime           | Trigger every 'Interval' run time period, e.g. every x seconds of calculation time
adjustableRunTime | Currently identical to "runTime"
clockTime         | Trigger every 'Interval' clock time period
cpuTime           | Trigger every 'Interval' CPU time period
onEnd             | Trigger on end of simulation run
- For a function object documentation, links below and/or https://www.openfoam.com/documentati...n-objects.html

- You can also have conditional writing by using `runTimeControl` function object: https://www.openfoam.com/documentati...e-control.html

- If you want to see the available options for an entry, e.g. `writeControl`, do write `writeControl banana;` and execute OpenFOAM which will return an error message with alternatives.

Hope these help.
hi HPE,

sorry to bother you (again), I wanted to do a mass flow average of the field T at the patch outlet, similar to this (http://openfoamwiki.net/index.php/Co...vailable_types)
as I am stock with OF without the possibility to compile extras, and from what I have read in the documentation that you forwarded me for the function objects, could you confirm me, if I am doing correct workflow?

Code:
TAverageOutlet
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");

        log             false;
	writeControl    timeStep;//https://www.openfoam.com/documentation/guides/latest/doc/guide-function-objects.html
	writeInterval   1;
        writeFields     true;
	surfaceFormat 	none;
        regionType      patch;
        name            outlet;
        operation       weightedAverage;
        fields(T);
        weightField            U;
    }
note that i weight it by U as it is incompressible flow (so it would be the same
than weight it by the massflow) but if not the case, how could I weight it to massflow ( I am asking this to learn how i could do this in case that i need it for something else)?

best regards, franco
otaolafr is offline   Reply With Quote

Reply

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
[ANSYS Meshing] Help with element size sandri_92 ANSYS Meshing & Geometry 14 November 14, 2018 07:54
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 04:16
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 06:59
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


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