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

Probes/Sensors in runtime

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By niklas
  • 3 Post By niklas

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2013, 04:04
Default Probes/Sensors in runtime
  #1
New Member
 
gabi
Join Date: Mar 2013
Location: Spain
Posts: 6
Rep Power: 13
gabitinho is on a distinguished road
Hi all,
My problema is concerned about the sampling of data during the runtime.
I'll try to explain myself pretty clear.

I can create a sampleDict for my puntual sensors; for example:
Code:
sets
(
   GaugesP
   {
        type patchCloud;
        axis xyz;
        patches 1(wall5);
        points ((1 10 15));
        maxDistance 100;
   }
)
Or i can add in my controlDict some lines to do the same but in the runtime; for example:
Code:
probes
{
   tyoe  probes;
   functionObjectLibs ("libsampling.so");
   enabled true;
   outputControl timeStep;
   outputInterval 1;
}

fields
(
   U
);

probeLocations
(
   (1 10 15)
);
And here is my problem; I can create a sampleDict for my line sensors; for example:

Code:
sets
(
   GaugesL
   {
       type uniform;
       axis xyz;
       start (0.5 0.001 0);
       end (0.5 0.001 1); 
       nPoints 101;
   }
);
but I DO NOT KNOW how to do the same thing in the runtime; i have tried many expressions in the controlDict but i was not able to do it.

Can anyone help me?

Thanks a lot for your time,
g.

Last edited by gabitinho; April 10, 2013 at 10:14.
gabitinho is offline   Reply With Quote

Old   April 10, 2013, 09:52
Default
  #2
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Do you mean something like this?
just add this to your controlDict

Code:
functions
{

    probes
    {
	functionObjectLibs ( "libutilityFunctionObjects.so" );
        type probes;
	probeLocations
	(
	   ( 0 0 0.4265111 )
	   ( 0 0 0.5284111 )
	   ( 0 0 0.7316111 )
	);
	fields ( p T );
    }
}
Hamoon likes this.
niklas is offline   Reply With Quote

Old   April 10, 2013, 10:20
Default
  #3
New Member
 
gabi
Join Date: Mar 2013
Location: Spain
Posts: 6
Rep Power: 13
gabitinho is on a distinguished road
Hi Niklas,
Thanks for your response;

I understand that the code that you wrote it is used for "point gauges" (x,y,z coordinates are needed)...

... BUT I need a code to be placed in the controlDict for "line gauges": starts from one point (Xi,Yi,Zi) and ends in another point (Xe,Ye,Ze), like free-surface gauges that are used in laboratory along a line.

g.
gabitinho is offline   Reply With Quote

Old   April 10, 2013, 17:45
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by gabitinho View Post
Hi Niklas,
Thanks for your response;

I understand that the code that you wrote it is used for "point gauges" (x,y,z coordinates are needed)...

... BUT I need a code to be placed in the controlDict for "line gauges": starts from one point (Xi,Yi,Zi) and ends in another point (Xe,Ye,Ze), like free-surface gauges that are used in laboratory along a line.

g.
What is wrong with the "sets"-functionObject?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 11, 2013, 02:58
Default
  #5
New Member
 
gabi
Join Date: Mar 2013
Location: Spain
Posts: 6
Rep Power: 13
gabitinho is on a distinguished road
Quote:
What is wrong with the "sets"-functionObject?
There is nothing wrong with it, but I must do it once the simulation has finished.
That's why I am trying to add some lines to my controlDict so I can obtain the info from my sensors in the run-time.

g.
gabitinho is offline   Reply With Quote

Old   April 11, 2013, 04:14
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by gabitinho View Post
There is nothing wrong with it, but I must do it once the simulation has finished.
That's why I am trying to add some lines to my controlDict so I can obtain the info from my sensors in the run-time.

g.
I said FUNCTIONOBJECT. That is executed at runtime
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 11, 2013, 06:31
Default
  #7
New Member
 
gabi
Join Date: Mar 2013
Location: Spain
Posts: 6
Rep Power: 13
gabitinho is on a distinguished road
Hi gschaider,
I think that I am not explaining my self clearly enough, sorry for that...

Quote:
I said FUNCTIONOBJECT. That is executed at runtime
Yes, that is the point;
I want to do it as a FUNCTIONOBJECT (that is executed at runtime), but I do not know to write the proper lines.

so, how do I define the start-point and the end-point of the line-segment?

I can NOT use
Code:
start (0.5 0.001 0);        
end (0.5 0.001 1);
g.
gabitinho is offline   Reply With Quote

Old   April 11, 2013, 07:20
Default
  #8
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Code:
    line
    {
        type            sets;
        functionObjectLibs ("libsampling.so");
        enabled         true;
        outputControl   timeStep;
        outputInterval  1;

	interpolationScheme cellPoint;
	setFormat       raw;
	sets
	(
	    line1
            {

	      type uniform;
	      axis distance;
	      start ( 0 0 0 );
	      end   ( 1 0 0 );
	      nPoints 10;
	    }
	);
        fields
        (
            p
        );
    }
niklas is offline   Reply With Quote

Old   April 11, 2013, 07:27
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by gabitinho View Post
Hi gschaider,
I think that I am not explaining my self clearly enough, sorry for that...

Yes, that is the point;
I want to do it as a FUNCTIONOBJECT (that is executed at runtime), but I do not know to write the proper lines.

so, how do I define the start-point and the end-point of the line-segment?

I can NOT use
Code:
start (0.5 0.001 0);        
end (0.5 0.001 1);
g.
Well. You can. Niklas showed you in the other post. That function-object uses exactly the same back-end as the samples/set-utility so I'd have thought your problem is only that you didn't know THAT the functionObject exists. Was wrong
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   August 14, 2015, 12:55
Default
  #10
Member
 
Gautami Erukulla
Join Date: Mar 2009
Posts: 71
Rep Power: 17
gautami is on a distinguished road
Quote:
Originally Posted by niklas View Post
Code:
    line
    {
        type            sets;
        functionObjectLibs ("libsampling.so");
        enabled         true;
        outputControl   timeStep;
        outputInterval  1;

    interpolationScheme cellPoint;
    setFormat       raw;
    sets
    (
        line1
            {

          type uniform;
          axis distance;
          start ( 0 0 0 );
          end   ( 1 0 0 );
          nPoints 10;
        }
    );
        fields
        (
            p
        );
    }
Dear Mr Nordin,

I am trying to use "sets-line" in the controlDict file exactly as you have posted in this thread.

I end up getting the following error.

/opt/OpenFOAM-2.2.0/bin/tools/RunFunctions: line 42: 18418 Segmentation fault $APP_RUN "$@" > log.$APP_NAME 2>&1

This is how my controlDict file looks: (After maxDeltaT)
Code:
functions
{   
    //probes
    //{ 
    // type            probes;
    // functionObjectLibs ("libsampling.so");
    //   // outputControl   outputTime;
    //    probeLocations
    //    ( 
    //        ( 1 0 1 )
    //        ( 1 0 1.5 )
    //    );
    //    fields
    //    ( 
    //        p
    //    );
   // }
    line 
    {   
        type            sets;
        functionObjectLibs ("libsampling.so");
        enabled         true;
        outputControl   timeStep;
        outputInterval  1;
        interpolationScheme cellPoint;
        setFormat       raw;
        sets
        (
            line1
            {

              type uniform;
              axis distance;
              start ( 0 0 0 );
              end   ( 0 0 1.5 );
              nPoints 10;
            }
        );
       fields
        (
            U
        );  
    }   
}
When I use "probes" I do not get any such errors and I find the porbes data in the postprocessing folder.

Kinldy can you please help me on this issue.

Kindly can you please let me know how could I use "sets-somePoints-cloud" option in controDict (for runtime data) where the points coordinates are to be read from a data file.

Your guidance is highly appreciated.Thank you.

Regards,
Gautami.

Last edited by wyldckat; August 19, 2015 at 16:11. Reason: Added [CODE][/CODE] markers
gautami 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
runTime deji OpenFOAM 2 January 17, 2019 09:14
Access UMean at runtime deji OpenFOAM Programming & Development 3 April 25, 2016 19:20
Mapping values from 2D mesh to 3D mesh boundary during runtime benk OpenFOAM Programming & Development 1 June 13, 2014 02:39
runTime out of scope in functionObject Sune OpenFOAM Programming & Development 2 September 26, 2012 02:11
FORTRAN runtime error, Please help Harendra Siemens 3 August 23, 2005 03:49


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