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

Calculations and Dimensions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2014, 08:04
Default Calculations and Dimensions
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
Hi,

I am working with the multiphaseEulerFoam and I recognized that sometimes fields are initialized like

Code:
volScalarField p
    (
        IOobject
        (
            "p",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );
without getting dimensions. On the other hand some fields are initialized like

Code:
volVectorField U
    (
        IOobject
        (
            "U",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        dimensionedVector("U", dimVelocity, vector::zero)
    );
Should I initialize fields generally with a dimensioned type especially when using them for calculations or should I initialize fields without any dimension type (-> are they dimless then?) ?
maybee is offline   Reply With Quote

Old   March 6, 2014, 08:23
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Hi Maybee,

The clue is in the way the field is read:

In case of your 'p'-example, the p-field must be read (IOobject::MUST_READ). Initial value of the field and also the dimensions are read from the field in the time folder "runTime.timeName()".

In case of the velocity field U. You specify IOobject::NO_READ meaning that OF will not search for an input file in the time folder but that the field is initialized by the dimensions vector (which automatically defines the dimensions).

There is an other option possible: READ_IF_PRESENT which basically combines the two previous ones. (in fact also a fourth, MUST_READ_IF_MODIFIED, but this is less relevant in the present context).

Hope this clarifies things...

Cheers,

L
Lieven is offline   Reply With Quote

Old   March 6, 2014, 12:09
Default
  #3
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
Thx. got it now.
maybee is offline   Reply With Quote

Old   December 26, 2014, 07:06
Default
  #4
Member
 
Niu
Join Date: Apr 2014
Posts: 55
Rep Power: 12
Z.Q. Niu is on a distinguished road
Hi Lieven, I want to define volSymmetryField, but I don't know know how to write the code of demensioneSet and initialize it. Would you mind giving me some advice? Thanks!
Z.Q. Niu 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
transient calculations! lelia Siemens 9 April 14, 2008 08:33
How to choose a BL dimensions..? Cyril FLUENT 11 September 21, 2007 08:42
Including gravity in calculations!!! gilberto CFX 26 October 15, 2001 20:55


All times are GMT -4. The time now is 23:59.