|
[Sponsors] |
October 15, 2021, 17:03 |
IO Object not updating - interFoam
|
#1 |
Member
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 5 |
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() ); 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? |
|
October 18, 2021, 07:44 |
|
#2 |
New Member
Anup Singh
Join Date: Mar 2020
Posts: 22
Rep Power: 6 |
It has nothing to do with class of IO Object. If you want them to be updated then update them after each iteration.
|
|
October 18, 2021, 11:58 |
|
#3 |
Member
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 5 |
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.
|
|
October 24, 2021, 15:53 |
|
#4 |
Senior Member
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16 |
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() Andrea |
|
|
|
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 |