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

dimensioned volScalarField

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 11, 2009, 12:54
Default dimensioned volScalarField
  #1
New Member
 
Emanuele Leoni
Join Date: Apr 2009
Posts: 13
Rep Power: 8
lions85 is on a distinguished road
Hi,

I'm programming in OpenFoam and I have a problem.

I am using a chemistry solver for some simple burners simulation.

In the transport equation I need to put the reaction velocity with its unit measures (so it has to be dimensioned). my velocity is a volScalarField, and when I declare a volScalarField I use this way:

volScalarField RR_Fuel
(
IOobject
(
"RR_Fuel",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("RRfuel", dimensionSet(1,-3,-1,0,0,0,0), 0)
);

Then in the program I initialize the field, but in this case when I do that the right hand side and the left hand side of the equation need to be dimensioned with the same units.

The problem is that I want to initialize the scalarfield with a undimensioned right hand side. If I do that in the declaration after dimensionSet where instead of 0 I put for example 5, it works, the RR_Fuel will be dimensioned and with the value 5. I want to do the same but not in the declaration, and this is impossible because when I run the program it stops for the inconsistency of the units.

I hope you can understand my question, I was nebulous but it's very difficult to speak in english about this staff.

Thank you for your help
bye
EManuele
lions85 is offline   Reply With Quote

Old   November 12, 2009, 03:41
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Quote:
Originally Posted by lions85 View Post
The problem is that I want to initialize the scalarfield with a undimensioned right hand side. If I do that in the declaration after dimensionSet where instead of 0 I put for example 5, it works, the RR_Fuel will be dimensioned and with the value 5. I want to do the same but not in the declaration, and this is impossible because when I run the program it stops for the inconsistency of the units.
You should be able to address (read/write) the dimensions and the values of the field separately. The doxygen docs
http://foam.sourceforge.net/doc/Doxy...onedField.html mention both a dimensions() method and a field() method. The latter is probably good starting place for solving your problem.
olesen 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 create initiate a volScalarField p without reading from disk NO_READ does not seem to work dbxmcf OpenFOAM Running, Solving & CFD 12 August 22, 2013 07:32
Definition of a linear function as volScalarField titio OpenFOAM Running, Solving & CFD 1 October 3, 2010 16:51
Is there a way to change the name a volScalarField liu OpenFOAM Running, Solving & CFD 2 October 18, 2007 17:49
Wall distance volScalarField r2d2 OpenFOAM Running, Solving & CFD 2 July 19, 2007 08:01
Problems with volScalarField niklas OpenFOAM Running, Solving & CFD 2 November 28, 2005 17:05


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