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

probe of mag(U)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Harald

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 2, 2014, 10:36
Default probe of mag(U)
  #1
New Member
 
Join Date: Oct 2013
Posts: 21
Rep Power: 12
flux is on a distinguished road
Hi,

i am trying , to probe the magnitude of the U-field at a specific position.

I have already tried the following code in my controldict, but i always get the U-field in components or nothing:

Code:
  
functions {
    probes
    {
        type            probes;
        functionObjectLibs     ("libsampling.so");
        enabled                 true;
        outputControl        timeStep;
        outputInterval       1;
        probeLocations
        (
            (-0.2 -0.05 0)
        );

        fields
        (
        U
        magU
        mag(U)
        );
    }
}
So what should i do, to get an x-y list of the itaration step and the magnitude of the U field?


Thanks!
flux is offline   Reply With Quote

Old   April 3, 2014, 07:31
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 634
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

I am not sure if it can be done within the controldict, but this command on the terminal will give you the magnitude of U for each probed timestep:

Code:
sed 's/(/ /g' postProcessing/probes/0/U | sed 's/)/ /g' | awk '{print $1 " " sqrt($2*$2+$3*$3+$4*$4)}' >  postProcessing/probes/0/magU
Regards,
Tom
tomf is offline   Reply With Quote

Old   April 9, 2014, 04:10
Default
  #3
New Member
 
Join Date: Oct 2013
Posts: 21
Rep Power: 12
flux is on a distinguished road
thx, but i calculated the magnitude with excel^^
flux is offline   Reply With Quote

Old   April 9, 2014, 07:48
Default
  #4
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
Quote:
Originally Posted by tomf View Post
Hi,

I am not sure if it can be done within the controldict, but this command on the terminal will give you the magnitude of U for each probed timestep:

Code:
sed 's/(/ /g' postProcessing/probes/0/U | sed 's/)/ /g' | awk '{print $1 " " sqrt($2*$2+$3*$3+$4*$4)}' >  postProcessing/probes/0/magU
Regards,
Tom
Your sed commands can be replaced by
Code:
tr "()" " "
Bernhard is offline   Reply With Quote

Old   January 25, 2021, 09:08
Default
  #5
New Member
 
Harald Radlwimmer
Join Date: Sep 2020
Location: Vienna, Austria
Posts: 5
Rep Power: 5
Harald is on a distinguished road
Hello,

today I faced the same challenge as you did a few years ago. After some elaboration, I managed to calculate the mag(U)-probes directly with OpenFOAM-8.

To do the same, you have to:

1) include the mag(U)-function in controlDict
Code:
functions
{
  #includeFunc  mag(U);
}
2) get the probes-dictonary (in case you have not got it yet)
Code:
foamGet probes
3) define your probe locations in system/probes and add mag(U) to the list
Code:
fields (p U mag(U));
probeLocations
(
    (0 0 0)
);
4) calculate mag(U)
Code:
postProcess -func "mag(U)"
and finally

5) get the probes
Code:
postProcess -func probes
In a script, you could also combine (4) and (5) as follows:
Code:
for x in mag\(U\) probes
do
runApplication -append postProcess -func "${x}"
done
For steady-state solvers, you may want to add an additionally latestTime-flag to the above commands.


Kind regards,
Harald
ali moeni likes this.

Last edited by Harald; January 25, 2021 at 10:20.
Harald 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
Using Probe for part of a patch ndr OpenFOAM Running, Solving & CFD 7 April 4, 2019 06:26
Line Probe Smoothing badger1 STAR-CCM+ 1 May 21, 2013 22:36
Heat transfer/Temperature along a tube and probe. moienfar-CFD FLUENT 4 March 4, 2013 11:29
new atmospheric probe design manobianco Main CFD Forum 0 May 12, 2012 15:04
functionObject Probe: it's possible to stop and restart? ivan_cozza OpenFOAM Post-Processing 0 September 28, 2010 04:42


All times are GMT -4. The time now is 13:25.