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

How OpenFoam stores variable values

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

Like Tree2Likes
  • 1 Post By olesen
  • 1 Post By Luise

Reply
 
LinkBack Thread Tools Display Modes
Old   July 26, 2010, 05:13
Unhappy How OpenFoam stores variable values
  #1
Senior Member
 
Antonio Martins
Join Date: Mar 2009
Location: Porto, Porto, Portugal
Posts: 112
Rep Power: 8
titio is on a distinguished road
Send a message via MSN to titio Send a message via Skype™ to titio
Hi Foamers.

I am having difficulties in understanding how OpenFoam stores variables, in particular dependent variables like for example velocity vector and stress tensor field, in the elements, and how it uses them when performing calculations, especially those associated with div schemes for convection and convective related derivatives.

Information in the literature, including Jasak thesis, are not very user friendly in this regard.

The problem is that my boss wants to know every little detail concerning OpenFoam, and he is having doubts that OpenFoam is any good.

Regards,

António Martins
titio is offline   Reply With Quote

Old   July 28, 2010, 05:33
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 titio View Post
Hi Foamers.

I am having difficulties in understanding how OpenFoam stores variables, in particular dependent variables like for example velocity vector and stress tensor field, in the elements, and how it uses them when performing calculations, especially those associated with div schemes for convection and convective related derivatives.

Information in the literature, including Jasak thesis, are not very user friendly in this regard.

The problem is that my boss wants to know every little detail concerning OpenFoam, and he is having doubts that OpenFoam is any good.
If you really wish to understand it, you'll have to wade your way through the source documentation. For example, starting with a volScalarField
http://foam.sourceforge.net/doc/Doxy...ca1069e5ec8d15
you can work back to the GeometricField http://foam.sourceforge.net/doc/Doxy...tricField.html
which gets you to a DimensionedField.html
http://foam.sourceforge.net/doc/Doxy...onedField.html

which has a dimensionSet http://foam.sourceforge.net/doc/Doxygen/html/classFoam_1_1dimensionSet.html for managing consistence in the operations and then there are the various bits of the field (internal, boundary..)

BTW: what happens when your boss can't get the same implementation information for a commercial code? I guess he wouldn't use a commercial code then.
aylalisa likes this.
olesen is offline   Reply With Quote

Old   August 4, 2010, 09:25
Default
  #3
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
marupio is on a distinguished road
VectorSpace has the actual data members for the tensor and vector components, which it stores as arrays. OpenFOAM defines its own lists, which I doubt are much different from STL lists. Fields are lists with algebra defined (for instance, using operator overloads). GeometricFields are fields with boundaries defined.

The indexing of the lists varies by what is defined. For instance, the diagonal coefficients are scalarFields, indexed by cell number; the owner and neighbour coefficients are also scalarFields, but these are indexed by cell faces.

My boss also had concerns about OpenFOAM. It seems the open source can scare some people... but try and find a commercial code that tells you where its TensorFields are stored.
marupio is offline   Reply With Quote

Old   August 5, 2010, 14:58
Default
  #4
New Member
 
Join Date: Jan 2010
Posts: 12
Rep Power: 7
Luise is on a distinguished road
You can find information about the basic principles in

Weller, Tabor, Jasak, Fureby; A tensorial approach to computational continuum mechanics using object-oriented techniques, 1998
http://powerlab.fsb.hr/ped/kturbo/op...apers/Foam.pdf.

Luise
aylalisa likes this.
Luise is offline   Reply With Quote

Old   September 2, 2010, 22:07
Default
  #5
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 15
santiagomarquezd will become famous soon enough
Quoting David:

Quote:
VectorSpace has the actual data members for the tensor and vector components, which it stores as arrays. OpenFOAM defines its own lists, which I doubt are much different from STL lists.
I agree with you in the STL part, FOAM's List has an interface similar to STL one, but there is a very important difference, in FOAM, Lists are raw memory, from List.C we have:

Code:
00041 // Construct with length specified
00042 template<class T>
00043 Foam::List<T>::List(const label s)
00044 :
00045     UList<T>(NULL, s)
00046 {
00047     if (this->size_ < 0)
00048     {
00049         FatalErrorIn("List<T>::List(const label size)")
00050             << "bad size " << this->size_
00051             << abort(FatalError);
00052     }
00053 
00054     if (this->size_)
00055     {
00056         this->v_ = new T[this->size_];
00057     }
00058 }
and has ramdom access capabilities. STL ones are based in linked lists.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   September 2, 2010, 22:33
Default
  #6
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 15
santiagomarquezd will become famous soon enough
Titio, you said:

Quote:
Originally Posted by titio View Post
Hi Foamers.
I am having difficulties in understanding how OpenFoam stores variables, in particular dependent variables like for example velocity vector and stress tensor field, in the elements, and how it uses them when performing calculations, especially those associated with div schemes for convection and convective related derivatives.
maybe you can give some other info about your concerns. If I understand, much of you want to know is related with lists as people said. In Figure 2.5 from FOAM's Programmer's Guide, one can see that values of fields are stored in GeometricFields, they have a lot info but essentially the values of the field and its positions. To do so it is necessary to have pointers to a fvMesh and a Field, finally Field class has a List of type T, where List and T are classes too.

Respect of div schemes for convection and convective related derivatives, it depends on the kind of operations you want to do, if these are implicit operations (fvm) or explicit (fvc) ones.

Regards.
Attached Images
File Type: jpg lists.jpg (32.8 KB, 119 views)
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   October 14, 2010, 10:56
Default Hi
  #7
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 193
Rep Power: 6
T.D. is on a distinguished road
Hi
i have something like this and i don't know if it is implemented in openfoam


it is:


fvc::div(nusEff * T)

where nusEff is a scalar spacial varying viscosity law to be defined and T is a tensor

so if i do fvc::div(nusEff *T), will it be ok in openFoam? or it should be done another way?
How to define a new nusEff , lets for example in simpleFoam different from the existing nuEff()?

thanks
T.D. 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
Reference Values for Troughs @ variable Angle? hornig FLUENT 1 April 12, 2014 22:26
OpenFOAM - Validation of Results Ahmed OpenFOAM Running, Solving & CFD 9 June 22, 2011 18:59
max node values exceed max element values in contour plot jason_t FLUENT 0 August 19, 2009 11:32
How to monitor variable values of point at t=0 sec yunhee CFX 3 February 13, 2008 13:45
Strongly variable and high viscosity bergantz OpenFOAM Running, Solving & CFD 1 June 23, 2007 10:02


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