CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

IO Object not updating - interFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Andrea1984

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2021, 17:03
Default IO Object not updating - interFoam
  #1
Member
 
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 5
Venky_94 is on a distinguished road
Hey,

I'm trying to print out mu and nu values from the simulation for post processing. Along the interface the values are meant to have a linear interpolation, but I'm getting a flat line in all my time steps. Can someone tell me what I'm doing wrong?

What I did was to create an IO object within the createFields.H header as below. I noticed that the mu() and nu() where members of the incompressibleTwoPhaseMixture class and hence I called upon them directly.

Code:
// Getting dynamic viscocity for postprocessing
volScalarField mu
(
    IOobject
    (
        "mu",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    mixture.mu()
);

// Getting kinematic viscocity for postprocessing
volScalarField nuproc
(
    IOobject
    (
        "nuproc",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
	mixture.nu()
);
The most possible explanation I could think of is because they're declared as tmp fields in the class, maybe the program isn't able to obtain the values. But I couldn't figure out how to bypass that.
Would declaring them somewhere within the main solver executable (interFoam.C) instead of createFields.H help? Or should they be recalculated within the solver executable?
Venky_94 is offline   Reply With Quote

Old   October 18, 2021, 07:44
Default
  #2
New Member
 
Anup Singh
Join Date: Mar 2020
Posts: 22
Rep Power: 6
Anup Singh is on a distinguished road
It has nothing to do with class of IO Object. If you want them to be updated then update them after each iteration.
Anup Singh is offline   Reply With Quote

Old   October 18, 2021, 11:58
Default
  #3
Member
 
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 5
Venky_94 is on a distinguished road
Quote:
Originally Posted by Anup Singh View Post
It has nothing to do with class of IO Object. If you want them to be updated then update them after each iteration.
And how would I go about doing it? Because of the variables I'm trying to write out, I think mu may not be stored and is calculated every time it is needed but I know for a fact that the solver calculates and *stores* nu every iteration as it is required for consequent equation solving. I'm not sure why it is writing out a constant value every time step.
Venky_94 is offline   Reply With Quote

Old   October 24, 2021, 15:53
Default
  #4
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16
Andrea1984 is on a distinguished road
You want to have a look at interFoam.C. You can see that createFields.H is included once before the start of the pimple loop (this makes sense, given the name of the file!), so all the variables created there are not updated unless you enforce this update at some point within the pimple loop.

In this case, on top of the code that you already have in createFields.H, you might want to include these two lines in interFoam.C right before the end of the pimple loop:

Code:
mu = mixture.mu()
nu = mixture.nu()
Hope this helps,
Andrea
Venky_94 likes this.
Andrea1984 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
[foam-extend.org] Error compiling OpenFOAM-1.6-ext Canesin OpenFOAM Installation 137 January 20, 2016 14:56
OpenFOAM 1.6.x - CentOS 5.3 x86_64 linnemann OpenFOAM Installation 68 April 22, 2013 11:03
Paraview Compiling Error (OpenFOAM 2.1.x + openSUSE 12.2) sfigato OpenFOAM Installation 22 January 31, 2013 10:16
Compilation error OF1.5-dev on Suse10.3 darenyang OpenFOAM Installation 0 April 29, 2009 04:55
OpenFOAM141dev linking error on IBM AIX 52 matthias OpenFOAM Installation 24 April 28, 2008 15:49


All times are GMT -4. The time now is 07:52.