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

How OpenFoam stores variable values

Register Blogs Community New Posts Updated Threads Search

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 26, 2010, 06:13
Unhappy How OpenFoam stores variable values
  #1
Senior Member
 
Antonio Martins
Join Date: Mar 2009
Location: Porto, Porto, Portugal
Posts: 112
Rep Power: 17
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, 06:33
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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, 10:25
Default
  #3
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
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, 15:58
Default
  #4
New Member
 
Join Date: Jan 2010
Posts: 12
Rep Power: 16
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, 23:07
Default
  #5
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
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.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   September 2, 2010, 23:33
Default
  #6
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
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, 186 views)
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   October 14, 2010, 11:56
Default Hi
  #7
Senior Member
 
Join Date: Sep 2010
Posts: 226
Rep Power: 17
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


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
OpenFOAM - Validation of Results Ahmed OpenFOAM Running, Solving & CFD 10 May 13, 2018 19:28
Reference Values for Troughs @ variable Angle? hornig FLUENT 1 April 12, 2014 23:26
max node values exceed max element values in contour plot jason_t FLUENT 0 August 19, 2009 12: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 11:02


All times are GMT -4. The time now is 04:44.