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

Error using R utility

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 3 Post By alexeym
  • 2 Post By lifeinhand
  • 1 Post By lifeinhand
  • 1 Post By alekhine

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 22, 2015, 15:40
Default Error using R utility
  #1
Member
 
Join Date: Nov 2009
Posts: 56
Rep Power: 17
fusij is on a distinguished road
Hello,

When I try to obtain the modelled Reynolds Stress tensor by using the R utility I get the following message


Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Time = 0
Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model LaunderSharmaKE
LaunderSharmaKECoeffs
{
    Cmu             0.09;
    C1              1.44;
    C2              1.92;
    sigmaEps        1.3;
}

Writing R field


--> FOAM FATAL ERROR: 
object of type N4Foam9DataEntryINS_10SymmTensorIdEEEE is not allocated

    From function Foam::autoPtr<T>::operator->()
    in file /home/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/autoPtrI.H at line 176.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::timeVaryingMappedFixedValueFvPatchField<Foam::SymmTensor<double> >::write(Foam::Ostream&) const at ??:?
#3  Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::writeEntry(Foam::word const&, Foam::Ostream&) const at ??:?
#4  Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>::writeData(Foam::Ostream&) const at ??:?
#5  Foam::regIOobject::writeObject(Foam::IOstream::streamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const at ??:?
#6  
 at ??:?
#7  
 at ??:?
#8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9  
 at ??:?
Aborted (core dumped)
This is a 3D simulation. I have tested the utility on another case were I was using the standard k-epsilon model and wall functions accordingly and it worked fine there.

In particular, does anybody know what this means: object of type N4Foam9DataEntryINS_10SymmTensorIdEEEE is not allocated

The R tensor is defined in LaunderSharmaKE.C
fusij is offline   Reply With Quote

Old   February 3, 2016, 13:12
Default
  #2
New Member
 
Han Li
Join Date: Jul 2015
Location: College Station
Posts: 16
Rep Power: 11
lifeinhand is on a distinguished road
I had the same issue. Anyone know the reason?
lifeinhand is offline   Reply With Quote

Old   February 3, 2016, 13:53
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Though it would be great to have test case with the error, let's try to deduce the reason from backtrace.

Error happened in

Code:
Foam::timeVaryingMappedFixedValueFvPatchField<Foam::SymmTensor<double> >::write
Do you have timeVaryingMappedFixedValue boundary condition for TKE (since R tensor uses the same BCs)?

Technically the reason for the error is this part of timeVaryingMappedFixedValueFvPatchField.C (since offset_ is the only property of DataEntry type):

Code:
template<class Type>
void timeVaryingMappedFixedValueFvPatchField<Type>::write(Ostream& os) const
{
...
    offset_->writeData(os);
...
}
For some reason offset_ if not initialized properly. So you could submit bug-report using Mantis. Or, since you are using version 2.3.x, enclose the expression into autoPtr validity check:

Code:
if (offset_.valid())
{
    offset_->writeData(os);
}
recompile finiteVolume library, check if it helps, and submit a patch.
alexeym is offline   Reply With Quote

Old   February 4, 2016, 20:34
Default
  #4
New Member
 
Han Li
Join Date: Jul 2015
Location: College Station
Posts: 16
Rep Power: 11
lifeinhand is on a distinguished road
According to the manager of Bug report website, the timeVaryingMappedFixedValue boundary condition could not use R utility.

"There is no automatic way to convert the timeVaryingMappedFixedValue BC for k into the equivalent for R. It would be possible to simply evaluate R for the current state of all the BCs and output them all as type "calculated" which would be OK for post-processing but not for changing from say a k-epsilon to an R-epsilon turbulence model."

I tried this, it worked. Since I am doing steady state now, it is fine. But for transient problem it seems a little bit trouble to change every time step.
aow and alekhine like this.
lifeinhand is offline   Reply With Quote

Old   March 21, 2016, 07:43
Default
  #5
Member
 
Join Date: Nov 2009
Posts: 56
Rep Power: 17
fusij is on a distinguished road
Could you explain to me in little more detail what you did to export the R stress tensor? I thought it was only a postprocessing utility explicitly calculating Reynolds stresses using my eddy viscosity and velocity gradients. Why is the problem related to timeVaryingMappedFixedValue?
fusij is offline   Reply With Quote

Old   March 21, 2016, 12:43
Default
  #6
New Member
 
Han Li
Join Date: Jul 2015
Location: College Station
Posts: 16
Rep Power: 11
lifeinhand is on a distinguished road
Yes, R is only a postprocessing utility. However, based on my understanding, R utility is not compatible with boundary condition "timeVaryingMappedFixedValue". So, what I did was after my calculation is done, I modify the file of the time step that I am going to postprocess, e.g. 1000, I change the U and other vaiables that was "timeVaryingMappedFixedValue" to "calculated". Then R utility will be able to to the job.
smayoral likes this.
lifeinhand is offline   Reply With Quote

Old   March 21, 2016, 20:00
Default
  #7
Member
 
Join Date: Nov 2009
Posts: 56
Rep Power: 17
fusij is on a distinguished road
Ahh OK, I get it. Thanks for that info. But I am still little bit confused why it is not working for timeVaryingMappedFixedValue since all variables are known for computing the R tensor
fusij is offline   Reply With Quote

Old   March 23, 2016, 21:38
Default
  #8
New Member
 
Han Li
Join Date: Jul 2015
Location: College Station
Posts: 16
Rep Power: 11
lifeinhand is on a distinguished road
I guess it is some bug in the utility or the boundary condition, but I am not capable to find out and fix. :P
lifeinhand is offline   Reply With Quote

Old   January 9, 2017, 10:23
Default
  #9
New Member
 
DimitriF
Join Date: Dec 2016
Location: London
Posts: 19
Rep Power: 10
alekhine is on a distinguished road
Hey Han Li,
I have now the same issue and cannot make it work. I changed

inlet
{
type timeVaryingMappedFixedValue;
setAverage 0;
offset constant 0;
value nonuniform List<scalar>

to

inlet
{
type calculated;
value nonuniform List<scalar>

but it doesn't work. Can you tell me what you changed in detail please?

UPDATE: I use the kOmegaSST model and adding the k,omega and U files enables the calculation of the Reynolds stress.
Thank you so much for providing the solution!!

Dimitri
smayoral likes this.
alekhine is offline   Reply With Quote

Old   January 9, 2017, 20:30
Default
  #10
New Member
 
Han Li
Join Date: Jul 2015
Location: College Station
Posts: 16
Rep Power: 11
lifeinhand is on a distinguished road
Did you change to calculated to all files?

All I did is replace the string "timeVaryingMappedFixedValue" to "calculated" for all variables. For my case U, epsilon and k.

Also, the version I used is OpenFOAM 2.4
lifeinhand is offline   Reply With Quote

Old   January 10, 2017, 07:24
Default
  #11
New Member
 
DimitriF
Join Date: Dec 2016
Location: London
Posts: 19
Rep Power: 10
alekhine is on a distinguished road
I did the same as you mention, changing only U, epsilon and k to calculated and deleted the setAverage and the offset lines. The delete of the setAverage and offset lines shouldn't make a difference since there are not taken into account by the type calculated, I believe.

Thanks again, you saved me!! :-)
alekhine is offline   Reply With Quote

Old   June 17, 2022, 20:39
Default Janaf Temperature Out of Range
  #12
New Member
 
Elhaddad
Join Date: Jun 2012
Posts: 7
Rep Power: 14
AhmedSamy is on a distinguished road
I am sure the solution to janaf temperature problem is in the mesh. A structured simple mesh using only scripting is the only solution.

I have prepared this procedure to get a good mesh. After gmshtofoam just prepare the bondary file to fit and run checkfoam. Pls check the attached file!
Attached Files
File Type: docx file.docx (12.2 KB, 22 views)

Last edited by AhmedSamy; June 19, 2022 at 08:31.
AhmedSamy is offline   Reply With Quote

Reply


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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 03:36
[mesh manipulation] mirrorMesh utility preserving regions zfaraday OpenFOAM Meshing & Mesh Conversion 1 November 7, 2016 22:51
Something doens't work with wallHeatFlux utility or externalWallHeatFluxTemperat BC!! zfaraday OpenFOAM Post-Processing 0 February 5, 2015 17:47
turbDyMFoam and refineMesh utility fusij OpenFOAM 6 December 12, 2011 10:39
StreamFunction utility titio OpenFOAM Post-Processing 0 May 19, 2010 17:04


All times are GMT -4. The time now is 18:49.