|
[Sponsors] |
September 12, 2012, 08:54 |
Why is field not being written?
|
#1 |
Member
Florian
Join Date: Nov 2009
Posts: 59
Rep Power: 16 |
Hello,
I have a function object (coded function object embeddd in controlDict) that calculates c_p for the entire field. The function object execution is controlled by: Code:
outputControl outputTime; outputInterval 1; Code:
volScalarField c_p ( IOobject ( "c_p", mesh().time().timeName(), mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), (p - p_inf) / (0.5 * sqr(U_inf)) ); But why is not written without an explicit write even though AUTO_WRITE is set? The U and p fields are declared just like this. Thanks, Florian |
|
September 12, 2012, 10:16 |
|
#2 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Hello,
If your field is not needed inside the calculations (not explicitly updated, i.e. using code). You can try adding the following at the end of your time loop: Code:
if (runTime.outputTime()) { volScalarField c_p ( IOobject ( "c_p", runTime().timeName(), mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), (p - p_inf) / (0.5 * sqr(U_inf)) ); runTime.write(); } Hisham |
|
February 13, 2023, 05:59 |
|
#3 |
New Member
simone tamaro
Join Date: Jan 2023
Posts: 2
Rep Power: 0 |
Hi guys
I had the same issue. I managed to solve it by realizing that I had used the value of the field in another file. I removed its use there and it now works. Hope it helps |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 04:49 |
funkySetBoundaryFields - Manipulation of existing field | jhertel | OpenFOAM Pre-Processing | 16 | May 18, 2020 06:32 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 06:20 |
Zero size field | taranov | OpenFOAM Bugs | 2 | April 20, 2010 04:51 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 06:51 |