|
[Sponsors] |
ouput function at different times than the solver writing times? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 18, 2020, 10:25 |
ouput function at different times than the solver writing times?
|
#1 |
Senior Member
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6 |
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 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; 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. |
|
May 18, 2020, 16:52 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 12 |
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 - 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.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
May 19, 2020, 02:51 |
|
#3 | |||
Senior Member
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6 |
Quote:
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 ); } } } // ************************************************************************* // 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:
Quote:
Last edited by otaolafr; May 19, 2020 at 05:19. |
||||
May 22, 2020, 07:53 |
|
#4 | |
Senior Member
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6 |
Quote:
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; } 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 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 17:22 |
[ANSYS Meshing] Help with element size | sandri_92 | ANSYS Meshing & Geometry | 14 | November 14, 2018 07:54 |
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 |