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

Access to field data

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2011, 09:59
Default Access to field data
  #1
New Member
 
johannes
Join Date: Feb 2011
Posts: 7
Rep Power: 15
sepp is on a distinguished road
hello
Probably I got a very simple question, but I'm new at openfoam and so I don't see the problem.

I'm working with icoFoam and in icoFoam I'm able to display each component of U:
Pout<< icoFoam.C u: " << U.internalField()[0][0] << endl;

then icoFoam calls fvm::div, which can also display each one: (U is now named vf)
Pout<<"fvmDiv.C div1 u:" << vf.internalField()[0][0] << endl;

div calls convectionScheme<Type>::New(vf.mesh(),flux,vf.mesh ().divScheme(name) )().fvmDiv(flux, vf), which calls gaussConvectionScheme.

and there I'm not able to access
Pout<<"gaussConvectionScheme.C fvmdiv1 u:" << vf.internalField()[0][0] << endl;


what's the reason for being able to access to vf.internalField()[0], but not to vf.internalField()[0][0] ?


thanks for your help
sepp is offline   Reply With Quote

Old   February 10, 2011, 10:29
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
I'm not sure what you want to reach here? Maybe you can explain it, because most likely there is a much easier solution.

Anyhow, the divergence of a vector gives you a scalar, so div(U) has no vector-components.
Bernhard is offline   Reply With Quote

Old   February 10, 2011, 11:45
Default
  #3
New Member
 
johannes
Join Date: Feb 2011
Posts: 7
Rep Power: 15
sepp is on a distinguished road
Well, the thing I should do is to implement an alternative way of calculating the convection term.

The calculation is made by an scheme invonked by gaussConvectionScheme. (It's not my idea but I've got to do it). In this scheme I've got to do some calculations with U-values. These values are imparted from icoFoam to fvmDiv and so on in a geometricField. There's nowhere any manipulation but beginning at gaussConvectionScheme I cannot access each component of the U vectors. I can do addition and multiplikation with scalars on the hole vector, but nothing for example on the x value of U.

I can do my calculation with an U-value from the lookup table, but then the return value has the wrong type.

typeid(vf.internalField()[0][0]).name() gave me "d" as datatype of this. Is there in OpenFoam a datatype d?
sepp 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
The initial values file does not contain any field solution data jiguozhao CFX 1 January 28, 2011 05:24
[OpenFOAM] Cell Data to Point Data Issues mcintoshjamie ParaView 2 November 19, 2009 03:55
Field data Jorge Siemens 1 November 29, 2005 11:31
How to access acceleration of steady Euler field? winnie FLUENT 0 May 2, 2003 22:53
access to FIDAP-internal data from within a UDF Ingo Meisel FLUENT 0 April 17, 2001 11:58


All times are GMT -4. The time now is 03:52.