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

writing out a volScalarField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2013, 06:42
Default writing out a volScalarField
  #1
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 13
Natalie2210 is on a distinguished road
Hi!

I would like another variable to be written to the output, namely, I'm using the porousInterFoam solver and I would like to write mu every writeInterval.

I tried it with

Code:
 mu.write()
but this writes mu every timestep and I only want it at the specified writeIntervals. So I set up a corresponding field in the createFields.H:

Code:
 
volScalarField mu
( 
    IOobject
    (
      "mu",
      runTime.timeName(),
      mesh,
      IOobject::READ_IF_PRESENT,
      IOobject::AUTO_WRITE
     ),
     twoPhaseProperties.mu(),
     alpha1.boundaryField().types()
 );
in the solver mu is then set by

Code:
mu = twoPhaseProperties.mu()
The code compiles, however, after one timestep I get the following error message:

Quote:
--> FOAM FATAL ERROR:
request for volScalarField mu from objectRegistry region0 failed
available objects of type volScalarField are
11
(
K
rho
p_rgh
alpha1_0
nu
gh
nu1
p
rho_0
nu2
alpha1
)

From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/openfoam/TryoutOF/openfoam211/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 131.
FOAM aborting
Does anyone know what's the problem here?

Thank you,
Natalie
Natalie2210 is offline   Reply With Quote

Old   May 27, 2013, 06:59
Default
  #2
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Quote:
Originally Posted by Natalie2210 View Post
Hi!

I would like another variable to be written to the output, namely, I'm using the porousInterFoam solver and I would like to write mu every writeInterval.

I tried it with

Code:
 mu.write()
but this writes mu every timestep and I only want it at the specified writeIntervals. So I set up a corresponding field in the createFields.H:

Code:
 
volScalarField mu
( 
    IOobject
    (
      "mu",
      runTime.timeName(),
      mesh,
      IOobject::READ_IF_PRESENT,
      IOobject::AUTO_WRITE
     ),
     twoPhaseProperties.mu(),
     alpha1.boundaryField().types()
 );
in the solver mu is then set by

Code:
mu = twoPhaseProperties.mu()
The code compiles, however, after one timestep I get the following error message:



Does anyone know what's the problem here?

Thank you,
Natalie

Why don't you write out nu?, if you look at the error then nu (volScalarField) seems to be available with respect to your code.
Tushar@cfd is offline   Reply With Quote

Old   May 27, 2013, 08:05
Default
  #3
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 13
Natalie2210 is on a distinguished road
Hi!

I want to write mu since mu is somehow interpolated due to the twoPhases and I want to have a look at that.. nu is an input parameter and should be constant over the entire domain.

greetings,
Natalie
Natalie2210 is offline   Reply With Quote

Old   May 27, 2013, 08:26
Default
  #4
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Quote:
Originally Posted by Natalie2210 View Post
Hi!

I want to write mu since mu is somehow interpolated due to the twoPhases and I want to have a look at that.. nu is an input parameter and should be constant over the entire domain.

greetings,
Natalie
Ok, now I understood.. Thanks for explaining..

create a file named "mu" in your case folder inside a 0 folder & set all BC as 0 value.
Tushar@cfd is offline   Reply With Quote

Old   August 16, 2018, 13:33
Default
  #5
New Member
 
Adi
Join Date: Apr 2018
Posts: 2
Rep Power: 0
aditya95 is on a distinguished road
Quote:
Originally Posted by Natalie2210 View Post
Hi!

I want to write mu since mu is somehow interpolated due to the twoPhases and I want to have a look at that.. nu is an input parameter and should be constant over the entire domain.

greetings,
Natalie
I am facing a similar problem, did you find a way to solve it?
if yes, could you please let me know how?
aditya95 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
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 09:21
How to Mix AIR and WATER Elvis1991 FLUENT 12 December 1, 2016 12:28
solid to fluid heattransfer with chtMultiRegionFoam nakor OpenFOAM 11 March 21, 2011 08:28
Not writing volScalarField to hard disk piccinini OpenFOAM 1 October 14, 2010 13:26
writing volScalarField ubaid OpenFOAM Post-Processing 0 August 16, 2010 13:55


All times are GMT -4. The time now is 09:16.