|
[Sponsors] |
July 8, 2015, 11:38 |
Read in "Mean" values during runTime
|
#1 |
New Member
Christoph Wenzel
Join Date: May 2014
Location: Germany
Posts: 21
Rep Power: 12 |
Hey FOAMERS,
i want to calculate the Dissipation in OpenFOAM in my LES (pimpleFoam). Therefore I have to calculate <du'_i/dx_j * du'_i/dx_j>. This value has to be averaged during runtime and so my solver needs the actual UPrime2Mean values of every time step. In OpenFOAM-2.2.0 it is very easy to read in the averaged velocity fields. You only have to add the following code into your createFields.H of your solver: Code:
volVectorField UM ( IOobject ( "UMean", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), mesh, dimensionedVector("UM",dimLength/dimTime, vector::zero) ); When you do exactly the same in OpenFOAM-2.2.2 or OpenFOAM-2.3.0, UM will not be filled with the UMean values and UM will not be written in your timefolder. OpenFOAM brings the following warning: Code:
--> FOAM Warning : From function GeometricField<Type, PatchField, GeoMesh>::readIfPresent() in file /home/iagwenze/opt/OpenFOAM/of230/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/GeometricField.C at line 108 read option IOobject::MUST_READ or MUST_READ_IF_MODIFIED suggests that a read constructor for field UMean would be more appropriate. Is there another possibility to read in Mean values to your solver? Cheers, Christoph Last edited by ChrisWe; July 10, 2015 at 05:48. |
|
October 28, 2016, 15:40 |
i AM FACING SIMILAR PROBLEM
|
#2 |
Member
Join Date: Oct 2013
Posts: 92
Rep Power: 13 |
Hi ChrisWe,
Did you solve this problem? Or at least did you circumvent it? Regards, |
|
October 28, 2016, 16:34 |
|
#3 |
New Member
Christoph Wenzel
Join Date: May 2014
Location: Germany
Posts: 21
Rep Power: 12 |
Hi,
I did not solve it in an elegant way, but as you mentioned, I circumvented it. I do not exactly know how I solved it right know (I am not at my PC), but I created a new IOobject and calculated the average with some additional lines in my solver. Something like: U_avg = U_avg * (timeSteps-1)/timeSteps + U / timeSteps For example: When I am in my 1001th iteration, I calculate: U_avg = U_avg * 1000/1001 + U / 1001 I was not happy with this solution, but it works. I hope this helps... All the best, Christoph |
|
October 28, 2016, 17:39 |
|
#4 | |
Member
Join Date: Oct 2013
Posts: 92
Rep Power: 13 |
Quote:
Ahh.. I think that should work for me.. Yeah not elegant. Thanks, |
||
March 31, 2018, 23:48 |
|
#5 | |
New Member
benqing Liu
Join Date: Sep 2017
Posts: 8
Rep Power: 9 |
Quote:
i am a new foamer . i want to Read in "Mean" values during runTime. did you slove this problem? Or would you mind posting your code ? Regards, benqing |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Read gradient values of constantAlphaContactAngle | styleworker | OpenFOAM Programming & Development | 0 | November 25, 2013 09:26 |
How to setup a simple OpenFOAM cluster? | TommiPLaiho | OpenFOAM Installation | 3 | October 27, 2013 16:15 |
Numerical errors in nested domain with pre-calculated boundary values | Arnoldinho | OpenFOAM Running, Solving & CFD | 3 | April 4, 2012 11:31 |
999999 (../../src/mpsystem.c@1123):mpt_read: failed:errno = 11 | UDS_rambler | FLUENT | 2 | November 22, 2011 10:46 |
read a file .txt with nurecial values of time and acceleration | sicfred | Fluent UDF and Scheme Programming | 0 | November 21, 2011 08:02 |