|
[Sponsors] |
postProcessing - want to stop the headers repeating in surfaceFieldValue.dat |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 16, 2020, 08:46 |
postProcessing - want to stop the headers repeating in surfaceFieldValue.dat
|
#1 |
New Member
Thangasivam
Join Date: Sep 2012
Location: India
Posts: 5
Rep Power: 14 |
Hello,
I am trying to write p, T, U values at inlet while solving. But in surfaceFieldValue.dat, I am seeing headers repeating after every timeStep or deltaT. I would like to stop the repetitive headers. I am attaching the necessary codes / contents of the files. I want Code:
# Region type : patch inlet # Faces : 174 # Area : 1.756255e-04 # Scale factor: 1.000000e+00 # Time areaAverage(p) areaAverage(T) areaAverage(phi) areaAverage(U) -179.75 9.996845e+04 3.000000e+02 6.017445e-09 (2.330926e-06 -4.596611e-05 1.718942e-02) -179.5 9.956394e+04 3.000000e+02 1.916559e-07 (-1.352449e-05 -5.353317e-04 5.285954e-01) : : : Code:
# Region type : patch inlet # Faces : 174 # Area : 1.756255e-04 # Scale factor: 1.000000e+00 # Time areaAverage(p) areaAverage(T) areaAverage(phi) areaAverage(U) -179.75 9.996845e+04 3.000000e+02 6.017445e-09 (2.330926e-06 -4.596611e-05 1.718942e-02) # Region type : patch inlet # Faces : 174 # Area : 1.756255e-04 # Scale factor: 1.000000e+00 # Time areaAverage(p) areaAverage(T) areaAverage(phi) areaAverage(U) -179.5 9.956394e+04 3.000000e+02 1.916559e-07 (-1.352449e-05 -5.353317e-04 5.285954e-01) # Region type : patch inlet # Faces : 174 # Area : 1.756255e-04 # Scale factor: 1.000000e+00 : : : controlDict Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1912 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict.1st; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application XiEngineFoam; startFrom startTime; startTime -180; stopAt endTime; endTime -160;// 60 deltaT 0.25; writeControl runTime; writeInterval 5; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; adjustTimeStep no; maxCo 0.2; maxDeltaT 1; functions { timeStep { name setDeltaT; type coded; libs (utilityFunctionObjects); code #{ #}; codeExecute #{ const Time& runTime = mesh().time(); if (runTime.timeToUserTime(runTime.value()) >= -15.0) { const_cast<Time&>(runTime).setDeltaT ( runTime.userTimeToTime(0.025) ); } #}; } #include "momentum" #include "velocityInlet" } // ************************************************************************* // velocityInlet Code:
velocityInlet { // Mandatory entries (unmodifiable) type surfaceFieldValue; libs (fieldFunctionObjects); log true; // Mandatory entries (runtime modifiable) fields (p T phi U); operation areaAverage; regionType patch; name inlet; // Optional (inherited) entries writeFields false; writeControl timeStep; writeInterval 1; writeArea false; } |
|
July 29, 2020, 18:14 |
|
#2 |
Member
Munaf
Join Date: May 2019
Posts: 42
Rep Power: 7 |
Hi
Please have you manged to resolve it as i am having the same problem Thanks |
|
November 28, 2020, 13:04 |
|
#3 |
Member
Join Date: Sep 2018
Posts: 53
Rep Power: 8 |
This resolves the issue for me on OpenFoam-v2006.
Create a copy of the surfaceFieldValue function object and inside the implementation file, comment out the line writeFileHeader(file()); Then add the same line to the constructor of the function object. Code:
Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue ( const word& name, const Time& runTime, const dictionary& dict ) : fieldValue(name, runTime, dict, typeName), regionType_(regionTypeNames_.get("regionType", dict)), operation_(operationTypeNames_.get("operation", dict)), postOperation_ ( postOperationTypeNames_.getOrDefault ( "postOperation", dict, postOperationType::postOpNone, true // Failsafe behaviour ) ), weightFieldName_("none"), needsUpdate_(true), writeArea_(false), totalArea_(0), nFaces_(0), faceId_(), facePatchId_(), faceFlip_() { writeFileHeader(file()); read(dict); } |
|
November 29, 2020, 07:31 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
https://develop.openfoam.com/Develop...nfoam/-/issues |
||
November 29, 2020, 13:15 |
|
#5 | |
Member
Join Date: Sep 2018
Posts: 53
Rep Power: 8 |
Quote:
https://develop.openfoam.com/Develop.../-/issues/1556 Apparently, this is by design in cases with a dynamic or topologically changing mesh and can be disabled with the "updateHeader" keyword, which defaults to true. I know user-friendliness is against OpenFoam's design philosophy but it would still be nice if the surfaceFieldValue header file mentioned this. |
||
November 29, 2020, 14:46 |
|
#6 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Fair enough but sometimes things do get forgotten, or are difficult to find. For these cases it would be best to flag it as an issue. Lamenting about the problem here is perfectly OK, but it increases the probability of things getting fixed if you report them. I've open this issue https://develop.openfoam.com/Develop...am/issues/1942 |
||
November 29, 2020, 17:25 |
|
#7 |
Member
Join Date: Sep 2018
Posts: 53
Rep Power: 8 |
||
Tags |
fieldfunctionobjects, headers, postprocessing, surfacefieldvalue, xienginefoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Add a stop criteria for an unsteady multiphase simulation | Jeneas | OpenFOAM Pre-Processing | 0 | May 18, 2018 10:22 |
How to stop transient simulation which has been run from scheme script? | AlexanderZ | FLUENT | 8 | August 31, 2017 05:25 |
Transient DPM-About Start Stop times | Julie | FLUENT | 3 | January 24, 2014 08:39 |
command TUI / Scheme for stop and continue calculate | rayolau | FLUENT | 1 | May 13, 2013 11:20 |
compiling firefoam | Farshad_Noravesh | OpenFOAM | 27 | December 24, 2012 05:21 |