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

writing out a volScalarField

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 27, 2013, 06:42
Default writing out a volScalarField
  #1
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 5
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
Location: India
Posts: 319
Blog Entries: 1
Rep Power: 10
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: 5
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
Location: India
Posts: 319
Blog Entries: 1
Rep Power: 10
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

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Mix AIR and WATER Elvis1991 FLUENT 12 Yesterday 13:28
libOpenSMOKE Tobi OpenFOAM Programming & Development 507 March 4, 2016 05:30
solid to fluid heattransfer with chtMultiRegionFoam nakor OpenFOAM 11 March 21, 2011 09: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 23:51.