CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Probes/Sensors in runtime (http://www.cfd-online.com/Forums/openfoam-post-processing/115953-probes-sensors-runtime.html)

gabitinho April 10, 2013 04:04

Probes/Sensors in runtime
 
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.

niklas April 10, 2013 09:52

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 );
    }
}


gabitinho April 10, 2013 10:20

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.

gschaider April 10, 2013 17:45

Quote:

Originally Posted by gabitinho (Post 419659)
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?

gabitinho April 11, 2013 02:58

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.

gschaider April 11, 2013 04:14

Quote:

Originally Posted by gabitinho (Post 419780)
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

gabitinho April 11, 2013 06:31

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.

niklas April 11, 2013 07:20

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
        );
    }


gschaider April 11, 2013 07:27

Quote:

Originally Posted by gabitinho (Post 419832)
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


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