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

extract information from sample during simulation for use

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2011, 14:51
Default extract information from sample during simulation for use
  #1
Member
 
Duong A. Hoang
Join Date: Apr 2009
Location: Delft, Netherlands
Posts: 93
Rep Power: 17
duongquaphim is on a distinguished road
Send a message via Yahoo to duongquaphim
Hi all,

I am using interFoam and wanna to extract the position of the interface every timestep for later use (for calculating height function). I found that I can use sample to extract the interface at alpha1 = 0.5. In /OpenFOAM-1.6/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C there is a function to write the positions and index of points (s.points() and s.faces()) on the surface called writeGeometry():

158 void Foam::sampledSurfaces::writeGeometry() const
159 {
............
186 genericFormatter_->write
187 (
188 outputDir,
189 s.name(),
190 s.points(),
191 s.faces()
192 );
193 }


What I did is create a function in sampleSurfaces.H like:

224 const vectorField iso_points()
225 {
226 return iso_points_;
227 };

and try to assign the value of s.points() to the value iso_points() later like:

iso_points_ = s.points();

But then when I compiled, I got the error: sampledSurface/sampledSurfaces/sampledSurfaces.C:198: error: passing 'const Foam::vectorField' as 'this' argument of 'void Foam::Field<Type>:perator=(const Foam::Field<Type>&) [with Type = Foam::Vector<double>]' discards qualifiers

I try different ways to get that information but it did not work. If you have any ideas or ways to extract that information for using in the solver, i would very appreciate to hear.

Regards,

Duong
duongquaphim 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
Fuse simulation canopy Main CFD Forum 0 February 11, 2009 04:24
about my old post Rogerio Fernandes Brito CFX 1 February 8, 2008 20:19
Transient simulation Error information Li CFX 0 July 25, 2007 12:27
Fire simulation using FDS from NIST Jens Main CFD Forum 1 January 22, 2004 02:53
3-D Contaminant Dispersal Simulation Apple L S Chan Main CFD Forum 1 December 23, 1998 11:06


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