CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Probes (http://www.cfd-online.com/Forums/openfoam/93057-probes.html)

dhruv October 4, 2011 05:07

Probes
 
Hello All,

I am using probes function to have data points at some locations in my domain. I have 2 questions.

1. If I use U as fields, I get the three components at of velocity at that point. Is there a way to get the magnitude of velocity at that point (like mag U) ?

2. For the location of the probes, I have different locations which changes with every test case, so I want the controlDict to read the locations from from a different file, where I have set the formula for the location points. How can I do this?

Thanks in advance for your help.

Dhruv.

nsf October 4, 2011 11:46

Hi,

I'm not sure about the first question, maybe someone else can help you there.

For the second question; you can use include statements in your controlDict file,

Code:

        ...
        probeLocations
        (
#include "some/PATH/someFile"
        );
        ...

Where someFile contains your probes just as if you would have entered them without the include statement.

Good Luck

/N

dhruv October 5, 2011 02:55

Thanks
 
Thanks nsf,

I also looked in one of the tutorials, and found the same. I will try it today.

Dhruv.

Quote:

Originally Posted by nsf (Post 326657)
Hi,

I'm not sure about the first question, maybe someone else can help you there.

For the second question; you can use include statements in your controlDict file,

Code:

        ...
        probeLocations
        (
#include "some/PATH/someFile"
    );
        ...

Where someFile contains your probes just as if you would have entered them without the include statement.

Good Luck

/N


nsf October 5, 2011 12:59

Quote:

Originally Posted by dhruv (Post 326725)
Thanks nsf,

I also looked in one of the tutorials, and found the same. I will try it today.

Dhruv.

No worries,

Here's a trick I'd like to share for those new to linux and bash.

Let's say you wanted to find tutorial examples that use include statements in the controlDict file, this one-liner can help you

Code:

find $FOAM_TUTORIALS -name controlDict | xargs grep "#include"
the first command (find) will list all controlDict files in the tutorial folder. The pipe (|) will pass the list to xargs which will run grep "#include" once on each controlDict in the list.

Hopefully someone will find this useful :).

/Nicolas


All times are GMT -4. The time now is 11:28.