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

Runtime sampling of line

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 6 Post By alientxtmsgs

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2014, 14:32
Default Runtime sampling of line
  #1
New Member
 
Steven
Join Date: Jan 2014
Posts: 14
Rep Power: 12
alientxtmsgs is on a distinguished road
Hello openFoam community,

I have a problem that I am trying to solve with sampling of field variable over a line. What I would like to do is to add a piece of script into my controlDict so that I can obtain the sampled fields during runtime at the same interval as the timestep. I can easily use sampleDict and the command sample to do this after the simulation has finished but I would like to achieve a much higher sampling frequency than just the write output.

At the bottom of my controlDict I have written:

Code:
functions {
   WG9 {
      type sets;
      functionObjectLibs ("libsampling.so");
      setFormat raw;
      interpolationScheme cell;
      outputControl timeStep;
      outputInterval 1;
      axis    z;
      start   (10.369 2.05 0);
      end     (10.369 2.05 1.15);
      nPoints 100;
      fields (alpha1);
   }
}
It seems to run fine without any errors but there is no output folder (I would expect a postProcessing folder to appear after simulation starts much like it does when you run the "forces" function)

Does anyone know if this is even possible what I am trying to accomplish? If so, do I appear to be missing something?

Steven
alientxtmsgs is offline   Reply With Quote

Old   April 2, 2014, 22:31
Default
  #2
New Member
 
Steven
Join Date: Jan 2014
Posts: 14
Rep Power: 12
alientxtmsgs is on a distinguished road
Hello all,

Just for reference I would like to post the solution I have found. Actually, it was someone elses solution I adapted to my own case (found here http://www.cfd-online.com/Forums/ope...ampledset.html), but it eluded me for a good few days.

To sample a field along a user-specified line with an output frequency equal to the time step I added this to the bottom of my controlDict:

Code:
functions {
alpha1 //call this whatever you like
  {
    type sets;
    enabled true;
    verbose true;
    interpolationScheme cellPoint;
    outputControl timeStep;
    outputInterval 1;
    setFormat raw;
    fields (alpha1); //insert the fields you would like to sample
    sets
    (
      WG9 //give the line a name. You can add more sample lines below this one
      {
        type uniform;
        axis z;
        start (10.369 2.05 0);
        end   (10.369 2.05 1.15);
        nPoints 100;
      }
    );
}
  }
I didn't have to add any function object libraries which seems odd to me . Works just fine though.

Cheers,
Steven
alientxtmsgs 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
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 03:09
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 04:23
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 flakid OpenFOAM Installation 16 December 28, 2010 09:48
Regarding FoamX running Kindly help out hariya03 OpenFOAM Pre-Processing 0 April 18, 2008 05:26
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 16:05.